breaking: fallback targets to "defaults, not ie 11"#12989
breaking: fallback targets to "defaults, not ie 11"#12989nicolo-ribaudo merged 13 commits intobabel:mainfrom
Conversation
| 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.
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 |
|
@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
| { | ||
| "externalHelpers": false | ||
| "externalHelpers": false, | ||
| "targets": { "browsers": "ie 6, ios 4" } |
There was a problem hiding this comment.
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.
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.
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.
Do we still want to make this change? Guess it could be a separate PR?
There was a problem hiding this comment.
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.
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
hzoo
left a comment
There was a problem hiding this comment.
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?
Fixes the issue caused by babel/babel#12989
BABEL_8_BREAKINGflagThis PR is an alternative to #12616. When no browsers targets are set and
ignoreBrowserslistConfigisfalse(default value),@babel/compilation-targetswill return the browserlists query"defaults, not ie 11", thus@babel/preset-envwill 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-spreadwill useObject.assignby default@babel/helper-compilation-targetsbehaviour changes:{ esmodules: "intersect" }without a target will become no op becausedefaults, not ie 11have native esmodules support.This PR includes commits from #12996.