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
breaking: fallback targets to "defaults, not ie 11" #12989
breaking: fallback targets to "defaults, not ie 11" #12989
Conversation
import "core-js/modules/es6.typed.float32-array.js"; | ||
import "core-js/modules/es6.typed.float64-array.js"; | ||
import "core-js/modules/es6.weak-map.js"; | ||
import "core-js/modules/es6.weak-set.js"; | ||
import "core-js/modules/web.timers.js"; | ||
import "core-js/modules/web.immediate.js"; | ||
import "core-js/modules/web.dom.iterable.js"; |
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.
Most core-js 2 polyfills are not used because defaults, not ie 11
already have native support.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44286/ |
cc @developit |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9399e44:
|
@nicolo-ribaudo @JLHwung this will be fantastic with bugfixes defaulting to true. |
@developit Note that |
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.
🎉 🎊 💯
@nicolo-ribaudo ah sorry, I had misread - that makes sense given Safari 11 and prior are not included due to the % cutoff. Just to clarify - |
Yes, we don't have data for |
ab5f225
to
32a2d00
Compare
@@ -1,3 +1,4 @@ | |||
{ | |||
"externalHelpers": false | |||
"externalHelpers": false, | |||
"targets": { "browsers": "ie 6, ios 4" } |
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.
Added ios 4
here because IE 5.5 has Array.map
but not ios 4
. Note that browserslist
does not support IE 5.
}; | ||
|
||
var buildTest = function buildTest(name) { | ||
const buildTest = name => { |
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.
We already have issue-10879-babel-7
for this test, so good to overwrite the test output.
Can/should 32a2d00 be extracted to a separate smaller PR? |
@@ -1,5 +1,5 @@ | |||
{ | |||
"presets": ["env"], | |||
"presets": [["env", { "targets": { "browsers": "ie 6" } }]], |
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.
Really a nit and only if you can do it with a regexp, but I find the top-level targets
slightly more readable (less [
and {
).
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.
Do we still want to make this change? Guess it could be a separate PR?
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.
We could track this in a separate PR but if we use top level targets, the output fixtures may need to be updated since plugins can be aware of that. This PR aims for minimizing fixtures update so we can move forward.
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.
Ok yeah that sounds like a different issue entirely given that chance.
Really want to work on making these diffs easier to look through! Would be interesting to run our tests through a combination of retainLines/recast
32a2d00
to
d1b36e2
Compare
d1b36e2
to
9399e44
Compare
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.
Probably one of the more helpful breaking changes that we do
- default to es6+
- makes users have to be aware of targets
- we can do the ideas we were talking about with applying preset-modules/bugfixes to further syntax since current bugfixes wouldn't be applied like @nicolo-ribaudo mentioned?
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.
This is exciting 🎉
Fixes the issue caused by babel/babel#12989
BABEL_8_BREAKING
flagThis PR is an alternative to #12616. When no browsers targets are set and
ignoreBrowserslistConfig
isfalse
(default value),@babel/compilation-targets
will return the browserlists query"defaults, not ie 11"
, thus@babel/preset-env
will skip most transforms given their native support on these targets (as of Mar 2021):npx browserslist --mobile-to-desktop "defaults, not ie 11"
Related plugins behaviour changes:
@babel/plugin-proposal-object-rest-spread
will useObject.assign
by default@babel/helper-compilation-targets
behaviour changes:{ esmodules: "intersect" }
without a target will become no op becausedefaults, not ie 11
have native esmodules support.This PR includes commits from #12996.