Repository navigation
Use @babel/preset-env exclusively - #395
Conversation
|
Would you like to help maintaining this module and be part of @nodejs/streams? |
Not that I know of, but it's good to leave that there. We don't officially support Android and iOS, but I think we should. Maybe we should add them to saucelabs. |
I'm open to it! Could you explain what it entails? Mostly in terms of time, i.e. what would I be committing to? Currently I help out when I have a moment to spare but maybe that's true for everyone. One possible benefit is that I can better keep up with streams. I wish to do so but there's too much noise on the Node.js repo to subscribe to the whole thing. |
|
Mainly reply/help out on some issues on Node core and keeping this module up to date. |
Closes #394. This:
@babel/preset-envexclusively, which reducesdevDependenciesand ensures we have all the necessary transforms to support intended target environments.babelrc, ensuring thatbuild/build.jsandnpm run update-browser-errorsuse the same setup.As a result, there are now 12 new transforms applied to code imported from node core. Most notably (going by the amount of diff):
transform-block-scoped-functionsfunction foo () {}to hoistedvar foo = function () {}transform-function-namefunction.namethough?From the new transforms, I excluded:
transform-typeof-symbolbecause a quick benchmark showed that its fallback is 2-3x slower than nativetypeof, we have replacements in place forSymbolusage and I couldn't find any code liketypeof Symbol().transform-regeneratorbecause it'd only apply to tests and I think we shouldn't transpile "optional features" (like generators and async functions) but rather run tests selectively in target environments that support these features.We may want to exclude some target environments as well if they're not officially supported. For example, do we support Android?
Here's a full list of resolved targets and plugins, logged by
@babel/preset-env:Click to expand
Of those plugins, the following are new to
build/build.js(not necessarily used):Click to expand
transform-block-scoped-functionstransform-function-nametransform-duplicate-keystransform-new-targettransform-object-superproposal-unicode-property-regextransform-unicode-regextransform-sticky-regextransform-dotall-regextransform-exponentiation-operatorproposal-json-stringstransform-literals