From aa0154d2d86b0bed7ffed3324c7a650ffe111c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 12 Mar 2024 14:58:52 +0900 Subject: [PATCH 1/7] fix(es/minifier): Fix evaluation of array literals with `void 0` (#8733) **Related issue:** - Closes #8706 --- .../tests/fixture/issues/8706/config.json | 3 +++ .../tests/fixture/issues/8706/input.js | 1 + .../tests/fixture/issues/8706/output.js | 1 + crates/swc_ecma_utils/src/lib.rs | 10 ++++++++++ 4 files changed, 15 insertions(+) create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8706/config.json create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8706/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8706/output.js diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8706/config.json b/crates/swc_ecma_minifier/tests/fixture/issues/8706/config.json new file mode 100644 index 000000000000..ee65e9fdc67e --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8706/config.json @@ -0,0 +1,3 @@ +{ + "defaults": true +} diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8706/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/8706/input.js new file mode 100644 index 000000000000..97839772a01d --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8706/input.js @@ -0,0 +1 @@ +console.log([void 0] + 'swc'); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8706/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8706/output.js new file mode 100644 index 000000000000..e7d809d714df --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8706/output.js @@ -0,0 +1 @@ +console.log("swc"); diff --git a/crates/swc_ecma_utils/src/lib.rs b/crates/swc_ecma_utils/src/lib.rs index 61562fedf53f..2963edaca181 100644 --- a/crates/swc_ecma_utils/src/lib.rs +++ b/crates/swc_ecma_utils/src/lib.rs @@ -1027,6 +1027,16 @@ pub trait ExprExt { let ExprOrSpread { ref expr, .. } = *elem; match &**expr { Expr::Lit(Lit::Null(..)) => Cow::Borrowed(""), + Expr::Unary(UnaryExpr { + op: op!("void"), + arg, + .. + }) => { + if arg.may_have_side_effects(ctx) { + return Value::Unknown; + } + Cow::Borrowed("") + } Expr::Ident(Ident { sym: undefined, .. }) if &**undefined == "undefined" => { From e46dd5a208d228a1707dec67ec5ac6bce00df1a1 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 12 Mar 2024 06:00:28 +0000 Subject: [PATCH 2/7] chore: Bump crates --- CHANGELOG.md | 6 +++--- Cargo.lock | 8 ++++---- crates/swc/Cargo.toml | 4 ++-- crates/swc_bundler/Cargo.toml | 2 +- crates/swc_core/Cargo.toml | 4 ++-- crates/swc_ecma_compat_bugfixes/Cargo.toml | 2 +- crates/swc_ecma_compat_common/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2015/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2016/Cargo.toml | 2 +- crates/swc_ecma_compat_es2017/Cargo.toml | 2 +- crates/swc_ecma_compat_es2018/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es2019/Cargo.toml | 2 +- crates/swc_ecma_compat_es2020/Cargo.toml | 2 +- crates/swc_ecma_compat_es2021/Cargo.toml | 2 +- crates/swc_ecma_compat_es2022/Cargo.toml | 4 ++-- crates/swc_ecma_compat_es3/Cargo.toml | 2 +- crates/swc_ecma_ext_transforms/Cargo.toml | 4 ++-- crates/swc_ecma_lints/Cargo.toml | 2 +- crates/swc_ecma_minifier/Cargo.toml | 4 ++-- crates/swc_ecma_preset_env/Cargo.toml | 2 +- crates/swc_ecma_transforms/Cargo.toml | 2 +- crates/swc_ecma_transforms_base/Cargo.toml | 2 +- crates/swc_ecma_transforms_classes/Cargo.toml | 2 +- crates/swc_ecma_transforms_compat/Cargo.toml | 4 ++-- crates/swc_ecma_transforms_module/Cargo.toml | 2 +- crates/swc_ecma_transforms_optimization/Cargo.toml | 2 +- crates/swc_ecma_transforms_proposal/Cargo.toml | 2 +- crates/swc_ecma_transforms_react/Cargo.toml | 2 +- crates/swc_ecma_transforms_testing/Cargo.toml | 2 +- crates/swc_ecma_transforms_typescript/Cargo.toml | 2 +- crates/swc_ecma_usage_analyzer/Cargo.toml | 4 ++-- crates/swc_ecma_utils/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 2 +- crates/swc_estree_compat/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 2 +- 35 files changed, 50 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcad69ae1e2d..e32a9c995091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ - **(es/minifier)** Handle cyclic references while dropping unused properties ([#8725](https://github.com/swc-project/swc/issues/8725)) ([102241b](https://github.com/swc-project/swc/commit/102241b812b8e815b59575178193bb71b4264bab)) + +- **(es/minifier)** Fix evaluation of array literals with `void 0` ([#8733](https://github.com/swc-project/swc/issues/8733)) ([aa0154d](https://github.com/swc-project/swc/commit/aa0154d2d86b0bed7ffed3324c7a650ffe111c93)) + ### Features @@ -1416,9 +1419,6 @@ - **(common)** Make `ahash` optional ([#7816](https://github.com/swc-project/swc/issues/7816)) ([981d7b1](https://github.com/swc-project/swc/commit/981d7b152b2f488a67d42052152db22225f1d094)) -- **(es/parser)** Remove needless `unsafe` ([#7818](https://github.com/swc-project/swc/issues/7818)) ([8b809db](https://github.com/swc-project/swc/commit/8b809dbe23cab3db2159979cf1852a69c109f1e0)) - - - Use `ahash` from `swc_common` in more places ([#7815](https://github.com/swc-project/swc/issues/7815)) ([b43e38d](https://github.com/swc-project/swc/commit/b43e38d3f92bc889e263b741dbe173a6f2206d88)) diff --git a/Cargo.lock b/Cargo.lock index 2c643c0797c9..f01d4310b134 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4204,7 +4204,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "0.4.10" +version = "0.4.11" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4375,7 +4375,7 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.113.10" +version = "0.113.11" dependencies = [ "phf", "swc_atoms", @@ -4833,7 +4833,7 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.23.10" +version = "0.23.11" dependencies = [ "indexmap 2.1.0", "rustc-hash", @@ -4848,7 +4848,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.127.10" +version = "0.127.11" dependencies = [ "indexmap 2.1.0", "num_cpus", diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 56a05d557cde..7338fb06092e 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -78,7 +78,7 @@ swc_compiler_base = { version = "0.7.15", path = "../swc_compiler_base" } swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } -swc_ecma_ext_transforms = { version = "0.113.10", path = "../swc_ecma_ext_transforms" } +swc_ecma_ext_transforms = { version = "0.113.11", path = "../swc_ecma_ext_transforms" } swc_ecma_lints = { version = "0.92.16", path = "../swc_ecma_lints" } swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader", features = [ "cache", @@ -99,7 +99,7 @@ swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms", f swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_compat = { version = "0.163.14", path = "../swc_ecma_transforms_compat" } swc_ecma_transforms_optimization = { version = "0.198.14", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_error_reporters = { version = "0.17.18", path = "../swc_error_reporters" } swc_node_comments = { version = "0.20.18", path = "../swc_node_comments" } diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index 565d7e3487ba..d8d2c83f5fbd 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_lo swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "0.198.14", path = "../swc_ecma_transforms_optimization" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_fast_graph = { version = "0.21.19", path = "../swc_fast_graph/" } swc_graph_analyzer = { version = "0.22.21", path = "../swc_graph_analyzer/" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index e90346e9341b..719913600cfe 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -358,8 +358,8 @@ swc_ecma_transforms_proposal = { optional = true, version = "0.171.14", path swc_ecma_transforms_react = { optional = true, version = "0.183.14", path = "../swc_ecma_transforms_react" } swc_ecma_transforms_testing = { optional = true, version = "0.140.14", path = "../swc_ecma_transforms_testing" } swc_ecma_transforms_typescript = { optional = true, version = "0.188.14", path = "../swc_ecma_transforms_typescript" } -swc_ecma_usage_analyzer = { optional = true, version = "0.23.10", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { optional = true, version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_usage_analyzer = { optional = true, version = "0.23.11", path = "../swc_ecma_usage_analyzer" } +swc_ecma_utils = { optional = true, version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "0.98.6", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "0.5.10", path = "../swc_malloc" } swc_node_bundler = { optional = true, version = "0.62.18", path = "../swc_node_bundler" } diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index eae2c52f875c..ba9587027ea1 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -16,7 +16,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_compat_es2015 = { version = "0.4.14", path = "../swc_ecma_compat_es2015" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } tracing = "0.1.37" diff --git a/crates/swc_ecma_compat_common/Cargo.toml b/crates/swc_ecma_compat_common/Cargo.toml index 8dfd4888d647..e2ba7d0fde05 100644 --- a/crates/swc_ecma_compat_common/Cargo.toml +++ b/crates/swc_ecma_compat_common/Cargo.toml @@ -7,13 +7,13 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_common" repository = "https://github.com/swc-project/swc.git" -version = "0.4.10" +version = "0.4.11" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index e356d9e84cb1..3b8c945e6b87 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -25,11 +25,11 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "0.4.10", path = "../swc_ecma_compat_common" } +swc_ecma_compat_common = { version = "0.4.11", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "0.126.14", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } tracing = "0.1.37" diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index d650d09f30b9..db82a1b9c2a6 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -18,7 +18,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } tracing = "0.1.37" diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index f6185c1fce5a..fcc089b14cec 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -21,7 +21,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index 083c557666fd..129ba7cfce7c 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -19,10 +19,10 @@ tracing = "0.1.37" swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "0.4.10", path = "../swc_ecma_compat_common" } +swc_ecma_compat_common = { version = "0.4.11", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 2b0f36a47b00..343ee5275616 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -20,7 +20,7 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index c1b8b1aa5683..a5f9f3e85870 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -19,7 +19,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_compat_es2022 = { version = "0.4.14", path = "../swc_ecma_compat_es2022" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } tracing = "0.1.37" diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 01e89167c872..7a8cb6ea8eb9 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -19,6 +19,6 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es2022/Cargo.toml b/crates/swc_ecma_compat_es2022/Cargo.toml index efc7c734808f..f2a782d19434 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -19,10 +19,10 @@ tracing = "0.1.37" swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_compat_common = { version = "0.4.10", path = "../swc_ecma_compat_common" } +swc_ecma_compat_common = { version = "0.4.11", path = "../swc_ecma_compat_common" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "0.126.14", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index d2bc29a59ee5..ae5d4c419f91 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -18,7 +18,7 @@ tracing = "0.1.37" swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_ext_transforms/Cargo.toml b/crates/swc_ecma_ext_transforms/Cargo.toml index 66140284f06b..882fabc6fd0a 100644 --- a/crates/swc_ecma_ext_transforms/Cargo.toml +++ b/crates/swc_ecma_ext_transforms/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_ext_transforms/" edition = "2021" license = "Apache-2.0" name = "swc_ecma_ext_transforms" -version = "0.113.10" +version = "0.113.11" [lib] bench = false @@ -16,5 +16,5 @@ phf = { version = "0.11", features = ["macros"] } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index fa342a5c6da3..240197516d27 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -28,7 +28,7 @@ swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 0d437dddeb34..0fffc8dbe71a 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -62,8 +62,8 @@ swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_optimization = { version = "0.198.14", path = "../swc_ecma_transforms_optimization" } -swc_ecma_usage_analyzer = { version = "0.23.10", path = "../swc_ecma_usage_analyzer" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_usage_analyzer = { version = "0.23.11", path = "../swc_ecma_usage_analyzer" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_timer = { version = "0.21.20", path = "../swc_timer" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 6ecc90b081bc..6eaf08d07177 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -36,7 +36,7 @@ swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms", f "compat", "proposal", ] } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 432a2a80e391..18a629123c89 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -41,7 +41,7 @@ swc_ecma_transforms_optimization = { version = "0.198.14", path = "../swc_ecma_t swc_ecma_transforms_proposal = { version = "0.171.14", path = "../swc_ecma_transforms_proposal", optional = true } swc_ecma_transforms_react = { version = "0.183.14", path = "../swc_ecma_transforms_react", optional = true } swc_ecma_transforms_typescript = { version = "0.188.14", path = "../swc_ecma_transforms_typescript", optional = true } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 664757743126..4aacb57f1b24 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -32,7 +32,7 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 4e69ad885b36..2ca9b3b3f0ca 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -16,5 +16,5 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 7500757c946e..fbacdc81f0dc 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -34,7 +34,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_compat_bugfixes = { version = "0.4.14", path = "../swc_ecma_compat_bugfixes" } -swc_ecma_compat_common = { version = "0.4.10", path = "../swc_ecma_compat_common" } +swc_ecma_compat_common = { version = "0.4.11", path = "../swc_ecma_compat_common" } swc_ecma_compat_es2015 = { version = "0.4.14", path = "../swc_ecma_compat_es2015" } swc_ecma_compat_es2016 = { version = "0.4.14", path = "../swc_ecma_compat_es2016" } swc_ecma_compat_es2017 = { version = "0.4.14", path = "../swc_ecma_compat_es2017" } @@ -47,7 +47,7 @@ swc_ecma_compat_es3 = { version = "0.4.14", path = "../swc_ecma_compat_e swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "0.126.14", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 579ca88bc1ca..baab17513cfc 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -33,7 +33,7 @@ swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader", features = ] } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index ee812592b438..ecdc133ba570 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -37,7 +37,7 @@ swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_fast_graph = { version = "0.21.19", path = "../swc_fast_graph" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index b70e1d5b748a..85c3e2c5b137 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -29,7 +29,7 @@ swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader" swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_classes = { version = "0.126.14", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index de5b2870fe30..70489a861710 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -34,7 +34,7 @@ swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.4", path = "../swc_ecma_transforms_macros" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 654a450df638..95b1d8036129 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -30,6 +30,6 @@ swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "0.22.21", path = "../swc_ecma_testing" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } testing = { version = "0.35.20", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 88924ddc0ac9..0511e46798f5 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -21,7 +21,7 @@ swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms_base = { version = "0.137.14", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_react = { version = "0.183.14", path = "../swc_ecma_transforms_react" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_ecma_usage_analyzer/Cargo.toml b/crates/swc_ecma_usage_analyzer/Cargo.toml index 21bee8992e81..ab4aa215a664 100644 --- a/crates/swc_ecma_usage_analyzer/Cargo.toml +++ b/crates/swc_ecma_usage_analyzer/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_usage_analyzer" repository = "https://github.com/swc-project/swc.git" -version = "0.23.10" +version = "0.23.11" [package.metadata.docs.rs] all-features = true @@ -29,6 +29,6 @@ tracing = "0.1.37" swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_timer = { version = "0.21.20", path = "../swc_timer" } diff --git a/crates/swc_ecma_utils/Cargo.toml b/crates/swc_ecma_utils/Cargo.toml index 96b053e38be3..ae96e3820807 100644 --- a/crates/swc_ecma_utils/Cargo.toml +++ b/crates/swc_ecma_utils/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_ecma_utils" repository = "https://github.com/swc-project/swc.git" -version = "0.127.10" +version = "0.127.11" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index fdbfbf4f4eaa..46950fdcbae2 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -45,7 +45,7 @@ swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser", option swc_ecma_preset_env = { version = "0.206.14", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "0.59.11", path = "../swc_ecma_quote", optional = true } swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms", optional = true } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils", optional = true } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils", optional = true } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit", optional = true } [dev-dependencies] diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 35ac331254ef..3ab837854ee2 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -31,7 +31,7 @@ swc_common = { version = "0.33.19", path = "../swc_common", features = [ ] } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_estree_ast = { version = "0.23.18", path = "../swc_estree_ast" } swc_node_comments = { version = "0.20.18", path = "../swc_node_comments/" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 3ba47ade127b..83275dfb07e5 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -42,7 +42,7 @@ swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms" } -swc_ecma_utils = { version = "0.127.10", path = "../swc_ecma_utils" } +swc_ecma_utils = { version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_malloc = { version = "0.5.10", path = "../swc_malloc" } From 312f0d8427b3c4436b491ed4265f9469dc017f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 12 Mar 2024 15:24:36 +0900 Subject: [PATCH 3/7] fix(es/minifier): Fix removal of array pattern bindings (#8730) **Related issue:** - Closes #8670 --- .../src/compress/optimize/unused.rs | 15 ++++++--------- crates/swc_ecma_minifier/tests/TODO.txt | 1 - .../tests/fixture/issues/8670/config.json | 5 +++++ .../tests/fixture/issues/8670/input.js | 2 ++ .../tests/fixture/issues/8670/output.js | 8 ++++++++ crates/swc_ecma_minifier/tests/passing.txt | 1 + .../output.js | 10 +++++++++- 7 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8670/config.json create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8670/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8670/output.js diff --git a/crates/swc_ecma_minifier/src/compress/optimize/unused.rs b/crates/swc_ecma_minifier/src/compress/optimize/unused.rs index 14b810be9d64..79ebff51d8f3 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/unused.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/unused.rs @@ -345,25 +345,22 @@ impl Optimizer<'_> { } Pat::Array(arr) => { - for (idx, elem) in arr.elems.iter_mut().enumerate() { - match elem { + for (idx, arr_elem) in arr.elems.iter_mut().enumerate() { + match arr_elem { Some(p) => { - if p.is_ident() { - continue; - } - let elem = init .as_mut() .and_then(|expr| self.access_numeric_property(expr, idx)); self.take_pat_if_unused(p, elem, is_var_decl); + + if p.is_invalid() { + *arr_elem = None; + } } None => {} } } - - arr.elems - .retain(|elem| !matches!(elem, Some(Pat::Invalid(..)))) } Pat::Object(obj) => { diff --git a/crates/swc_ecma_minifier/tests/TODO.txt b/crates/swc_ecma_minifier/tests/TODO.txt index 2031e7c8c43e..cec001dfbdf4 100644 --- a/crates/swc_ecma_minifier/tests/TODO.txt +++ b/crates/swc_ecma_minifier/tests/TODO.txt @@ -184,7 +184,6 @@ harmony/issue_2874_2/input.js harmony/module_enabled/input.js harmony/module_mangle_scope/input.js harmony/regression_cannot_use_of/input.js -hoist_props/contains_this_3/input.js hoist_props/hoist_function_with_call/input.js if_return/if_return_same_value/input.js if_return/if_var_return/input.js diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8670/config.json b/crates/swc_ecma_minifier/tests/fixture/issues/8670/config.json new file mode 100644 index 000000000000..b15be3b3e06b --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8670/config.json @@ -0,0 +1,5 @@ +{ + "defaults": true, + "pure_getters": true, + "toplevel": true +} diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8670/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/8670/input.js new file mode 100644 index 000000000000..7b0444cf7412 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8670/input.js @@ -0,0 +1,2 @@ +const [a, b, c, d, e] = [1, 2, 3, 4, 5] +console.log(c) \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8670/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8670/output.js new file mode 100644 index 000000000000..482e2841b0ed --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8670/output.js @@ -0,0 +1,8 @@ +const [, , c, , ] = [ + 1, + 2, + 3, + 4, + 5 +]; +console.log(c); diff --git a/crates/swc_ecma_minifier/tests/passing.txt b/crates/swc_ecma_minifier/tests/passing.txt index f6a47e6515ce..d3f2f33b63db 100644 --- a/crates/swc_ecma_minifier/tests/passing.txt +++ b/crates/swc_ecma_minifier/tests/passing.txt @@ -739,6 +739,7 @@ hoist/hoist_no_destructurings/input.js hoist/hoist_vars/input.js hoist_props/contains_this_1/input.js hoist_props/contains_this_2/input.js +hoist_props/contains_this_3/input.js hoist_props/direct_access_1/input.js hoist_props/direct_access_2/input.js hoist_props/direct_access_3/input.js diff --git a/crates/swc_ecma_minifier/tests/terser/compress/destructuring/unused_destructuring_declaration_complex_1/output.js b/crates/swc_ecma_minifier/tests/terser/compress/destructuring/unused_destructuring_declaration_complex_1/output.js index 816d1b56097d..be76f977eb06 100644 --- a/crates/swc_ecma_minifier/tests/terser/compress/destructuring/unused_destructuring_declaration_complex_1/output.js +++ b/crates/swc_ecma_minifier/tests/terser/compress/destructuring/unused_destructuring_declaration_complex_1/output.js @@ -1,2 +1,10 @@ -const [, w, , x, { z: z }] = [1, 2, 3, 4, { z: 5 }]; +const [, , , x, { z: z }] = [ + 1, + 2, + 3, + 4, + { + z: 5 + } +]; console.log(x, z); From e4ce46682361554396341df959797f4a2a39a364 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 12 Mar 2024 06:26:14 +0000 Subject: [PATCH 4/7] chore: Bump crates --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e32a9c995091..c52821866efa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ - **(es/minifier)** Fix evaluation of array literals with `void 0` ([#8733](https://github.com/swc-project/swc/issues/8733)) ([aa0154d](https://github.com/swc-project/swc/commit/aa0154d2d86b0bed7ffed3324c7a650ffe111c93)) + +- **(es/minifier)** Fix removal of array pattern bindings ([#8730](https://github.com/swc-project/swc/issues/8730)) ([312f0d8](https://github.com/swc-project/swc/commit/312f0d8427b3c4436b491ed4265f9469dc017f8f)) + ### Features @@ -1418,7 +1421,4 @@ - **(common)** Make `ahash` optional ([#7816](https://github.com/swc-project/swc/issues/7816)) ([981d7b1](https://github.com/swc-project/swc/commit/981d7b152b2f488a67d42052152db22225f1d094)) - -- Use `ahash` from `swc_common` in more places ([#7815](https://github.com/swc-project/swc/issues/7815)) ([b43e38d](https://github.com/swc-project/swc/commit/b43e38d3f92bc889e263b741dbe173a6f2206d88)) - From 391d6f6820d385ac7c4181abd1f7d2c01a9b2172 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Tue, 12 Mar 2024 06:34:54 +0000 Subject: [PATCH 5/7] chore: Publish 1.4.7-nightly-20240312.1 --- bindings/Cargo.lock | 138 +++++++++++----------- bindings/binding_core_node/Cargo.toml | 2 +- bindings/binding_core_wasm/Cargo.toml | 4 +- bindings/binding_minifier_node/Cargo.toml | 4 +- bindings/binding_minifier_wasm/Cargo.toml | 4 +- bindings/swc_cli/Cargo.toml | 4 +- package.json | 2 +- packages/minifier/package.json | 2 +- 8 files changed, 80 insertions(+), 80 deletions(-) diff --git a/bindings/Cargo.lock b/bindings/Cargo.lock index 297e3ff38ff9..cc7bd48cd2a3 100644 --- a/bindings/Cargo.lock +++ b/bindings/Cargo.lock @@ -223,7 +223,7 @@ dependencies = [ [[package]] name = "binding_core_wasm" -version = "1.4.7-nightly-20240310.2" +version = "1.4.7-nightly-20240312.1" dependencies = [ "anyhow", "getrandom", @@ -236,9 +236,9 @@ dependencies = [ [[package]] name = "binding_macros" -version = "0.64.17" +version = "0.64.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6dce5324435c74a774df03256a70a84ef5a033da96e282ad01467f9b00994f" +checksum = "bd296ea88689d27d3c1e603c54c208c7fe91875b111ebf1ea0cf1ba59ae3787e" dependencies = [ "anyhow", "console_error_panic_hook", @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "binding_minifier_wasm" -version = "1.4.7-nightly-20240310.2" +version = "1.4.7-nightly-20240312.1" dependencies = [ "anyhow", "getrandom", @@ -2926,9 +2926,9 @@ dependencies = [ [[package]] name = "swc" -version = "0.273.17" +version = "0.273.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5697e6ea7a715dd5d6606f7e131b6b047277efb7ab720998deff7e8dd47fd0f" +checksum = "c61371c0375d66cbbdb601513f6d2f0713e6fe984deb549ac80a7861fc3c22b2" dependencies = [ "anyhow", "base64", @@ -2993,9 +2993,9 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.225.13" +version = "0.225.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f5d8dcab6db0bdafb4928cd333464ec3dbc9ae57953910b7a3a05e3a5a3f82c" +checksum = "0061b48aeff696bf8f1623d843a48dbec83451496dbdaf260f8613220e19e849" dependencies = [ "anyhow", "crc", @@ -3039,7 +3039,7 @@ dependencies = [ [[package]] name = "swc_cli" -version = "0.91.197" +version = "0.91.198" dependencies = [ "anyhow", "swc_cli_impl", @@ -3047,9 +3047,9 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41eea4fc5f95f3c90b8d059696c6f0ae3829a3c753f66e73d628d00149b82c5" +checksum = "bc166dcd6a5c9cc0cdee11bbf7519467e847da5cfd514fe04c4e51e670c54fda" dependencies = [ "anyhow", "atty", @@ -3102,9 +3102,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca1146aff9655a17a7958f2484a5ca4f81ba9c641410896c0e7bb80c84db2ab" +checksum = "b44065d50b699d2d8108edaa9f134e1dc411cd379e3e46e29898e14dcd266d0d" dependencies = [ "anyhow", "base64", @@ -3154,9 +3154,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.90.18" +version = "0.90.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c498fc0c7bc3a81257e6474636ea8dbfeb372371bfc31b3d95918d336df3822" +checksum = "8651aaebeb5a5c2b29af32cef6eac55861d0e475cdb76a6939c81786de0fce30" dependencies = [ "binding_macros", "swc", @@ -3232,9 +3232,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b78793b8d68a64c4e0c0e2c55f31330fe953b9d38e264bd2a6cc9481e6194d" +checksum = "fac3f77e07132056bdf7336e6930fdc4365c394466f97c992f29642c3e55793e" dependencies = [ "swc_atoms", "swc_common", @@ -3249,9 +3249,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e6db48f9bbde54338832c4c100ba400e773bf5d6357eee599bd8d631b1caa2" +checksum = "b0a9bf70ce439c6dab8617ebe7691865fe80687d796c806fc39008f6ac102f84" dependencies = [ "swc_common", "swc_ecma_ast", @@ -3262,9 +3262,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "321f1d679d24e894eab81c415828f6c8283fb665fd1639aff1c1eed810657f5b" +checksum = "0f6705c0d640f42dbbdb43f9da4cd83269bcc19b888cb31433d401a2e68a9d6c" dependencies = [ "arrayvec", "indexmap 2.1.0", @@ -3288,9 +3288,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727983ef362b8a347247bfde562b4f842578585f89ca3a1ccd77b7cbcbfe77ec" +checksum = "2edefbf5cd69132c3e9dc2bd450e0fb39e82f9eba07ca37b18fc9bcac7d9a8cd" dependencies = [ "swc_atoms", "swc_common", @@ -3305,9 +3305,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3bd9774bbb0173aa4ecaccc95e98d209f2fbb42e594fe2d9e35cd70bed0bbc" +checksum = "3455e30c73c79a1e583bf22bdb99c1e766dca2d863e1ea721e9d685b6345e133" dependencies = [ "serde", "swc_atoms", @@ -3323,9 +3323,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a77eac0032cba8696461896a2bf05f1db9b453c3ad1573275bebb5e3bd5dc0" +checksum = "027190a908e5af75d3a9ccb20ab036a55f82702e6de61ac9341fd40c2855a557" dependencies = [ "serde", "swc_atoms", @@ -3342,9 +3342,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcb35f9478cdc3fab186f1b06f725583bfddca43b66d9e686a5c0dc72110b18" +checksum = "8dfd12f37aa46c2faa4c542377c1e86d52df6e8c05c59fd43552e6a9d37857a3" dependencies = [ "swc_atoms", "swc_common", @@ -3358,9 +3358,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b36db7815ebe0c6ac65d47f0f31db364824ad501b8262176269a12c79362bc96" +checksum = "2a2c8bdd554bd4c3d819de7c28f697d5fc23118bb7fcd5e8ea0dc8cb28103094" dependencies = [ "serde", "swc_atoms", @@ -3376,9 +3376,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07a98d073aac3e47c5c8b4d4fbf606d9fea008d9ffc36aac170db97016d103b9" +checksum = "33fdbb6fb08f498189dd95c118f9c583572df4c61fc5ff158b860a8f4338a7c0" dependencies = [ "swc_atoms", "swc_common", @@ -3392,9 +3392,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec6a3a7b059d4b123b54cdcbe52601f9e83a432c26fff8bcc9b127a60ee705e" +checksum = "97b10f83e74b21c32de25a9391aabd3b725baf5b31696cd7ce57a971bb71f190" dependencies = [ "swc_atoms", "swc_common", @@ -3411,9 +3411,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3d3a090e3f9c4e8c4f2fd0a22321f4389b8a1baa49399d9e0e420b1bce70a3" +checksum = "7a1ae4cdab0e1d269e8baffa7f16f4808d2bc0e7b898a1b5ec9d90df8d852fe6" dependencies = [ "swc_common", "swc_ecma_ast", @@ -3426,9 +3426,9 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.113.10" +version = "0.113.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91f36c0e3a192d1477d5ab00c7924f85e998eb6f26cd36121255efcb104cf4a" +checksum = "a2abcbbff3c42d6a4333ac77872958610888305d03f6c38312697c5b076c4f88" dependencies = [ "phf", "swc_atoms", @@ -3440,9 +3440,9 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.92.15" +version = "0.92.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53e92d321be276a31e612a7926cfef05484f661bbd08b7ff40b585576015aeb" +checksum = "7894a057a4c5f240a61955a4f40353b728b5b555800b704f8c5547c63c93b7ed" dependencies = [ "auto_impl", "dashmap", @@ -3482,9 +3482,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.192.14" +version = "0.192.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b108f08d487ce79cfb2599c0532fde6ed30738824da7f8d9f25fce527db75395" +checksum = "01d138fa420d6939ca43b87c8cd9bfd5c9e9408b9e8eb80ccd10cf3834aac719" dependencies = [ "arrayvec", "indexmap 2.1.0", @@ -3538,9 +3538,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.206.13" +version = "0.206.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f6d4e577171a9c21317bba1bc7207830f4f3cef63b5702b1a2ba280c0e3a64" +checksum = "beb4e0016f42208333dc7edafd6241fb68a1d740d860b6f627a3e797c4870701" dependencies = [ "anyhow", "dashmap", @@ -3563,9 +3563,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.229.13" +version = "0.229.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b02bdbac1ea925fecaba08292ce2b8b022a0703b74c13b52742c032ed361867e" +checksum = "047f84ab4c4b7a08a7894e48019d3f0f32a71eadc123186fefba3ea36d5c23af" dependencies = [ "swc_atoms", "swc_common", @@ -3583,9 +3583,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.137.13" +version = "0.137.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a5d4bc7ba8b19d09d8024e60111041c1e728b38bc1f745859e809e17911a92" +checksum = "2c36ec1188950c6f5b74fa751db8bcfc7bdd97f231287a34ed43b5fe0752f02d" dependencies = [ "better_scoped_tls", "bitflags 2.3.3", @@ -3607,9 +3607,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.126.13" +version = "0.126.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90dca67c3eeefe00cf76a783f5cc1ff2614e270d0e71cbe2e0a1e926e34fd84" +checksum = "c86a23a79abb7e609f17a0ca4ed4060ce911ba5f2055896b45c987574c913e03" dependencies = [ "swc_atoms", "swc_common", @@ -3621,9 +3621,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.163.13" +version = "0.163.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0935b56a2cfc0977a7abd5922f40816190937f703c45d7d98a3a080e7e1158aa" +checksum = "e26dfa2fe6a3273ec341de0090f556d037604eebf5f38e07c5ecdcaf2a3435e9" dependencies = [ "arrayvec", "indexmap 2.1.0", @@ -3670,9 +3670,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.180.13" +version = "0.180.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0627abb2062203bba6b17198ae4ca27f8e5fe18a99fce2608f3c396d87885a" +checksum = "b2e25fb5e0627bc17e0f6fcd5c9fb903d98143c2ff0b30906ff5b52abae5930d" dependencies = [ "Inflector", "anyhow", @@ -3697,9 +3697,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.198.13" +version = "0.198.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf2fcca33fbed8088bdd9978be4b460080662511e50742b32b20347f08296d7" +checksum = "51052ccc02161109066c40ccbefb96f81d959ef47b2244059ffc24f6f7f294d9" dependencies = [ "dashmap", "indexmap 2.1.0", @@ -3722,9 +3722,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.171.13" +version = "0.171.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9723deb426703981b232db1f091140cc5a197af68d8090bace6afa5f3e2dbd0" +checksum = "3a4e8f7b02320dc446d38fc797aa764b9b574839106327295a177ee38ad37da7" dependencies = [ "either", "rustc-hash", @@ -3742,9 +3742,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.183.13" +version = "0.183.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e62a60e66f7f9e7490c5b7b8ed32c5746447bd7ee4ddda910e3825a369ba49" +checksum = "36d33e1f84d75e7c1b66433dfbfe9866855a896b9d18c33199ead961d3606a39" dependencies = [ "base64", "dashmap", @@ -3767,9 +3767,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.188.13" +version = "0.188.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ac06411e6370b545808f80516bec2dd38e0ec573f797802d2f85195e6b4abe" +checksum = "a591d07a82edaf90b35c0d6c98b60cec1ff1f239035707a19276cebf856c569a" dependencies = [ "ryu-js", "serde", @@ -3784,9 +3784,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.23.10" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742aed73c3d3b9b8cfcd6a1a4ff6585a3e1b0f4b487f5dbf7e4fee8a46a174aa" +checksum = "f6ff1c851a55df4803e8bd56e9a3161b743203b4ef651ac2b1b4dc9b24df11fb" dependencies = [ "indexmap 2.1.0", "rustc-hash", @@ -3801,9 +3801,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.127.10" +version = "0.127.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f52aae3ab2558cbe9f480bae68a8b3a5233d4a9dd355e1afe833d574b7c05" +checksum = "fbe5ea2a95bea51461395cb4d7cfcbcb361562981d19cb502b7f90dff35364ac" dependencies = [ "indexmap 2.1.0", "num_cpus", @@ -3905,9 +3905,9 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "0.62.17" +version = "0.62.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78418c3fae8224c426028f3662bec2b62b80fb376f85f5798cdc2e9cfecdd44" +checksum = "9191d8223e7f2acdca7a48bb5603a565cba3a7e40a37099e6932bcf59638dc19" dependencies = [ "anyhow", "dashmap", diff --git a/bindings/binding_core_node/Cargo.toml b/bindings/binding_core_node/Cargo.toml index 659570f5d562..c5c6102a413e 100644 --- a/bindings/binding_core_node/Cargo.toml +++ b/bindings/binding_core_node/Cargo.toml @@ -51,7 +51,7 @@ tracing-chrome = "0.5.0" tracing-futures = "0.2.5" tracing-subscriber = { version = "0.3.9", features = ["env-filter"] } -swc_core = { version = "0.90.18", features = [ +swc_core = { version = "0.90.19", features = [ "allocator_node", "ecma_ast", "ecma_codegen", diff --git a/bindings/binding_core_wasm/Cargo.toml b/bindings/binding_core_wasm/Cargo.toml index bc60fc1130d9..87e8c359d24b 100644 --- a/bindings/binding_core_wasm/Cargo.toml +++ b/bindings/binding_core_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "binding_core_wasm" publish = false repository = "https://github.com/swc-project/swc.git" -version = "1.4.7-nightly-20240310.2" +version = "1.4.7-nightly-20240312.1" [lib] bench = false @@ -35,7 +35,7 @@ anyhow = "1.0.66" getrandom = { version = "0.2.10", features = ["js"] } serde = { version = "1", features = ["derive"] } serde-wasm-bindgen = "0.4.5" -swc_core = { version = "0.90.18", features = [ +swc_core = { version = "0.90.19", features = [ "ecma_ast_serde", "ecma_codegen", "binding_macro_wasm", diff --git a/bindings/binding_minifier_node/Cargo.toml b/bindings/binding_minifier_node/Cargo.toml index 29221b24a7d2..7006f5da2d88 100644 --- a/bindings/binding_minifier_node/Cargo.toml +++ b/bindings/binding_minifier_node/Cargo.toml @@ -35,9 +35,9 @@ tracing-chrome = "0.5.0" tracing-futures = "0.2.5" tracing-subscriber = { version = "0.3.9", features = ["env-filter"] } -swc_compiler_base = { version = "0.7.14", features = ["node"] } +swc_compiler_base = { version = "0.7.15", features = ["node"] } swc_config = "0.1.11" -swc_core = { version = "0.90.18", features = [ +swc_core = { version = "0.90.19", features = [ "allocator_node", "common_concurrent", "common_sourcemap", diff --git a/bindings/binding_minifier_wasm/Cargo.toml b/bindings/binding_minifier_wasm/Cargo.toml index 52bb1c31c331..6dfd73757bf0 100644 --- a/bindings/binding_minifier_wasm/Cargo.toml +++ b/bindings/binding_minifier_wasm/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" name = "binding_minifier_wasm" publish = false repository = "https://github.com/swc-project/swc.git" -version = "1.4.7-nightly-20240310.2" +version = "1.4.7-nightly-20240312.1" [lib] bench = false @@ -35,7 +35,7 @@ anyhow = "1.0.66" getrandom = { version = "0.2.10", features = ["js"] } serde = { version = "1", features = ["derive"] } serde-wasm-bindgen = "0.4.5" -swc_core = { version = "0.90.18", features = [ +swc_core = { version = "0.90.19", features = [ "ecma_ast_serde", "ecma_codegen", "binding_macro_wasm", diff --git a/bindings/swc_cli/Cargo.toml b/bindings/swc_cli/Cargo.toml index 561b04313b56..a182279bb8ee 100644 --- a/bindings/swc_cli/Cargo.toml +++ b/bindings/swc_cli/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_cli" repository = "https://github.com/swc-project/swc.git" -version = "0.91.197" +version = "0.91.198" [[bin]] bench = false @@ -19,4 +19,4 @@ plugin = ["swc_cli_impl/plugin"] [dependencies] anyhow = "1.0.66" -swc_cli_impl = "0.8.17" +swc_cli_impl = "0.8.18" diff --git a/package.json b/package.json index ef2043df392b..4fee618486c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@swc/core", - "version": "1.4.7-nightly-20240310.2", + "version": "1.4.7-nightly-20240312.1", "description": "Super-fast alternative for babel", "homepage": "https://swc.rs", "main": "./index.js", diff --git a/packages/minifier/package.json b/packages/minifier/package.json index e218d6f8b6c5..856589b16c9b 100644 --- a/packages/minifier/package.json +++ b/packages/minifier/package.json @@ -1,6 +1,6 @@ { "name": "@swc/minifier", - "version": "1.4.7-nightly-20240310.2", + "version": "1.4.7-nightly-20240312.1", "description": "Super-fast alternative for terser", "homepage": "https://swc.rs", "main": "./index.js", From 95761b76bf09a4d2c09517b2bd7bf7b78ee2149f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 13 Mar 2024 11:21:15 +0900 Subject: [PATCH 6/7] fix(es/minifier): Make `Finalizer` handle `hoisted_props` correctly (#8738) **Related issue:** - Closes #8737 --- .../fixture/issues-8xxx/8737/input/.swcrc | 63 +++++++++++++++++++ .../tests/fixture/issues-8xxx/8737/input/1.js | 14 +++++ .../fixture/issues-8xxx/8737/output/1.js | 8 +++ .../src/compress/optimize/mod.rs | 1 + .../src/compress/optimize/util.rs | 33 ++++++---- .../tests/fixture/issues/8737/2/input.js | 10 +++ .../tests/fixture/issues/8737/2/output.js | 8 +++ .../tests/fixture/issues/8737/config.json | 47 ++++++++++++++ .../tests/fixture/issues/8737/input.js | 14 +++++ .../tests/fixture/issues/8737/output.js | 6 ++ 10 files changed, 193 insertions(+), 11 deletions(-) create mode 100644 crates/swc/tests/fixture/issues-8xxx/8737/input/.swcrc create mode 100644 crates/swc/tests/fixture/issues-8xxx/8737/input/1.js create mode 100644 crates/swc/tests/fixture/issues-8xxx/8737/output/1.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8737/2/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8737/config.json create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8737/input.js create mode 100644 crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js diff --git a/crates/swc/tests/fixture/issues-8xxx/8737/input/.swcrc b/crates/swc/tests/fixture/issues-8xxx/8737/input/.swcrc new file mode 100644 index 000000000000..cd530500a1f2 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8737/input/.swcrc @@ -0,0 +1,63 @@ +{ + "jsc": { + "parser": { + "syntax": "ecmascript", + "jsx": false + }, + "target": "es5", + "loose": false, + "minify": { + "compress": { + "arguments": false, + "arrows": true, + "booleans": true, + "booleans_as_integers": false, + "collapse_vars": true, + "comparisons": true, + "computed_props": true, + "conditionals": true, + "dead_code": true, + "directives": true, + "drop_console": false, + "drop_debugger": true, + "evaluate": true, + "expression": false, + "hoist_funs": false, + "hoist_props": true, + "hoist_vars": false, + "if_return": true, + "join_vars": true, + "keep_classnames": false, + "keep_fargs": true, + "keep_fnames": false, + "keep_infinity": false, + "loops": true, + "negate_iife": true, + "properties": true, + "reduce_funcs": false, + "reduce_vars": false, + "side_effects": true, + "switches": true, + "typeofs": true, + "unsafe": false, + "unsafe_arrows": false, + "unsafe_comps": false, + "unsafe_Function": false, + "unsafe_math": false, + "unsafe_symbols": false, + "unsafe_methods": false, + "unsafe_proto": false, + "unsafe_regexp": false, + "unsafe_undefined": false, + "unused": true, + "const_to_let": true, + "pristine_globals": true + }, + "mangle": false + } + }, + "module": { + "type": "es6" + }, + "isModule": true +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8737/input/1.js b/crates/swc/tests/fixture/issues-8xxx/8737/input/1.js new file mode 100644 index 000000000000..c77842050387 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8737/input/1.js @@ -0,0 +1,14 @@ +d(() => { + var obj = { + key: "some string", + }; + + var b = () => { + switch (a) { + default: + break; + } + return obj.key; + }; + return () => b; +}); \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js new file mode 100644 index 000000000000..bb0fd3bbeaa5 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8737/output/1.js @@ -0,0 +1,8 @@ +d(function() { + var b = function() { + return a, "some string"; + }; + return function() { + return b; + }; +}); diff --git a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs index f9e1a7146916..770d14ecf4e5 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs @@ -269,6 +269,7 @@ impl Vars { || !self.lits.is_empty() || !self.lits_for_cmp.is_empty() || !self.lits_for_array_access.is_empty() + || !self.hoisted_props.is_empty() || !self.removed.is_empty() { let mut v = Finalizer { diff --git a/crates/swc_ecma_minifier/src/compress/optimize/util.rs b/crates/swc_ecma_minifier/src/compress/optimize/util.rs index ab671c14a532..7ae6087aeae3 100644 --- a/crates/swc_ecma_minifier/src/compress/optimize/util.rs +++ b/crates/swc_ecma_minifier/src/compress/optimize/util.rs @@ -405,24 +405,35 @@ impl VisitMut for Finalizer<'_> { } fn visit_mut_expr(&mut self, n: &mut Expr) { - if let Expr::Ident(i) = n { - if let Some(expr) = self.lits.get(&i.to_id()) { - *n = *expr.clone(); + match n { + Expr::Ident(i) => { + if let Some(expr) = self.lits.get(&i.to_id()) { + *n = *expr.clone(); + return; + } } - } else { - n.visit_mut_children_with(self); - } - - if let Expr::Member(e) = n { - if let Expr::Ident(obj) = &*e.obj { - if let MemberProp::Ident(prop) = &e.prop { - if let Some(ident) = self.hoisted_props.get(&(obj.to_id(), prop.sym.clone())) { + Expr::Member(e) => { + if let Expr::Ident(obj) = &*e.obj { + let sym = match &e.prop { + MemberProp::Ident(i) => &i.sym, + MemberProp::Computed(e) => match &*e.expr { + Expr::Lit(Lit::Str(s)) => &s.value, + _ => return, + }, + _ => return, + }; + + if let Some(ident) = self.hoisted_props.get(&(obj.to_id(), sym.clone())) { self.changed = true; *n = ident.clone().into(); + return; } } } + _ => {} } + + n.visit_mut_children_with(self); } fn visit_mut_stmts(&mut self, n: &mut Vec) { diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/input.js new file mode 100644 index 000000000000..bbca9b5721ca --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/input.js @@ -0,0 +1,10 @@ +d(function () { + var obj = { + key: "some string" + }, b = function () { + return a, obj.key; + }; + return function () { + return b; + }; +}); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js new file mode 100644 index 000000000000..bb0fd3bbeaa5 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/2/output.js @@ -0,0 +1,8 @@ +d(function() { + var b = function() { + return a, "some string"; + }; + return function() { + return b; + }; +}); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/config.json b/crates/swc_ecma_minifier/tests/fixture/issues/8737/config.json new file mode 100644 index 000000000000..7e144b291fa7 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/config.json @@ -0,0 +1,47 @@ +{ + "defaults": true, + "arguments": false, + "arrows": true, + "booleans": true, + "booleans_as_integers": false, + "collapse_vars": true, + "comparisons": true, + "computed_props": true, + "conditionals": true, + "dead_code": true, + "directives": true, + "drop_console": false, + "drop_debugger": true, + "evaluate": true, + "expression": false, + "hoist_funs": false, + "hoist_props": true, + "hoist_vars": false, + "if_return": true, + "join_vars": true, + "keep_classnames": false, + "keep_fargs": true, + "keep_fnames": false, + "keep_infinity": false, + "loops": true, + "negate_iife": true, + "properties": true, + "reduce_funcs": false, + "reduce_vars": false, + "side_effects": true, + "switches": true, + "typeofs": true, + "unsafe": false, + "unsafe_arrows": false, + "unsafe_comps": false, + "unsafe_Function": false, + "unsafe_math": false, + "unsafe_symbols": false, + "unsafe_methods": false, + "unsafe_proto": false, + "unsafe_regexp": false, + "unsafe_undefined": false, + "unused": true, + "const_to_let": true, + "pristine_globals": true +} diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/input.js new file mode 100644 index 000000000000..c77842050387 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/input.js @@ -0,0 +1,14 @@ +d(() => { + var obj = { + key: "some string", + }; + + var b = () => { + switch (a) { + default: + break; + } + return obj.key; + }; + return () => b; +}); \ No newline at end of file diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js new file mode 100644 index 000000000000..2d9886ffdc7f --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/8737/output.js @@ -0,0 +1,6 @@ +d(()=>{ + var obj = { + key: "some string" + }, b = ()=>(a, obj.key); + return ()=>b; +}); From 8a5163ce5d0cd02f77887bf306e9f8ecac4b41b9 Mon Sep 17 00:00:00 2001 From: SWC Bot Date: Wed, 13 Mar 2024 02:23:10 +0000 Subject: [PATCH 7/7] chore: Bump crates --- CHANGELOG.md | 9 +++------ Cargo.lock | 24 ++++++++++++------------ crates/binding_macros/Cargo.toml | 4 ++-- crates/dbg-swc/Cargo.toml | 4 ++-- crates/swc/Cargo.toml | 6 +++--- crates/swc_bundler/Cargo.toml | 4 ++-- crates/swc_cli_impl/Cargo.toml | 4 ++-- crates/swc_compiler_base/Cargo.toml | 4 ++-- crates/swc_core/Cargo.toml | 12 ++++++------ crates/swc_ecma_minifier/Cargo.toml | 2 +- crates/swc_ecmascript/Cargo.toml | 4 ++-- crates/swc_estree_compat/Cargo.toml | 4 ++-- crates/swc_html/Cargo.toml | 2 +- crates/swc_html_minifier/Cargo.toml | 2 +- crates/swc_node_bundler/Cargo.toml | 6 +++--- 15 files changed, 44 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c52821866efa..0b70e1fc12aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,9 @@ - **(es/minifier)** Fix removal of array pattern bindings ([#8730](https://github.com/swc-project/swc/issues/8730)) ([312f0d8](https://github.com/swc-project/swc/commit/312f0d8427b3c4436b491ed4265f9469dc017f8f)) + +- **(es/minifier)** Make `Finalizer` handle `hoisted_props` correctly ([#8738](https://github.com/swc-project/swc/issues/8738)) ([95761b7](https://github.com/swc-project/swc/commit/95761b76bf09a4d2c09517b2bd7bf7b78ee2149f)) + ### Features @@ -1415,10 +1418,4 @@ - **(es/module)** Improve error message about relative `jsc.baseUrl` ([#7827](https://github.com/swc-project/swc/issues/7827)) ([9099883](https://github.com/swc-project/swc/commit/9099883175c590106109670de01ab32b33303bfd)) -### Refactor - - - -- **(common)** Make `ahash` optional ([#7816](https://github.com/swc-project/swc/issues/7816)) ([981d7b1](https://github.com/swc-project/swc/commit/981d7b152b2f488a67d42052152db22225f1d094)) - diff --git a/Cargo.lock b/Cargo.lock index f01d4310b134..e25ba0d5f856 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "binding_macros" -version = "0.64.18" +version = "0.64.19" dependencies = [ "anyhow", "console_error_panic_hook", @@ -1056,7 +1056,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbg-swc" -version = "0.91.19" +version = "0.91.20" dependencies = [ "anyhow", "clap 3.2.25", @@ -3667,7 +3667,7 @@ dependencies = [ [[package]] name = "swc" -version = "0.273.18" +version = "0.273.19" dependencies = [ "ansi_term", "anyhow", @@ -3737,7 +3737,7 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.225.14" +version = "0.225.15" dependencies = [ "anyhow", "crc", @@ -3792,7 +3792,7 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "0.8.18" +version = "0.8.19" dependencies = [ "anyhow", "assert_cmd", @@ -3851,7 +3851,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.7.15" +version = "0.7.16" dependencies = [ "anyhow", "base64", @@ -3897,7 +3897,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.90.19" +version = "0.90.20" dependencies = [ "anyhow", "binding_macros", @@ -4430,7 +4430,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.192.15" +version = "0.192.16" dependencies = [ "ansi_term", "anyhow", @@ -4880,7 +4880,7 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.239.18" +version = "0.239.19" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -4926,7 +4926,7 @@ dependencies = [ [[package]] name = "swc_estree_compat" -version = "0.198.17" +version = "0.198.18" dependencies = [ "ahash 0.8.8", "anyhow", @@ -4974,7 +4974,7 @@ dependencies = [ [[package]] name = "swc_html" -version = "0.137.15" +version = "0.137.16" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -5109,7 +5109,7 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "0.62.18" +version = "0.62.19" dependencies = [ "anyhow", "dashmap", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index d34662e0326d..f7d59cae1141 100644 --- a/crates/binding_macros/Cargo.toml +++ b/crates/binding_macros/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "Apache-2.0" name = "binding_macros" repository = "https://github.com/swc-project/swc.git" -version = "0.64.18" +version = "0.64.19" [lib] bench = false @@ -33,7 +33,7 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports -swc = { optional = true, version = "0.273.18", path = "../swc" } +swc = { optional = true, version = "0.273.19", path = "../swc" } swc_common = { optional = true, version = "0.33.19", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_transforms = { optional = true, version = "0.229.14", path = "../swc_ecma_transforms" } diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index df24ccae064d..41d91a34077a 100644 --- a/crates/dbg-swc/Cargo.toml +++ b/crates/dbg-swc/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "Apache-2.0" name = "dbg-swc" repository = "https://github.com/kdy1/dbg-swc.git" -version = "0.91.19" +version = "0.91.20" [[bin]] bench = false @@ -32,7 +32,7 @@ swc_common = { version = "0.33.19", features = [ ], path = "../swc_common" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 7338fb06092e..1454e92a93c8 100644 --- a/crates/swc/Cargo.toml +++ b/crates/swc/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc" repository = "https://github.com/swc-project/swc.git" -version = "0.273.18" +version = "0.273.19" [lib] bench = false @@ -74,7 +74,7 @@ swc_common = { version = "0.33.19", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } -swc_compiler_base = { version = "0.7.15", path = "../swc_compiler_base" } +swc_compiler_base = { version = "0.7.16", path = "../swc_compiler_base" } swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } @@ -85,7 +85,7 @@ swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_preset_env = { version = "0.206.14", path = "../swc_ecma_preset_env" } swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms", features = [ diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index d8d2c83f5fbd..b4540bbb0fba 100644 --- a/crates/swc_bundler/Cargo.toml +++ b/crates/swc_bundler/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"] license = "Apache-2.0" name = "swc_bundler" repository = "https://github.com/swc-project/swc.git" -version = "0.225.14" +version = "0.225.15" [package.metadata.docs.rs] all-features = true @@ -63,7 +63,7 @@ swc_ecma_loader = { version = "0.45.21", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_transforms_proposal = { version = "0.171.14", path = "../swc_ecma_transforms_proposal" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 03d7d3be7390..78fb38d0ab75 100644 --- a/crates/swc_cli_impl/Cargo.toml +++ b/crates/swc_cli_impl/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_cli_impl" repository = "https://github.com/swc-project/swc.git" -version = "0.8.18" +version = "0.8.19" [[bin]] name = "swc" @@ -40,7 +40,7 @@ tracing-futures = "0.2.5" tracing-subscriber = { version = "0.3.9", features = ["env-filter"] } walkdir = "2" -swc_core = { version = "0.90.19", features = [ +swc_core = { version = "0.90.20", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index edb3fe7f49e8..2483fc91141c 100644 --- a/crates/swc_compiler_base/Cargo.toml +++ b/crates/swc_compiler_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_compiler_base" repository = "https://github.com/swc-project/swc.git" -version = "0.7.15" +version = "0.7.16" [features] node = ["napi", "napi-derive"] @@ -27,7 +27,7 @@ swc_common = { version = "0.33.19", path = "../swc_common", features = [ swc_config = { version = "0.1.11", path = "../swc_config" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "0.98.6", path = "../swc_ecma_visit" } swc_timer = { version = "0.21.20", path = "../swc_timer" } diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 719913600cfe..0728266f8c9a 100644 --- a/crates/swc_core/Cargo.toml +++ b/crates/swc_core/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_core" repository = "https://github.com/swc-project/swc.git" -version = "0.90.19" +version = "0.90.20" [package.metadata.docs.rs] features = [ "allocator_node", @@ -327,10 +327,10 @@ __visit = ["__ecma", "swc_ecma_visit"] once_cell = { optional = true, version = "1.18.0" } # swc_* dependencies -binding_macros = { optional = true, version = "0.64.18", path = "../binding_macros" } -swc = { optional = true, version = "0.273.18", path = "../swc" } +binding_macros = { optional = true, version = "0.64.19", path = "../binding_macros" } +swc = { optional = true, version = "0.273.19", path = "../swc" } swc_atoms = { optional = true, version = "0.6.5", path = "../swc_atoms" } -swc_bundler = { optional = true, version = "0.225.14", path = "../swc_bundler" } +swc_bundler = { optional = true, version = "0.225.15", path = "../swc_bundler" } swc_cached = { optional = true, version = "0.3.19", path = "../swc_cached" } swc_common = { optional = true, version = "0.33.19", path = "../swc_common" } swc_css_ast = { optional = true, version = "0.140.20", path = "../swc_css_ast" } @@ -346,7 +346,7 @@ swc_ecma_ast = { optional = true, version = "0.112.5", path swc_ecma_codegen = { optional = true, version = "0.148.10", path = "../swc_ecma_codegen" } swc_ecma_lints = { optional = true, version = "0.92.16", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "0.45.21", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "0.192.15", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "0.192.16", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_preset_env = { optional = true, version = "0.206.14", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "0.54.11", path = "../swc_ecma_quote_macros" } @@ -362,7 +362,7 @@ swc_ecma_usage_analyzer = { optional = true, version = "0.23.11", path swc_ecma_utils = { optional = true, version = "0.127.11", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "0.98.6", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "0.5.10", path = "../swc_malloc" } -swc_node_bundler = { optional = true, version = "0.62.18", path = "../swc_node_bundler" } +swc_node_bundler = { optional = true, version = "0.62.19", path = "../swc_node_bundler" } swc_nodejs_common = { optional = true, version = "0.0.8", path = "../swc_nodejs_common" } swc_plugin = { optional = true, version = "0.90.0", path = "../swc_plugin" } swc_plugin_macro = { optional = true, version = "0.9.16", path = "../swc_plugin_macro" } diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 0fffc8dbe71a..d3828a41b3de 100644 --- a/crates/swc_ecma_minifier/Cargo.toml +++ b/crates/swc_ecma_minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = "Apache-2.0" name = "swc_ecma_minifier" repository = "https://github.com/swc-project/swc.git" -version = "0.192.15" +version = "0.192.16" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index 46950fdcbae2..b3fcb7ff6ec6 100644 --- a/crates/swc_ecmascript/Cargo.toml +++ b/crates/swc_ecmascript/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_ecmascript" repository = "https://github.com/swc-project/swc.git" -version = "0.239.18" +version = "0.239.19" [package.metadata.docs.rs] all-features = true @@ -40,7 +40,7 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier", optional = true } +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser", optional = true, default-features = false } swc_ecma_preset_env = { version = "0.206.14", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "0.59.11", path = "../swc_ecma_quote", optional = true } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 3ab837854ee2..9d7b8854a501 100644 --- a/crates/swc_estree_compat/Cargo.toml +++ b/crates/swc_estree_compat/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_estree_compat" repository = "https://github.com/swc-project/swc.git" -version = "0.198.17" +version = "0.198.18" [package.metadata.docs.rs] all-features = true @@ -40,7 +40,7 @@ swc_node_comments = { version = "0.20.18", path = "../swc_node_comments/" } criterion = "0.5" pretty_assertions = "1.3" -swc = { version = "0.273.18", path = "../swc" } +swc = { version = "0.273.19", path = "../swc" } swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } swc_ecma_transforms = { version = "0.229.14", path = "../swc_ecma_transforms/" } diff --git a/crates/swc_html/Cargo.toml b/crates/swc_html/Cargo.toml index 0196570c297f..3676bf032c26 100644 --- a/crates/swc_html/Cargo.toml +++ b/crates/swc_html/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_html" repository = "https://github.com/swc-project/swc.git" -version = "0.137.15" +version = "0.137.16" [package.metadata.docs.rs] all-features = true diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index d9d3af33ee69..b01d60b5e473 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -31,7 +31,7 @@ swc_ecma_ast = { version = "0.112.5", path = "../swc_ecma_ast" } swc_ecma_codegen = { version = "0.148.10", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "0.192.15", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "0.192.16", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "0.143.8", path = "../swc_ecma_parser" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 83275dfb07e5..223caa28573c 100644 --- a/crates/swc_node_bundler/Cargo.toml +++ b/crates/swc_node_bundler/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_node_bundler" repository = "https://github.com/swc-project/swc.git" -version = "0.62.18" +version = "0.62.19" [lib] bench = false @@ -29,9 +29,9 @@ serde_json = "1" tracing = "0.1.37" string_enum = { version = "0.4.2", path = "../string_enum" } -swc = { version = "0.273.18", path = "../swc" } +swc = { version = "0.273.19", path = "../swc" } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } -swc_bundler = { version = "0.225.14", path = "../swc_bundler", features = [ +swc_bundler = { version = "0.225.15", path = "../swc_bundler", features = [ "concurrent", ] } swc_common = { version = "0.33.19", path = "../swc_common", features = [