-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Improve webpack chunk names #16513
Conversation
Nx Cloud ReportCI ran the following commands for commit 9170830. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
This is awesome @yannbf |
YES! Prefetch all the things! I plan to preload the font files as well. This is great! |
What does it do to startup time? |
Ideally nothing right?, the aim of the prefetch annotation is to fetch the resources once the "site" is ready. Would be interesting to know if this is actually the case, for sure! |
5c8a673
to
9e06963
Compare
@yannbf did you test it out? I just tried it in Chromatic's Storybook and I am seeing a definitely slowdown in the time to render the first story (from around 1 -> 2.5s in my rough metrics) . I'm not sure why the browser isn't waiting to fetch the files but it seems to launch of a massive batch of requests straight away. I would be leaning towards maybe not including it given that, unless we can find some way to make the browser deprioritize it. |
we'll follow up in 6.5 with a custom approach that eagerly loads all links that are visible AFTER the entire storybook has loaded, to avoid the slowdown mentioned above. thanks for the awesome POC @yannbf !!! 💯 |
Closing this with #16546 as a followup |
@shilman I think we may as well keep the nicer bundle/chunk name part of this? |
merging the modified PR without prefetching |
Issue: N/A
UPDATE: Removed the prefetching and kept the nice chunk names. See rationale and planned followup below
What I did
With the new story store and stories being lazy loaded, the initial loading experience is great but the experience when switching stories is degraded. This PR adds two things:
1 - Webpack chunk names.
Important to identify what's actually being downloaded rather than random names like:
and have more meaningful names like:
2 - Prefetched chunks
Here's a video comparison of the user experience without and with prefetching enabled in a Slow 3G setting.
Before (without prefetching):
without-prefetch.mov
After (with prefetching):
with-prefetch.mov
How to test
If your answer is yes to any of these, please make sure to include it in your PR.