chore(deps): Update swc (#38347)

This PR updates swc to fa66ee86e5
This commit is contained in:
Donny/강동윤 2022-07-12 00:10:57 +09:00 committed by GitHub
parent 9036924c71
commit f694e6c42f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 363 additions and 250 deletions

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,7 @@ chrono = "0.4"
easy-error = "1.0.0"
either = "1"
fxhash = "0.2.1"
once_cell = "1.8.0"
once_cell = "1.13.0"
pathdiff = "0.2.0"
regex = "1.5"
serde = "1"
@ -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.188.0"
swc_atoms = "0.2.12"
swc_common = { version = "0.18.9", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.30.2", features = ["node", "lru"] }
swc_ecmascript = { version = "0.164.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.56.0", optional = true, default-features = false }
swc = "0.205.0"
swc_atoms = "0.2.13"
swc_common = { version = "0.23.0", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.35.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.180.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.64.0", optional = true, default-features = false }
swc_cached = "0.1.1"
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.91.0"
testing = "0.20.1"
swc_ecma_transforms_testing = "0.99.0"
testing = "0.25.0"
walkdir = "2.3.2"

View file

@ -30,10 +30,11 @@ fn test(input: &Path, minify: bool) {
let options = TransformOptions {
swc: swc::config::Options {
swcrc: true,
is_module: swc::config::IsModule::Bool(true),
output_path: Some(output.clone()),
config: swc::config::Config {
is_module: swc::config::IsModule::Bool(true),
jsc: swc::config::JscConfig {
minify: if minify {
Some(assert_json("{ \"compress\": true, \"mangle\": true }"))

View file

@ -1,4 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
});
var a = function(a) {
return a && a.__esModule ? a : {
default: a

View file

@ -1,40 +1,40 @@
function b(c, a) {
(null == a || a > c.length) && (a = c.length);
for(var b = 0, d = new Array(a); b < a; b++)d[b] = c[b];
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;
}
import a from "other";
(function(a, c) {
import b from "other";
(function(b, c) {
return function(a) {
if (Array.isArray(a)) return a;
}(a) || function(b, e) {
var f, g, a = null == b ? null : "undefined" != typeof Symbol && b[Symbol.iterator] || b["@@iterator"];
if (null != a) {
var c = [], d = !0, h = !1;
}(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;
try {
for(a = a.call(b); !(d = (f = a.next()).done) && (c.push(f.value), !e || c.length !== e); d = !0);
for(e = e.call(a); !(g = (c = e.next()).done) && (f.push(c.value), !b || f.length !== b); g = !0);
} catch (i) {
h = !0, g = i;
h = !0, d = i;
} finally{
try {
d || null == a.return || a.return();
g || null == e.return || e.return();
} finally{
if (h) throw g;
if (h) throw d;
}
}
return c;
return f;
}
}(a, c) || function e(a, d) {
if (a) {
if ("string" == typeof a) return b(a, d);
var c = Object.prototype.toString.call(a).slice(8, -1);
if ("Object" === c && a.constructor && (c = a.constructor.name), "Map" === c || "Set" === c) return Array.from(c);
if ("Arguments" === c || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)) return b(a, d);
}(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);
}
}(a, c) || function() {
}(b, c) || 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.");
}();
})(a, 1)[0];
})(b, 1)[0];
var c = function() {
"use strict";
!function(a, b) {

View file

@ -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.10.0"
version = "0.12.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -13,17 +13,17 @@ version = "0.10.0"
base64 = "0.13"
byteorder = "1"
fxhash = "0.2.1"
once_cell = "1.8.0"
once_cell = "1.13.0"
radix_fmt = "1"
regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
swc_atoms = "0.2.12"
swc_common = { version = "0.18.9", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.164.0", features = ["codegen", "utils", "visit"] }
swc_atoms = "0.2.13"
swc_common = { version = "0.23.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.180.0", features = ["codegen", "utils", "visit"] }
swc_trace_macro = "0.1.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
[dev-dependencies]
swc_ecma_transforms_testing = "0.91.0"
testing = "0.20.1"
swc_ecma_transforms_testing = "0.99.0"
testing = "0.25.0"

View file

@ -5,18 +5,18 @@ edition = "2018"
license = "Apache-2.0"
name = "modularize_imports"
repository = "https://github.com/vercel/next.js.git"
version = "0.9.0"
version = "0.11.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
handlebars = "4.2.1"
once_cell = "1.8.0"
once_cell = "1.13.0"
regex = "1.5"
serde = "1"
swc_cached = "0.1.1"
swc_ecmascript = { version = "0.164.0", features = ["visit"] }
swc_ecmascript = { version = "0.180.0", features = ["visit"] }
[dev-dependencies]
swc_ecma_transforms_testing = "0.91.0"
testing = "0.20.1"
swc_ecma_transforms_testing = "0.99.0"
testing = "0.25.0"

View file

@ -30,16 +30,16 @@ fxhash = "0.2.1"
napi = {version = "1", features = ["serde-json"]}
napi-derive = "1"
next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.8.0"
once_cell = "1.13.0"
serde = "1"
serde_json = "1"
swc = "0.188.0"
swc_atoms = "0.2.12"
swc_bundler = { version = "0.154.0", features = ["concurrent"] }
swc_common = { version = "0.18.9", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.30.2", features = ["node", "lru"] }
swc_ecmascript = { version = "0.164.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.56.0", optional = true }
swc = "0.205.0"
swc_atoms = "0.2.13"
swc_bundler = { version = "0.169.0", features = ["concurrent"] }
swc_common = { version = "0.23.0", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.35.0", features = ["node", "lru"] }
swc_ecmascript = { version = "0.180.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.64.0", optional = true }
swc_node_base = "0.5.5"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
tracing-futures = "0.2.5"
@ -63,4 +63,4 @@ _sentry_rustls = { package = "sentry", version = "0.27.0", default-features = fa
[build-dependencies]
napi-build = "1"
serde = "1"
serde_json = "1"
serde_json = "1"

View file

@ -33,7 +33,7 @@ use fxhash::FxHashMap;
use napi::{CallContext, JsObject, Task};
use serde::Deserialize;
use std::sync::Arc;
use swc::{try_with_handler, TransformOutput};
use swc::{config::JsMinifyOptions, try_with_handler, TransformOutput};
use swc_common::{errors::ColorConfig, sync::Lrc, FileName, SourceFile, SourceMap};
struct MinifyTask {
@ -85,7 +85,13 @@ impl Task for MinifyTask {
|handler| {
let fm = self.code.to_file(self.c.cm.clone());
self.c.minify(fm, handler, &self.opts)
self.c.minify(
fm,
handler,
&JsMinifyOptions {
..self.opts.clone()
},
)
},
)
.convert_err()

View file

@ -6,22 +6,22 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0"
name = "styled_components"
repository = "https://github.com/vercel/next.js.git"
version = "0.34.0"
version = "0.36.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Inflector = "0.11.4"
once_cell = "1.10.0"
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.2.12"
swc_common = { version = "0.18.9", features = ["concurrent"] }
swc_ecmascript = { version = "0.164.0", features = ["utils", "visit"] }
swc_atoms = "0.2.13"
swc_common = { version = "0.23.0", features = ["concurrent"] }
swc_ecmascript = { version = "0.180.0", features = ["utils", "visit"] }
tracing = "0.1.32"
[dev-dependencies]
serde_json = "1"
swc_ecma_transforms_testing = "0.91.0"
swc_ecmascript = { version = "0.164.0", features = ["parser", "transforms"] }
testing = "0.20.1"
swc_ecma_transforms_testing = "0.99.0"
swc_ecmascript = { version = "0.180.0", features = ["parser", "transforms"] }
testing = "0.25.0"

View file

@ -5,18 +5,18 @@ edition = "2018"
license = "Apache-2.0"
name = "styled_jsx"
repository = "https://github.com/vercel/next.js.git"
version = "0.9.0"
version = "0.11.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.18.9", features = ["concurrent", "sourcemap"] }
swc_css = "0.106.0"
swc_css_prefixer = "0.101.0"
swc_ecmascript = { version = "0.164.0", features = ["parser", "minifier", "utils", "visit"] }
swc_common = { version = "0.23.0", features = ["concurrent", "sourcemap"] }
swc_css = "0.111.0"
swc_css_prefixer = "0.107.0"
swc_ecmascript = { version = "0.180.0", features = ["parser", "minifier", "utils", "visit"] }
tracing = "0.1.32"
[dev-dependencies]
swc_ecma_transforms_testing = "0.91.0"
testing = "0.20.1"
swc_ecma_transforms_testing = "0.99.0"
testing = "0.25.0"

View file

@ -20,15 +20,15 @@ plugin = [
anyhow = "1.0.42"
console_error_panic_hook = "0.1.6"
next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.3.1"
once_cell = "1.13.0"
parking_lot_core = "=0.8.0"
path-clean = "0.1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
swc = "0.188.0"
swc_common = { version = "0.18.9", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.164.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.56.0", default-features = false, optional = true }
swc = "0.205.0"
swc_common = { version = "0.23.0", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.180.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_plugin_runner = { version = "0.64.0", default-features = false, optional = true }
tracing = { version = "0.1.32", features = ["release_max_level_off"] }
wasm-bindgen = {version = "0.2", features = ["serde-serialize"]}
wasm-bindgen-futures = "0.4.8"