-
Notifications
You must be signed in to change notification settings - Fork 12k
BuildOptimizer breaks 3rd party library #12096
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
From @filipesilva on May 18, 2018 13:57 This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via |
From @Enngage on May 18, 2018 14:39 Thanks for the response! Sure, I understand - this is the minimal code I could come up with (repo generated with To reproduce:
You should see new image appear with no animation each second. When you use either Let me know if you need anything else. |
From @clydin on May 21, 2018 16:7 This is not actually due to the build optimizer itself but rather a minification setting that is enabled when the build optimizer is enabled. Specifically the |
From @Enngage on May 26, 2018 7:58 Forgive my ignorance, but I wasn't able to find exactly what the Isn't there a possibility of excluding libraries from the build optimizer? I think it might make sense for you to be able to specify if some library should be skipped so that you can still leverage build optimizer for the rest of your code. |
I guess this is the same problem with pure_getters: true that is discussed in issue 11439, too. |
When we first started using Build Optimizer, we saw a lot of the savings were tied to using the Uglify/Terser `pure_getters` option. This was intimately related with the structure and shape of the Angular codebase. The measurements we did at the time on angular.io showed a significant size reduction, from 1mb to about 600kb. Of these roughly 150kb were tied to using `pure_getters` if I remember correctly. Meanwhile the Angular codebase has changed significantly and I don't really see these savings anymore, so I don't think it makes sense to keep it on given that it is known to cause problems with some libraries. Related to angular#9231, angular#11439, angular#12096.
When we first started using Build Optimizer, we saw a lot of the savings were tied to using the Uglify/Terser `pure_getters` option. This was intimately related with the structure and shape of the Angular codebase. The measurements we did at the time on angular.io showed a significant size reduction, from 1mb to about 600kb. Of these roughly 150kb were tied to using `pure_getters` if I remember correctly. Meanwhile the Angular codebase has changed significantly and I don't really see these savings anymore, so I don't think it makes sense to keep it on given that it is known to cause problems with some libraries. Closes angular#9231, angular#11439, angular#12096, angular#12128.
When we first started using Build Optimizer, we saw a lot of the savings were tied to using the Uglify/Terser `pure_getters` option. This was intimately related with the structure and shape of the Angular codebase. The measurements we did at the time on angular.io showed a significant size reduction, from 1mb to about 600kb. Of these roughly 150kb were tied to using `pure_getters` if I remember correctly. Meanwhile the Angular codebase has changed significantly and I don't really see these savings anymore, so I don't think it makes sense to keep it on given that it is known to cause problems with some libraries. Closes angular#9231, angular#11439, angular#12096, angular#12128.
When we first started using Build Optimizer, we saw a lot of the savings were tied to using the Uglify/Terser `pure_getters` option. This was intimately related with the structure and shape of the Angular codebase. The measurements we did at the time on angular.io showed a significant size reduction, from 1mb to about 600kb. Of these roughly 150kb were tied to using `pure_getters` if I remember correctly. Meanwhile the Angular codebase has changed significantly and I don't really see these savings anymore, so I don't think it makes sense to keep it on given that it is known to cause problems with some libraries. Closes #9231, #11439, #12096, #12128.
Closed via #14187 |
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. |
From @Enngage on May 18, 2018 8:17
Bug Report or Feature Request (mark with an
x
)Area
Versions
npm 5.6.0
node v8.9.4
Windows (10
Repro steps
I have this simple angular library repo where I use masonry js library. Everything works perfectly fine (demo) as long as
buildOptimizer
is disabled:"buildOptimizer": false
However, as soon as I enable it, some animations (not all!) are broken. I'm pretty confident this is not the issue in the masonry js library, rather it seems like build optimizer might be tampering with the code in some way.
Is there a way to 'disable' build optimizer for this library only? Or could this be part of a bigger problem somewhere?
The log given by the failure
No errors/warnings logged anywhere.
Desired functionality
Don't break code of external libraries.
Mention any other details that might be useful
Angular.json
Copied from original issue: angular/devkit#937
The text was updated successfully, but these errors were encountered: