-
Notifications
You must be signed in to change notification settings - Fork 12k
6rc3 build size multiplied by 4 & build time multiplied by 2 #10294
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
Why aren't you building with |
@skreborn with |
Heya @istiti, and 4x build size sounds like something is broken somewhere. I'm not sure where to start. Can you tell me if the output from CLI 6 in dist looks like it is uglified? All the vars renamed and in a single line. Other than that I'd have to debug myself... in the projects we tests, we didn't see a size increase and the build time went down. |
thanks @filipesilva , The only problem is "build size" I still get 1.7.x verison build6rc3 buildMy heart is broken too ^^ I tried disable vendorChunk but build size still 4x big: here's screenshot: To answer to your question: yes one line and yes vars renamed Updateone of them in 6rc3 output 66.cb3a50319cb5f9413888.js FYI most of blocking time build is at
|
@istiti very helpful information in your last comment, thank you! @clydin was wondering if our sourcemaps were bugged but looking at the bundle you uploaded and the screenshot of file sizes, we now know that's not the case. So we can see that some bundles just got much, much bigger. I think that explains why the build time is longer: webpack and build optimizer have a lot more code to process. I don't have an explanations for why the bundles got bigger in the first place. I notice you have a vendor chunk in the second rc.3 example. Can you try setting |
@filipesilva i was in editing mode of my last comment while you respond here, please check my last comment you was in my mind ^^ I post screenshot without vendorChunk |
:D Ok, so it didn't really change much with or without vendor chunk. Maybe this is something related to Webpack and Module Concatenation... your project has many modules, and many as lazy as well. In the past regressions in Module Concatenation have broken your project, so that might be it. I'll try to have a look soon in a big project I have. I also added this as a blocker for our 6.0 final. |
@filipesilva if you want to see content of some module let me know: |
This ensures that initial vendor modules are alway placed in the vendor bundle. And also increases the potential for splitting common modules out of async (lazy route) chunks. Mitigates angular/angular-cli#10294
@clydin you are the boss it is ALMOST fixed with 6rc4 release ! Do I need open new issue or it's maybe related because now size build output seems correct (total 10MB) instead 8.2MB with cli1.7.x I think I find why it is 10 instead 8 because with cli6rc4 I have a weird output chunks number beginin with ..js Before in cli 1.7.x I had <75 chunks from 0...js to 72...js And now with 6rc4 I have 115 chunks from 0...js to 115...js here is screenshot with vendorChunk to false but it is same if I put it to true: I think numbers chunks are lazyload module? so when in my project I search FYI: you can check images above but yesterday with 6rc3 I had only 80 chunks begining from 0to80....js that seems more correct than today with 6rc4. Maybe you miss something else ? Because Yes I continue to develop since my last 1.7.x build but I can't believe I add 2MB compiled code ^^ Especially if you see my comment above #10294 (comment) @filipesilva thanks adding it as blocker to v6 release |
@istiti very happy to hear a bit part of the problem was addressed! I don't know why the size is still bigger than before. This isn't isn't closed so I think you don't need to open a new one, we can continue to look into it here. The numbers are the lazy loaded modules, yes. I'm not sure why the numbers go so high, but it looks like the number of those bundles is the same as in 1.7 (or near the same). You can replace the numbers with their names by adding |
@filipesilva yep some are weird, here you are: first part screenshot of my /distbottom part screenshot of my /distin these both screenshot you don't see all but second sreenshot is pretty interesting because of my routing.ts are declared from /src/... example:
|
I found the bug here! But i can't understand. If it can help you here you are the squelete of my code. If you are interested in one module/file in particular let me know . In this stackblitz repro, I write (not working) structure of my app. Please check where is imported DialogModule. If in app.module = 115 numeroted chunks generated. |
The observed behavior isn't necessarily a bug but a result of the new behavior for Webpack 4, and as a result CLI 6.0. The module analysis and splitting is significantly more advanced. In CLI 1.x all common modules found within lazy routes where combined into one potentially large common chunk. While this reduced the size of the affected modules, it required all these lazy routes to download and use this common chunk regardless of how many of those common modules were actually needed for that route. The new behavior now creates more granular common chunks based on the specific needs of each lazy chunk and only loads the necessary common chunks for each lazy route. This is the cause for the increase in file count. Overall this should provide a benefit to end users of the application by reducing the amount of data necessary to visit a particular lazy route. This can be especially true if, for example, two routes (out of potentially many) require a vary large dependency that would in CLI 1.x be required to be downloaded by all lazy routes but now would not. The settings may need to be fine tuned over time as more data is collected from a variety (e.g., lazy route count, dependency count & size, etc.) of projects. |
Also, a blog post by the Webpack team provides some more details regarding the new behavior: https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366 |
@clydin I just notice that when more chunks are created size of app is around 1 MB bigger. This is too normal ? You let my issue still opened I won't close it myself, feel free close it. ps : someone create duplication here #10364 might be related thanks again |
This should now be improved in the upcoming release. If you are still encountering issues after the new release, please open a new issue with your findings. |
This ensures that initial vendor modules are alway placed in the vendor bundle. And also increases the potential for splitting common modules out of async (lazy route) chunks. Mitigates #10294
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
Repro steps
update from 1.7.x to 6rc3
Observed behavior
The text was updated successfully, but these errors were encountered: