feat(build)!: Drop pre-ES2020 polyfills #14882
Merged
Conversation
Contributor
size-limit report 📦
|
mydea
added a commit
that referenced
this pull request
Jan 3, 2025
We already have an eslint rule to avoid class fields, but had exceptions for static fields as well as for arrow functions. This also leads to bundle size increases, so removing the exceptions and handling the (few) exceptions we have there should save some bytes. Additionally, this has additional challenges if we want to avoid/reduce polyfills, as class fields need to be polyfilled for ES2020, sadly. Found as part of #14882
Lms24
reviewed
Jan 3, 2025
Member
Lms24
left a comment
There was a problem hiding this comment.
One question: Should we to adjust the makeSucrasePlugin call in bundleHelpers.,js as well?
| "wide-align/string-width": "4.2.3", | ||
| "cliui/wrap-ansi": "7.0.0" | ||
| "cliui/wrap-ansi": "7.0.0", | ||
| "**/sucrase": "getsentry/sucrase#es2020-polyfills" |
Member
There was a problem hiding this comment.
Gotta admit, I had no idea that one can simply specify a repo/branch name here. Nice!
Member
Author
There was a problem hiding this comment.
yeah, it required us to ensure that the dist folder is actually checked in on that branch, but IMHO this appears easier than to publish stuff from there etc 😅
Member
Author
It should be the same now in all places, as we just generally set this option always? |
Lms24
approved these changes
Jan 3, 2025
Member
Lms24
left a comment
There was a problem hiding this comment.
It should be the same now in all places, as we just generally set this option always
Oh right, missed that, sorry! Let's
then!
AbhiPrasad
approved these changes
Jan 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates to use a forked version of sucrase (https://github.com/getsentry/sucrase/tree/es2020-polyfills).
On this branch, a new option
disableES2019Transformsis added, which can be used to only polyfill ES2020 features:10_000)class X { field; })It also adds a lint step that checks all build output for ES2020 compatibility, to avoid regressions in this regard.