-
Notifications
You must be signed in to change notification settings - Fork 12k
Bundle size got bigger between #10364
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
Comments
Thank you for running some comparison tests.
|
I'm sorry for misscommunication. We are run during a postbuild numbers in total:
Now the size difference is not huge but still there is some. Weird part for me is that based on the name of chunks, one chunk is split into e.g. 3 parts ( |
to answer also a question, the only change in the code is refactoring for rxjs@6 so mostly change in import statements |
The common module split logic has changed in v6. More granular common chunks are now created which lowers the amount of data necessary for a particular lazy route. This differs from the previous behavior wherein all common modules were downloaded for any route which uses one of the common modules regardless of the relevance of the other modules. As an example, in version 1.x, to access the lazy route "enquiry" the following chunks (excluding the initial chunks) needed to be downloaded and initialized (if not previous done so):
In 6.x, the following are needed (note the overall smaller size):
Still in 6.x, if the "pre-qualifier" route is then accessed after the above, only this chunk is needed:
In this case, note that since the common elements of the "pre-qualifier" route have already been downloaded from the following during "enquiry", it does not need to be downloaded and initialized again:
This new behavior also has advantages when using route preloading. In this scenario, only the chunks that are immediately needed are downloaded and then the rest are downloaded in the background as the user is navigating the application. This allows the user to more immediately access and use the application while allowing near instant access to the remainder of the application due to the background preloading. Also, in regards to the larger size (in this case a ~3% increase), the new heuristics prevent common chunks of an unoptimized size of less then 30Kb. This is most likely the cause of the overall size difference as smaller common modules are not meeting this threshold. The settings will be fine-tuned in the CLI in upcoming versions. Additional information such as provided here will be very helpful in this process. And again thank you for taking the time to provide them. |
Thank you @clydin for the explanation. If you would like to get more insights later, I would like to help as possible. I'm also on ng-conf — if you're here as well, we could meet, chat and you could take a look at the code and our build process... |
Duplicate of #10294. Please keep discussions there. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Versions
Version 6
Version 5
Observed behavior
Bundle size got bigger in preparing RC.4 version. Size change:
Version 6
Version 5
used commands:
6:
5:
Desired behavior
Smaller or at least the same bundle size
The text was updated successfully, but these errors were encountered: