-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix: consistently use const enum #18390
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
b2776e5 to
3019a79
Compare
jelbourn
left a comment
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.
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.
3019a79 to
644f7be
Compare
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)
|
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. |
Plain
enumdeclarations 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 useconst enumwhich 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.