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
chore: remove unnecessary transform-for-of when building babel-parser #10823
Conversation
babel.config.js
Outdated
@@ -101,14 +103,12 @@ module.exports = function(api) { | |||
["@babel/plugin-proposal-nullish-coalescing-operator", { loose: true }], | |||
|
|||
convertESM ? "@babel/transform-modules-commonjs" : null, | |||
isStandalone ? ["@babel/transform-for-of", { assumeArray: true }] : null, |
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.
I'd prefer that we also apply this transform when running tests outside of @babel/standalone
, otherwise we risk introducing a for-of
with a Map
which isn't caught by the tests.
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.
Actually, this probably already breaks part of @babel/core
and all the modules plugins.
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.
That's an interesting usage of this plugin! I will try it later.
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.
85dec70
to
6bcadd0
Compare
@nicolo-ribaudo I revised this PR to be minimal: It only removes unnecessary |
How much bigger it the new bundle size? (Since it will now use the "default" transform for |
@nicolo-ribaudo The unminified babel-preset-env.js increases from 3.0MB to 3.1MB. I will work on a fix later. |
6bcadd0
to
0741bb4
Compare
0741bb4
to
c936b00
Compare
This PR appliestransform-for-of: assumeArray
on standalone build, of which the size decrease is expected.It removes this transform from babel-parser build config since it is supported in Node >= 6.