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.
There are some browsers that support array spread but don't support generators.
Why did we never realize it?
The browsers versions that support array spread and the versions that supports generators are close:
Probably no one ever used a browsers query in
preset-env
that includedtransform-regenerator
but nottransform-spread
.Why did we found this bug now?
create-react-app
defaults to>0.2%, not dead, not op_mini all
for browsers support. Some users additionally exclude IE 11 and Safari 5.1, since they are really old and force the inclusion of a lot of different transforms.Due to some recent changes in the usage data on caniuse/browserslist (an old browser felt below 0.2%, or it become "dead"), this currently matches these browsers:
These browsers need
transform-regenerator
(because of Chrome 49), but they don't needtransform-spread
.Alternative solution
We could force
transform-spread
when usingtransform-regenerator
inpreset-env
, but I'd avoid forcing an unnecessary transform if possible.Fixes babel/babel#11212