Skip to content

Commit

Permalink
feat(next-swc): Update swc (#39499)
Browse files Browse the repository at this point in the history
This PR applies

 - swc-project/swc#5487
   - Closes #39538
 - swc-project/swc#5485
   - Closes #39412
 - swc-project/swc#5498
   - Closes #39360
  • Loading branch information
kdy1 committed Aug 17, 2022
1 parent c79b67c commit ab15291
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 189 deletions.
211 changes: 106 additions & 105 deletions packages/next-swc/Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions packages/next-swc/crates/core/Cargo.toml
Expand Up @@ -26,18 +26,18 @@ swc_emotion = {path="../emotion"}
styled_components = {path="../styled_components"}
styled_jsx = {path="../styled_jsx"}
modularize_imports = {path="../modularize_imports"}
swc = "0.212.1"
swc_atoms = "0.3.1"
swc_common = { version = "0.26.0", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] }
swc_ecma_loader = { version = "0.38.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.186.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.70.0", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] }
swc_cached = "0.2.0"
swc = "0.214.9"
swc_atoms = "0.4.8"
swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap", "plugin_transform_schema_v1"] }
swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] }
swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.71.15", optional = true, default-features = false, features = ["plugin_transform_schema_v1"] }
swc_cached = "0.3.5"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
wasmer = { version = "2.3.0", optional = true, default-features = false }
wasmer-wasi = { version = "2.3.0", optional = true, default-features = false }

