Unverified Commit 6324fdba authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Upgrade to swc 75 (#96702)

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

We encourage you to use AI to assist you in researching, creating, and
reviewing changes. However, you must review and deeply understand the
contributions you are making. For this reason, **pull request
descriptions from external contributors must be written by a human**.

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Signed commits

- This repository requires verified commit signatures on protected
branches.
- If this pull request is blocked for unsigned commits, re-sign the
commits and force-push the branch.
- A `Signed-off-by` line in the commit message is not enough.

## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->
parent 5d1bbce4
This diff is collapsed.
...@@ -209,29 +209,29 @@ turbopack-trace-server = { path = "turbopack/crates/turbopack-trace-server" } ...@@ -209,29 +209,29 @@ turbopack-trace-server = { path = "turbopack/crates/turbopack-trace-server" }
turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" } turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" } turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }
swc_ecma_react_compiler = "20.1.0" swc_ecma_react_compiler = "22.0.0"
react_compiler = { version = "0.2", package = "forked_react_compiler" } react_compiler = { version = "0.2", package = "forked_react_compiler" }
# SWC crates # SWC crates
swc_core = { version = "73.0.0", default-features = false, features = [ swc_core = { version = "75.0.0", default-features = false, features = [
"ecma_loader_lru", "ecma_loader_lru",
"ecma_loader_parking_lot", "ecma_loader_parking_lot",
"parallel_rayon", "parallel_rayon",
] } ] }
swc_plugin_backend_wasmtime = "12.0.0" swc_plugin_backend_wasmtime = "14.0.0"
testing = "24.0.1" testing = "25.0.0"
# Keep consistent with preset_env_base through swc_core # Keep consistent with preset_env_base through swc_core
browserslist-rs = "0.19.0" browserslist-rs = "0.19.0"
mdxjs = "1.0.4" mdxjs = "1.0.4"
modularize_imports = "13.0.0" modularize_imports = "15.0.0"
styled_components = "13.0.0" styled_components = "15.0.0"
styled_jsx = "13.0.0" styled_jsx = "15.0.0"
swc_emotion = "13.0.0" swc_emotion = "15.0.0"
swc_relay = "13.0.0" swc_relay = "15.0.0"
react_remove_properties = "13.0.0" react_remove_properties = "15.0.0"
remove_console = "13.0.0" remove_console = "15.0.0"
preset_env_base = "8.0.1" preset_env_base = "8.0.1"
......
...@@ -58,7 +58,7 @@ describe('next/swc', () => { ...@@ -58,7 +58,7 @@ describe('next/swc', () => {
return _arr; return _arr;
} }
function _non_iterable_rest() { function _non_iterable_rest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
} }
function _sliced_to_array(arr, i) { function _sliced_to_array(arr, i) {
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
...@@ -95,10 +95,12 @@ describe('next/swc', () => { ...@@ -95,10 +95,12 @@ describe('next/swc', () => {
if (Array.isArray(arr)) return arr; if (Array.isArray(arr)) return arr;
} }
function _iterable_to_array(iter) { function _iterable_to_array(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
return Array.from(iter);
}
} }
function _non_iterable_rest() { function _non_iterable_rest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
} }
function _to_array(arr) { function _to_array(arr) {
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest(); return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
......
...@@ -31,11 +31,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { ...@@ -31,11 +31,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
reject(error); reject(error);
return; return;
} }
if (info.done) { if (info.done) resolve(value);
resolve(value); else Promise.resolve(value).then(_next, _throw);
} else {
Promise.resolve(value).then(_next, _throw);
}
} }
function _async_to_generator(fn) { function _async_to_generator(fn) {
return function() { return function() {
...@@ -52,10 +49,6 @@ function _async_to_generator(fn) { ...@@ -52,10 +49,6 @@ function _async_to_generator(fn) {
}); });
}; };
} }
function _type_of(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _ts_generator(thisArg, body) { function _ts_generator(thisArg, body) {
var f, y, t, _ = { var f, y, t, _ = {
label: 0, label: 0,
...@@ -155,6 +148,10 @@ function _ts_generator(thisArg, body) { ...@@ -155,6 +148,10 @@ function _ts_generator(thisArg, body) {
}; };
} }
} }
function _type_of(obj) {
"@swc/helpers - typeof";
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
/** /**
* Describes why a module was instantiated. * Describes why a module was instantiated.
* Shared between browser and Node.js runtimes. * Shared between browser and Node.js runtimes.
...@@ -799,11 +796,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { ...@@ -799,11 +796,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
reject(error); reject(error);
return; return;
} }
if (info.done) { if (info.done) resolve(value);
resolve(value); else Promise.resolve(value).then(_next, _throw);
} else {
Promise.resolve(value).then(_next, _throw);
}
} }
function _async_to_generator(fn) { function _async_to_generator(fn) {
return function() { return function() {
...@@ -845,19 +839,11 @@ function _iterable_to_array_limit(arr, i) { ...@@ -845,19 +839,11 @@ function _iterable_to_array_limit(arr, i) {
return _arr; return _arr;
} }
function _non_iterable_rest() { function _non_iterable_rest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
} }
function _sliced_to_array(arr, i) { function _sliced_to_array(arr, i) {
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
} }
function _unsupported_iterable_to_array(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
function _ts_generator(thisArg, body) { function _ts_generator(thisArg, body) {
var f, y, t, _ = { var f, y, t, _ = {
label: 0, label: 0,
...@@ -957,6 +943,14 @@ function _ts_generator(thisArg, body) { ...@@ -957,6 +943,14 @@ function _ts_generator(thisArg, body) {
}; };
} }
} }
function _unsupported_iterable_to_array(o, minLen) {
if (!o) return;
if (typeof o === "string") return _array_like_to_array(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(n);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
var browserContextPrototype = Context.prototype; var browserContextPrototype = Context.prototype;
var RUNTIME_CHUNK_BASE_PATH = typeof TURBOPACK_CHUNK_BASE_PATH === 'string' ? TURBOPACK_CHUNK_BASE_PATH : CHUNK_BASE_PATH; var RUNTIME_CHUNK_BASE_PATH = typeof TURBOPACK_CHUNK_BASE_PATH === 'string' ? TURBOPACK_CHUNK_BASE_PATH : CHUNK_BASE_PATH;
var moduleFactories = new Map(); var moduleFactories = new Map();
...@@ -1509,11 +1503,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { ...@@ -1509,11 +1503,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
reject(error); reject(error);
return; return;
} }
if (info.done) { if (info.done) resolve(value);
resolve(value); else Promise.resolve(value).then(_next, _throw);
} else {
Promise.resolve(value).then(_next, _throw);
}
} }
function _async_to_generator(fn) { function _async_to_generator(fn) {
return function() { return function() {
...@@ -1534,9 +1525,7 @@ function _instanceof(left, right) { ...@@ -1534,9 +1525,7 @@ function _instanceof(left, right) {
"@swc/helpers - instanceof"; "@swc/helpers - instanceof";
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left); return !!right[Symbol.hasInstance](left);
} else { } else return left instanceof right;
return left instanceof right;
}
} }
function _ts_generator(thisArg, body) { function _ts_generator(thisArg, body) {
var f, y, t, _ = { var f, y, t, _ = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment