Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jul 21, 2021

When script optimizations are enabled, classes containing downlevelled static properties are wrapped in a pure annotated IIFE to allow the class to be removed if it is otherwise unused. Only properties with initializer values that do not have the potential for side effects can be safely wrapped. Previously, pure annotations were not considered when analyzing the values and this caused classes to be retained that could be considered safe for removal. To resolve this issue, pure annotations are now considered when analyzing a property's initializer value for potential side effects.

@clydin clydin added the target: patch This PR is targeted for the next patch release label Jul 21, 2021
@google-cla google-cla bot added the cla: yes label Jul 21, 2021
@clydin clydin requested a review from alan-agius4 July 21, 2021 19:08
… static properties to be optimized

When script optimizations are enabled, classes containing downlevelled static properties are wrapped in a pure annotated IIFE to allow the class to be removed if it is otherwise unused. Only properties with initializer values that do not have the potential for side effects can be safely wrapped. Previously, pure annotations were not considered when analyzing the values and this caused classes to be retained that could be considered safe for removal. To resolve this issue, pure annotations are now considered when analyzing a property's initializer value for potential side effects.
@clydin clydin force-pushed the build-optimizer/pure-statics branch from 632f658 to 9a9ba91 Compare July 21, 2021 20:25
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Jul 21, 2021
@josephperrott josephperrott merged commit 4bcd1dc into angular:master Jul 21, 2021
@clydin clydin deleted the build-optimizer/pure-statics branch July 21, 2021 22:08
@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 21, 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: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants