Commit 25f16f93 authored by Luke Sandberg's avatar Luke Sandberg

Fix compilation errors in wasmtime backend implementation

- Remove unused import (std::sync::Arc)
- Use raw pointer approach for Caller trait implementation to work
  around Rust lifetime constraints with wasmtime::Caller parameter
- Implement runtime::Caller trait methods using unsafe pointer access,
  which is safe because the pointer lifetime is controlled within
  the host function closure

The key challenge was that wasmtime's closure signature provides a
Caller parameter with a specific lifetime that doesn't satisfy the
trait object requirements for runtime::Caller. The solution uses
unsafe pointer casting with careful lifetime management to bridge
the gap between wasmtime's API and swc_plugin_runner's trait interface.
parent 1e7b3e3f
......@@ -139,6 +139,12 @@ dependencies = [
"unicode-joining-type",
]
[[package]]
name = "ambient-authority"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b"
[[package]]
name = "android-tzdata"
version = "0.1.1"
......@@ -640,9 +646,9 @@ dependencies = [
[[package]]
name = "binding_macros"
version = "55.0.0"
version = "56.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5618ad063e3cb3eb2939634c26384c1767f039058924cf8d7fab3493dc2fb436"
checksum = "d96bb26c29e49fe159d5d20c8b81ef2deca762a9d07ad98e18227d7112aa146f"
dependencies = [
"anyhow",
"console_error_panic_hook",
......@@ -651,10 +657,10 @@ dependencies = [
"serde",
"serde-wasm-bindgen 0.6.5",
"swc",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms",
"swc_ecma_visit",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transforms 48.0.0",
"swc_ecma_visit 21.0.0",
"wasm-bindgen",
"wasm-bindgen-futures",
]
......@@ -923,6 +929,84 @@ dependencies = [
"serde",
]
[[package]]
name = "cap-fs-ext"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5528f85b1e134ae811704e41ef80930f56e795923f866813255bc342cc20654"
dependencies = [
"cap-primitives",
"cap-std",
"io-lifetimes",
"windows-sys 0.59.0",
]
[[package]]
name = "cap-net-ext"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20a158160765c6a7d0d8c072a53d772e4cb243f38b04bfcf6b4939cfbe7482e7"
dependencies = [
"cap-primitives",
"cap-std",
"rustix 1.0.7",
"smallvec",
]
[[package]]
name = "cap-primitives"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6cf3aea8a5081171859ef57bc1606b1df6999df4f1110f8eef68b30098d1d3a"
dependencies = [
"ambient-authority",
"fs-set-times",
"io-extras",
"io-lifetimes",
"ipnet",
"maybe-owned",
"rustix 1.0.7",
"rustix-linux-procfs",
"windows-sys 0.59.0",
"winx",
]
[[package]]
name = "cap-rand"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8144c22e24bbcf26ade86cb6501a0916c46b7e4787abdb0045a467eb1645a1d"
dependencies = [
"ambient-authority",
"rand 0.8.5",
]
[[package]]
name = "cap-std"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6dc3090992a735d23219de5c204927163d922f42f575a0189b005c62d37549a"
dependencies = [
"cap-primitives",
"io-extras",
"io-lifetimes",
"rustix 1.0.7",
]
[[package]]
name = "cap-time-ext"
version = "3.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "def102506ce40c11710a9b16e614af0cde8e76ae51b1f48c04b8d79f4b671a80"
dependencies = [
"ambient-authority",
"cap-primitives",
"iana-time-zone",
"once_cell",
"rustix 1.0.7",
"winx",
]
[[package]]
name = "cargo-lock"
version = "8.0.3"
......@@ -1026,7 +1110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9"
dependencies = [
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
]
[[package]]
......@@ -1529,7 +1613,16 @@ version = "0.110.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "305d51c180ebdc46ef61bc60c54ae6512db3bc9a05842a1f1e762e45977019ab"
dependencies = [
"cranelift-entity",
"cranelift-entity 0.110.2",
]
[[package]]
name = "cranelift-bforest"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e15d04a0ce86cb36ead88ad68cf693ffd6cda47052b9e0ac114bc47fd9cd23c4"
dependencies = [
"cranelift-entity 0.116.1",
]
[[package]]
......@@ -1538,6 +1631,16 @@ version = "0.110.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "690d8ae6c73748e5ce3d8fe59034dceadb8823e6c8994ba324141c5eae909b0e"
[[package]]
name = "cranelift-bitset"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c6e3969a7ce267259ce244b7867c5d3bc9e65b0a87e81039588dfdeaede9f34"
dependencies = [
"serde",
"serde_derive",
]
[[package]]
name = "cranelift-codegen"
version = "0.110.2"
......@@ -1545,20 +1648,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd7ca95e831c18d1356da783765c344207cbdffea91e13e47fa9327dbb2e0719"
dependencies = [
"bumpalo",
"cranelift-bforest",
"cranelift-bitset",
"cranelift-codegen-meta",
"cranelift-codegen-shared",
"cranelift-control",
"cranelift-entity",
"cranelift-isle",
"cranelift-bforest 0.110.2",
"cranelift-bitset 0.110.3",
"cranelift-codegen-meta 0.110.3",
"cranelift-codegen-shared 0.110.3",
"cranelift-control 0.110.3",
"cranelift-entity 0.110.2",
"cranelift-isle 0.110.2",
"gimli 0.28.1",
"hashbrown 0.14.5",
"log",
"regalloc2",
"regalloc2 0.9.3",
"rustc-hash 1.1.0",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
]
[[package]]
name = "cranelift-codegen"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c22032c4cb42558371cf516bb47f26cdad1819d3475c133e93c49f50ebf304e"
dependencies = [
"bumpalo",
"cranelift-bforest 0.116.1",
"cranelift-bitset 0.116.1",
"cranelift-codegen-meta 0.116.1",
"cranelift-codegen-shared 0.116.1",
"cranelift-control 0.116.1",
"cranelift-entity 0.116.1",
"cranelift-isle 0.116.1",
"gimli 0.31.1",
"hashbrown 0.14.5",
"log",
"regalloc2 0.11.2",
"rustc-hash 2.1.1",
"serde",
"smallvec",
"target-lexicon 0.13.5",
]
[[package]]
......@@ -1567,7 +1694,16 @@ version = "0.110.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0a2d2ab65e6cbf91f81781d8da65ec2005510f18300eff21a99526ed6785863"
dependencies = [
"cranelift-codegen-shared",
"cranelift-codegen-shared 0.110.3",
]
[[package]]
name = "cranelift-codegen-meta"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c904bc71c61b27fc57827f4a1379f29de64fe95653b620a3db77d59655eee0b8"
dependencies = [
"cranelift-codegen-shared 0.116.1",
]
[[package]]
......@@ -1576,6 +1712,12 @@ version = "0.110.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efcff860573cf3db9ae98fbd949240d78b319df686cc306872e7fab60e9c84d7"
[[package]]
name = "cranelift-codegen-shared"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40180f5497572f644ce88c255480981ae2ec1d7bb4d8e0c0136a13b87a2f2ceb"
[[package]]
name = "cranelift-control"
version = "0.110.3"
......@@ -1585,13 +1727,33 @@ dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-control"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d132c6d0bd8a489563472afc171759da0707804a65ece7ceb15a8c6d7dd5ef"
dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-entity"
version = "0.110.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a48cb0a194c9ba82fec35a1e492055388d89b2e3c03dee9dcf2488892be8004d"
dependencies = [
"cranelift-bitset",
"cranelift-bitset 0.110.3",
]
[[package]]
name = "cranelift-entity"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b2d0d9618275474fbf679dd018ac6e009acbd6ae6850f6a67be33fb3b00b323"
dependencies = [
"cranelift-bitset 0.116.1",
"serde",
"serde_derive",
]
[[package]]
......@@ -1600,10 +1762,22 @@ version = "0.110.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8327afc6c1c05f4be62fefce5b439fa83521c65363a322e86ea32c85e7ceaf64"
dependencies = [
"cranelift-codegen",
"cranelift-codegen 0.110.2",
"log",
"smallvec",
"target-lexicon 0.12.16",
]
[[package]]
name = "cranelift-frontend"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fac41e16729107393174b0c9e3730fb072866100e1e64e80a1a963b2e484d57"
dependencies = [
"cranelift-codegen 0.116.1",
"log",
"smallvec",
"target-lexicon",
"target-lexicon 0.13.5",
]
[[package]]
......@@ -1612,6 +1786,23 @@ version = "0.110.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56b08621c00321efcfa3eee6a3179adc009e21ea8d24ca7adc3c326184bc3f48"
[[package]]
name = "cranelift-isle"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca20d576e5070044d0a72a9effc2deacf4d6aa650403189d8ea50126483944d"
[[package]]
name = "cranelift-native"
version = "0.116.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8dee82f3f1f2c4cba9177f1cc5e350fe98764379bcd29340caa7b01f85076c7"
dependencies = [
"cranelift-codegen 0.116.1",
"libc",
"target-lexicon 0.13.5",
]
[[package]]
name = "crc32fast"
version = "1.4.2"
......@@ -2112,6 +2303,26 @@ dependencies = [
"crypto-common",
]
[[package]]
name = "dirs"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs-sys"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
dependencies = [
"libc",
"redox_users",
"winapi",
]
[[package]]
name = "displaydoc"
version = "0.2.5"
......@@ -2306,6 +2517,17 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
[[package]]
name = "fd-lock"
version = "4.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78"
dependencies = [
"cfg-if",
"rustix 1.0.7",
"windows-sys 0.59.0",
]
[[package]]
name = "fdeflate"
version = "0.3.7"
......@@ -2395,6 +2617,17 @@ dependencies = [
"syn 2.0.104",
]
[[package]]
name = "fs-set-times"
version = "0.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a"
dependencies = [
"io-lifetimes",
"rustix 1.0.7",
"windows-sys 0.59.0",
]
[[package]]
name = "fs_extra"
version = "1.3.0"
......@@ -2600,6 +2833,17 @@ dependencies = [
"stable_deref_trait",
]
[[package]]
name = "gimli"
version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
dependencies = [
"fallible-iterator",
"indexmap 2.13.0",
"stable_deref_trait",
]
[[package]]
name = "glob"
version = "0.3.3"
......@@ -3471,6 +3715,22 @@ dependencies = [
"rustversion",
]
[[package]]
name = "io-extras"
version = "0.18.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2285ddfe3054097ef4b2fe909ef8c3bcd1ea52a8f0d274416caebeef39f04a65"
dependencies = [
"io-lifetimes",
"windows-sys 0.59.0",
]
[[package]]
name = "io-lifetimes"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983"
[[package]]
name = "ipnet"
version = "2.10.1"
......@@ -3796,6 +4056,12 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "libm"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "libmimalloc-sys"
version = "0.1.44"
......@@ -3807,6 +4073,15 @@ dependencies = [
"libc",
]
[[package]]
name = "libredox"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a"
dependencies = [
"libc",
]
[[package]]
name = "libunwind"
version = "1.3.3"
......@@ -4067,6 +4342,12 @@ version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "maybe-owned"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4"
[[package]]
name = "maybe-rayon"
version = "0.1.1"
......@@ -4084,7 +4365,7 @@ dependencies = [
"markdown",
"rustc-hash 2.1.1",
"serde",
"swc_core",
"swc_core 57.0.0",
]
[[package]]
......@@ -4093,6 +4374,15 @@ version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "memfd"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227"
dependencies = [
"rustix 1.0.7",
]
[[package]]
name = "memmap2"
version = "0.6.2"
......@@ -4264,9 +4554,9 @@ dependencies = [
"serde",
"swc_atoms",
"swc_cached",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_visit 20.0.0",
]
[[package]]
......@@ -4420,7 +4710,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_core",
"swc_core 58.0.4",
"tempfile",
"tokio",
"tracing",
......@@ -4467,7 +4757,7 @@ dependencies = [
"num_cpus",
"rand 0.10.0",
"serde_json",
"swc_core",
"swc_core 58.0.4",
"tokio",
"tokio-stream",
"tracing",
......@@ -4527,8 +4817,8 @@ dependencies = [
"serde_json",
"serde_path_to_error",
"smallvec",
"swc_core",
"swc_sourcemap",
"swc_core 58.0.4",
"swc_sourcemap 9.3.4",
"thiserror 1.0.69",
"tracing",
"turbo-bincode",
......@@ -4582,10 +4872,10 @@ dependencies = [
"sha1",
"styled_components",
"styled_jsx",
"swc_core",
"swc_core 58.0.4",
"swc_emotion",
"swc_relay",
"testing",
"testing 19.0.0",
"tracing",
"turbo-rcstr",
"turbopack-ecmascript-plugins",
......@@ -4625,7 +4915,8 @@ dependencies = [
"serde",
"serde_json",
"supports-hyperlinks",
"swc_core",
"swc_core 58.0.4",
"swc_plugin_backend_wasmtime",
"terminal_hyperlink",
"terminal_size",
"tokio",
......@@ -4905,6 +5196,18 @@ dependencies = [
"ruzstd",
]
[[package]]
name = "object"
version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
dependencies = [
"crc32fast",
"hashbrown 0.15.4",
"indexmap 2.13.0",
"memchr",
]
[[package]]
name = "once_cell"
version = "1.21.3"
......@@ -5652,6 +5955,18 @@ dependencies = [
"unicase",
]
[[package]]
name = "pulley-interpreter"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62d95f8575df49a2708398182f49a888cf9dc30210fb1fd2df87c889edcee75d"
dependencies = [
"cranelift-bitset 0.116.1",
"log",
"sptr",
"wasmtime-math",
]
[[package]]
name = "pxfm"
version = "0.1.25"
......@@ -5946,9 +6261,9 @@ dependencies = [
"serde",
"swc_atoms",
"swc_cached",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_visit 20.0.0",
]
[[package]]
......@@ -5960,6 +6275,17 @@ dependencies = [
"bitflags 1.3.2",
]
[[package]]
name = "redox_users"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [
"getrandom 0.2.15",
"libredox",
"thiserror 1.0.69",
]
[[package]]
name = "ref-cast"
version = "1.0.24"
......@@ -5993,6 +6319,20 @@ dependencies = [
"smallvec",
]
[[package]]
name = "regalloc2"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc06e6b318142614e4a48bc725abbf08ff166694835c43c9dae5a9009704639a"
dependencies = [
"allocator-api2",
"bumpalo",
"hashbrown 0.15.4",
"log",
"rustc-hash 2.1.1",
"smallvec",
]
[[package]]
name = "regex"
version = "1.11.1"
......@@ -6059,9 +6399,9 @@ dependencies = [
"serde",
"swc_atoms",
"swc_cached",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_visit 20.0.0",
]
[[package]]
......@@ -6321,6 +6661,16 @@ dependencies = [
"windows-sys 0.59.0",
]
[[package]]
name = "rustix-linux-procfs"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056"
dependencies = [
"once_cell",
"rustix 1.0.7",
]
[[package]]
name = "rustls"
version = "0.23.31"
......@@ -6857,6 +7207,15 @@ dependencies = [
"memmap2 0.6.2",
]
[[package]]
name = "shellexpand"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4"
dependencies = [
"dirs",
]
[[package]]
name = "shlex"
version = "1.3.0"
......@@ -7036,6 +7395,12 @@ dependencies = [
"lock_api",
]
[[package]]
name = "sptr"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a"
[[package]]
name = "st-map"
version = "0.2.0"
......@@ -7150,10 +7515,10 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"tracing",
]
......@@ -7171,7 +7536,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_css_codegen",
"swc_css_compat",
......@@ -7179,12 +7544,12 @@ dependencies = [
"swc_css_parser",
"swc_css_prefixer",
"swc_css_visit",
"swc_ecma_ast",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_ast 20.0.1",
"swc_ecma_minifier 45.0.0",
"swc_ecma_parser 34.0.0",
"swc_ecma_transforms_base 37.0.0",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"swc_plugin_macro",
"tracing",
]
......@@ -7203,9 +7568,9 @@ checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b"
[[package]]
name = "swc"
version = "55.0.0"
version = "56.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "928fcdf3eb0f7f3aced6002421a1cde696d1bafd5070acf44c4b27164603f608"
checksum = "95ceeae046d148c779be1bb207909600adbda56ca33cb6e47587c460bd45b1a9"
dependencies = [
"anyhow",
"base64 0.22.1",
......@@ -7223,31 +7588,31 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"swc_compiler_base",
"swc_config",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen 24.0.0",
"swc_ecma_ext_transforms",
"swc_ecma_loader",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_minifier 46.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_preset_env",
"swc_ecma_transforms",
"swc_ecma_transforms_base",
"swc_ecma_transforms 48.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_compat",
"swc_ecma_transforms_module",
"swc_ecma_transforms_optimization",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_error_reporters",
"swc_ecma_transforms_optimization 40.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_error_reporters 21.0.0",
"swc_node_comments",
"swc_plugin_backend_wasmer",
"swc_plugin_proxy",
"swc_plugin_runner",
"swc_sourcemap",
"swc_plugin_proxy 21.0.0",
"swc_plugin_runner 25.0.0",
"swc_sourcemap 10.0.2",
"swc_timer",
"swc_transform_common",
"swc_transform_common 13.0.0",
"swc_visit",
"tokio",
"tracing",
......@@ -7262,7 +7627,7 @@ dependencies = [
"clap",
"owo-colors",
"regex",
"swc_core",
"swc_core 58.0.4",
]
[[package]]
......@@ -7316,23 +7681,17 @@ dependencies = [
"anyhow",
"ast_node",
"better_scoped_tls",
"bytecheck 0.8.1",
"bytes-str",
"cbor4ii",
"either",
"from_variant",
"num-bigint",
"once_cell",
"parking_lot",
"rancor",
"rkyv 0.8.10",
"rustc-hash 2.1.1",
"serde",
"shrink-to-fit",
"siphasher",
"swc_atoms",
"swc_eq_ignore_macros",
"swc_sourcemap",
"swc_visit",
"termcolor",
"tracing",
......@@ -7341,28 +7700,61 @@ dependencies = [
]
[[package]]
name = "swc_compiler_base"
version = "48.0.0"
name = "swc_common"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd68ff549974c02a5b3932a2b58938c168e01d7ac4663590afa96968fdcb4fc8"
checksum = "623a4ee8bb19d87de6fc781e44e1696af20136d1c1eabf9f3712ff1fb50b6189"
dependencies = [
"anyhow",
"base64 0.22.1",
"ast_node",
"better_scoped_tls",
"bytecheck 0.8.1",
"bytes-str",
"cbor4ii",
"either",
"from_variant",
"num-bigint",
"once_cell",
"pathdiff",
"rustc-hash 2.1.1",
"parking_lot",
"rancor",
"rkyv 0.8.10",
"rustc-hash 2.1.1",
"serde",
"shrink-to-fit",
"siphasher",
"swc_atoms",
"swc_eq_ignore_macros",
"swc_sourcemap 10.0.2",
"swc_visit",
"termcolor",
"tracing",
"unicode-width 0.2.1",
"url",
]
[[package]]
name = "swc_compiler_base"
version = "49.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9840f1fb3e2c98f55a4b4f7485d062b374d929d94c02dfb5002b9325768678a9"
dependencies = [
"anyhow",
"base64 0.22.1",
"bytes-str",
"once_cell",
"pathdiff",
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_visit",
"swc_sourcemap",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen 24.0.0",
"swc_ecma_minifier 46.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_visit 21.0.0",
"swc_sourcemap 10.0.2",
"swc_timer",
]
......@@ -7384,7 +7776,28 @@ dependencies = [
"serde",
"serde_json",
"swc_config_macro",
"swc_sourcemap",
"swc_sourcemap 9.3.4",
]
[[package]]
name = "swc_config"
version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b9cc428c17cfb0fc7d31177b413d9c131a99a9c2d08ff30260261c4c3058449"
dependencies = [
"anyhow",
"bytes-str",
"dashmap 5.5.3",
"globset",
"indexmap 2.13.0",
"once_cell",
"regex",
"regress",
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_config_macro",
"swc_sourcemap 10.0.2",
]
[[package]]
......@@ -7404,32 +7817,49 @@ name = "swc_core"
version = "57.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b10e3434d100ec55a0b5431987d608989ddf943b7176cc3ac01e0aa8553470c"
dependencies = [
"swc_allocator",
"swc_atoms",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_codegen 23.0.0",
"swc_ecma_parser 34.0.0",
"swc_ecma_transforms_base 37.0.0",
"swc_ecma_visit 20.0.0",
"vergen",
]
[[package]]
name = "swc_core"
version = "58.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b4c5412d3e9b4e88611a4d64d5aca10bc6ccc56a72f14f12d94529c645167b8"
dependencies = [
"binding_macros",
"par-core",
"swc",
"swc_allocator",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen 24.0.0",
"swc_ecma_lints",
"swc_ecma_loader",
"swc_ecma_minifier",
"swc_ecma_parser",
"swc_ecma_minifier 46.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_preset_env",
"swc_ecma_quote_macros",
"swc_ecma_transforms_base",
"swc_ecma_transforms_optimization",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_optimization 40.0.0",
"swc_ecma_transforms_proposal",
"swc_ecma_transforms_react",
"swc_ecma_transforms_testing",
"swc_ecma_transforms_typescript",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_plugin_proxy",
"swc_plugin_runner",
"testing",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_plugin_proxy 21.0.0",
"swc_plugin_runner 25.0.0",
"testing 20.0.0",
"vergen",
]
......@@ -7442,7 +7872,7 @@ dependencies = [
"is-macro",
"string_enum",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
]
[[package]]
......@@ -7456,7 +7886,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_css_codegen_macros",
"swc_css_utils",
......@@ -7481,7 +7911,7 @@ dependencies = [
"bitflags 2.9.1",
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_css_utils",
"swc_css_visit",
......@@ -7496,7 +7926,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_css_utils",
"swc_css_visit",
......@@ -7511,7 +7941,7 @@ dependencies = [
"lexical",
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
]
......@@ -7527,7 +7957,7 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_css_utils",
"swc_css_visit",
......@@ -7556,7 +7986,7 @@ checksum = "bf9564e30ba8af784ac9bd8355a35ec51a3e4aa3ee86495e8cb4b182c6c53a51"
dependencies = [
"serde",
"swc_atoms",
"swc_common",
"swc_common 18.0.1",
"swc_css_ast",
"swc_visit",
]
......@@ -7566,6 +7996,26 @@ name = "swc_ecma_ast"
version = "20.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "252124d0d786aa2338860701a067c93488747dfadbfedb16ac78f386e16a0ac4"
dependencies = [
"bitflags 2.9.1",
"is-macro",
"num-bigint",
"once_cell",
"phf",
"rustc-hash 2.1.1",
"serde",
"string_enum",
"swc_atoms",
"swc_common 18.0.1",
"swc_visit",
"unicode-id-start",
]
[[package]]
name = "swc_ecma_ast"
version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27111582629a1cc116f9cffa6bfa501e6c849e0e66fafdf78cd404dce919117d"
dependencies = [
"bitflags 2.9.1",
"cbor4ii",
......@@ -7578,7 +8028,7 @@ dependencies = [
"shrink-to-fit",
"string_enum",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"swc_visit",
"unicode-id-start",
]
......@@ -7600,8 +8050,31 @@ dependencies = [
"serde",
"swc_allocator",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_codegen_macros",
"tracing",
]
[[package]]
name = "swc_ecma_codegen"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50b8dbdc2be434883934cda8c3f6638130390032c44e1952e543252fcafd67e0"
dependencies = [
"ascii",
"compact_str",
"dragonbox_ecma",
"memchr",
"num-bigint",
"once_cell",
"regex",
"rustc-hash 2.1.1",
"serde",
"swc_allocator",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen_macros",
"tracing",
]
......@@ -7619,39 +8092,39 @@ dependencies = [
[[package]]
name = "swc_ecma_compat_bugfixes"
version = "42.0.0"
version = "43.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c427e6db46fc66b2e5d53f191e798b8d991c22cf47fa495c6c968332cfccb548"
checksum = "0dc75856ed940f4d7dd6c930479fcdc82f3826f3cf766cc0e6d562f6d862065b"
dependencies = [
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_compat_es2015",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_trace_macro",
"tracing",
]
[[package]]
name = "swc_ecma_compat_common"
version = "33.0.0"
version = "34.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d0a11705dc2b2a534e86317056bf85f6dfbc3d188cfd44dd07eb6b986800386"
checksum = "e8d968f907f4e9bff56d6f4a29b8b2e41ad857276c28ab198be6e4cc28d91753"
dependencies = [
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_utils",
"swc_ecma_utils 27.0.0",
]
[[package]]
name = "swc_ecma_compat_es2015"
version = "42.0.0"
version = "43.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c0dccce1836d0c15e9e7114eef1dc39973efd45a8eb266251e551fac12a6cb7"
checksum = "eb06fa8eee27d26df6e6a60c1ca4c59275af7efea6d3f088137e212952369fa3"
dependencies = [
"arrayvec 0.7.6",
"indexmap 2.13.0",
......@@ -7661,131 +8134,131 @@ dependencies = [
"serde_derive",
"smallvec",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_compat_common",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_classes",
"swc_ecma_transforms_macros",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_trace_macro",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2016"
version = "38.0.0"
version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce774431cd21cbb724e29c20e84ed98cbcb5e2b362cc3fa34a35c78b459af66f"
checksum = "35a473127d4730dc01db478fc80021140f513bd94eb31c4d44e1fb6c0dbab9ea"
dependencies = [
"swc_ecma_ast",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2017"
version = "38.0.0"
version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9201214d7b7337c9bd33b0a29e7993b93b6392f73dabf1290bbd9fe28be78eae"
checksum = "c1008be88e6750ff1a868aa14e58a9866336b1372dc515e85aacf409af0e3127"
dependencies = [
"serde",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2018"
version = "39.0.0"
version = "40.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "518959bc86ab0e9717cf1877db13858ff3f5312dad877521b90a782dd2d3c242"
checksum = "2e8ba224f97507565fb08be97d1bcab911eeafe2726f78e473305aa27c9a60e0"
dependencies = [
"serde",
"swc_ecma_ast",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2019"
version = "38.0.0"
version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e292d39a97e708841e6fb5c135e23d9df9f8194945eecef8cc63e9f999a700"
checksum = "482d527b58a8789b23477e7d838f514c9219539da1d231d60f38335d2299ffdf"
dependencies = [
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2020"
version = "40.0.0"
version = "41.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9110bdfd1614351237e67727511b60c0fd070ccec0c8dc7a2b1d7e67ebb4b70"
checksum = "d44c002ae40c600054f791978073981943406f5058a17c027239ff3ba58bcccd"
dependencies = [
"serde",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_compat_es2022",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2021"
version = "38.0.0"
version = "39.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bdf4e0547ba148491e8d00fff315f40d54c928d4dda75f7325106bad5a05002"
checksum = "47fac38a09c94c63222fd90bfe7b526afe6f74bd5e3521e9929c9faa3dd365c3"
dependencies = [
"swc_ecma_ast",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_compat_es2022"
version = "40.0.0"
version = "41.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4251437fce71eb2c4cb24fcc332a74b47682cc8153c1f9dcf8c4add09a20e24c"
checksum = "105286915785d3cf0f1024092cfe9112ee377bfca1e2c6f4a2a76761b6d32416"
dependencies = [
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms_base",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_classes",
"swc_ecma_transforms_macros",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_trace_macro",
"tracing",
]
[[package]]
name = "swc_ecma_compat_regexp"
version = "1.0.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35c267d92e58db3f3c00cf3f7e93ee72391f5cc2d9a5877db63ca95d7495a535"
checksum = "0a4840cc8ba3f03756c2b3f5f73c53964f77b6ba7b8164ce53772b56016e0331"
dependencies = [
"icu_properties 2.1.2",
"swc_ecma_regexp_ast",
......@@ -7794,15 +8267,15 @@ dependencies = [
[[package]]
name = "swc_ecma_ext_transforms"
version = "26.0.0"
version = "27.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a6aed670f87cde675f40dcd0ff5196f3cec9b2bc7e6fed12adf5b808f18eb69"
checksum = "044961e27feff62f927950355f1a66c0599653727c106b929456cc635b858d86"
dependencies = [
"phf",
"swc_common",
"swc_ecma_ast",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
......@@ -7812,16 +8285,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c9adff1f01550ef653e262ad709a2914d3dd6cfd559aea2e28eeeab8f895981"
dependencies = [
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_visit 20.0.0",
]
[[package]]
name = "swc_ecma_hooks"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d15c2c9ef00252fed90e19e709e77fe6160922bb6838e6906a364bceaee0d744"
dependencies = [
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_lints"
version = "27.0.0"
version = "28.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b21488b346ed189e52c641259307eb6d5e322f3c832696358a661660ce8e8932"
checksum = "67b4dafded16a43a165dbbb7e423222326155129b8bf439e5d2c9c6ec3737750"
dependencies = [
"auto_impl",
"dashmap 5.5.3",
......@@ -7831,18 +8316,18 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_loader"
version = "18.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b36b38399698e77c3d63838c2e32e40df0d5e55e489bef529a77a349a722c7a"
checksum = "55b798cee30450c4ea55f17cd6968e69097411bc3c5ec3ca3430e1d0ebfaf629"
dependencies = [
"anyhow",
"dashmap 5.5.3",
......@@ -7856,7 +8341,7 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"tracing",
]
......@@ -7882,17 +8367,54 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_hooks",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_transforms_optimization",
"swc_ecma_usage_analyzer",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_config 3.1.2",
"swc_ecma_ast 20.0.1",
"swc_ecma_codegen 23.0.0",
"swc_ecma_hooks 0.4.0",
"swc_ecma_parser 34.0.0",
"swc_ecma_transforms_base 37.0.0",
"swc_ecma_transforms_optimization 39.0.0",
"swc_ecma_usage_analyzer 28.0.0",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"swc_timer",
"tracing",
]
[[package]]
name = "swc_ecma_minifier"
version = "46.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3975f1c2347ec502c975e4df17dff27f5ba70281e02a314448055ad689979e2a"
dependencies = [
"arrayvec 0.7.6",
"bitflags 2.9.1",
"indexmap 2.13.0",
"num-bigint",
"num_cpus",
"once_cell",
"par-core",
"par-iter",
"parking_lot",
"phf",
"radix_fmt",
"rustc-hash 2.1.1",
"ryu-js",
"serde",
"serde_json",
"swc_atoms",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen 24.0.0",
"swc_ecma_hooks 0.5.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_optimization 40.0.0",
"swc_ecma_usage_analyzer 29.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_timer",
"tracing",
]
......@@ -7913,16 +8435,37 @@ dependencies = [
"smartstring",
"stacker",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"tracing",
]
[[package]]
name = "swc_ecma_parser"
version = "35.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "943b8743c57783b35b6c173b0a8ef539a6c1d06ee5d1588b2821992c3fd35f39"
dependencies = [
"bitflags 2.9.1",
"either",
"num-bigint",
"phf",
"rustc-hash 2.1.1",
"seq-macro",
"serde",
"smartstring",
"stacker",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_preset_env"
version = "48.0.0"
version = "49.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3903fcc6dc4f51e898c643ece06bab6591237d466e0e69226810677b48bcbeb"
checksum = "b8ac43696834e7125772e94f514bf1dea183c97bac510376d27088f7edce63d8"
dependencies = [
"anyhow",
"foldhash 0.1.5",
......@@ -7935,42 +8478,42 @@ dependencies = [
"serde_json",
"string_enum",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transformer",
"swc_ecma_transforms",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_transforms 48.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_quote_macros"
version = "34.0.0"
version = "35.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3adaa86c70b29508cc8ed9a4ff9690e5e47fffc12ac36a12ee4abe4acec16edd"
checksum = "d77bc4bcdd13ba12e3a92e94effb56154d2d87aa903b2eeb2861b41877e24fd5"
dependencies = [
"anyhow",
"proc-macro2",
"quote",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_parser 35.0.0",
"swc_macros_common",
"syn 2.0.104",
]
[[package]]
name = "swc_ecma_regexp"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fb1c912d1f73009546bc8271feb40a2371f148fcde6a4b6f4973a1ce167bc07"
checksum = "729ebdefd7efa85c90c4a1b273d9bff533c63c24caa494ee884996aa0230005f"
dependencies = [
"phf",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"swc_ecma_regexp_ast",
"swc_ecma_regexp_common",
"swc_ecma_regexp_visit",
......@@ -7979,14 +8522,14 @@ dependencies = [
[[package]]
name = "swc_ecma_regexp_ast"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "568b408134ad2e201cd48db4d1ed7bed40abbec6e242fb8492a066834f674b11"
checksum = "b35f7e4a026dbd065141006fc36556848c9892337f8213dd607198cd9c50da67"
dependencies = [
"bitflags 2.9.1",
"is-macro",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"swc_ecma_regexp_common",
]
......@@ -7998,46 +8541,46 @@ checksum = "0a0a09a9e4dc09c97f07273695bd4b58e46b99dbb0cb788ce0dad2a181eb1e94"
[[package]]
name = "swc_ecma_regexp_visit"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "258ea946dddb367af135b8255c6ddd0b86a066f3d3c7d4bca2e624b77cd1b51f"
checksum = "eae310f36e2f8b09e352d2165102d0c9502080407845523c97ba54827d278089"
dependencies = [
"serde",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
"swc_ecma_regexp_ast",
"swc_visit",
]
[[package]]
name = "swc_ecma_testing"
version = "19.0.0"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "177244625cdecd268a07534c3b087f7f263604dd40f3ec7c7a984ca95351b632"
checksum = "40134d12eabe326a97d10b19dfacf98fdc92d93e9c78008948d2992f6d3767b9"
dependencies = [
"anyhow",
"hex",
"sha2",
"testing",
"testing 20.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_transformer"
version = "9.0.0"
version = "10.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "133f705294aa6319310a98eed2e140ab34116f71b17174e2a994bb159d51fe9b"
checksum = "d1cda2816c9b381606dec412433804f36a01985b226b46f59bea4ca2de4c9191"
dependencies = [
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_compat_regexp",
"swc_ecma_hooks",
"swc_ecma_hooks 0.5.0",
"swc_ecma_regexp",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
......@@ -8048,16 +8591,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fbe202e4a5b51a9f29275eac42fb785e907ac359edc61984788ff046b4fb20f"
dependencies = [
"par-core",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_transforms_base 37.0.0",
"swc_ecma_utils 26.0.1",
]
[[package]]
name = "swc_ecma_transforms"
version = "48.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e3b8482a2ccf4f9b031aef2408c57d98d816b44cdab5852a636663851c2ae80"
dependencies = [
"par-core",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_compat",
"swc_ecma_transforms_module",
"swc_ecma_transforms_optimization",
"swc_ecma_transforms_optimization 40.0.0",
"swc_ecma_transforms_proposal",
"swc_ecma_transforms_react",
"swc_ecma_transforms_typescript",
"swc_ecma_utils",
"swc_ecma_utils 27.0.0",
]
[[package]]
......@@ -8074,39 +8630,61 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_parser 34.0.0",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_transforms_base"
version = "38.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a6bfa9bb82de047afae2eadef24e7ac4e4578fe11c977d8f61423131bdef9e4"
dependencies = [
"better_scoped_tls",
"indexmap 2.13.0",
"once_cell",
"par-core",
"phf",
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_transforms_classes"
version = "37.0.0"
version = "38.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cd626c92e18463806ec5822d5cd6841e6903f92b7e6bd7348dba2179274932b"
checksum = "d5f1701026c80526a50c822e212196650a49cc8dfb4e8fa190ce274a066639d3"
dependencies = [
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_transforms_compat"
version = "43.0.0"
version = "44.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed73c7ec4346508a9d63b98e2759b5da04e61667e5df1fd4d8ccfe629a75c45d"
checksum = "fa3a557bf293ea6e19c780bb147f380f5f97f7f0955a49db85a8e1abcc5d08b9"
dependencies = [
"indexmap 2.13.0",
"par-core",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_compat_bugfixes",
"swc_ecma_compat_common",
"swc_ecma_compat_es2015",
......@@ -8117,9 +8695,9 @@ dependencies = [
"swc_ecma_compat_es2020",
"swc_ecma_compat_es2021",
"swc_ecma_compat_es2022",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
......@@ -8137,9 +8715,9 @@ dependencies = [
[[package]]
name = "swc_ecma_transforms_module"
version = "41.0.0"
version = "42.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69fcedd707e9eb35521cdd6349633ad87ebd17dbde7e7bf0edb21a14b5f8d5fb"
checksum = "a3f72dc1e23c723c34248d0cf7f0aa8e9ba968cf28d4272c08a84310c2ceb7ce"
dependencies = [
"Inflector",
"anyhow",
......@@ -8152,14 +8730,14 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_loader",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_parser 35.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
......@@ -8178,38 +8756,62 @@ dependencies = [
"rustc-hash 2.1.1",
"serde_json",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_parser 34.0.0",
"swc_ecma_transforms_base 37.0.0",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_transforms_optimization"
version = "40.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f43dc268f8164b5363c44a0fe9408808155f1506684e25f32685f77fe9df4b6"
dependencies = [
"bytes-str",
"dashmap 5.5.3",
"indexmap 2.13.0",
"once_cell",
"par-core",
"petgraph 0.7.1",
"rustc-hash 2.1.1",
"serde_json",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_transforms_proposal"
version = "37.0.0"
version = "38.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86b05992a81ecd5d1bda71ae1f7300d28d466dde6fbd0e5dc1084f4325e6a097"
checksum = "19f57be5a8374390872b4311d04f924da5ee832315198db777289aa1decd5a44"
dependencies = [
"either",
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_classes",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_transforms_react"
version = "41.0.0"
version = "42.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "652fe0ed56d05ff0776fd93ea1229ec1b4acdc9cb39d195ae1a84ddb5e9e9495"
checksum = "d6e3d8ec79bf7d04c8fe05b31b667d4de3dd60fa0f489ab25efe8cb4bbbfe3f1"
dependencies = [
"base64 0.22.1",
"bytes-str",
......@@ -8220,21 +8822,21 @@ dependencies = [
"sha1",
"string_enum",
"swc_atoms",
"swc_common",
"swc_config",
"swc_ecma_ast",
"swc_ecma_hooks",
"swc_ecma_parser",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 19.0.0",
"swc_config 4.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_hooks 0.5.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
name = "swc_ecma_transforms_testing"
version = "41.0.0"
version = "42.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1385bece088a1c51d0c3c379642eacf5ed9a69c1b6fe5c4c07878eeecbb55ff8"
checksum = "09c877d67f86dd26c85470df2d0db9f4008b5d4b9734950780cd200db5181c9b"
dependencies = [
"ansi_term",
"anyhow",
......@@ -8243,35 +8845,35 @@ dependencies = [
"serde",
"serde_json",
"sha2",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_parser",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_codegen 24.0.0",
"swc_ecma_parser 35.0.0",
"swc_ecma_testing",
"swc_ecma_transforms_base",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_sourcemap",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_sourcemap 10.0.2",
"tempfile",
"testing",
"testing 20.0.0",
]
[[package]]
name = "swc_ecma_transforms_typescript"
version = "41.0.0"
version = "42.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c59c1d87f4c36161833462cbf16d769fce63158da04a42dbb83c8fac7ee8e04e"
checksum = "7a87d3eb0b68efa61c5d467d38d1e6f4879a6f1b84526603b8e8b964458ffebb"
dependencies = [
"bytes-str",
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_transforms_base",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_transforms_base 38.0.0",
"swc_ecma_transforms_react",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
]
[[package]]
......@@ -8284,10 +8886,28 @@ dependencies = [
"indexmap 2.13.0",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"swc_timer",
"tracing",
]
[[package]]
name = "swc_ecma_usage_analyzer"
version = "29.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26a2082f0ab640cb8fa48c7b5708000c188178a891c9cb970ad714e40350825"
dependencies = [
"bitflags 2.9.1",
"indexmap 2.13.0",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_utils 27.0.0",
"swc_ecma_visit 21.0.0",
"swc_timer",
"tracing",
]
......@@ -8305,9 +8925,28 @@ dependencies = [
"par-core",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_visit 20.0.0",
"tracing",
]
[[package]]
name = "swc_ecma_utils"
version = "27.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c91e3ed13767ac74670e9cc9895d8c3502a9086fe69fe8a23295da08e6f7e02"
dependencies = [
"dragonbox_ecma",
"indexmap 2.13.0",
"num_cpus",
"once_cell",
"par-core",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_ecma_visit 21.0.0",
"tracing",
]
......@@ -8316,13 +8955,28 @@ name = "swc_ecma_visit"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e971a258717db3dc8939c38410d8b8cb8126f1b05b9758672daa7cae3e0248c2"
dependencies = [
"new_debug_unreachable",
"num-bigint",
"swc_atoms",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_visit",
"tracing",
]
[[package]]
name = "swc_ecma_visit"
version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c1b3a04c999c14f09d81c959f8a84f71d594f2ad2456470eb38d78532e82dda"
dependencies = [
"new_debug_unreachable",
"num-bigint",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_visit",
"tracing",
]
......@@ -8342,13 +8996,13 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_codegen",
"swc_ecma_transforms",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_sourcemap",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_codegen 23.0.0",
"swc_ecma_transforms 47.0.0",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"swc_sourcemap 9.3.4",
"swc_trace_macro",
"tracing",
]
......@@ -8374,7 +9028,20 @@ dependencies = [
"miette",
"once_cell",
"serde",
"swc_common",
"swc_common 18.0.1",
]
[[package]]
name = "swc_error_reporters"
version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bce8f4474b6f874cc49d745b41d610342a3ea0e1dc57dbc4bf223162b196e7a"
dependencies = [
"anyhow",
"miette",
"once_cell",
"serde",
"swc_common 19.0.0",
]
[[package]]
......@@ -8390,32 +9057,43 @@ dependencies = [
[[package]]
name = "swc_node_comments"
version = "18.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e110f3d5684e9c087450ee522d4b8ba68fd91964992984032cc00194a212cde4"
checksum = "cec41c72e5a6a5c5591b7ea4358b1ac64d6d6fac8209ff9e083bce53db6d7b0a"
dependencies = [
"dashmap 5.5.3",
"rustc-hash 2.1.1",
"swc_atoms",
"swc_common",
"swc_common 19.0.0",
]
[[package]]
name = "swc_plugin_backend_wasmer"
version = "7.0.0"
version = "8.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a6a8648be03aaeaac5251823651d9b9c86a57db5e43064764c6b7fa5437d99"
checksum = "289f5d26a5ba945c4f4234fd1d80cd1c11936f1e25c55ca9539f3cf6222e188f"
dependencies = [
"anyhow",
"enumset",
"parking_lot",
"swc_common",
"swc_plugin_runner",
"swc_common 19.0.0",
"swc_plugin_runner 25.0.0",
"wasmer",
"wasmer-compiler-cranelift",
"wasmer-wasix",
]
[[package]]
name = "swc_plugin_backend_wasmtime"
version = "0.0.0"
dependencies = [
"anyhow",
"once_cell",
"swc_plugin_runner 24.0.0",
"wasmtime",
"wasmtime-wasi",
]
[[package]]
name = "swc_plugin_macro"
version = "1.1.0"
......@@ -8432,12 +9110,26 @@ name = "swc_plugin_proxy"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78e1a9d26be495289cb07b9d73222f92f60b74d47904169d3ce4977600ec11e"
dependencies = [
"better_scoped_tls",
"rustc-hash 2.1.1",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_trace_macro",
"tracing",
]
[[package]]
name = "swc_plugin_proxy"
version = "21.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa426e25a63f653fd7efb19f5c684057e66572773ebbd176e8be38f3b7378e75"
dependencies = [
"better_scoped_tls",
"cbor4ii",
"rustc-hash 2.1.1",
"swc_common",
"swc_ecma_ast",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_trace_macro",
"tracing",
]
......@@ -8447,6 +9139,25 @@ name = "swc_plugin_runner"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a48f119fba50bb6bbf54366fc37a7e0c4d94a641936a082330cc6ab8e3f947d"
dependencies = [
"anyhow",
"parking_lot",
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_atoms",
"swc_common 18.0.1",
"swc_plugin_proxy 20.0.0",
"swc_transform_common 12.0.0",
"tracing",
"vergen",
]
[[package]]
name = "swc_plugin_runner"
version = "25.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6a0d20fa98d2a94ddb82d924ac98175a7e10d607d3bfd007bf72981b1dcc218"
dependencies = [
"anyhow",
"blake3",
......@@ -8455,10 +9166,10 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_plugin_proxy",
"swc_transform_common",
"swc_common 19.0.0",
"swc_ecma_ast 21.0.0",
"swc_plugin_proxy 21.0.0",
"swc_transform_common 13.0.0",
"tracing",
"vergen",
]
......@@ -8474,10 +9185,10 @@ dependencies = [
"serde",
"serde_json",
"swc_atoms",
"swc_common",
"swc_ecma_ast",
"swc_ecma_utils",
"swc_ecma_visit",
"swc_common 18.0.1",
"swc_ecma_ast 20.0.1",
"swc_ecma_utils 26.0.1",
"swc_ecma_visit 20.0.0",
"tracing",
]
......@@ -8500,6 +9211,25 @@ dependencies = [
"url",
]
[[package]]
name = "swc_sourcemap"
version = "10.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c421e5e39e43a4b1b70c07922d7bffd5c22e8eff1340c0b15d0bfd0328822ee"
dependencies = [
"base64-simd 0.8.0",
"bitvec",
"bytes-str",
"data-encoding",
"debugid",
"if_chain",
"rustc-hash 2.1.1",
"serde",
"serde_json",
"unicode-id-start",
"url",
]
[[package]]
name = "swc_timer"
version = "1.0.0"
......@@ -8528,7 +9258,19 @@ dependencies = [
"better_scoped_tls",
"rustc-hash 2.1.1",
"serde",
"swc_common",
"swc_common 18.0.1",
]
[[package]]
name = "swc_transform_common"
version = "13.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1874cae422d398137e9b7cb39ceb2d91068342ca152ab3137709dbc175cc965f"
dependencies = [
"better_scoped_tls",
"rustc-hash 2.1.1",
"serde",
"swc_common 19.0.0",
]
[[package]]
......@@ -8606,6 +9348,22 @@ dependencies = [
"version-compare",
]
[[package]]
name = "system-interface"
version = "0.27.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc4592f674ce18521c2a81483873a49596655b179f71c5e05d10c1fe66c78745"
dependencies = [
"bitflags 2.9.1",
"cap-fs-ext",
"cap-std",
"fd-lock",
"io-lifetimes",
"rustix 0.38.41",
"windows-sys 0.59.0",
"winx",
]
[[package]]
name = "tabled"
version = "0.10.0"
......@@ -8654,6 +9412,12 @@ version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "target-lexicon"
version = "0.13.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
[[package]]
name = "target-triple"
version = "1.0.0"
......@@ -8709,9 +9473,30 @@ dependencies = [
[[package]]
name = "testing"
version = "19.0.0"
version = "19.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1506c602222ebab5d96100180f8d3c015b2394eceb00a46d20c25b8b1e5100"
dependencies = [
"cargo_metadata 0.18.1",
"difference",
"once_cell",
"pretty_assertions",
"regex",
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_common 18.0.1",
"swc_error_reporters 20.0.0",
"testing_macros",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "testing"
version = "20.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1506c602222ebab5d96100180f8d3c015b2394eceb00a46d20c25b8b1e5100"
checksum = "137ed830e8e9c80b84a2579039ab340f5bf3f1aa1c72e5e41d38fafef2c9d21d"
dependencies = [
"cargo_metadata 0.18.1",
"difference",
......@@ -8721,8 +9506,8 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"serde_json",
"swc_common",
"swc_error_reporters",
"swc_common 19.0.0",
"swc_error_reporters 21.0.0",
"testing_macros",
"tracing",
"tracing-subscriber",
......@@ -9276,6 +10061,17 @@ dependencies = [
"tracing-serde",
]
[[package]]
name = "trait-variant"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
]
[[package]]
name = "triomphe"
version = "0.1.12"
......@@ -9876,7 +10672,7 @@ dependencies = [
"regex",
"rustc-hash 2.1.1",
"serde",
"swc_core",
"swc_core 58.0.4",
"tokio",
"tracing",
"tracing-subscriber",
......@@ -9948,8 +10744,8 @@ dependencies = [
"serde",
"serde_json",
"smallvec",
"swc_core",
"swc_sourcemap",
"swc_core 58.0.4",
"swc_sourcemap 9.3.4",
"tempfile",
"tokio",
"tracing",
......@@ -9995,7 +10791,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"smallvec",
"swc_core",
"swc_core 58.0.4",
"tokio",
"tracing",
"turbo-bincode",
......@@ -10073,8 +10869,8 @@ dependencies = [
"serde_json",
"smallvec",
"strsim 0.11.1",
"swc_core",
"swc_sourcemap",
"swc_core 58.0.4",
"swc_sourcemap 9.3.4",
"tokio",
"tracing",
"turbo-bincode",
......@@ -10118,9 +10914,9 @@ dependencies = [
"serde_json",
"styled_components",
"styled_jsx",
"swc_core",
"swc_core 58.0.4",
"swc_emotion",
"swc_plugin_backend_wasmer",
"swc_plugin_backend_wasmtime",
"swc_relay",
"tracing",
"turbo-rcstr",
......@@ -10202,7 +10998,7 @@ dependencies = [
"console-subscriber",
"rustc-hash 2.1.1",
"serde",
"swc_core",
"swc_core 58.0.4",
"tokio",
"tracing",
"tracing-subscriber",
......@@ -10320,7 +11116,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"parking_lot",
"swc_core",
"swc_core 58.0.4",
"turbo-rcstr",
"turbo-tasks",
"turbopack-core",
......@@ -10356,7 +11152,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde",
"serde_json",
"testing",
"testing 19.0.0",
"tokio",
"tracing-subscriber",
"turbo-rcstr",
......@@ -10973,7 +11769,7 @@ dependencies = [
"rustc-hash 2.1.1",
"serde-wasm-bindgen 0.4.5",
"serde_json",
"swc_core",
"swc_core 58.0.4",
"wasm-bindgen",
"wasm-bindgen-futures",
]
......@@ -11049,6 +11845,16 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "wasm-encoder"
version = "0.221.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc8444fe4920de80a4fe5ab564fff2ae58b6b73166b89751f8c6c93509da32e5"
dependencies = [
"leb128",
"wasmparser 0.221.3",
]
[[package]]
name = "wasm-encoder"
version = "0.235.0"
......@@ -11101,7 +11907,7 @@ dependencies = [
"serde-wasm-bindgen 0.6.5",
"shared-buffer",
"tar",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"tracing",
"wasm-bindgen",
......@@ -11137,7 +11943,7 @@ dependencies = [
"self_cell",
"shared-buffer",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"wasmer-types",
"wasmer-vm",
......@@ -11152,15 +11958,15 @@ version = "6.1.0-rc.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a69f548bcccd4791b2647e0d748eb8ddd4d0856233778867c8b0db3781a82ca1"
dependencies = [
"cranelift-codegen",
"cranelift-entity",
"cranelift-frontend",
"cranelift-codegen 0.110.2",
"cranelift-entity 0.110.2",
"cranelift-frontend 0.110.2",
"gimli 0.28.1",
"itertools 0.12.1",
"more-asserts",
"rayon",
"smallvec",
"target-lexicon",
"target-lexicon 0.12.16",
"tracing",
"wasmer-compiler",
"wasmer-types",
......@@ -11273,7 +12079,7 @@ dependencies = [
"rkyv 0.8.10",
"serde",
"sha2",
"target-lexicon",
"target-lexicon 0.12.16",
"thiserror 1.0.69",
"wasmparser 0.224.1",
"xxhash-rust",
......@@ -11406,6 +12212,19 @@ dependencies = [
"wasmer-types",
]
[[package]]
name = "wasmparser"
version = "0.221.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d06bfa36ab3ac2be0dee563380147a5b81ba10dd8885d7fbbc9eb574be67d185"
dependencies = [
"bitflags 2.9.1",
"hashbrown 0.15.4",
"indexmap 2.13.0",
"semver",
"serde",
]
[[package]]
name = "wasmparser"
version = "0.224.1"
......@@ -11440,6 +12259,267 @@ dependencies = [
"semver",
]
[[package]]
name = "wasmprinter"
version = "0.221.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7343c42a97f2926c7819ff81b64012092ae954c5d83ddd30c9fcdefd97d0b283"
dependencies = [
"anyhow",
"termcolor",
"wasmparser 0.221.3",
]
[[package]]
name = "wasmtime"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11976a250672556d1c4c04c6d5d7656ac9192ac9edc42a4587d6c21460010e69"
dependencies = [
"anyhow",
"async-trait",
"bitflags 2.9.1",
"bumpalo",
"cc",
"cfg-if",
"encoding_rs",
"hashbrown 0.14.5",
"indexmap 2.13.0",
"libc",
"log",
"mach2",
"memfd",
"object 0.36.7",
"once_cell",
"paste",
"postcard",
"psm",
"pulley-interpreter",
"rustix 0.38.41",
"semver",
"serde",
"serde_derive",
"smallvec",
"sptr",
"target-lexicon 0.13.5",
"trait-variant",
"wasmparser 0.221.3",
"wasmtime-asm-macros",
"wasmtime-component-macro",
"wasmtime-component-util",
"wasmtime-cranelift",
"wasmtime-environ",
"wasmtime-fiber",
"wasmtime-jit-icache-coherence",
"wasmtime-math",
"wasmtime-slab",
"wasmtime-versioned-export-macros",
"wasmtime-winch",
"windows-sys 0.59.0",
]
[[package]]
name = "wasmtime-asm-macros"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f178b0d125201fbe9f75beaf849bd3e511891f9e45ba216a5b620802ccf64f2"
dependencies = [
"cfg-if",
]
[[package]]
name = "wasmtime-component-macro"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d74de6592ed945d0a602f71243982a304d5d02f1e501b638addf57f42d57dfaf"
dependencies = [
"anyhow",
"proc-macro2",
"quote",
"syn 2.0.104",
"wasmtime-component-util",
"wasmtime-wit-bindgen",
"wit-parser 0.221.3",
]
[[package]]
name = "wasmtime-component-util"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707dc7b3c112ab5a366b30cfe2fb5b2f8e6a0f682f16df96a5ec582bfe6f056e"
[[package]]
name = "wasmtime-cranelift"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "366be722674d4bf153290fbcbc4d7d16895cc82fb3e869f8d550ff768f9e9e87"
dependencies = [
"anyhow",
"cfg-if",
"cranelift-codegen 0.116.1",
"cranelift-control 0.116.1",
"cranelift-entity 0.116.1",
"cranelift-frontend 0.116.1",
"cranelift-native",
"gimli 0.31.1",
"itertools 0.12.1",
"log",
"object 0.36.7",
"smallvec",
"target-lexicon 0.13.5",
"thiserror 1.0.69",
"wasmparser 0.221.3",
"wasmtime-environ",
"wasmtime-versioned-export-macros",
]
[[package]]
name = "wasmtime-environ"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdadc1af7097347aa276a4f008929810f726b5b46946971c660b6d421e9994ad"
dependencies = [
"anyhow",
"cranelift-bitset 0.116.1",
"cranelift-entity 0.116.1",
"gimli 0.31.1",
"indexmap 2.13.0",
"log",
"object 0.36.7",
"postcard",
"semver",
"serde",
"serde_derive",
"smallvec",
"target-lexicon 0.13.5",
"wasm-encoder 0.221.3",
"wasmparser 0.221.3",
"wasmprinter",
"wasmtime-component-util",
]
[[package]]
name = "wasmtime-fiber"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccba90d4119f081bca91190485650730a617be1fff5228f8c4757ce133d21117"
dependencies = [
"anyhow",
"cc",
"cfg-if",
"rustix 0.38.41",
"wasmtime-asm-macros",
"wasmtime-versioned-export-macros",
"windows-sys 0.59.0",
]
[[package]]
name = "wasmtime-jit-icache-coherence"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec5e8552e01692e6c2e5293171704fed8abdec79d1a6995a0870ab190e5747d1"
dependencies = [
"anyhow",
"cfg-if",
"libc",
"windows-sys 0.59.0",
]
[[package]]
name = "wasmtime-math"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29210ec2aa25e00f4d54605cedaf080f39ec01a872c5bd520ad04c67af1dde17"
dependencies = [
"libm",
]
[[package]]
name = "wasmtime-slab"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb5821a96fa04ac14bc7b158bb3d5cd7729a053db5a74dad396cd513a5e5ccf"
[[package]]
name = "wasmtime-versioned-export-macros"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86ff86db216dc0240462de40c8290887a613dddf9685508eb39479037ba97b5b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
]
[[package]]
name = "wasmtime-wasi"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d1be69bfcab1bdac74daa7a1f9695ab992b9c8e21b9b061e7d66434097e0ca4"
dependencies = [
"anyhow",
"async-trait",
"bitflags 2.9.1",
"bytes",
"cap-fs-ext",
"cap-net-ext",
"cap-rand",
"cap-std",
"cap-time-ext",
"fs-set-times",
"futures",
"io-extras",
"io-lifetimes",
"rustix 0.38.41",
"system-interface",
"thiserror 1.0.69",
"tokio",
"tracing",
"trait-variant",
"url",
"wasmtime",
"wiggle",
"windows-sys 0.59.0",
]
[[package]]
name = "wasmtime-winch"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdbabfb8f20502d5e1d81092b9ead3682ae59988487aafcd7567387b7a43cf8f"
dependencies = [
"anyhow",
"cranelift-codegen 0.116.1",
"gimli 0.31.1",
"object 0.36.7",
"target-lexicon 0.13.5",
"wasmparser 0.221.3",
"wasmtime-cranelift",
"wasmtime-environ",
"winch-codegen",
]
[[package]]
name = "wasmtime-wit-bindgen"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8358319c2dd1e4db79e3c1c5d3a5af84956615343f9f89f4e4996a36816e06e6"
dependencies = [
"anyhow",
"heck 0.5.0",
"indexmap 2.13.0",
"wit-parser 0.221.3",
]
[[package]]
name = "wast"
version = "35.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68"
dependencies = [
"leb128",
]
[[package]]
name = "wast"
version = "235.0.0"
......@@ -11459,7 +12539,7 @@ version = "1.235.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e777e0327115793cb96ab220b98f85327ec3d11f34ec9e8d723264522ef206aa"
dependencies = [
"wast",
"wast 235.0.0",
]
[[package]]
......@@ -11553,6 +12633,48 @@ dependencies = [
"rustix 0.38.41",
]
[[package]]
name = "wiggle"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b9af35bc9629c52c261465320a9a07959164928b4241980ba1cf923b9e6751d"
dependencies = [
"anyhow",
"async-trait",
"bitflags 2.9.1",
"thiserror 1.0.69",
"tracing",
"wasmtime",
"wiggle-macro",
]
[[package]]
name = "wiggle-generate"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cf267dd05673912c8138f4b54acabe6bd53407d9d1536f0fadb6520dd16e101"
dependencies = [
"anyhow",
"heck 0.5.0",
"proc-macro2",
"quote",
"shellexpand",
"syn 2.0.104",
"witx",
]
[[package]]
name = "wiggle-macro"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08c5c473d4198e6c2d377f3809f713ff0c110cab88a0805ae099a82119ee250c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.104",
"wiggle-generate",
]
[[package]]
name = "winapi"
version = "0.3.9"
......@@ -11584,6 +12706,24 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "winch-codegen"
version = "29.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f849ef2c5f46cb0a20af4b4487aaa239846e52e2c03f13fa3c784684552859c"
dependencies = [
"anyhow",
"cranelift-codegen 0.116.1",
"gimli 0.31.1",
"regalloc2 0.11.2",
"smallvec",
"target-lexicon 0.13.5",
"thiserror 1.0.69",
"wasmparser 0.221.3",
"wasmtime-cranelift",
"wasmtime-environ",
]
[[package]]
name = "windows-core"
version = "0.62.2"
......@@ -11974,6 +13114,16 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "winx"
version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d"
dependencies = [
"bitflags 2.9.1",
"windows-sys 0.59.0",
]
[[package]]
name = "wit-bindgen"
version = "0.51.0"
......@@ -11991,7 +13141,7 @@ checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
dependencies = [
"anyhow",
"heck 0.5.0",
"wit-parser",
"wit-parser 0.244.0",
]
[[package]]
......@@ -12050,7 +13200,25 @@ dependencies = [
"wasm-encoder 0.244.0",
"wasm-metadata",
"wasmparser 0.244.0",
"wit-parser",
"wit-parser 0.244.0",
]
[[package]]
name = "wit-parser"
version = "0.221.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "896112579ed56b4a538b07a3d16e562d101ff6265c46b515ce0c701eef16b2ac"
dependencies = [
"anyhow",
"id-arena",
"indexmap 2.13.0",
"log",
"semver",
"serde",
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.221.3",
]
[[package]]
......@@ -12071,6 +13239,18 @@ dependencies = [
"wasmparser 0.244.0",
]
[[package]]
name = "witx"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b"
dependencies = [
"anyhow",
"log",
"thiserror 1.0.69",
"wast 35.0.2",
]
[[package]]
name = "write16"
version = "1.0.0"
......
......@@ -317,7 +317,7 @@ turbopack-trace-utils = { path = "turbopack/crates/turbopack-trace-utils" }
turbopack-wasm = { path = "turbopack/crates/turbopack-wasm" }
# SWC crates
swc_core = { version = "57.0.0", features = [
swc_core = { version = "57.0.0", default-features = false, features = [
"ecma_loader_lru",
"ecma_loader_parking_lot",
"parallel_rayon",
......
use std::{path::Path, sync::Arc};
use std::path::Path;
use once_cell::sync::Lazy;
use swc_plugin_runner::runtime;
use wasmtime::AsContextMut;
/// Identifier for bytecode cache stored in local filesystem.
///
......@@ -38,8 +37,11 @@ struct WasmtimeCache {
module: wasmtime::Module,
}
// WasmtimeInstance needs to wrap Store in a way that satisfies Send + Sync.
// Store itself is Send but not Sync, so we use an UnsafeCell wrapper.
struct WasmtimeInstance {
store: wasmtime::Store<StoreState>,
// Store is !Sync, but we ensure single-threaded access via &mut self methods
store: std::cell::UnsafeCell<wasmtime::Store<StoreState>>,
module: wasmtime::Module,
memory: wasmtime::Memory,
......@@ -48,22 +50,17 @@ struct WasmtimeInstance {
transform_func: wasmtime::TypedFunc<(u32, u32, u32, u32), u32>,
}
// SAFETY: WasmtimeInstance is Sync because all access to store goes through &mut self,
// ensuring single-threaded access. The swc_plugin_runner framework enforces this.
unsafe impl Sync for WasmtimeInstance {}
struct WasmtimeCaller<'a> {
memory: wasmtime::Memory,
alloc_func: wasmtime::TypedFunc<u32, u32>,
free_func: wasmtime::TypedFunc<(u32, u32), u32>,
alloc_func: &'a wasmtime::TypedFunc<u32, u32>,
free_func: &'a wasmtime::TypedFunc<(u32, u32), u32>,
store: &'a mut wasmtime::Store<StoreState>,
}
/// Caller adapter used inside host function callbacks.
/// Wasmtime's `Caller<'_, StoreState>` provides store access directly.
struct WasmtimeCallerRef<'a> {
memory: wasmtime::Memory,
alloc_func: wasmtime::TypedFunc<u32, u32>,
free_func: wasmtime::TypedFunc<(u32, u32), u32>,
caller: wasmtime::Caller<'a, StoreState>,
}
/// The wasmtime-based SWC plugin runtime.
///
/// This implements the `swc_plugin_runner::runtime::Runtime` trait,
......@@ -83,7 +80,7 @@ impl runtime::Runtime for WasmtimeRuntime {
fn init(
&self,
name: &str,
_name: &str,
imports: Vec<(String, runtime::Func)>,
envs: Vec<(String, String)>,
module: runtime::Module,
......@@ -165,9 +162,10 @@ impl runtime::Runtime for WasmtimeRuntime {
)?;
// Store handles in the table for host function callbacks
// Clone the TypedFunc values since they need to be used in multiple places
store.data_mut().table.memory = Some(memory);
store.data_mut().table.alloc_func = Some(alloc_func);
store.data_mut().table.free_func = Some(free_func);
store.data_mut().table.alloc_func = Some(alloc_func.clone());
store.data_mut().table.free_func = Some(free_func.clone());
// Handshake: call diagnostics function to verify plugin initialization
instance
......@@ -175,7 +173,7 @@ impl runtime::Runtime for WasmtimeRuntime {
.call(&mut store, ())?;
Ok(Box::new(WasmtimeInstance {
store,
store: std::cell::UnsafeCell::new(store),
module,
memory,
alloc_func,
......@@ -221,9 +219,11 @@ impl runtime::Instance for WasmtimeInstance {
unresolved_mark: u32,
should_enable_comments_proxy: u32,
) -> anyhow::Result<u32> {
// SAFETY: We have &mut self, ensuring exclusive access to the store
let store = unsafe { &mut *self.store.get() };
self.transform_func
.call(
&mut self.store,
store,
(
program_ptr,
program_len,
......@@ -235,11 +235,13 @@ impl runtime::Instance for WasmtimeInstance {
}
fn caller(&mut self) -> anyhow::Result<Box<dyn runtime::Caller<'_> + '_>> {
// SAFETY: We have &mut self, ensuring exclusive access to the store
let store = unsafe { &mut *self.store.get() };
Ok(Box::new(WasmtimeCaller {
memory: self.memory,
alloc_func: self.alloc_func,
free_func: self.free_func,
store: &mut self.store,
alloc_func: &self.alloc_func,
free_func: &self.free_func,
store,
}))
}
......@@ -286,42 +288,6 @@ impl<'a> runtime::Caller<'a> for WasmtimeCaller<'a> {
}
}
impl<'a> runtime::Caller<'a> for WasmtimeCallerRef<'a> {
fn read_buf(&self, ptr: u32, buf: &mut [u8]) -> anyhow::Result<()> {
let data = self.memory.data(&self.caller);
let start = ptr as usize;
let end = start + buf.len();
if end > data.len() {
anyhow::bail!("read out of bounds: {}..{} > {}", start, end, data.len());
}
buf.copy_from_slice(&data[start..end]);
Ok(())
}
fn write_buf(&mut self, ptr: u32, buf: &[u8]) -> anyhow::Result<()> {
let data = self.memory.data_mut(&mut self.caller);
let start = ptr as usize;
let end = start + buf.len();
if end > data.len() {
anyhow::bail!("write out of bounds: {}..{} > {}", start, end, data.len());
}
data[start..end].copy_from_slice(buf);
Ok(())
}
fn alloc(&mut self, size: u32) -> anyhow::Result<u32> {
self.alloc_func
.call(&mut self.caller, size)
.map_err(Into::into)
}
fn free(&mut self, ptr: u32, size: u32) -> anyhow::Result<u32> {
self.free_func
.call(&mut self.caller, (ptr, size))
.map_err(Into::into)
}
}
/// Register a single host function with the wasmtime linker under the "env" module.
///
/// This bridges the `runtime::Func` closure interface to wasmtime's host function mechanism.
......@@ -344,43 +310,89 @@ fn register_host_func(
results.iter().cloned(),
);
let func = Arc::new(func);
let func_inner = func.func;
let sign = func.sign;
linker.func_new(
"env",
name,
func_type,
move |mut caller, args, results_out| {
// Extract handles from store state. These were set after instantiation.
let memory = caller
.data()
.table
.memory
.expect("memory not set in store state");
let alloc_func = caller
.data()
.table
.alloc_func
.expect("alloc_func not set in store state");
let free_func = caller
.data()
.table
.free_func
.expect("free_func not set in store state");
let mut adapter = WasmtimeCallerRef {
memory,
alloc_func,
free_func,
caller,
};
let input: Vec<runtime::Value> = args[..func.sign.0 as usize]
let input: Vec<runtime::Value> = args[..sign.0 as usize]
.iter()
.map(|v| v.unwrap_i32())
.collect();
let mut output = vec![0i32; func.sign.1 as usize];
let mut output = vec![0i32; sign.1 as usize];
// Use a raw pointer to work around lifetime constraints.
// SAFETY: The pointer is only dereferenced within this closure,
// and we ensure the original caller is not moved or dropped until after all uses.
let caller_ptr: *mut wasmtime::Caller<StoreState> = &mut caller;
struct UnsafeCaller {
caller_ptr: *mut wasmtime::Caller<'static, StoreState>,
}
impl<'a> runtime::Caller<'a> for UnsafeCaller {
fn read_buf(&self, ptr: u32, buf: &mut [u8]) -> anyhow::Result<()> {
// SAFETY: caller_ptr is valid for the duration of the outer closure
let caller = unsafe { &*self.caller_ptr };
let memory = caller.data().table.memory.expect("memory not set");
let data = memory.data(caller);
let start = ptr as usize;
let end = start + buf.len();
if end > data.len() {
anyhow::bail!("read out of bounds: {}..{} > {}", start, end, data.len());
}
buf.copy_from_slice(&data[start..end]);
Ok(())
}
fn write_buf(&mut self, ptr: u32, buf: &[u8]) -> anyhow::Result<()> {
// SAFETY: caller_ptr is valid for the duration of the outer closure
let caller = unsafe { &mut *self.caller_ptr };
let memory = caller.data().table.memory.expect("memory not set");
let data = memory.data_mut(caller);
let start = ptr as usize;
let end = start + buf.len();
if end > data.len() {
anyhow::bail!("write out of bounds: {}..{} > {}", start, end, data.len());
}
data[start..end].copy_from_slice(buf);
Ok(())
}
fn alloc(&mut self, size: u32) -> anyhow::Result<u32> {
// SAFETY: caller_ptr is valid for the duration of the outer closure
let caller = unsafe { &mut *self.caller_ptr };
let alloc_func = caller
.data()
.table
.alloc_func
.as_ref()
.expect("alloc not set")
.clone();
alloc_func.call(caller, size).map_err(Into::into)
}
fn free(&mut self, ptr: u32, size: u32) -> anyhow::Result<u32> {
// SAFETY: caller_ptr is valid for the duration of the outer closure
let caller = unsafe { &mut *self.caller_ptr };
let free_func = caller
.data()
.table
.free_func
.as_ref()
.expect("free not set")
.clone();
free_func.call(caller, (ptr, size)).map_err(Into::into)
}
}
let mut unsafe_caller = UnsafeCaller {
caller_ptr: unsafe { std::mem::transmute(caller_ptr) },
};
(func.func)(&mut adapter, &input, &mut output);
(func_inner)(&mut unsafe_caller, &input, &mut output);
for (i, v) in output.into_iter().enumerate() {
results_out[i] = wasmtime::Val::I32(v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment