-
Notifications
You must be signed in to change notification settings - Fork 27
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: defer application main JS chunks #3619
Conversation
🦋 Changeset detectedLatest commit: 8ec2c9e The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Great find, thanks again for the contribution! 🙌
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.
Nice find. Thanks!
Description
The goal of this PR is to avoid network falls when downloading MC apps initial JS chunks (runtime and app bundles.See screenshots below).
By moving initial JS chunks to the HTML head and deferring them, we allow the browser to concurrently download the initial JS chunks and the initial CSS files.
We save ~60ms when cold loading a MC app.
You can use https://github.com/commercetools/merchant-center-frontend/pull/17738 to test the Webpack changes (I've patched
@commercetools-frontend/mc-html-template
in that branch of the monorepo).Current Discount app
https://mc.europe-west1.gcp.escemo.com/sunrise-data-alex/discounts
DIscount app with this PR changes
https://mc-17738.mc-preview.europe-west1.gcp.escemo.com/sunrise-data-alex/discounts