-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
perf: reduce preload marker markup size #14550
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@benmccann This is ready for review now. Let me know how I can help get this out. |
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.
Looks great to me with one nit. I think we can get this in the next beta.
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
From what I can tell, the |
Qwik is also failing in |
This reverts commit 1ca5017.
Co-authored-by: Ben McCann <[email protected]>
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.
Looks good, thanks!
@bluwy I saw you just released v5.0.0-beta.5. Is it possible to do v5.0.0-beta.6 as a fast follow with this change? We are trying to roll this out to contra.com ASAP due to SEO impact (it dramatically reduces unused JavaScript), and unfortunately the usual |
Thanks for following up with the feature. Yeah I can cut another one today in around 8 hours (the usual time), want to get a few more PRs batched up first at the meantime. |
Before: https://web-app-cb19100f.contra.dev/itsjennylee Total uncompressed JavaScript: 3.4MB -> 2.8MB |
Just wanted to say big thank you for this 🙏, that redundancy has been bugging for a while, since I updated my projects to Vite. |
Description
Introduces
__viteMapDep
helper which is a generated function that allows to refer to chunks by an index.Using this helper allows to generate preload markers without repeatedly hard-coding the same strings.
Before:
After:
This change amounts to ~70% code reduction needed for preload markers.
In a real-life project, this accounts anywhere between 20% to 40% reduction of the total chunk size.
Code walkthrough https://www.loom.com/share/8d775aa5035d4995ae8e1b94afdd1c12
Additional context
This is a re-work of an earlier PR: #9491
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).