-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve site performance metrics #3224
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f252421
enable docusaurus faster
Blargian c72fd37
disable docusaurus faster features causing styling issues
Blargian 099cc56
fix incorrect definition which breaks styling in production for Docus…
Blargian bb30d61
fix incorrect color definition breaking styling in prod with upgrade …
Blargian e0039f4
restore parts of code which were modified during testing, to default
Blargian 42feda7
change package name to something more logical
Blargian fe7c5cb
add defer=true to kapa script
Blargian 472dc1f
Lazy load code blocks with basic animation
Blargian ea432ed
remove unneeded katex font, use preload and headTags for the others
Blargian 550bbea
add preconnect resource hint for kapa.ai
Blargian 6c44540
turn on lightningCssMinimizer and rspackBundler
Blargian fc023ca
add preconnects to gstatic and googletagmanager
Blargian af063cf
remove client side redirects and add to vercel.json
Blargian 0f23b71
modify routes to begin from /docs/
Blargian 6e3cc56
fix resource hints and remove unused resource hints
Blargian ff8807c
change crossorigin type to use-credentials based on debugbear hint
Blargian ecf1b9b
remove unused packages and code
Blargian aea399d
disable source maps for production builds
Blargian c1c91e0
style codeblock
Blargian 79d559d
review fixes
Blargian 345ff8c
Merge branch 'ClickHouse:main' into improve_site_vitals
Blargian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import useDebounce from './useDebounce' | ||
import useThrottle from './useThrottle' | ||
import useClickOutside from './useClickOutside' | ||
|
||
export { useDebounce, useThrottle, useClickOutside } | ||
export { useClickOutside } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
--ifm-pre-color: var(--prism-color); | ||
overflow-x: scroll; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React, {useState, useRef, useCallback, useEffect} from 'react'; | ||
import CodeBlock from '@theme-original/CodeBlock'; | ||
import styles from './styles.module.css'; | ||
|
||
export default function CodeBlockWrapper(props) { | ||
const [isLoaded, setIsLoaded] = useState(false); | ||
const codeBlockRef = useRef(null); | ||
|
||
const handleIntersection = useCallback((entries) => { | ||
const entry = entries[0]; | ||
if (entry.isIntersecting && !isLoaded) { | ||
setIsLoaded(true); | ||
} | ||
}, [isLoaded]); | ||
|
||
useEffect(() => { | ||
const observer = new IntersectionObserver(handleIntersection, { | ||
rootMargin: '0px 0px', | ||
}); | ||
|
||
const currentRef = codeBlockRef.current; // Store current ref value | ||
|
||
if (currentRef) { | ||
observer.observe(currentRef); | ||
} | ||
|
||
return () => { | ||
if (currentRef) { // Use stored ref value here as well | ||
observer.unobserve(currentRef); | ||
} | ||
}; | ||
}, [handleIntersection]); // Add handleIntersection to dependency array | ||
|
||
if (!isLoaded) { | ||
return ( | ||
<div ref={codeBlockRef} className={styles.wrapper}> | ||
<div className={styles.activity}></div> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<> | ||
<CodeBlock {...props} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.wrapper { | ||
position: relative; | ||
height: 100px; | ||
width: 100%; | ||
z-index: 44; | ||
overflow: hidden; | ||
border-radius: 5px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
[data-theme='dark'] .wrapper { | ||
background-color: rgb(46,46,41); | ||
} | ||
|
||
[data-theme='light'] .wrapper { | ||
background-color: rgb(245,245,245); | ||
} | ||
|
||
.activity { | ||
position: absolute; | ||
left: -45%; | ||
height: 100%; | ||
width: 45%; | ||
animation: loading 1s infinite; | ||
z-index: 45; | ||
} | ||
|
||
[data-theme='dark'] .activity { | ||
background-image: linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05)); | ||
background-image: -moz-linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05)); | ||
background-image: -webkit-linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05)); | ||
} | ||
|
||
[data-theme='light'] .activity { | ||
background-image: linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05)); | ||
background-image: -moz-linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05)); | ||
background-image: -webkit-linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05)); | ||
} | ||
|
||
@keyframes loading { | ||
0% { | ||
left: -45%; /* Start off-screen to the left */ | ||
} | ||
100% { | ||
left: calc(100% + 45%); /* Move off-screen to the right */ | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* Previously this was loaded from a CDN, have moved it here */ | ||
|
||
/* cyrillic-ext */ | ||
Blargian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; | ||
} | ||
/* cyrillic */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; | ||
} | ||
/* greek-ext */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+1F00-1FFF; | ||
} | ||
/* greek */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; | ||
} | ||
/* vietnamese */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; | ||
} | ||
/* latin-ext */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2) format('woff2'); | ||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; | ||
} | ||
/* latin */ | ||
@font-face { | ||
font-family: 'Inter'; | ||
font-style: normal; | ||
font-weight: 400 700; | ||
font-display: swap; | ||
src: url(https://fonts.gstatic.com/s/inter/v18/UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2) format('woff2'); | ||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lio-p this is where our code block will go. Pay attention to lazy-loading - @Blargian found this to important for google site metricsw