Skip to content
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

fix(@angular-devkit/build-angular): limit advanced terser passes to two #21324

Merged
merged 1 commit into from
Jul 13, 2021

Conversation

clydin
Copy link
Member

@clydin clydin commented Jul 9, 2021

Limiting the terser passes to two helps to workaround an issue with terser wherein terser will errantly inline a function argument containing a yield expression inside an inner arrow function. This results in a syntax error since the yield expression is no longer within the scope of a generator.
Reducing the number of terser passes to two does cause a minor increase in size as shown below. However, the change is far less than 1% in both cases.

File 2 passes (this PR) 3 passes (master) Change
main 3755283 3754440 (broken) 843 (~0.02%)
polyfills 37207 37207 0
runtime 1545 1545 0
File 2 passes (this PR) 3 passes (master) Change
main 137466 137226 240 (~0.17%)
polyfills 37100 37100 0
runtime 1031 1031 0

Limiting the terser passes to two helps to workaround an issue with terser wherein terser will errantly inline a function argument containing a `yield` expression inside an inner arrow function.  This results in a syntax error since the yield expression is no longer within the scope of a generator.
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jul 9, 2021
@google-cla google-cla bot added the cla: yes label Jul 9, 2021
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jul 12, 2021
@filipesilva filipesilva merged commit 2c2b499 into angular:master Jul 13, 2021
@clydin clydin deleted the terser-inline-bug branch July 13, 2021 14:46
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants