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.
Closes #394. This:
@babel/preset-env
exclusively, which reducesdevDependencies
and ensures we have all the necessary transforms to support intended target environments.babelrc
, ensuring thatbuild/build.js
andnpm run update-browser-errors
use 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-functions
function foo () {}
to hoistedvar foo = function () {}
transform-function-name
function.name
though?From the new transforms, I excluded:
transform-typeof-symbol
because a quick benchmark showed that its fallback is 2-3x slower than nativetypeof
, we have replacements in place forSymbol
usage and I couldn't find any code liketypeof Symbol()
.transform-regenerator
because 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-functions
transform-function-name
transform-duplicate-keys
transform-new-target
transform-object-super
proposal-unicode-property-regex
transform-unicode-regex
transform-sticky-regex
transform-dotall-regex
transform-exponentiation-operator
proposal-json-strings
transform-literals