[dev-dependencies]
swc_ecma_transforms_testing = "0.104.0"
testing = "0.28.0"
swc_ecma_transforms_testing = "0.105.5"
testing = "0.29.4"
walkdir = "2.3.2"
8 changes: 4 additions & 4 deletions packages/next-swc/crates/core/tests/full/auto-cjs/1/output.js
Expand Up @@ -2,9 +2,9 @@
Object.defineProperty(exports, "__esModule", {
value: !0
});
var a = function(a) {
return a && a.__esModule ? a : {
default: a
var e = function(e) {
return e && e.__esModule ? e : {
default: e
};
}(require("esm"));
console.log(a.default.foo), module.exports = a.default;
console.log(e.default.foo), module.exports = e.default;
60 changes: 30 additions & 30 deletions packages/next-swc/crates/core/tests/full/example/output.js
@@ -1,47 +1,47 @@
function a(a, b) {
(null == b || b > a.length) && (b = a.length);
for(var c = 0, d = new Array(b); c < b; c++)d[c] = a[c];
return d;
function n(n, t) {
(null == t || t > n.length) && (t = n.length);
for(var r = 0, e = new Array(t); r < t; r++)e[r] = n[r];
return e;
}
import b from "other";
(function(b, c) {
return function(a) {
if (Array.isArray(a)) return a;
}(b) || function(a, b) {
var c, d, e = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"];
if (null != e) {
var f = [], g = !0, h = !1;
import t from "other";
(function(t, r) {
return function(n) {
if (Array.isArray(n)) return n;
}(t) || function(n, t) {
var r, e, o = null == n ? null : "undefined" != typeof Symbol && n[Symbol.iterator] || n["@@iterator"];
if (null != o) {
var u = [], l = !0, f = !1;
try {
for(e = e.call(a); !(g = (c = e.next()).done) && (f.push(c.value), !b || f.length !== b); g = !0);
for(o = o.call(n); !(l = (r = o.next()).done) && (u.push(r.value), !t || u.length !== t); l = !0);
} catch (i) {
h = !0, d = i;
f = !0, e = i;
} finally{
try {
g || null == e.return || e.return();
l || null == o.return || o.return();
} finally{
if (h) throw d;
if (f) throw e;
}
}
return f;
return u;
}
}(b, c) || function b(c, d) {
if (c) {
if ("string" == typeof c) return a(c, d);
var e = Object.prototype.toString.call(c).slice(8, -1);
if ("Object" === e && c.constructor && (e = c.constructor.name), "Map" === e || "Set" === e) return Array.from(e);
if ("Arguments" === e || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return a(c, d);
}(t, r) || function t(r, e) {
if (r) {
if ("string" == typeof r) return n(r, e);
var o = Object.prototype.toString.call(r).slice(8, -1);
if ("Object" === o && r.constructor && (o = r.constructor.name), "Map" === o || "Set" === o) return Array.from(o);
if ("Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)) return n(r, e);
}
}(b, c) || function() {
}(t, r) || 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.");
}();
})(b, 1)[0];
var c = function() {
})(t, 1)[0];
var r = function() {
"use strict";
!function(a, b) {
if (!(a instanceof b)) throw new TypeError("Cannot call a class as a function");
}(this, c);
!function(n, t) {
if (!(n instanceof t)) throw new TypeError("Cannot call a class as a function");
}(this, r);
};
export var __N_SSG = !0;
export default function d() {
export default function e() {
return React.createElement("div", null);
};
15 changes: 8 additions & 7 deletions packages/next-swc/crates/emotion/Cargo.toml
Expand Up @@ -5,7 +5,7 @@ description = "AST Transforms for emotion"
license = "Apache-2.0"
name = "swc_emotion"
repository = "https://github.com/vercel/next.js.git"
version = "0.16.0"
version = "0.17.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -18,13 +18,14 @@ radix_fmt = "1"
regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
swc_atoms = "0.3.1"
swc_common = { version = "0.26.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.186.0", features = ["codegen", "utils", "visit"] }
swc_trace_macro = "0.1.1"
swc_atoms = "0.4.8"
swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.189.4", features = ["codegen", "utils", "visit"] }
swc_trace_macro = "0.1.2"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }

[dev-dependencies]
swc_ecma_transforms_testing = "0.104.0"
testing = "0.28.0"
swc_ecma_transforms_testing = "0.105.5"
testing = "0.29.4"
serde_json = "1"
swc_ecma_transforms_react = "0.141.4"
6 changes: 2 additions & 4 deletions packages/next-swc/crates/emotion/tests/fixture.rs
Expand Up @@ -2,10 +2,7 @@ use std::path::PathBuf;

use swc_common::{chain, comments::SingleThreadedComments, Mark};
use swc_ecma_transforms_testing::test_fixture;
use swc_ecmascript::{
parser::{Syntax, TsConfig},
transforms::react::{jsx, Runtime},
};
use swc_ecmascript::parser::{Syntax, TsConfig};
use swc_emotion::EmotionOptions;
use testing::fixture;

Expand All @@ -15,6 +12,7 @@ fn ts_syntax() -> Syntax {
..Default::default()
})
}
use swc_ecma_transforms_react::{jsx, Runtime};

#[fixture("tests/fixture/**/input.tsx")]
fn next_emotion_fixture(input: PathBuf) {
Expand Down
10 changes: 5 additions & 5 deletions packages/next-swc/crates/modularize_imports/Cargo.toml
Expand Up @@ -5,7 +5,7 @@ edition = "2018"
license = "Apache-2.0"
name = "modularize_imports"
repository = "https://github.com/vercel/next.js.git"
version = "0.14.0"
version = "0.15.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -15,9 +15,9 @@ handlebars = "4.2.1"
once_cell = "1.13.0"
regex = "1.5"
serde = "1"
swc_cached = "0.2.0"
swc_ecmascript = { version = "0.186.0", features = ["visit"] }
swc_cached = "0.3.5"
swc_ecmascript = { version = "0.189.4", features = ["visit"] }

[dev-dependencies]
swc_ecma_transforms_testing = "0.104.0"
testing = "0.28.0"
swc_ecma_transforms_testing = "0.105.5"
testing = "0.29.4"
14 changes: 7 additions & 7 deletions packages/next-swc/crates/napi/Cargo.toml
Expand Up @@ -33,13 +33,13 @@ next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.13.0"
serde = "1"
serde_json = "1"
swc = "0.212.1"
swc_atoms = "0.3.1"
swc_bundler = { version = "0.175.0", features = ["concurrent"] }
swc_common = { version = "0.26.0", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.38.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.186.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.70.0", optional = true }
swc = "0.214.9"
swc_atoms = "0.4.8"
swc_bundler = { version = "0.177.4", features = ["concurrent"] }
swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.39.4", features = ["node", "lru"] }
swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.71.15", optional = true }
swc_node_base = "0.5.5"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
Expand Down
14 changes: 7 additions & 7 deletions packages/next-swc/crates/styled_components/Cargo.toml
Expand Up @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0"
name = "styled_components"
repository = "https://github.com/vercel/next.js.git"
version = "0.39.0"
version = "0.40.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -15,13 +15,13 @@ Inflector = "0.11.4"
once_cell = "1.13.0"
regex = {version = "1.5.4", features = ["std", "perf"], default-features = false}
serde = {version = "1.0.130", features = ["derive"]}
swc_atoms = "0.3.1"
swc_common = { version = "0.26.0", features = ["concurrent"] }
swc_ecmascript = { version = "0.186.0", features = ["utils", "visit"] }
swc_atoms = "0.4.8"
swc_common = { version = "0.27.11", features = ["concurrent"] }
swc_ecmascript = { version = "0.189.4", features = ["utils", "visit"] }
tracing = "0.1.32"

[dev-dependencies]
serde_json = "1"
swc_ecma_transforms_testing = "0.104.0"
swc_ecmascript = { version = "0.186.0", features = ["parser", "transforms"] }
testing = "0.28.0"
swc_ecma_transforms_testing = "0.105.5"
swc_ecmascript = { version = "0.189.4", features = ["parser", "transforms"] }
testing = "0.29.4"
14 changes: 7 additions & 7 deletions packages/next-swc/crates/styled_jsx/Cargo.toml
Expand Up @@ -5,18 +5,18 @@ edition = "2018"
license = "Apache-2.0"
name = "styled_jsx"
repository = "https://github.com/vercel/next.js.git"
version = "0.14.0"
version = "0.15.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
easy-error = "1.0.0"
swc_common = { version = "0.26.0", features = ["concurrent", "sourcemap"] }
swc_css = "0.116.0"
swc_css_prefixer = "0.113.3"
swc_ecmascript = { version = "0.186.0", features = ["parser", "minifier", "utils", "visit"] }
swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] }
swc_css = "0.120.0"
swc_css_prefixer = "0.117.0"
swc_ecmascript = { version = "0.189.4", features = ["parser", "minifier", "utils", "visit"] }
tracing = "0.1.32"

[dev-dependencies]
swc_ecma_transforms_testing = "0.104.0"
testing = "0.28.0"
swc_ecma_transforms_testing = "0.105.5"
testing = "0.29.4"
8 changes: 4 additions & 4 deletions packages/next-swc/crates/wasm/Cargo.toml
Expand Up @@ -25,10 +25,10 @@ parking_lot_core = "=0.8.0"
path-clean = "0.1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
swc = "0.212.1"
swc_common = { version = "0.26.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.186.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.70.0", default-features = false, optional = true }
swc = "0.214.9"
swc_common = { version = "0.27.11", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.189.4", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.71.15", default-features = false, optional = true }
tracing = { version = "0.1.32", features = ["release_max_level_off"] }
wasm-bindgen = {version = "0.2", features = ["serde-serialize", "enable-interning"]}
wasm-bindgen-futures = "0.4.8"
Expand Down

0 comments on commit ab15291

Please sign in to comment.