-
Notifications
You must be signed in to change notification settings - Fork 27.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
Load the main JS bundle in production with async #1485
Conversation
Great improvments @arunoda |
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.
Niiiiice 😍 ❤️
server/build/index.js
Outdated
|
||
async function writeBuildStats (dir) { | ||
// Here we can't use the hashes in the webpack chunks. | ||
// That's because the "app.js" is not tight with a chunk. |
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.
is not tight with a chunk.
is not tied to a chunk
is more correct here right?
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.
Thanks.
@@ -0,0 +1,26 @@ | |||
// This pulgin combines a set of assets into a single asset |
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.
pulgin
=> plugin
should we also defer this bundle? |
|
I feel like this topic has been done to death but I wanted to comment and make sure I'm on the right lines and nothing has been missed. After trying to improve the performance of a site I'm working on I came across this PR. My initial thought is deferring this file (along with all other JS) as it is not needed initially due to SSR. What are your thoughts? Maybe all JS should be loaded after the DOM on initial load. |
The long evaluation is probably fixed by #4639 as main.js used to serve as main bundle + commons but is now split. In general, it makes not much sense to comment on a 1-year-old pull request to ask for help. |
@timneutkens thanks for the info regarding #4639, I will keep an eye on that PR. Apologies, I understood it was an old PR hence cavitating the comment with "I feel like this topic has been done to death". I could see that there were several comments on an issue (#1436) and this PR was to resolve it, with no future issues or PRs referencing this problem... hence the comment above. |
Fixes #1436
With this, we don't need to wait for the JS bundle and page can render directly.
This will lead to better page load performance.