[docs-infra] Improve Typedocs HTML Weight#4497
Open
dav-is wants to merge 19 commits intomui:masterfrom
Open
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for base-ui ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
…-is/base-ui into docs-infra/improve-types-html-weight
Bundle size
Deploy previewhttps://deploy-preview-4497--base-ui.netlify.app/ PerformanceTotal duration: 1,300.40 ms 🔺+47.49 ms(+3.8%) | Renders: 53 (+0) | Paint: 2,047.77 ms 🔺+93.37 ms(+4.8%)
...and 7 more. View full report Check out the code infra dashboard for more information about this PR. |
Signed-off-by: Connor Davis <mail@connordav.is>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pairs with upstream PR: mui/mui-public#1269 released in
v0.8Defers detailed type code highlighting until after hydration. Significantly decreases uncompressed HTML size, HTML parse time, RSC prop parse time, and render time. This is described in the docs: Prop Compression Pattern
Similar to performance improvements seen for Demos in #2443
Preview Deployment
Screenshots
First render (realistically, the accordion will be closed, so this will not be visible to users):
shortTypeis always highlighted on first render.After hydration + visible:
Combobox Benchmark
Decreases the page's uncompressed HTML size by 30% with the tradeoff of increasing the compressed HTML by 5%. Brings it below the 2 MB limit for search engine crawlers.
Improves first contentful paint and hydration time by 42 ms. Achieved by reducing HTML parse time by 34%, scripting time (to parse the RSC props) by 31%, and reducing time to calculate styles by 30% ("Recalculating Styles" in performance trace).
Before:

After:

changing network conditions resulted in slightly offset timing between the two runs
Local Testing
To remove network latency as a factor, I tested this locally using the calibrated "Mid-Tier Mobile" CPU throttling.
All the following screenshots are the same scale.
Largest Contentful Paint (LCP)
Before: LCP in 278 ms

After: LCP in 229 ms (reduced by 18%)

DOM Content Loaded (DCL)
Before: 1,120 ms

After: 952 ms (reduced by 15%)

Before:

After:

Hydrated & Idle Time
Page hydrates and becomes idle 215ms sooner.