-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat: defer mode #3237
base: main
Are you sure you want to change the base?
feat: defer mode #3237
Conversation
…nhancement" of a static site that works without JS
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
I am highly interested in this, I was thinking of implementing the exact same thing. Is there any drawback you can think of? Also, it might be interesting to let the user |
Hi, Unfortunately I'm not a perf expert. Using If that interests you, here are 3 Docusaurus deployments I used for my tests: No JS at all: JS low priority (end of body, defer) JS high priority (preload + no defer) If this is useful, I'd find it cool to be able to specific which one of the 3 modes you want :) The "no js" is likely to have some issues currently but this seems fixable (can't expand sidebar categories etc...) |
Hi Sébastien, Thanks for taking the time to do that. Here are Lighthouse performance results for each page: My take on the results:
|
Maybe you could share me how you get these scores? are they consistent across multiple runs? My scores are very random , all 3 gives between 60 and 95 quite randomly so it's hard to do anything with that... Note, React is working on progressive hydration, afaik this is not ready but this would be an interesting feature to get 3 perform better. |
Yes you are right, the results are changing quite a lot between runs. I will script this and run 100 tests per version, I will keep you updated once I have the results. I still think 2. would be a great option: no downside and bench results seem to be better, let's prove it with reliable numbers 🙂. |
Thanks :) that's something I wanted to do but didn't have time. |
For 100 runs (using Lighthouse programmatically), I get:
If you want to reproduce the results yourself, you can check the code on this repo. EDIT: I re-ran the script with 100 benchmarks (50 before) per scenario and updated the results accordingly. |
After 1000 runs:
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3237--docusaurus-2.netlify.app/ |
Size Change: -256 B (0%) Total Size: 805 kB
ℹ️ View Unchanged
|
to be continued after React 18 upgrade: we need time sliced hydration |
Motivation
Webpack JS assets are added to the page using defer, making them less "critical" for the browser.
As Docusaurus v2 can almost work without any JS, we can see React hydration as non-mandatory progressive enhancement
For now it's just a POC