Commit e5b08416 authored by Luke Sandberg's avatar Luke Sandberg

Remove wasmer from compilation graph

Replace swc_core/plugin_transform_host_native with granular internal features
(__plugin_transform_host + __plugin_transform_host_schema_v1) to bypass
__plugin_transform_env_native, which is the only feature path that pulls in
wasmer via swc -> swc_plugin_backend_wasmer.

Since we provide WasmtimeRuntime explicitly, we don't need swc's env-native
backend wiring. This removes wasmer and all its sub-crates from cargo tree
entirely, eliminating unnecessary compilation time.
parent e9c985e7
......@@ -6753,19 +6753,6 @@ version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"
[[package]]
name = "rusty_pool"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ed36cdb20de66d89a17ea04b8883fc7a386f2cf877aaedca5005583ce4876ff"
dependencies = [
"crossbeam-channel",
"futures",
"futures-channel",
"futures-executor",
"num_cpus",
]
[[package]]
name = "ruzstd"
version = "0.5.0"
......@@ -11359,12 +11346,9 @@ dependencies = [
"dashmap 6.1.0",
"derive_more 2.0.1",
"dunce",
"filetime",
"fs_extra",
"futures",
"getrandom 0.2.15",
"indexmap 2.13.0",
"libc",
"pin-project-lite",
"replace_with",
"shared-buffer",
......@@ -11740,10 +11724,8 @@ dependencies = [
"tracing",
"wasm-bindgen",
"wasmer-compiler",
"wasmer-compiler-cranelift",
"wasmer-derive",
"wasmer-types",
"wasmer-vm",
"wasmparser 0.224.1",
"wat",
"windows-sys 0.59.0",
......@@ -11792,7 +11774,6 @@ dependencies = [
"gimli 0.28.1",
"itertools 0.12.1",
"more-asserts",
"rayon",
"smallvec",
"target-lexicon 0.12.16",
"tracing",
......@@ -11977,7 +11958,6 @@ dependencies = [
"pin-utils",
"rand 0.8.5",
"rkyv 0.8.10",
"rusty_pool",
"semver",
"serde",
"serde_derive",
......
......@@ -93,7 +93,8 @@ process_pool = ["turbopack-node/process_pool"]
worker_pool = ["turbopack-node/worker_pool"]
next-font-local = []
plugin = [
"swc_core/plugin_transform_host_native",
"swc_core/__plugin_transform_host",
"swc_core/__plugin_transform_host_schema_v1",
"turbopack-ecmascript-plugins/swc_ecma_transform_plugin",
]
image-webp = ["turbopack-image/webp"]
......
......@@ -6,7 +6,8 @@ publish = false
[features]
plugin = [
"swc_core/plugin_transform_host_native",
"swc_core/__plugin_transform_host",
"swc_core/__plugin_transform_host_schema_v1",
"turbopack-ecmascript-plugins/swc_ecma_transform_plugin",
]
......@@ -75,5 +76,5 @@ preset_env_base = { workspace = true }
[dev-dependencies]
testing = { workspace = true }
# effectively enable the "plugin" feature for tests
swc_core = { workspace = true, features = ["testing_transform", "plugin_transform_host_native"] }
swc_core = { workspace = true, features = ["testing_transform", "__plugin_transform_host", "__plugin_transform_host_schema_v1"] }
turbopack-ecmascript-plugins = { workspace = true, features = ["swc_ecma_transform_plugin"] }
......@@ -14,9 +14,10 @@ crate-type = ["cdylib", "rlib"]
# time (i.e wasmer/default vs wasmer/js-default) while cargo merges all the
# features at once.
plugin = [
"swc_core/plugin_transform_host_native",
# Use granular plugin features to avoid pulling in wasmer via __plugin_transform_env_native.
"swc_core/__plugin_transform_host",
"swc_core/__plugin_transform_host_schema_v1",
"swc_core/plugin_transform_host_native_filesystem_cache",
"swc_core/plugin_transform_host_native_shared_runtime",
"dep:swc_plugin_backend_wasmtime",
"next-custom-transforms/plugin",
"next-core/plugin",
......
......@@ -14,8 +14,12 @@ default = ["swc_ecma_transform_plugin"]
transform_emotion = []
# [NOTE]: Be careful to explicitly enable this only for the supported platform / targets.
swc_ecma_transform_plugin = [
"swc_core/plugin_transform_host_native",
"swc_core/plugin_transform_host_native_shared_runtime",
# Use granular plugin features to avoid pulling in wasmer via __plugin_transform_env_native.
# __plugin_transform_host provides the plugin runner types and proxy re-exports.
# __plugin_transform_host_schema_v1 provides the schema version support.
# We provide WasmtimeRuntime explicitly, so we don't need swc's env-native backend wiring.
"swc_core/__plugin_transform_host",
"swc_core/__plugin_transform_host_schema_v1",
"swc_plugin_backend_wasmtime"
]
......
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