From d676b6c63ada85801673f0e691f8ba11e44e347a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 11 Jan 2021 15:32:34 +0100 Subject: [PATCH] upgrade: swc_bundler 0.19.2 (#9085) --- Cargo.lock | 20 ++++++++++---------- cli/Cargo.toml | 4 ++-- cli/tests/bundle.test.out | 26 +++++++++++++++++--------- cli/tests/bundle/fixture02.out | 5 +++-- cli/tests/bundle/fixture08.out | 2 +- cli/tests/bundle/fixture09.out | 5 +++-- cli/tests/bundle/fixture10.out | 2 +- cli/tests/bundle/fixture11.out | 7 ++++--- cli/tests/bundle/fixture14.out | 18 +++++++++--------- cli/tests/bundle/fixture15.out | 4 +++- 10 files changed, 53 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09b269457a..031bedab54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2516,9 +2516,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233e7e26004d0421a3db5f4b61bbdc7728bb798cc8ca3c73d8a82e1e22028672" +checksum = "ca206cdd8d27e6fea6ceb24d890bf6ce1313ff4e6d93ef5de213a18a871153e4" dependencies = [ "anyhow", "crc", @@ -2642,9 +2642,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2aad881f470227b9da6ab2d625468a609ad638cbfc8a1268804b1d697fdbdc" +checksum = "2cf5ed72776b751ead1417159462ad2e82dd3ab9da98ffea8edf4f8c0953ea1e" dependencies = [ "swc_atoms", "swc_common", @@ -2681,9 +2681,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50aeac71e3b3b7a2b145bfb5d145b9c367d2bc5de184a0f00b94e797751c5e" +checksum = "a4cd5ff2818c8b4ac9ea6a5fe302bdf0dc6ddf7368a9d7a6ea44ecdda17bed36" dependencies = [ "dashmap 4.0.1", "fxhash", @@ -2741,9 +2741,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f811aec8fa4bcf758f75b6b42c793fabd0f843a5f78cc14647002090d4b9bc83" +checksum = "8be0bec18ada45c611cb862c8700de262fb1800af35045b58b4180a39ea4dff5" dependencies = [ "fxhash", "serde", @@ -2786,9 +2786,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab54fd9535fe42b73e6409b360b10472dcfa7239aa22a7da75ab664d3105ab83" +checksum = "184233c2afeec295375f7e416c323de11444051f9989cce0843c408970b191ab" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index bea5e87a56..e6b37712bc 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -68,9 +68,9 @@ semver-parser = "0.9.0" serde = { version = "1.0.116", features = ["derive"] } shell-escape = "0.1.5" sourcemap = "6.0.1" -swc_bundler = "0.19.1" +swc_bundler = "0.19.2" swc_common = { version = "0.10.8", features = ["sourcemap"] } -swc_ecmascript = { version = "0.17.0", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] } +swc_ecmascript = { version = "0.17.1", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] } tempfile = "3.1.0" termcolor = "1.1.0" tokio = { version = "0.2.22", features = ["full"] } diff --git a/cli/tests/bundle.test.out b/cli/tests/bundle.test.out index d90dc9f95e..155430c995 100644 --- a/cli/tests/bundle.test.out +++ b/cli/tests/bundle.test.out @@ -1,23 +1,31 @@ [WILDCARD] -function printHello() { - console.log("Hello"); +function returnsHi() { + return "Hi"; } function returnsFoo() { return "Foo"; } +function printHello() { + console.log("Hello"); +} function printHello2() { printHello(); } -export function returnsHi() { - return "Hi"; -} -export function returnsFoo2() { +function returnsFoo2() { return returnsFoo(); } -export function printHello3() { +function printHello3() { printHello2(); } -export function throwsError() { +function throwsError() { throw Error("exception from mod1"); } -[WILDCARD] \ No newline at end of file +const returnsHi1 = returnsHi; +const returnsFoo21 = returnsFoo2; +const printHello31 = printHello3; +const throwsError1 = throwsError; +export { returnsHi as returnsHi }; +export { returnsFoo2 as returnsFoo2 }; +export { printHello3 as printHello3 }; +export { throwsError as throwsError }; + diff --git a/cli/tests/bundle/fixture02.out b/cli/tests/bundle/fixture02.out index aad359fce2..b14fc143b3 100644 --- a/cli/tests/bundle/fixture02.out +++ b/cli/tests/bundle/fixture02.out @@ -4,10 +4,11 @@ const mod = function() { const c = "c"; class C { } - const __default = C; const c1 = c; + const __default = C; + const __default1 = C; return { - c, + c: c, default: C }; }(); diff --git a/cli/tests/bundle/fixture08.out b/cli/tests/bundle/fixture08.out index 01d6befb42..0ab6468401 100644 --- a/cli/tests/bundle/fixture08.out +++ b/cli/tests/bundle/fixture08.out @@ -2,7 +2,7 @@ const mod = function() { const a = "a"; const a1 = a; return { - a + a: a }; }(); const a = mod; diff --git a/cli/tests/bundle/fixture09.out b/cli/tests/bundle/fixture09.out index e7396f493c..73031ef02e 100644 --- a/cli/tests/bundle/fixture09.out +++ b/cli/tests/bundle/fixture09.out @@ -15,6 +15,7 @@ const mod1 = function() { }; }(); const k = globalThis.value ? mod : mod1; -const { a: a2 , } = k; -const a1 = a2; +const { a , } = k; +const a1 = a; +const a2 = a; export { a1 as a }; diff --git a/cli/tests/bundle/fixture10.out b/cli/tests/bundle/fixture10.out index 5491e5e7f2..209c19612c 100644 --- a/cli/tests/bundle/fixture10.out +++ b/cli/tests/bundle/fixture10.out @@ -1,5 +1,5 @@ -const a = "a"; const o = { }; +const a = "a"; const { a: a1 = a } = o; console.log(a1); diff --git a/cli/tests/bundle/fixture11.out b/cli/tests/bundle/fixture11.out index 3dc1a454b7..9c22c3b093 100644 --- a/cli/tests/bundle/fixture11.out +++ b/cli/tests/bundle/fixture11.out @@ -1,6 +1,3 @@ -function a() { - console.log("a"); -} var O2; (function(O1) { O1[O1["A"] = 0] = "A"; @@ -8,6 +5,9 @@ var O2; O1[O1["C"] = 2] = "C"; })(O2 || (O2 = { })); +function a() { + console.log("a"); +} const O1 = O2; export { O1 as O }; class A { @@ -29,3 +29,4 @@ class A { const a2 = new A(); a2.a(); a2.c(); +const O3 = O2; diff --git a/cli/tests/bundle/fixture14.out b/cli/tests/bundle/fixture14.out index 80532a1ddc..2534a70159 100644 --- a/cli/tests/bundle/fixture14.out +++ b/cli/tests/bundle/fixture14.out @@ -6,26 +6,26 @@ const mod = function() { }(); console.log(mod); const mod1 = function() { - const a = []; - const a1 = a; + const c = []; + const c1 = c; return { - a + c: c }; }(); -const a = mod1; +const c = mod1; const mod2 = function() { const b = []; const b1 = b; return { - b + b: b }; }(); const b = mod2; const mod3 = function() { - const c = []; - const c1 = c; + const a = []; + const a1 = a; return { - c + a: a }; }(); -const c = mod3; +const a = mod3; diff --git a/cli/tests/bundle/fixture15.out b/cli/tests/bundle/fixture15.out index b8e7cfc5e7..408d8464f0 100644 --- a/cli/tests/bundle/fixture15.out +++ b/cli/tests/bundle/fixture15.out @@ -1,3 +1,5 @@ -export function getIndex(c) { +function getIndex(c) { return "\x00\r\n\x85\u2028\u2029".indexOf(c); } +const getIndex1 = getIndex; +export { getIndex as getIndex };