Skip to content

Conversation

@crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 4, 2020

Plain enum declarations generate a bunch of code that can't be minified very well and is included even if the enum isn't used. In most places we use const enum which inlines the value on consumption, but we have a few leftovers that are still using plain enums. These changes switch all of the remaining usages (except for one) and add a lint rule to enforce consistency in the future.

Caretaker note: this has a small chance of being breaking if any of the enums are used in a view. I doubt that's the case, but we should re-evaluate if something breaks in g3.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release labels Feb 4, 2020
@crisbeto crisbeto requested review from a team, devversion, jelbourn and mmalerba as code owners February 4, 2020 21:07
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 4, 2020
@crisbeto crisbeto force-pushed the const-enum-usage branch 3 times, most recently from b2776e5 to 3019a79 Compare February 4, 2020 21:32
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM aside from Miles' comment

Plain `enum` declarations generate a bunch of code that can't be minified very well and is included even if the enum isn't used. In most places we use `const enum` which inlines the value on consumption, but we have a few leftovers that are still using plain enums. These changes switch all of the remaining usages (except for one) and add a lint rule to enforce consistency in the future.
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Feb 5, 2020
@andrewseguin andrewseguin merged commit 8ae7b18 into angular:master Feb 20, 2020
andrewseguin pushed a commit that referenced this pull request Feb 20, 2020
Plain `enum` declarations generate a bunch of code that can't be minified very well and is included even if the enum isn't used. In most places we use `const enum` which inlines the value on consumption, but we have a few leftovers that are still using plain enums. These changes switch all of the remaining usages (except for one) and add a lint rule to enforce consistency in the future.

(cherry picked from commit 8ae7b18)
@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 Mar 22, 2020
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 cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants