-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@angular/cli): not use buildOptimizer for JIT in prod #8346
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
Conversation
Is this still work in progress? |
If you fix the lint issue, we can merge this. |
@hansl It was too late yesterday, just made a placeholder, will work on it soon. |
@hansl Do you want me to add some tests against it? Not sure if this one is urgent. |
Is decorator removal the only problematic pass within the build optimizer? Would it be useful to add an option to the build optimizer loader to disable the pass? |
@clydin Without AOT there can be no tree-shaking or other kinds of dead-code elimination, all types would be referenced in metadata, the only optimization remains is |
The build optimizer passes facilitate dead code removal via UglifyJS for a variety of TypeScript output code structures. There is most definitely a benefit even without AOT enabled. |
The code-wrapping or annotation will only help when the identifier itself is removable, so it's only true for non-Angular related TypeScript libraries, but for all Angular libraries there can be little help as nothing can be removed. |
Which would demonstrate a benefit to leaving it in place. A significantly reduced benefit currently, but a benefit nonetheless. |
Also of note is the following result of a simple application in JIT mode with decorator removal disabled:
And an AIO test application with the same setup:
|
You're right, indeed what |
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.
I think the PR at the moment is correct. While it is true that there are benefits to be had even in JIT, the intended behaviour was always that Build Optimizer can only be used with AOT (see the validateBuildOptions
method). That it was possible to use it in JIT was an oversight of how defaults are processed.
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. |
fixes #8345