forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rebased] Remove automatic core-js polyfills (vercel#91)
Rebase of #68, which was merged into a now-closed PR. Closes #65. When configured to use preset-env, this stops turbopack from inserting dependencies on core-js. It's: * Buggy/error-prone, at least through swc preset-env: * vercel/the-three-body#65 * setImmediate "polyfills" always inserted for this nonstandard feature when React (scheduler, iirc) does feature detection of it * Big. Updating the snapshot alone for a test that only used [].includes resulted in a diff with nearly 4700 line deletions * Not done by Next.js for modern targets in the past couple of years: https://twitter.com/timneutkens/status/1234548900272517120 Test Plan: Added [].includes to preset_env snapshot test and verified no references to core-js are inserted.
- Loading branch information
1 parent
80b17f1
commit 793262f
Showing
13 changed files
with
58 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
crates/turbopack/tests/snapshot/integration/preset_env/input/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class Foo {} | ||
|
||
console.log(Foo); | ||
console.log(Foo, [].includes("foo")); |
18 changes: 18 additions & 0 deletions
18
...ts/snapshot/integration/preset_env/output/3f8b2_@swc_helpers_src__class_call_check.mjs.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...on/preset_env/output/3f8b2_@swc_helpers_src__class_call_check.mjs.js.8bcaf458ac88e308.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"sections": [ | ||
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["/[project]/node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/src/_class_call_check.mjs"],"sourcesContent":["export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}"],"names":[],"mappings":"AAAA;;;AAAe,SAAS,gBAAgB,QAAQ,EAAE,WAAW,EAAE;IAC7D,IAAI,CAAC,CAAC,oBAAoB,WAAW,GAAG;QACtC,MAAM,IAAI,UAAU,qCAAqC;IAC3D,CAAC;AACH"}}, | ||
{"offset": {"line": 12, "column": 0}, "map": {"version": 3, "names": [], "sources": [], "mappings": "A"}}] | ||
} |
6 changes: 6 additions & 0 deletions
6
.../integration/preset_env/output/3f8b2_@swc_helpers_src__class_call_check.mjs.js.8c683f.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"sections": [ | ||
{"offset": {"line": 2, "column": 0}, "map": {"version":3,"sources":["/[project]/node_modules/.pnpm/@[email protected]/node_modules/@swc/helpers/src/_class_call_check.mjs"],"sourcesContent":["export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}"],"names":[],"mappings":"AAAA;;;AAAe,SAAS,gBAAgB,QAAQ,EAAE,WAAW,EAAE;IAC7D,IAAI,CAAC,CAAC,oBAAoB,WAAW,GAAG;QACtC,MAAM,IAAI,UAAU,qCAAqC;IAC3D,CAAC;AACH"}}, | ||
{"offset": {"line": 10, "column": 0}, "map": {"version": 3, "names": [], "sources": [], "mappings": "A"}}] | ||
} |
12 changes: 6 additions & 6 deletions
12
...egration_preset_env_input_index_17d7e7.js → ...egration_preset_env_input_index_56c340.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...nput_index_17d7e7.js.b2643f4016b9579d.map → ...nput_index_56c340.js.496f26fdbe25baf2.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"sections": [ | ||
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["/[project]/crates/turbopack/tests/snapshot/integration/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo);\n"],"names":[],"mappings":"AAAA;;;AAAA,IAAA,AAAM,MAAN,SAAM;;2IAAA;;AAEN,QAAQ,GAAG,CAAC"}}, | ||
{"offset": {"line": 4, "column": 0}, "map": {"version":3,"sources":["/[project]/crates/turbopack/tests/snapshot/integration/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo, [].includes(\"foo\"));\n"],"names":[],"mappings":"AAAA;;;AAAA,IAAA,AAAM,MAAN,SAAM;;yMAAA;;AAEN,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC"}}, | ||
{"offset": {"line": 12, "column": 0}, "map": {"version": 3, "names": [], "sources": [], "mappings": "A"}}] | ||
} |
2 changes: 1 addition & 1 deletion
2
...eset_env_input_index_17d7e7.js.42272d.map → ...eset_env_input_index_56c340.js.d5a489.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"sections": [ | ||
{"offset": {"line": 2, "column": 0}, "map": {"version":3,"sources":["/[project]/crates/turbopack/tests/snapshot/integration/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo);\n"],"names":[],"mappings":"AAAA;;;AAAA,IAAA,AAAM,MAAN,SAAM;;2IAAA;;AAEN,QAAQ,GAAG,CAAC"}}, | ||
{"offset": {"line": 2, "column": 0}, "map": {"version":3,"sources":["/[project]/crates/turbopack/tests/snapshot/integration/preset_env/input/index.js"],"sourcesContent":["class Foo {}\n\nconsole.log(Foo, [].includes(\"foo\"));\n"],"names":[],"mappings":"AAAA;;;AAAA,IAAA,AAAM,MAAN,SAAM;;yMAAA;;AAEN,QAAQ,GAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC"}}, | ||
{"offset": {"line": 10, "column": 0}, "map": {"version": 3, "names": [], "sources": [], "mappings": "A"}}] | ||
} |
18 changes: 0 additions & 18 deletions
18
...shot/integration/preset_env/output/node_modules_@swc_helpers_src__class_call_check.mjs.js
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...et_env/output/node_modules_@swc_helpers_src__class_call_check.mjs.js.8bcaf458ac88e308.map
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...ation/preset_env/output/node_modules_@swc_helpers_src__class_call_check.mjs.js.8c683f.map
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.