diff --git a/CHANGELOG.md b/CHANGELOG.md index 39578b53ab16..d1f3e935775d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - **(allocator)** Fix allocator & add benchmark ([#9234](https://github.com/swc-project/swc/issues/9234)) ([037dad5](https://github.com/swc-project/swc/commit/037dad52f44235590a0bcd5287d5118bca9da111)) +- **(allocator)** Remove wrong assertions and add tests ([#9252](https://github.com/swc-project/swc/issues/9252)) ([d8e8b04](https://github.com/swc-project/swc/commit/d8e8b04cd877bcf00157eeee9b7af0b4244a1827)) + + - **(ci)** Fix CI of `peff ([#9216](https://github.com/swc-project/swc/issues/9216)) ([602e0e5](https://github.com/swc-project/swc/commit/602e0e5aa14ecb3a7bc20bfe77aac2badaa54bb2)) @@ -53,6 +56,9 @@ - **(allocator)** Mention `oxc_allocator` ([be99ce0](https://github.com/swc-project/swc/commit/be99ce0a570c41b3fd471c5d609bd63c25740b36)) +- **(contributing)** Fix deno installation url ([#9249](https://github.com/swc-project/swc/issues/9249)) ([ff5bbda](https://github.com/swc-project/swc/commit/ff5bbdae6ad16309efe592788f4cb14956ffc3b1)) + + - **(es/minifier)** Add contributing section ([e22f3ba](https://github.com/swc-project/swc/commit/e22f3ba9adf21eac057eab29284333b1631258b3)) ### Features @@ -98,6 +104,9 @@ - **(bindings/wasm)** Shrink the size of the wasm file ([#9191](https://github.com/swc-project/swc/issues/9191)) ([3a23b3d](https://github.com/swc-project/swc/commit/3a23b3d120a14ca514204ef80bf744bb483dcfd6)) +- **(es/codegen)** Use scoped allocator ([#9248](https://github.com/swc-project/swc/issues/9248)) ([970f323](https://github.com/swc-project/swc/commit/970f32398c6ff444540a31e1172a33b6155ed18b)) + + - **(es/typescript)** Add a benchmark for fast TS strip ([#9205](https://github.com/swc-project/swc/issues/9205)) ([7d9364c](https://github.com/swc-project/swc/commit/7d9364cad3618d9039eadbab6fa8c57091ec7794)) @@ -110,6 +119,9 @@ - **(allocator)** Use `&` instead of a thread-local ([#9235](https://github.com/swc-project/swc/issues/9235)) ([8d5670e](https://github.com/swc-project/swc/commit/8d5670e72bb930f18c5d1d4262caa80cae0be03a)) +- **(allocator)** Use RAII guard instead of `scope` ([#9254](https://github.com/swc-project/swc/issues/9254)) ([6e098ae](https://github.com/swc-project/swc/commit/6e098aeeb5976292e43786f72bd91f1de50a9daa)) + + - **(common)** Drop `SyntaxContext` from AST nodes ([#9175](https://github.com/swc-project/swc/issues/9175)) ([b2491e5](https://github.com/swc-project/swc/commit/b2491e5461c0fea0aed04133074e34c92950845d)) @@ -127,6 +139,9 @@ - **(es/base)** Disable flaky benchmark ([#9221](https://github.com/swc-project/swc/issues/9221)) ([bd4bef1](https://github.com/swc-project/swc/commit/bd4bef16fb6d21d97699d46649c8db6af1dd27df)) + +- Enable scoped API by default ([#9247](https://github.com/swc-project/swc/issues/9247)) ([e7ce94b](https://github.com/swc-project/swc/commit/e7ce94b5ee713dc76383c35d99dd6a707c90339c)) + ### Pers @@ -1361,24 +1376,4 @@ - **(common)** Update `sourcemap` ([#8544](https://github.com/swc-project/swc/issues/8544)) ([4630426](https://github.com/swc-project/swc/commit/4630426d6aa77af992787456e476b8862c25a45e)) -## [1.3.105] - 2024-01-21 - -### Bug Fixes - - - -- **(common)** Remove `<` and `>` from `Display` impl of `FileName::Custom` ([#8530](https://github.com/swc-project/swc/issues/8530)) ([014a6cd](https://github.com/swc-project/swc/commit/014a6cda8205183f6c3a5e395b6f89cbf7b388b9)) - -### Miscellaneous Tasks - - - -- **(preset-env)** Update `browserslist-rs` ([#8524](https://github.com/swc-project/swc/issues/8524)) ([5e40dc7](https://github.com/swc-project/swc/commit/5e40dc7d8c7d7b979c3765fbaa2f9c9b41cf49a0)) - -### Testing - - - -- **(es/codegen)** Add a JS test for ascii-only mode ([#8519](https://github.com/swc-project/swc/issues/8519)) ([974c6a0](https://github.com/swc-project/swc/commit/974c6a0036c5ef3e3d12c81c7310758046ff0a0d)) - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37c51754a751..28bfaf0be343 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,7 +102,7 @@ For running all tests, take the following steps: 4. Install deno - See [official install guide of deno](https://deno.land/manual/getting_started/installation) to install it. + See [official install guide of deno](https://docs.deno.com/runtime/manual/getting_started/installation/) to install it. 5. Add wasm32-wasi target diff --git a/Cargo.lock b/Cargo.lock index c75efaffa426..da8dfeb98d66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "binding_macros" -version = "0.71.0" +version = "0.72.0" dependencies = [ "anyhow", "console_error_panic_hook", @@ -1084,7 +1084,7 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "dbg-swc" -version = "0.97.2" +version = "0.98.0" dependencies = [ "anyhow", "clap 3.2.25", @@ -3623,7 +3623,7 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "swc" -version = "0.280.0" +version = "0.281.0" dependencies = [ "ansi_term", "anyhow", @@ -3684,7 +3684,7 @@ dependencies = [ [[package]] name = "swc_allocator" -version = "0.1.5" +version = "0.1.6" dependencies = [ "allocator-api2", "bumpalo", @@ -3713,7 +3713,7 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.231.1" +version = "0.232.0" dependencies = [ "anyhow", "crc", @@ -3768,7 +3768,7 @@ dependencies = [ [[package]] name = "swc_cli_impl" -version = "0.15.0" +version = "0.16.0" dependencies = [ "anyhow", "assert_cmd", @@ -3792,7 +3792,7 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.35.0" +version = "0.35.1" dependencies = [ "ahash 0.8.8", "anyhow", @@ -3829,7 +3829,7 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "0.13.0" +version = "0.14.0" dependencies = [ "anyhow", "base64", @@ -3841,6 +3841,7 @@ dependencies = [ "serde", "serde_json", "sourcemap", + "swc_allocator", "swc_atoms", "swc_common", "swc_config", @@ -3877,7 +3878,7 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.97.6" +version = "0.98.0" dependencies = [ "anyhow", "binding_macros", @@ -4139,7 +4140,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.152.1" +version = "0.153.0" dependencies = [ "base64", "codspeed-criterion-compat", @@ -4151,6 +4152,7 @@ dependencies = [ "serde", "serde_json", "sourcemap", + "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -4174,7 +4176,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_atoms", "swc_common", @@ -4202,7 +4204,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.8.1" +version = "0.9.0" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -4228,7 +4230,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_atoms", "swc_common", @@ -4245,7 +4247,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.8.0" +version = "0.9.0" dependencies = [ "serde", "swc_atoms", @@ -4263,7 +4265,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.8.0" +version = "0.9.0" dependencies = [ "serde", "swc_atoms", @@ -4282,7 +4284,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_atoms", "swc_common", @@ -4298,7 +4300,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.8.0" +version = "0.9.0" dependencies = [ "serde", "swc_atoms", @@ -4316,7 +4318,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_atoms", "swc_common", @@ -4330,7 +4332,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_atoms", "swc_common", @@ -4347,7 +4349,7 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.8.0" +version = "0.9.0" dependencies = [ "swc_common", "swc_ecma_ast", @@ -4374,7 +4376,7 @@ dependencies = [ [[package]] name = "swc_ecma_lints" -version = "0.96.0" +version = "0.97.0" dependencies = [ "auto_impl", "dashmap", @@ -4417,7 +4419,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.198.2" +version = "0.199.0" dependencies = [ "ansi_term", "anyhow", @@ -4488,7 +4490,7 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.211.0" +version = "0.212.0" dependencies = [ "anyhow", "codspeed-criterion-compat", @@ -4554,7 +4556,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.233.0" +version = "0.234.0" dependencies = [ "pretty_assertions", "sourcemap", @@ -4579,7 +4581,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.141.1" +version = "0.142.0" dependencies = [ "better_scoped_tls", "bitflags 2.5.0", @@ -4592,6 +4594,7 @@ dependencies = [ "rustc-hash", "serde", "smallvec", + "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -4607,7 +4610,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.130.0" +version = "0.131.0" dependencies = [ "swc_atoms", "swc_common", @@ -4619,7 +4622,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.167.0" +version = "0.168.0" dependencies = [ "arrayvec", "indexmap 2.2.6", @@ -4668,7 +4671,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.184.1" +version = "0.185.0" dependencies = [ "Inflector", "anyhow", @@ -4698,7 +4701,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.202.1" +version = "0.203.0" dependencies = [ "dashmap", "indexmap 2.2.6", @@ -4728,7 +4731,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.175.0" +version = "0.176.0" dependencies = [ "either", "rustc-hash", @@ -4753,7 +4756,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.187.0" +version = "0.188.0" dependencies = [ "base64", "dashmap", @@ -4763,6 +4766,7 @@ dependencies = [ "serde", "sha1", "string_enum", + "swc_allocator", "swc_atoms", "swc_common", "swc_config", @@ -4780,7 +4784,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.144.0" +version = "0.145.0" dependencies = [ "ansi_term", "anyhow", @@ -4804,7 +4808,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.192.1" +version = "0.193.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -4877,7 +4881,7 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.246.0" +version = "0.247.0" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -4923,7 +4927,7 @@ dependencies = [ [[package]] name = "swc_estree_compat" -version = "0.205.0" +version = "0.206.0" dependencies = [ "ahash 0.8.8", "anyhow", @@ -4960,12 +4964,13 @@ dependencies = [ [[package]] name = "swc_fast_ts_strip" -version = "0.2.2" +version = "0.3.0" dependencies = [ "anyhow", "codspeed-criterion-compat", "criterion", "serde", + "swc_allocator", "swc_common", "swc_ecma_ast", "swc_ecma_codegen", @@ -4990,7 +4995,7 @@ dependencies = [ [[package]] name = "swc_html" -version = "0.143.0" +version = "0.144.0" dependencies = [ "swc_html_ast", "swc_html_codegen", @@ -5040,7 +5045,7 @@ dependencies = [ [[package]] name = "swc_html_minifier" -version = "0.140.0" +version = "0.141.0" dependencies = [ "codspeed-criterion-compat", "criterion", @@ -5127,7 +5132,7 @@ dependencies = [ [[package]] name = "swc_node_bundler" -version = "0.69.0" +version = "0.70.0" dependencies = [ "anyhow", "dashmap", @@ -5270,7 +5275,7 @@ dependencies = [ [[package]] name = "swc_typescript" -version = "0.2.0" +version = "0.3.0" dependencies = [ "swc_atoms", "swc_common", diff --git a/crates/binding_macros/Cargo.toml b/crates/binding_macros/Cargo.toml index ab58aae157bf..e1e294be3e9b 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.71.0" +version = "0.72.0" [lib] bench = false @@ -33,10 +33,10 @@ binding_wasm = [ [dependencies] # Common deps for the SWC imports -swc = { optional = true, version = "0.280.0", path = "../swc" } +swc = { optional = true, version = "0.281.0", path = "../swc" } swc_common = { optional = true, version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { optional = true, version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms = { optional = true, version = "0.233.0", path = "../swc_ecma_transforms" } +swc_ecma_transforms = { optional = true, version = "0.234.0", path = "../swc_ecma_transforms" } swc_ecma_visit = { optional = true, version = "0.102.0", path = "../swc_ecma_visit" } # Optional deps for the wasm binding macro diff --git a/crates/dbg-swc/Cargo.toml b/crates/dbg-swc/Cargo.toml index c453cacfe5a0..a09de3373232 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 = { workspace = true } -version = "0.97.2" +version = "0.98.0" [[bin]] bench = false @@ -32,12 +32,12 @@ swc_common = { version = "0.35.0", features = [ "tty-emitter", ], path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier", features = [ "concurrent", ] } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "0.19.0", path = "../swc_error_reporters" } swc_timer = { version = "0.23.0", path = "../swc_timer" } diff --git a/crates/swc/Cargo.toml b/crates/swc/Cargo.toml index 4eaedf0e5414..981ad23378db 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.280.0" +version = "0.281.0" [lib] bench = false @@ -74,21 +74,21 @@ swc_common = { version = "0.35.0", path = "../swc_common", features = [ "sourcemap", "parking_lot", ] } -swc_compiler_base = { version = "0.13.0", path = "../swc_compiler_base" } +swc_compiler_base = { version = "0.14.0", path = "../swc_compiler_base" } swc_config = { version = "0.1.13", path = "../swc_config" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_ext_transforms = { version = "0.117.0", path = "../swc_ecma_ext_transforms" } -swc_ecma_lints = { version = "0.96.0", path = "../swc_ecma_lints" } +swc_ecma_lints = { version = "0.97.0", path = "../swc_ecma_lints" } swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader", features = [ "cache", "node", "tsc", ] } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_preset_env = { version = "0.211.0", path = "../swc_ecma_preset_env" } -swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms", features = [ +swc_ecma_preset_env = { version = "0.212.0", path = "../swc_ecma_preset_env" } +swc_ecma_transforms = { version = "0.234.0", path = "../swc_ecma_transforms", features = [ "compat", "module", "optimization", @@ -96,9 +96,9 @@ swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms", fe "react", "typescript", ] } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_optimization = { version = "0.202.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_optimization = { version = "0.203.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_error_reporters = { version = "0.19.0", path = "../swc_error_reporters" } @@ -107,7 +107,7 @@ swc_plugin_proxy = { version = "0.45.0", path = "../swc_plugin_proxy", optional swc_plugin_runner = { version = "0.110.0", path = "../swc_plugin_runner", optional = true, default-features = false } swc_timer = { version = "0.23.0", path = "../swc_timer" } swc_transform_common = { version = "0.1.1", path = "../swc_transform_common" } -swc_typescript = { version = "0.2.0", path = "../swc_typescript" } +swc_typescript = { version = "0.3.0", path = "../swc_typescript" } swc_visit = { version = "0.5.14", path = "../swc_visit" } [dependencies.tokio] @@ -136,7 +136,7 @@ codspeed-criterion-compat = { workspace = true } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast", features = [ "serde-impl", ] } -swc_ecma_lints = { version = "0.96.0", path = "../swc_ecma_lints", features = [ +swc_ecma_lints = { version = "0.97.0", path = "../swc_ecma_lints", features = [ "non_critical_lints", ] } swc_ecma_testing = { version = "0.24.0", path = "../swc_ecma_testing" } diff --git a/crates/swc_allocator/Cargo.toml b/crates/swc_allocator/Cargo.toml index e8a67404b171..5ee7a7eeb3c5 100644 --- a/crates/swc_allocator/Cargo.toml +++ b/crates/swc_allocator/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_allocator" repository = { workspace = true } -version = "0.1.5" +version = "0.1.6" [package.metadata.docs.rs] all-features = true @@ -14,9 +14,10 @@ version = "0.1.5" [features] -rkyv = ["dep:rkyv"] -scoped = [] -serde = ["dep:serde", "dep:serde_derive"] +default = ["scoped"] +rkyv = ["dep:rkyv"] +scoped = [] +serde = ["dep:serde", "dep:serde_derive"] [dependencies] allocator-api2 = { workspace = true, features = ["serde"] } diff --git a/crates/swc_allocator/benches/bench.rs b/crates/swc_allocator/benches/bench.rs index 355e6f939240..8b1b10328466 100644 --- a/crates/swc_allocator/benches/bench.rs +++ b/crates/swc_allocator/benches/bench.rs @@ -39,30 +39,30 @@ fn bench_alloc(c: &mut Criterion) { fn direct_alloc_scoped(b: &mut Bencher, times: usize) { b.iter(|| { let allocator = Allocator::default(); + let _guard = unsafe { allocator.guard() }; - allocator.scope(|| { - let mut vec = SwcVec::new(); + let mut vec = SwcVec::new(); - for i in 0..times { - let item: SwcBox = black_box(SwcBox::new(black_box(i))); - vec.push(item); - } - }); + for i in 0..times { + let item: SwcBox = black_box(SwcBox::new(black_box(i))); + vec.push(item); + } }) } fn fast_alloc_scoped(b: &mut Bencher, times: usize) { b.iter(|| { - Allocator::default().scope(|| { - let alloc = FastAlloc::default(); + let alloc = Allocator::default(); + let _guard = unsafe { alloc.guard() }; + + let alloc = FastAlloc::default(); - let mut vec = SwcVec::new_in(alloc); + let mut vec = SwcVec::new_in(alloc); - for i in 0..times { - let item: SwcBox = black_box(SwcBox::new_in(black_box(i), alloc)); - vec.push(item); - } - }); + for i in 0..times { + let item: SwcBox = black_box(SwcBox::new_in(black_box(i), alloc)); + vec.push(item); + } }) } diff --git a/crates/swc_allocator/src/alloc.rs b/crates/swc_allocator/src/alloc.rs index 91cd4397d0d4..94197fcc5fcd 100644 --- a/crates/swc_allocator/src/alloc.rs +++ b/crates/swc_allocator/src/alloc.rs @@ -21,22 +21,33 @@ pub struct Allocator { alloc: Bump, } +pub struct AllocGuard { + orig: Option<&'static Allocator>, +} + +impl Drop for AllocGuard { + fn drop(&mut self) { + ALLOC.set(self.orig.take()); + } +} + impl Allocator { - /// Invokes `f` in a scope where the allocations are done in this allocator. - #[inline(always)] - pub fn scope<'a, F, R>(&'a self, f: F) -> R - where - F: FnOnce() -> R, - { + /// Creates a RAII guard that enables optimized allocation. + /// + /// # Safety + /// + /// [Allocator] must outlive [crate::boxed::Box] and [crate::vec::Vec] + /// created while the guard is active. + pub unsafe fn guard(&self) -> AllocGuard { + let orig = ALLOC.get(); + let s = unsafe { // Safery: We are using a scoped API - transmute::<&'a Allocator, &'static Allocator>(self) + transmute::<&Allocator, &'static Allocator>(self) }; ALLOC.set(Some(s)); - let ret = f(); - ALLOC.set(None); - ret + AllocGuard { orig } } } @@ -116,11 +127,6 @@ unsafe impl allocator_api2::alloc::Allocator for FastAlloc { unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { #[cfg(feature = "scoped")] if self.alloc.is_some() { - debug_assert!( - ALLOC.get().is_some(), - "Deallocating a pointer allocated with arena mode with a non-arena mode allocator" - ); - self.with_allocator(|alloc, _| alloc.deallocate(ptr, layout)); return; } diff --git a/crates/swc_allocator/src/lib.rs b/crates/swc_allocator/src/lib.rs index 5f36f29225df..5fd3f8e57faf 100644 --- a/crates/swc_allocator/src/lib.rs +++ b/crates/swc_allocator/src/lib.rs @@ -19,8 +19,8 @@ //! [crate::vec::Vec] very fast. //! //! In this mode, you need to be careful while using [crate::boxed::Box] and -//! [crate::vec::Vec]. Be sure to use same [Allocator] for allocation and -//! deallocation. +//! [crate::vec::Vec]. You should ensure that [Allocator] outlives all +//! [crate::boxed::Box] and [crate::vec::Vec] created in the scope. //! //! Recommened way to use this mode is to wrap the whole operations in //! a call to [Allocator::scope]. @@ -61,3 +61,15 @@ pub struct FastAlloc { #[cfg(feature = "scoped")] alloc: Option<&'static Allocator>, } + +impl FastAlloc { + /// [crate::boxed::Box] or [crate::vec::Vec] created with this instance is + /// managed by the global allocator and it can outlive the + /// [crate::Allocator] instance used for [Allocator::scope]. + pub const fn global() -> Self { + Self { + #[cfg(feature = "scoped")] + alloc: None, + } + } +} diff --git a/crates/swc_allocator/src/vec/mod.rs b/crates/swc_allocator/src/vec/mod.rs index dfcd2bdf9b98..7569af262f9a 100644 --- a/crates/swc_allocator/src/vec/mod.rs +++ b/crates/swc_allocator/src/vec/mod.rs @@ -1,6 +1,9 @@ //! Faster vec type. -use std::ops::{Deref, DerefMut}; +use std::{ + fmt, io, + ops::{Deref, DerefMut}, +}; #[cfg(feature = "rkyv")] mod rkyv; @@ -349,3 +352,32 @@ impl Extend for Vec { self.0.extend(iter) } } + +impl io::Write for Vec { + fn write(&mut self, buf: &[u8]) -> io::Result { + io::Write::write(&mut self.0, buf) + } + + fn flush(&mut self) -> io::Result<()> { + io::Write::flush(&mut self.0) + } + + fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { + io::Write::write_all(&mut self.0, buf) + } + + fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result { + io::Write::write_vectored(&mut self.0, bufs) + } + + fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> io::Result<()> { + io::Write::write_fmt(&mut self.0, fmt) + } + + fn by_ref(&mut self) -> &mut Self + where + Self: Sized, + { + self + } +} diff --git a/crates/swc_allocator/tests/apis.rs b/crates/swc_allocator/tests/apis.rs index 377251cd50f2..bf35cea53d35 100644 --- a/crates/swc_allocator/tests/apis.rs +++ b/crates/swc_allocator/tests/apis.rs @@ -23,14 +23,13 @@ fn direct_alloc_no_scope() { #[test] fn direct_alloc_in_scope() { let allocator = Allocator::default(); + let _guard = unsafe { allocator.guard() }; - allocator.scope(|| { - let mut vec = swc_allocator::vec::Vec::new(); + let mut vec = swc_allocator::vec::Vec::new(); - for i in 0..1000 { - let item: swc_allocator::boxed::Box = - black_box(swc_allocator::boxed::Box::new(black_box(i))); - vec.push(item); - } - }); + for i in 0..1000 { + let item: swc_allocator::boxed::Box = + black_box(swc_allocator::boxed::Box::new(black_box(i))); + vec.push(item); + } } diff --git a/crates/swc_allocator/tests/escape.rs b/crates/swc_allocator/tests/escape.rs new file mode 100644 index 000000000000..f12ab5520b0e --- /dev/null +++ b/crates/swc_allocator/tests/escape.rs @@ -0,0 +1,29 @@ +use swc_allocator::{boxed::Box, Allocator, FastAlloc}; + +#[test] +fn escape() { + let allocator = Allocator::default(); + + let obj = { + let _guard = unsafe { allocator.guard() }; + Box::new(1234) + }; + + assert_eq!(*obj, 1234); + // It should not segfault, because the allocator is still alive. + drop(obj); +} + +#[test] +fn global_allocator() { + let allocator = Allocator::default(); + let obj = { + let _guard = unsafe { allocator.guard() }; + Box::new_in(1234, FastAlloc::global()) + }; + + assert_eq!(*obj, 1234); + drop(allocator); + // Object created with global allocator should outlive the allocator. + drop(obj); +} diff --git a/crates/swc_bundler/Cargo.toml b/crates/swc_bundler/Cargo.toml index a4a5b29ca6b1..fd0fa0b3798c 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.231.1" +version = "0.232.0" [package.metadata.docs.rs] all-features = true @@ -40,11 +40,11 @@ tracing = { workspace = true } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_optimization = { version = "0.202.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_optimization = { version = "0.203.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_fast_graph = { version = "0.23.0", path = "../swc_fast_graph/" } @@ -63,11 +63,11 @@ swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader", features = "node", "cache", ] } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier", features = [ "concurrent", ] } -swc_ecma_transforms_proposal = { version = "0.175.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { version = "0.187.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_typescript = { version = "0.192.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_proposal = { version = "0.176.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { version = "0.188.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_typescript = { version = "0.193.0", path = "../swc_ecma_transforms_typescript" } swc_malloc = { version = "0.5.10", path = "../swc_malloc" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_cli_impl/Cargo.toml b/crates/swc_cli_impl/Cargo.toml index 2940db54b458..0e892176d33f 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.15.0" +version = "0.16.0" [[bin]] name = "swc" @@ -40,7 +40,7 @@ tracing-futures = { workspace = true } tracing-subscriber = { workspace = true, features = ["env-filter"] } walkdir = { workspace = true } -swc_core = { version = "0.97.0", features = [ +swc_core = { version = "0.98.0", features = [ "trace_macro", "common_concurrent", "base_concurrent", diff --git a/crates/swc_common/Cargo.toml b/crates/swc_common/Cargo.toml index 7e842f79c9c5..a692a3e6fab0 100644 --- a/crates/swc_common/Cargo.toml +++ b/crates/swc_common/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_common" repository = "https://github.com/swc-project/swc.git" -version = "0.35.0" +version = "0.35.1" [package.metadata.docs.rs] all-features = true @@ -65,7 +65,7 @@ url = { workspace = true } ast_node = { version = "0.9.8", path = "../ast_node" } better_scoped_tls = { version = "0.1.1", path = "../better_scoped_tls" } from_variant = { version = "0.1.8", path = "../from_variant" } -swc_allocator = { version = "0.1.1", path = "../swc_allocator" } +swc_allocator = { version = "0.1.1", path = "../swc_allocator", default-features = false } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_eq_ignore_macros = { version = "0.1.3", path = "../swc_eq_ignore_macros" } swc_visit = { version = "0.5.14", path = "../swc_visit" } diff --git a/crates/swc_compiler_base/Cargo.toml b/crates/swc_compiler_base/Cargo.toml index 4a92bee18538..de1cc23e7ea5 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.13.0" +version = "0.14.0" [features] node = ["napi", "napi-derive"] @@ -21,6 +21,7 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } sourcemap = { workspace = true } +swc_allocator = { version = "0.1.5", path = "../swc_allocator", default-features = false } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common", features = [ @@ -28,8 +29,8 @@ swc_common = { version = "0.35.0", path = "../swc_common", features = [ ] } swc_config = { version = "0.1.13", path = "../swc_config" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_timer = { version = "0.23.0", path = "../swc_timer" } diff --git a/crates/swc_compiler_base/src/lib.rs b/crates/swc_compiler_base/src/lib.rs index 2def122b13ba..60592cae351a 100644 --- a/crates/swc_compiler_base/src/lib.rs +++ b/crates/swc_compiler_base/src/lib.rs @@ -171,10 +171,10 @@ where { let _timer = timer!("Compiler::print"); - let mut src_map_buf = vec![]; + let mut src_map_buf = swc_allocator::vec::Vec::new(); let src = { - let mut buf = vec![]; + let mut buf = Vec::new(); { let mut w = swc_ecma_codegen::text_writer::JsWriter::new( cm.clone(), diff --git a/crates/swc_core/Cargo.toml b/crates/swc_core/Cargo.toml index 51c5ee098275..b4903ab75ac7 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.97.6" +version = "0.98.0" [package.metadata.docs.rs] features = [ "allocator_node", @@ -338,10 +338,10 @@ __visit = ["__ecma", "swc_ecma_visit"] once_cell = { workspace = true, optional = true } # swc_* dependencies -binding_macros = { optional = true, version = "0.71.0", path = "../binding_macros" } -swc = { optional = true, version = "0.280.0", path = "../swc" } +binding_macros = { optional = true, version = "0.72.0", path = "../binding_macros" } +swc = { optional = true, version = "0.281.0", path = "../swc" } swc_atoms = { optional = true, version = "0.6.5", path = "../swc_atoms" } -swc_bundler = { optional = true, version = "0.231.0", path = "../swc_bundler" } +swc_bundler = { optional = true, version = "0.232.0", path = "../swc_bundler" } swc_cached = { optional = true, version = "0.3.19", path = "../swc_cached" } swc_common = { optional = true, version = "0.35.0", path = "../swc_common" } swc_css_ast = { optional = true, version = "0.142.0", path = "../swc_css_ast" } @@ -354,36 +354,36 @@ swc_css_prefixer = { optional = true, version = "0.156.0", path swc_css_utils = { optional = true, version = "0.139.0", path = "../swc_css_utils/" } swc_css_visit = { optional = true, version = "0.141.0", path = "../swc_css_visit" } swc_ecma_ast = { optional = true, version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { optional = true, version = "0.152.0", path = "../swc_ecma_codegen" } -swc_ecma_lints = { optional = true, version = "0.96.0", path = "../swc_ecma_lints" } +swc_ecma_codegen = { optional = true, version = "0.153.0", path = "../swc_ecma_codegen" } +swc_ecma_lints = { optional = true, version = "0.97.0", path = "../swc_ecma_lints" } swc_ecma_loader = { optional = true, version = "0.47.0", path = "../swc_ecma_loader" } -swc_ecma_minifier = { optional = true, version = "0.198.0", path = "../swc_ecma_minifier" } +swc_ecma_minifier = { optional = true, version = "0.199.0", path = "../swc_ecma_minifier" } swc_ecma_parser = { optional = true, version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_preset_env = { optional = true, version = "0.211.0", path = "../swc_ecma_preset_env" } +swc_ecma_preset_env = { optional = true, version = "0.212.0", path = "../swc_ecma_preset_env" } swc_ecma_quote_macros = { optional = true, version = "0.58.0", path = "../swc_ecma_quote_macros" } -swc_ecma_transforms_base = { optional = true, version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { optional = true, version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_module = { optional = true, version = "0.184.0", path = "../swc_ecma_transforms_module" } -swc_ecma_transforms_optimization = { optional = true, version = "0.202.0", path = "../swc_ecma_transforms_optimization" } -swc_ecma_transforms_proposal = { optional = true, version = "0.175.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { optional = true, version = "0.187.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_testing = { optional = true, version = "0.144.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { optional = true, version = "0.192.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_base = { optional = true, version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { optional = true, version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_module = { optional = true, version = "0.185.0", path = "../swc_ecma_transforms_module" } +swc_ecma_transforms_optimization = { optional = true, version = "0.203.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_transforms_proposal = { optional = true, version = "0.176.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { optional = true, version = "0.188.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_testing = { optional = true, version = "0.145.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { optional = true, version = "0.193.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_usage_analyzer = { optional = true, version = "0.27.0", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { optional = true, version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { optional = true, version = "0.102.0", path = "../swc_ecma_visit" } swc_malloc = { optional = true, version = "0.5.10", path = "../swc_malloc" } -swc_node_bundler = { optional = true, version = "0.69.0", path = "../swc_node_bundler" } +swc_node_bundler = { optional = true, version = "0.70.0", 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" } swc_plugin_proxy = { optional = true, version = "0.45.0", path = "../swc_plugin_proxy" } swc_trace_macro = { optional = true, version = "0.1.3", path = "../swc_trace_macro" } swc_transform_common = { optional = true, version = "0.1.0", path = "../swc_transform_common" } -swc_typescript = { optional = true, version = "0.2.0", path = "../swc_typescript" } +swc_typescript = { optional = true, version = "0.3.0", path = "../swc_typescript" } testing = { optional = true, version = "0.37.0", path = "../testing" } # TODO: eventually swc_plugin_runner needs to remove default features -swc_allocator = { version = "0.1.2", path = "../swc_allocator" } +swc_allocator = { version = "0.1.2", path = "../swc_allocator", default-features = false } swc_plugin_runner = { optional = true, version = "0.110.0", path = "../swc_plugin_runner", default-features = false } [build-dependencies] diff --git a/crates/swc_ecma_ast/src/stmt.rs b/crates/swc_ecma_ast/src/stmt.rs index 32665b359a73..c19460bbcf7f 100644 --- a/crates/swc_ecma_ast/src/stmt.rs +++ b/crates/swc_ecma_ast/src/stmt.rs @@ -164,7 +164,7 @@ impl Stmt { } } -// Memory layout depedns on the version of rustc. +// Memory layout depends on the version of rustc. // #[cfg(target_pointer_width = "64")] // assert_eq_size!(Stmt, [u8; 56]); diff --git a/crates/swc_ecma_codegen/Cargo.toml b/crates/swc_ecma_codegen/Cargo.toml index efca69e793ce..7a0ad7458835 100644 --- a/crates/swc_ecma_codegen/Cargo.toml +++ b/crates/swc_ecma_codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_codegen" repository = "https://github.com/swc-project/swc.git" -version = "0.152.1" +version = "0.153.0" [features] # This does not enable serde for ast nodes. @@ -25,6 +25,7 @@ serde = { workspace = true } sourcemap = { workspace = true } tracing = { workspace = true } +swc_allocator = { version = "0.1.5", path = "../swc_allocator" } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } diff --git a/crates/swc_ecma_codegen/benches/bench.rs b/crates/swc_ecma_codegen/benches/bench.rs index 9c820aeeac3c..af47725357e4 100644 --- a/crates/swc_ecma_codegen/benches/bench.rs +++ b/crates/swc_ecma_codegen/benches/bench.rs @@ -1,6 +1,7 @@ extern crate swc_malloc; use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion}; +use swc_allocator::{vec::Vec, Allocator}; use swc_common::FileName; use swc_ecma_codegen::Emitter; use swc_ecma_parser::{Parser, StringInput, Syntax}; @@ -84,7 +85,6 @@ fn bench_emitter(b: &mut Bencher, s: &str) { let fm = cm.new_source_file(FileName::Anon.into(), s.into()); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); - let mut src_map_buf = vec![]; let module = parser .parse_module() .map_err(|e| e.into_diagnostic(handler).emit()) @@ -95,7 +95,11 @@ fn bench_emitter(b: &mut Bencher, s: &str) { } b.iter(|| { - let mut buf = vec![]; + let alloc = Allocator::default(); + let _guard = unsafe { alloc.guard() }; + let mut src_map_buf = Vec::new(); + + let mut buf = Vec::new(); { let mut emitter = Emitter { cfg: Default::default(), diff --git a/crates/swc_ecma_codegen/benches/with_parse.rs b/crates/swc_ecma_codegen/benches/with_parse.rs index d0ff27b97d61..a08132e44f6a 100644 --- a/crates/swc_ecma_codegen/benches/with_parse.rs +++ b/crates/swc_ecma_codegen/benches/with_parse.rs @@ -1,6 +1,7 @@ extern crate swc_malloc; use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Bencher, Criterion}; +use swc_allocator::vec::Vec; use swc_common::FileName; use swc_ecma_codegen::Emitter; use swc_ecma_parser::{Parser, StringInput, Syntax}; @@ -84,7 +85,7 @@ fn bench_emitter(b: &mut Bencher, s: &str) { b.iter(|| { let fm = cm.new_source_file(FileName::Anon.into(), s.into()); let mut parser = Parser::new(Syntax::default(), StringInput::from(&*fm), None); - let mut src_map_buf = vec![]; + let mut src_map_buf = Vec::new(); let module = parser .parse_module() .map_err(|e| e.into_diagnostic(handler).emit()) diff --git a/crates/swc_ecma_codegen/examples/sourcemap.rs b/crates/swc_ecma_codegen/examples/sourcemap.rs index e18522086244..1f004bb406cd 100644 --- a/crates/swc_ecma_codegen/examples/sourcemap.rs +++ b/crates/swc_ecma_codegen/examples/sourcemap.rs @@ -9,6 +9,7 @@ use std::{ time::Instant, }; +use swc_allocator::vec::Vec; use swc_common::input::SourceFileInput; use swc_ecma_ast::*; use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; @@ -30,7 +31,7 @@ fn parse_and_gen(entry: &Path) { .expect("failed to parse input as a module"); let mut code = vec![]; - let mut srcmap = vec![]; + let mut srcmap = Vec::new(); { let mut emitter = Emitter { @@ -56,7 +57,7 @@ fn parse_and_gen(entry: &Path) { .expect("failed to process a module"); } -/// Usage: ./scripts/instruements path/to/input/file +/// Usage: ./scripts/instruments path/to/input/file fn main() { let main_file = env::args().nth(1).unwrap(); diff --git a/crates/swc_ecma_codegen/src/tests.rs b/crates/swc_ecma_codegen/src/tests.rs index 3a89dd94d4fa..a86ba42ffa42 100644 --- a/crates/swc_ecma_codegen/src/tests.rs +++ b/crates/swc_ecma_codegen/src/tests.rs @@ -1,5 +1,6 @@ use std::path::PathBuf; +use swc_allocator::vec::Vec; use swc_common::{comments::SingleThreadedComments, FileName, SourceMap}; use swc_ecma_parser; use swc_ecma_testing::{exec_node_js, JsExecOptions}; @@ -44,11 +45,11 @@ impl Builder { where F: for<'aa> FnOnce(&mut Emitter<'aa, Box<(dyn WriteJs + 'aa)>, SourceMap>), { - let mut buf = vec![]; + let mut buf = Vec::new(); self.with(src, &mut buf, op); - String::from_utf8(buf).unwrap() + String::from_utf8_lossy(&buf).into_owned() } } diff --git a/crates/swc_ecma_codegen/src/text_writer/basic_impl.rs b/crates/swc_ecma_codegen/src/text_writer/basic_impl.rs index e21389cc474f..055317a54feb 100644 --- a/crates/swc_ecma_codegen/src/text_writer/basic_impl.rs +++ b/crates/swc_ecma_codegen/src/text_writer/basic_impl.rs @@ -1,6 +1,7 @@ use std::io::Write; use rustc_hash::FxHashSet; +use swc_allocator::vec::Vec; use swc_common::{sync::Lrc, BytePos, LineCol, SourceMap, Span}; use super::{Result, WriteJs}; diff --git a/crates/swc_ecma_codegen/tests/sourcemap.rs b/crates/swc_ecma_codegen/tests/sourcemap.rs index 1fdaec759198..73ffa99d9767 100644 --- a/crates/swc_ecma_codegen/tests/sourcemap.rs +++ b/crates/swc_ecma_codegen/tests/sourcemap.rs @@ -3,6 +3,7 @@ use std::{fs::read_to_string, path::PathBuf}; use base64::prelude::{Engine, BASE64_STANDARD}; use rustc_hash::FxHashSet; use sourcemap::SourceMap; +use swc_allocator::vec::Vec; use swc_common::{comments::SingleThreadedComments, source_map::SourceMapGenConfig}; use swc_ecma_ast::EsVersion; use swc_ecma_codegen::{text_writer::WriteJs, Emitter}; @@ -315,7 +316,7 @@ fn identity(entry: PathBuf) { Some(&comments), ); let mut parser: Parser = Parser::new_from(lexer); - let mut src_map = vec![]; + let mut src_map = Vec::new(); { let mut wr = Box::new(swc_ecma_codegen::text_writer::JsWriter::new( diff --git a/crates/swc_ecma_compat_bugfixes/Cargo.toml b/crates/swc_ecma_compat_bugfixes/Cargo.toml index edec775497bc..5416da0b42e3 100644 --- a/crates/swc_ecma_compat_bugfixes/Cargo.toml +++ b/crates/swc_ecma_compat_bugfixes/Cargo.toml @@ -7,15 +7,15 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_bugfixes" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_compat_es2015 = { version = "0.8.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_compat_es2015 = { version = "0.9.0", path = "../swc_ecma_compat_es2015" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } @@ -23,4 +23,4 @@ tracing = { workspace = true } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2015/Cargo.toml b/crates/swc_ecma_compat_es2015/Cargo.toml index 384def829f37..b013f5ecbe1b 100644 --- a/crates/swc_ecma_compat_es2015/Cargo.toml +++ b/crates/swc_ecma_compat_es2015/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2015" repository = "https://github.com/swc-project/swc.git" -version = "0.8.1" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -26,8 +26,8 @@ swc_common = { version = "0.35.0", path = "../swc_common" } swc_config = { version = "0.1.13", path = "../swc_config" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "0.8.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "0.130.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "0.131.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -36,4 +36,4 @@ tracing = { workspace = true } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2016/Cargo.toml b/crates/swc_ecma_compat_es2016/Cargo.toml index 5562566623aa..a626f8e9d271 100644 --- a/crates/swc_ecma_compat_es2016/Cargo.toml +++ b/crates/swc_ecma_compat_es2016/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2016" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,7 +16,7 @@ version = "0.8.0" swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -25,4 +25,4 @@ tracing = { workspace = true } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2017/Cargo.toml b/crates/swc_ecma_compat_es2017/Cargo.toml index 53a7ef9867c2..ba28fb015d59 100644 --- a/crates/swc_ecma_compat_es2017/Cargo.toml +++ b/crates/swc_ecma_compat_es2017/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2017" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,7 +19,7 @@ tracing = { workspace = true } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -27,4 +27,4 @@ swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2018/Cargo.toml b/crates/swc_ecma_compat_es2018/Cargo.toml index be1ab4e43ff8..7c8db99c0b15 100644 --- a/crates/swc_ecma_compat_es2018/Cargo.toml +++ b/crates/swc_ecma_compat_es2018/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2018" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,7 +20,7 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "0.8.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -28,4 +28,4 @@ swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2019/Cargo.toml b/crates/swc_ecma_compat_es2019/Cargo.toml index 40770bd78359..637eeb864b65 100644 --- a/crates/swc_ecma_compat_es2019/Cargo.toml +++ b/crates/swc_ecma_compat_es2019/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2019" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,11 +19,11 @@ tracing = { workspace = true } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2020/Cargo.toml b/crates/swc_ecma_compat_es2020/Cargo.toml index 857a85d86d04..6069c2459b6a 100644 --- a/crates/swc_ecma_compat_es2020/Cargo.toml +++ b/crates/swc_ecma_compat_es2020/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2020" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,8 +17,8 @@ serde = { workspace = true, features = ["derive"] } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_compat_es2022 = { version = "0.8.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_compat_es2022 = { version = "0.9.0", path = "../swc_ecma_compat_es2022" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } @@ -26,4 +26,4 @@ tracing = { workspace = true } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_compat_es2021/Cargo.toml b/crates/swc_ecma_compat_es2021/Cargo.toml index 58ce15f464c5..5aa29cbb7b54 100644 --- a/crates/swc_ecma_compat_es2021/Cargo.toml +++ b/crates/swc_ecma_compat_es2021/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2021" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,7 +18,7 @@ tracing = { workspace = true } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", 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 2d2284f2cb82..1420f89268b1 100644 --- a/crates/swc_ecma_compat_es2022/Cargo.toml +++ b/crates/swc_ecma_compat_es2022/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es2022" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,8 +20,8 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_compat_common = { version = "0.8.0", path = "../swc_ecma_compat_common" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "0.130.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "0.131.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_compat_es3/Cargo.toml b/crates/swc_ecma_compat_es3/Cargo.toml index 8bdcf35de5e9..38c4eae424cb 100644 --- a/crates/swc_ecma_compat_es3/Cargo.toml +++ b/crates/swc_ecma_compat_es3/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_compat_es3" repository = "https://github.com/swc-project/swc.git" -version = "0.8.0" +version = "0.9.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,11 +17,11 @@ tracing = { workspace = true } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } [dev-dependencies] swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } diff --git a/crates/swc_ecma_lints/Cargo.toml b/crates/swc_ecma_lints/Cargo.toml index 8407041a6ec5..726fe3ccb91b 100644 --- a/crates/swc_ecma_lints/Cargo.toml +++ b/crates/swc_ecma_lints/Cargo.toml @@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_lints" repository = "https://github.com/swc-project/swc.git" -version = "0.96.0" +version = "0.97.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -32,9 +32,9 @@ swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } testing = { version = "0.37.0", path = "../testing" } [features] diff --git a/crates/swc_ecma_minifier/Cargo.toml b/crates/swc_ecma_minifier/Cargo.toml index 153e8a00b934..e2df45bf760a 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.198.2" +version = "0.199.0" [package.metadata.docs.rs] all-features = true @@ -59,10 +59,10 @@ swc_config = { version = "0.1.13", path = "../swc_config", features = [ swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast", features = [ "serde", ] } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_optimization = { version = "0.202.0", path = "../swc_ecma_transforms_optimization" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_optimization = { version = "0.203.0", path = "../swc_ecma_transforms_optimization" } swc_ecma_usage_analyzer = { version = "0.27.0", path = "../swc_ecma_usage_analyzer" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_preset_env/Cargo.toml b/crates/swc_ecma_preset_env/Cargo.toml index 6ee74391070a..b96d6d3c4aff 100644 --- a/crates/swc_ecma_preset_env/Cargo.toml +++ b/crates/swc_ecma_preset_env/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.json", "data/**/*.json"] license = "Apache-2.0" name = "swc_ecma_preset_env" repository = { workspace = true } -version = "0.211.0" +version = "0.212.0" [lib] bench = false @@ -32,7 +32,7 @@ string_enum = { version = "0.4.4", path = "../string_enum" } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms", features = [ +swc_ecma_transforms = { version = "0.234.0", path = "../swc_ecma_transforms", features = [ "compat", "proposal", ] } @@ -44,7 +44,7 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms/Cargo.toml b/crates/swc_ecma_transforms/Cargo.toml index 2b5ac8b5a624..721caa809d57 100644 --- a/crates/swc_ecma_transforms/Cargo.toml +++ b/crates/swc_ecma_transforms/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms" repository = "https://github.com/swc-project/swc.git" -version = "0.233.0" +version = "0.234.0" [package.metadata.docs.rs] all-features = true @@ -34,13 +34,13 @@ typescript = ["swc_ecma_transforms_typescript"] swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat", optional = true } -swc_ecma_transforms_module = { version = "0.184.0", path = "../swc_ecma_transforms_module", optional = true } -swc_ecma_transforms_optimization = { version = "0.202.0", path = "../swc_ecma_transforms_optimization", optional = true } -swc_ecma_transforms_proposal = { version = "0.175.0", path = "../swc_ecma_transforms_proposal", optional = true } -swc_ecma_transforms_react = { version = "0.187.0", path = "../swc_ecma_transforms_react", optional = true } -swc_ecma_transforms_typescript = { version = "0.192.0", path = "../swc_ecma_transforms_typescript", optional = true } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat", optional = true } +swc_ecma_transforms_module = { version = "0.185.0", path = "../swc_ecma_transforms_module", optional = true } +swc_ecma_transforms_optimization = { version = "0.203.0", path = "../swc_ecma_transforms_optimization", optional = true } +swc_ecma_transforms_proposal = { version = "0.176.0", path = "../swc_ecma_transforms_proposal", optional = true } +swc_ecma_transforms_react = { version = "0.188.0", path = "../swc_ecma_transforms_react", optional = true } +swc_ecma_transforms_typescript = { version = "0.193.0", path = "../swc_ecma_transforms_typescript", optional = true } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -49,7 +49,7 @@ pretty_assertions = { workspace = true } sourcemap = { workspace = true } tempfile = { workspace = true } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_base/Cargo.toml b/crates/swc_ecma_transforms_base/Cargo.toml index 0c397657ba75..22aed4db537f 100644 --- a/crates/swc_ecma_transforms_base/Cargo.toml +++ b/crates/swc_ecma_transforms_base/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/**/*.js"] license = "Apache-2.0" name = "swc_ecma_transforms_base" repository = "https://github.com/swc-project/swc.git" -version = "0.141.1" +version = "0.142.0" [lib] bench = false @@ -34,13 +34,14 @@ swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } +swc_allocator = { version = "0.1.5", path = "../swc_allocator", default-features = false } [dev-dependencies] codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } rayon = { workspace = true } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_malloc = { version = "0.5.10", path = "../swc_malloc" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_classes/Cargo.toml b/crates/swc_ecma_transforms_classes/Cargo.toml index 0ab3ef1c5733..906ec7681457 100644 --- a/crates/swc_ecma_transforms_classes/Cargo.toml +++ b/crates/swc_ecma_transforms_classes/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_ecma_transforms_classes" repository = "https://github.com/swc-project/swc.git" -version = "0.130.0" +version = "0.131.0" [lib] bench = false @@ -15,6 +15,6 @@ bench = false swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } diff --git a/crates/swc_ecma_transforms_compat/Cargo.toml b/crates/swc_ecma_transforms_compat/Cargo.toml index 808a915d301d..6f6d145c3635 100644 --- a/crates/swc_ecma_transforms_compat/Cargo.toml +++ b/crates/swc_ecma_transforms_compat/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_compat" repository = "https://github.com/swc-project/swc.git" -version = "0.167.0" +version = "0.168.0" [lib] bench = false @@ -33,19 +33,19 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_config = { version = "0.1.13", path = "../swc_config" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_compat_bugfixes = { version = "0.8.0", path = "../swc_ecma_compat_bugfixes" } +swc_ecma_compat_bugfixes = { version = "0.9.0", path = "../swc_ecma_compat_bugfixes" } swc_ecma_compat_common = { version = "0.8.0", path = "../swc_ecma_compat_common" } -swc_ecma_compat_es2015 = { version = "0.8.0", path = "../swc_ecma_compat_es2015" } -swc_ecma_compat_es2016 = { version = "0.8.0", path = "../swc_ecma_compat_es2016" } -swc_ecma_compat_es2017 = { version = "0.8.0", path = "../swc_ecma_compat_es2017" } -swc_ecma_compat_es2018 = { version = "0.8.0", path = "../swc_ecma_compat_es2018" } -swc_ecma_compat_es2019 = { version = "0.8.0", path = "../swc_ecma_compat_es2019" } -swc_ecma_compat_es2020 = { version = "0.8.0", path = "../swc_ecma_compat_es2020" } -swc_ecma_compat_es2021 = { version = "0.8.0", path = "../swc_ecma_compat_es2021" } -swc_ecma_compat_es2022 = { version = "0.8.0", path = "../swc_ecma_compat_es2022" } -swc_ecma_compat_es3 = { version = "0.8.0", path = "../swc_ecma_compat_es3" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "0.130.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_compat_es2015 = { version = "0.9.0", path = "../swc_ecma_compat_es2015" } +swc_ecma_compat_es2016 = { version = "0.9.0", path = "../swc_ecma_compat_es2016" } +swc_ecma_compat_es2017 = { version = "0.9.0", path = "../swc_ecma_compat_es2017" } +swc_ecma_compat_es2018 = { version = "0.9.0", path = "../swc_ecma_compat_es2018" } +swc_ecma_compat_es2019 = { version = "0.9.0", path = "../swc_ecma_compat_es2019" } +swc_ecma_compat_es2020 = { version = "0.9.0", path = "../swc_ecma_compat_es2020" } +swc_ecma_compat_es2021 = { version = "0.9.0", path = "../swc_ecma_compat_es2021" } +swc_ecma_compat_es2022 = { version = "0.9.0", path = "../swc_ecma_compat_es2022" } +swc_ecma_compat_es3 = { version = "0.9.0", path = "../swc_ecma_compat_es3" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "0.131.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -55,5 +55,5 @@ swc_trace_macro = { version = "0.1.3", path = "../swc_trace_macro" } serde_json = { workspace = true } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_module/Cargo.toml b/crates/swc_ecma_transforms_module/Cargo.toml index 171dcf11b825..7f1dcee7a562 100644 --- a/crates/swc_ecma_transforms_module/Cargo.toml +++ b/crates/swc_ecma_transforms_module/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_module" repository = "https://github.com/swc-project/swc.git" -version = "0.184.1" +version = "0.185.0" [lib] bench = false @@ -32,7 +32,7 @@ swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader", features = "node", ] } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -44,7 +44,7 @@ swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader", features = "node", "tsc", ] } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { version = "0.192.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { version = "0.193.0", path = "../swc_ecma_transforms_typescript" } testing = { version = "0.37.0", path = "../testing/" } diff --git a/crates/swc_ecma_transforms_optimization/Cargo.toml b/crates/swc_ecma_transforms_optimization/Cargo.toml index 6692ee4c3876..7150392fed5d 100644 --- a/crates/swc_ecma_transforms_optimization/Cargo.toml +++ b/crates/swc_ecma_transforms_optimization/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_optimization" repository = "https://github.com/swc-project/swc.git" -version = "0.202.1" +version = "0.203.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -35,17 +35,17 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_fast_graph = { version = "0.23.0", path = "../swc_fast_graph" } [dev-dependencies] -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_module = { version = "0.184.0", path = "../swc_ecma_transforms_module" } -swc_ecma_transforms_proposal = { version = "0.175.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_react = { version = "0.187.0", path = "../swc_ecma_transforms_react" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } -swc_ecma_transforms_typescript = { version = "0.192.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_module = { version = "0.185.0", path = "../swc_ecma_transforms_module" } +swc_ecma_transforms_proposal = { version = "0.176.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_react = { version = "0.188.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_typescript = { version = "0.193.0", path = "../swc_ecma_transforms_typescript" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_proposal/Cargo.toml b/crates/swc_ecma_transforms_proposal/Cargo.toml index d6a1b032bcd1..768367e6da69 100644 --- a/crates/swc_ecma_transforms_proposal/Cargo.toml +++ b/crates/swc_ecma_transforms_proposal/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_proposal" repository = "https://github.com/swc-project/swc.git" -version = "0.175.0" +version = "0.176.0" [lib] bench = false @@ -26,8 +26,8 @@ swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader", optional = true } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_classes = { version = "0.130.0", path = "../swc_ecma_transforms_classes" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_classes = { version = "0.131.0", path = "../swc_ecma_transforms_classes" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -35,8 +35,8 @@ swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" [dev-dependencies] serde_json = { workspace = true } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_react/Cargo.toml b/crates/swc_ecma_transforms_react/Cargo.toml index 7c8ced316768..7f1678027b78 100644 --- a/crates/swc_ecma_transforms_react/Cargo.toml +++ b/crates/swc_ecma_transforms_react/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_react" repository = "https://github.com/swc-project/swc.git" -version = "0.187.0" +version = "0.188.0" [lib] bench = false @@ -27,18 +27,19 @@ serde = { workspace = true, features = ["derive"], optional = true } sha1 = { workspace = true } string_enum = { version = "0.4.4", path = "../string_enum" } +swc_allocator = { version = "0.1.5", path = "../swc_allocator", default-features = false } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_config = { version = "0.1.13", path = "../swc_config" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_transforms_macros = { version = "0.5.5", path = "../swc_ecma_transforms_macros" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } [dev-dependencies] -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen/" } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat/" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen/" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat/" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs b/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs index b7aeb94bf43f..4ae2ae269867 100644 --- a/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs +++ b/crates/swc_ecma_transforms_react/src/pure_annotations/tests.rs @@ -1,3 +1,4 @@ +use swc_allocator::vec::Vec; use swc_common::{comments::SingleThreadedComments, sync::Lrc, FileName, Mark, SourceMap}; use swc_ecma_codegen::{text_writer::JsWriter, Emitter}; use swc_ecma_parser::{Parser, StringInput}; @@ -40,8 +41,8 @@ fn emit( comments: Lrc, program: &Module, ) -> String { - let mut src_map_buf = vec![]; - let mut buf = vec![]; + let mut src_map_buf = Vec::new(); + let mut buf = std::vec::Vec::new(); { let writer = Box::new(JsWriter::new( source_map.clone(), diff --git a/crates/swc_ecma_transforms_testing/Cargo.toml b/crates/swc_ecma_transforms_testing/Cargo.toml index 6a36f6409245..3e8a24656487 100644 --- a/crates/swc_ecma_transforms_testing/Cargo.toml +++ b/crates/swc_ecma_transforms_testing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_ecma_transforms_testing" repository = "https://github.com/swc-project/swc.git" -version = "0.144.0" +version = "0.145.0" [lib] bench = false @@ -26,10 +26,10 @@ swc_common = { version = "0.35.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } swc_ecma_testing = { version = "0.24.0", path = "../swc_ecma_testing" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } testing = { version = "0.37.0", path = "../testing" } diff --git a/crates/swc_ecma_transforms_typescript/Cargo.toml b/crates/swc_ecma_transforms_typescript/Cargo.toml index 31989721ba0a..08de75e4a2d2 100644 --- a/crates/swc_ecma_transforms_typescript/Cargo.toml +++ b/crates/swc_ecma_transforms_typescript/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_ecma_transforms_typescript" repository = "https://github.com/swc-project/swc.git" -version = "0.192.1" +version = "0.193.0" [lib] bench = false @@ -19,8 +19,8 @@ ryu-js = { workspace = true } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } swc_common = { version = "0.35.0", path = "../swc_common" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_react = { version = "0.187.0", path = "../swc_ecma_transforms_react" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_react = { version = "0.188.0", path = "../swc_ecma_transforms_react" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } @@ -28,11 +28,11 @@ swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_compat = { version = "0.167.0", path = "../swc_ecma_transforms_compat" } -swc_ecma_transforms_proposal = { version = "0.175.0", path = "../swc_ecma_transforms_proposal" } -swc_ecma_transforms_testing = { version = "0.144.0", path = "../swc_ecma_transforms_testing" } +swc_ecma_transforms_compat = { version = "0.168.0", path = "../swc_ecma_transforms_compat" } +swc_ecma_transforms_proposal = { version = "0.176.0", path = "../swc_ecma_transforms_proposal" } +swc_ecma_transforms_testing = { version = "0.145.0", path = "../swc_ecma_transforms_testing" } testing = { version = "0.37.0", path = "../testing" } [[bench]] diff --git a/crates/swc_ecmascript/Cargo.toml b/crates/swc_ecmascript/Cargo.toml index d98ded759d37..ce17741a319c 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.246.0" +version = "0.247.0" [package.metadata.docs.rs] all-features = true @@ -39,12 +39,12 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen", optional = true } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier", optional = true } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen", optional = true } +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier", optional = true } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser", optional = true, default-features = false } -swc_ecma_preset_env = { version = "0.211.0", path = "../swc_ecma_preset_env", optional = true } +swc_ecma_preset_env = { version = "0.212.0", path = "../swc_ecma_preset_env", optional = true } swc_ecma_quote = { version = "0.63.0", path = "../swc_ecma_quote", optional = true } -swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms", optional = true } +swc_ecma_transforms = { version = "0.234.0", path = "../swc_ecma_transforms", optional = true } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils", optional = true } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit", optional = true } diff --git a/crates/swc_estree_compat/Cargo.toml b/crates/swc_estree_compat/Cargo.toml index 84468a1777c5..2ab6e9b31074 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.205.0" +version = "0.206.0" [package.metadata.docs.rs] all-features = true @@ -41,10 +41,10 @@ codspeed-criterion-compat = { workspace = true } criterion = { workspace = true } pretty_assertions = { workspace = true } -swc = { version = "0.280.0", path = "../swc" } +swc = { version = "0.281.0", path = "../swc" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms/" } +swc_ecma_transforms = { version = "0.234.0", path = "../swc_ecma_transforms/" } testing = { version = "0.37.0", path = "../testing" } walkdir = { workspace = true } diff --git a/crates/swc_fast_ts_strip/Cargo.toml b/crates/swc_fast_ts_strip/Cargo.toml index 47d9eaa4d111..60ce710bc4d5 100644 --- a/crates/swc_fast_ts_strip/Cargo.toml +++ b/crates/swc_fast_ts_strip/Cargo.toml @@ -7,21 +7,22 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0" name = "swc_fast_ts_strip" repository = { workspace = true } -version = "0.2.2" +version = "0.3.0" [dependencies] anyhow = { workspace = true } serde = { workspace = true, features = ["derive"] } +swc_allocator = { version = "0.1.5", path = "../swc_allocator", default-features = false } swc_common = { version = "0.35.0", path = "../swc_common", features = [ "sourcemap", ] } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.1", path = "../swc_ecma_transforms_base" } -swc_ecma_transforms_typescript = { version = "0.192.0", path = "../swc_ecma_transforms_typescript" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_typescript = { version = "0.193.0", path = "../swc_ecma_transforms_typescript" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } [dev-dependencies] diff --git a/crates/swc_fast_ts_strip/src/lib.rs b/crates/swc_fast_ts_strip/src/lib.rs index f2ea8400834b..92e2b78c9e90 100644 --- a/crates/swc_fast_ts_strip/src/lib.rs +++ b/crates/swc_fast_ts_strip/src/lib.rs @@ -241,7 +241,7 @@ pub fn operate( let mut src = vec![]; let mut src_map_buf = if options.source_map { - Some(vec![]) + Some(swc_allocator::vec::Vec::new()) } else { None }; diff --git a/crates/swc_html/Cargo.toml b/crates/swc_html/Cargo.toml index 343913a67d60..ccb318335f89 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.143.0" +version = "0.144.0" [package.metadata.docs.rs] all-features = true @@ -21,6 +21,6 @@ minifier = ["swc_html_minifier"] [dependencies] swc_html_ast = {version = "0.35.0", path = "../swc_html_ast"} swc_html_codegen = {version = "0.44.0", path = "../swc_html_codegen"} -swc_html_minifier = {version = "0.140.0", path = "../swc_html_minifier", optional = true} +swc_html_minifier = {version = "0.141.0", path = "../swc_html_minifier", optional = true} swc_html_parser = {version = "0.41.0", path = "../swc_html_parser"} swc_html_visit = {version = "0.35.0", path = "../swc_html_visit"} diff --git a/crates/swc_html_minifier/Cargo.toml b/crates/swc_html_minifier/Cargo.toml index ce6fedf0cc3c..5612c51d0636 100644 --- a/crates/swc_html_minifier/Cargo.toml +++ b/crates/swc_html_minifier/Cargo.toml @@ -10,7 +10,7 @@ include = ["Cargo.toml", "src/**/*.rs", "data/**/*.json"] license = "Apache-2.0" name = "swc_html_minifier" repository = "https://github.com/swc-project/swc.git" -version = "0.140.0" +version = "0.141.0" [lib] bench = false @@ -28,14 +28,14 @@ swc_css_codegen = { version = "0.153.0", path = "../swc_css_codegen" } swc_css_minifier = { version = "0.118.0", path = "../swc_css_minifier" } swc_css_parser = { version = "0.152.0", path = "../swc_css_parser" } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen", features = [ +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen", features = [ "serde-impl", ] } -swc_ecma_minifier = { version = "0.198.0", path = "../swc_ecma_minifier", features = [ +swc_ecma_minifier = { version = "0.199.0", path = "../swc_ecma_minifier", features = [ "extra-serde", ] } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms_base = { version = "0.141.0", path = "../swc_ecma_transforms_base" } +swc_ecma_transforms_base = { version = "0.142.0", path = "../swc_ecma_transforms_base" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_html_ast = { version = "0.35.0", path = "../swc_html_ast" } swc_html_codegen = { version = "0.44.0", path = "../swc_html_codegen" } diff --git a/crates/swc_node_bundler/Cargo.toml b/crates/swc_node_bundler/Cargo.toml index 9e8b71bfc6b9..1b8511f4eefe 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.69.0" +version = "0.70.0" [lib] bench = false @@ -29,19 +29,19 @@ serde_json = { workspace = true } tracing = { workspace = true } string_enum = { version = "0.4.4", path = "../string_enum" } -swc = { version = "0.280.0", path = "../swc" } +swc = { version = "0.281.0", path = "../swc" } swc_atoms = { version = "0.6.5", path = "../swc_atoms" } -swc_bundler = { version = "0.231.0", path = "../swc_bundler", features = [ +swc_bundler = { version = "0.232.0", path = "../swc_bundler", features = [ "concurrent", ] } swc_common = { version = "0.35.0", path = "../swc_common", features = [ "concurrent", ] } swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_loader = { version = "0.47.0", path = "../swc_ecma_loader" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } -swc_ecma_transforms = { version = "0.233.0", path = "../swc_ecma_transforms" } +swc_ecma_transforms = { version = "0.234.0", path = "../swc_ecma_transforms" } swc_ecma_utils = { version = "0.131.0", path = "../swc_ecma_utils" } swc_ecma_visit = { version = "0.102.0", path = "../swc_ecma_visit" } swc_malloc = { version = "0.5.10", path = "../swc_malloc" } diff --git a/crates/swc_typescript/Cargo.toml b/crates/swc_typescript/Cargo.toml index f82a32757f83..eadf2bcf7924 100644 --- a/crates/swc_typescript/Cargo.toml +++ b/crates/swc_typescript/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "Apache-2.0" name = "swc_typescript" repository = { workspace = true } -version = "0.2.0" +version = "0.3.0" [dependencies] thiserror = { workspace = true } @@ -17,6 +17,6 @@ swc_ecma_ast = { version = "0.116.0", path = "../swc_ecma_ast" } [dev-dependencies] -swc_ecma_codegen = { version = "0.152.0", path = "../swc_ecma_codegen" } +swc_ecma_codegen = { version = "0.153.0", path = "../swc_ecma_codegen" } swc_ecma_parser = { version = "0.147.0", path = "../swc_ecma_parser" } testing = { version = "0.37.0", path = "../testing" }