-
Notifications
You must be signed in to change notification settings - Fork 191
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
Move from const enums to consts #1645
Conversation
797a506
to
bda4a4b
Compare
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.
Lots of changes! But overall looks good, and all the types of changes here are straight forward.
Good improvement, yay!
Left a question tho
(Doesn't affect approval)
packages/@glimmer-workspace/integration-tests/lib/setup-harness.ts
Outdated
Show resolved
Hide resolved
Historically, many of these enums used `const enum`s, which at least had the benefit of being compiled away at build time. We've now moved to mostly normal `enum`s, which are both less efficient than normal constants, and a relic of an earlier TypeScript era before literal types. This PR moves all enums to normal constants, and creates types for the constant values when the code needs them.
74a32c5
to
b10d437
Compare
Local results are "no change". I would have expected at least a small change, but the main motivation for this change was to move away from enums and const enums in favor of normal constants and literal types, which eliminates a dependency on increasingly non-standard compilation infrastructure. So no news is good news. |
No perf difference on either of our local tests -- CI thinks improvement, so we'll merge. |
This PR ended up being much more extensive than originally intended because it ended up including quite a bit of cleanup to the benchmark setup and cleaned up mistakes in the
package.json
s that were causing subtle issues in the benchmark environment.[EDIT] @NullVoxPopuli pushed me to extract a lot of the incidental changes into their own PRs. I did quite a bit of that and it did streamline this PR. Thanks @NullVoxPopuli!