Skip to content
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

feat(es/preset-env): Update preset-env data #9573

Merged
merged 23 commits into from
Oct 8, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require("core-js/modules/es.array.at.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.at-alternative.js");
require("core-js/modules/es.string.at.js");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core-js doesn't have a module with this name.

require("core-js/modules/es.string.split.js");
'1.2.3'.split('.').at(-1);
[
Expand Down
4 changes: 1 addition & 3 deletions crates/swc/tests/fixture/issues-6xxx/6888/output/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
require("core-js/modules/es.array.at.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.string.at-alternative.js");
require("core-js/modules/es.string.replace-all.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.string.at.js");
require("core-js/modules/es.string.split.js");
'test'.replaceAll('', '');
'1.2.3'.split('.').at(-1);
Expand Down
2 changes: 0 additions & 2 deletions crates/swc/tests/fixture/issues-8xxx/8193/output/1.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require("core-js/modules/es.object.create.js");
require("core-js/modules/esnext.object.group-by.js");
var data = [
{
name: 'a',
Expand Down
15 changes: 15 additions & 0 deletions crates/swc/tests/fixture/issues-9xxx/9544/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "ecmascript",
},
},
"env": {
"targets": {
"chrome": "40"
},
"mode": "usage",
"coreJs": "3.22"
}
}
3 changes: 3 additions & 0 deletions crates/swc/tests/fixture/issues-9xxx/9544/input/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
document.querySelectorAll('div').forEach(el => {
console.log(el);
})
4 changes: 4 additions & 0 deletions crates/swc/tests/fixture/issues-9xxx/9544/output/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require("core-js/modules/web.dom-collections.for-each.js");
document.querySelectorAll('div').forEach(function(el) {
console.log(el);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kdy1 to fix #9544, it should also load web.dom-collections.for-each, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I'll reopen it.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"transform-duplicate-named-capturing-groups-regex": {
"chrome": "126",
"opera": "112",
"edge": "126",
"firefox": "129",
"safari": "17.4",
Expand All @@ -22,7 +23,7 @@
"chrome": "98",
"opera": "84",
"edge": "98",
"firefox": "95",
"firefox": "75",
"safari": "15",
"node": "12",
"deno": "1.18",
Expand Down
Loading
Loading