Update swc_core to v0.56.0 (#44792)

Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
This commit is contained in:
JJ Kasper 2023-01-20 10:34:09 -08:00 committed by GitHub
parent d6b4c5411e
commit 9db8145858
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 691 additions and 463 deletions

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ serde = "1"
serde_json = "1" serde_json = "1"
tracing = { version = "0.1.37", features = ["release_max_level_info"] } tracing = { version = "0.1.37", features = ["release_max_level_info"] }
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "079505baf1ce03707d28b6c0afb158dca601a11a", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "37b5840ba713c8c68db357daae9cde312f73d076", features = [
"__swc_core", "__swc_core",
"__swc_core_next_core", "__swc_core_next_core",
"__swc_transform_styled_jsx", "__swc_transform_styled_jsx",
@ -29,7 +29,7 @@ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "079505baf1c
] } ] }
[dev-dependencies] [dev-dependencies]
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "079505baf1ce03707d28b6c0afb158dca601a11a", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "37b5840ba713c8c68db357daae9cde312f73d076", features = [
"__swc_core_testing_transform", "__swc_core_testing_transform",
"__swc_testing", "__swc_testing",
] } ] }

View file

@ -1,7 +1,7 @@
export default function Home() { export default function Home() {
return <div data-test-id="1"> return <div data-test-id="1">
<div > <div>
<h1 data-testid="3">Hello World!</h1> <h1 data-testid="3">Hello World!</h1>

View file

@ -3,7 +3,7 @@ export default function Home() {
<div data-custom="2"> <div data-custom="2">
<h1 nested={()=><div >nested</div>}>Hello World!</h1> <h1 nested={()=><div>nested</div>}>Hello World!</h1>
</div> </div>

View file

@ -1,40 +1,40 @@
function t(t, r) { function r(r, t) {
(null == r || r > t.length) && (r = t.length); (null == t || t > r.length) && (t = r.length);
for(var n = 0, e = new Array(r); n < r; n++)e[n] = t[n]; for(var n = 0, e = Array(t); n < t; n++)e[n] = r[n];
return e; return e;
} }
import r from "other"; import t from "other";
(function(r, n) { (function(t, n) {
return function(t) { return function(r) {
if (Array.isArray(t)) return t; if (Array.isArray(r)) return r;
}(r) || function(t, r) { }(t) || function(r, t) {
var n, e, o = null == t ? null : "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]; var n, e, o = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != o) { if (null != o) {
var u = [], l = !0, i = !1; var a = [], l = !0, u = !1;
try { try {
for(o = o.call(t); !(l = (n = o.next()).done) && (u.push(n.value), !r || u.length !== r); l = !0); for(o = o.call(r); !(l = (n = o.next()).done) && (a.push(n.value), !t || a.length !== t); l = !0);
} catch (a) { } catch (r) {
i = !0, e = a; u = !0, e = r;
} finally{ } finally{
try { try {
l || null == o.return || o.return(); l || null == o.return || o.return();
} finally{ } finally{
if (i) throw e; if (u) throw e;
} }
} }
return u; return a;
} }
}(r, n) || function(r, n) { }(t, n) || function(t, n) {
if (r) { if (t) {
if ("string" == typeof r) return t(r, n); if ("string" == typeof t) return r(t, n);
var e = Object.prototype.toString.call(r).slice(8, -1); var e = Object.prototype.toString.call(t).slice(8, -1);
if ("Object" === e && r.constructor && (e = r.constructor.name), "Map" === e || "Set" === e) return Array.from(e); if ("Object" === e && t.constructor && (e = t.constructor.name), "Map" === e || "Set" === e) return Array.from(e);
if ("Arguments" === e || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return t(r, n); if ("Arguments" === e || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return r(t, n);
} }
}(r, n) || function() { }(t, n) || function() {
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 TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}(); }();
})(r, 1)[0]; })(t, 1)[0];
export var __N_SSG = !0; export var __N_SSG = !0;
export default function n() { export default function n() {
return React.createElement("div", null); return React.createElement("div", null);

View file

@ -39,7 +39,7 @@ tracing = { version = "0.1.37", features = ["release_max_level_info"] }
tracing-futures = "0.2.5" tracing-futures = "0.2.5"
tracing-subscriber = "0.3.9" tracing-subscriber = "0.3.9"
tracing-chrome = "0.5.0" tracing-chrome = "0.5.0"
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "079505baf1ce03707d28b6c0afb158dca601a11a", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "37b5840ba713c8c68db357daae9cde312f73d076", features = [
"__swc_core_binding_napi", "__swc_core_binding_napi",
"__turbo_next_dev_server", "__turbo_next_dev_server",
"__turbo_node_file_trace", "__turbo_node_file_trace",

View file

@ -61,6 +61,11 @@ pub struct TransformTask {
pub options: Buffer, pub options: Buffer,
} }
#[inline]
fn skip_filename() -> bool {
cfg!(debug_assertions)
}
impl Task for TransformTask { impl Task for TransformTask {
type Output = (TransformOutput, FxHashSet<String>); type Output = (TransformOutput, FxHashSet<String>);
type JsValue = Object; type JsValue = Object;
@ -72,8 +77,8 @@ impl Task for TransformTask {
try_with_handler( try_with_handler(
self.c.cm.clone(), self.c.cm.clone(),
next_binding::swc::core::base::HandlerOpts { next_binding::swc::core::base::HandlerOpts {
color: ColorConfig::Never, color: ColorConfig::Always,
skip_filename: true, skip_filename: skip_filename(),
}, },
|handler| { |handler| {
self.c.run(|| { self.c.run(|| {

View file

@ -31,7 +31,7 @@ wasm-bindgen-futures = "0.4.8"
getrandom = { version = "0.2.5", optional = true, default-features = false } getrandom = { version = "0.2.5", optional = true, default-features = false }
js-sys = "0.3.59" js-sys = "0.3.59"
serde-wasm-bindgen = "0.4.3" serde-wasm-bindgen = "0.4.3"
next-binding = { git = "https://github.com/vercel/turbo.git", rev = "079505baf1ce03707d28b6c0afb158dca601a11a", features = [ next-binding = { git = "https://github.com/vercel/turbo.git", rev = "37b5840ba713c8c68db357daae9cde312f73d076", features = [
"__swc_core_binding_wasm", "__swc_core_binding_wasm",
"__feature_mdx_rs", "__feature_mdx_rs",
] } ] }

View file

@ -108,8 +108,7 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error
1: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js ./index.js
@ -188,9 +187,8 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file 0: error was recoverable, but proceeding would result in wrong codegen
1: error was recoverable, but proceeding would result in wrong codegen 1: Syntax Error
2: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js ./index.js
@ -210,9 +208,8 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file 0: error was recoverable, but proceeding would result in wrong codegen
1: error was recoverable, but proceeding would result in wrong codegen 1: Syntax Error
2: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js ./index.js
@ -241,8 +238,7 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error
1: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js ./index.js

View file

@ -26,8 +26,7 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error"
1: Syntax Error"
`; `;
exports[`ReactRefreshLogBox default _document syntax error shows logbox 1`] = ` exports[`ReactRefreshLogBox default _document syntax error shows logbox 1`] = `
@ -46,6 +45,5 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error"
1: Syntax Error"
`; `;

View file

@ -75,8 +75,7 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error
1: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js" ./index.js"
@ -154,9 +153,8 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file 0: error was recoverable, but proceeding would result in wrong codegen
1: error was recoverable, but proceeding would result in wrong codegen 1: Syntax Error
2: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js" ./index.js"
@ -175,9 +173,8 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file 0: error was recoverable, but proceeding would result in wrong codegen
1: error was recoverable, but proceeding would result in wrong codegen 1: Syntax Error
2: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js" ./index.js"
@ -205,8 +202,7 @@ Error:
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error
1: Syntax Error
Import trace for requested module: Import trace for requested module:
./index.js" ./index.js"

View file

@ -832,8 +832,7 @@ describe.each([[''], ['/docs']])(
\`---- \`----
Caused by: Caused by:
0: failed to process input file Syntax Error
1: Syntax Error
Import trace for requested module: Import trace for requested module:
./components/parse-error.js" ./components/parse-error.js"