Skip to content

Commit 1c6e6ab

Browse files
committed
Breaking changes in 35
1 parent 0b23abe commit 1c6e6ab

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ swc_core = { version = "35.0.0", features = [
304304
"ecma_loader_parking_lot",
305305
"parallel_rayon",
306306
] }
307+
swc_plugin_backend_wasmer = { version = "1.0.0" }
307308
testing = "15.0.0"
308309

309310
# Keep consistent with preset_env_base through swc_core

crates/napi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ plugin = [
1717
"swc_core/plugin_transform_host_native",
1818
"swc_core/plugin_transform_host_native_filesystem_cache",
1919
"swc_core/plugin_transform_host_native_shared_runtime",
20+
"swc_core/plugin_backend_wasmer",
2021
"next-custom-transforms/plugin",
2122
"next-core/plugin",
2223
"turbopack-ecmascript-plugins",

crates/next-core/src/next_shared/transforms/modularize_imports.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl ModularizeImportsTransformer {
100100
skip_default_conversion: v.skip_default_conversion,
101101
handle_default_import: false,
102102
handle_namespace_import: false,
103+
style: None,
103104
}),
104105
)
105106
})

crates/next-custom-transforms/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ remove_console = { workspace = true }
7272
preset_env_base = { workspace = true }
7373

7474
[dev-dependencies]
75-
swc_core = { workspace = true, features = ["testing_transform"] }
75+
swc_core = { workspace = true, features = ["testing_transform", "plugin_backend_wasmer"] }
7676
testing = { workspace = true }

turbopack/crates/turbopack-ecmascript-plugins/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ transform_emotion = []
1616
swc_ecma_transform_plugin = [
1717
"swc_core/plugin_transform_host_native",
1818
"swc_core/plugin_transform_host_native_shared_runtime",
19+
"swc_plugin_backend_wasmer"
1920
]
2021

2122
[lints]
@@ -40,6 +41,7 @@ modularize_imports = { workspace = true }
4041
styled_components = { workspace = true }
4142
styled_jsx = { workspace = true }
4243
swc_core = { workspace = true, features = ["ecma_ast", "ecma_visit", "common"] }
44+
swc_plugin_backend_wasmer = { workspace = true, optional = true }
4345
swc_emotion = { workspace = true }
4446
swc_relay = { workspace = true }
4547

turbopack/crates/turbopack-ecmascript-plugins/src/transform/modularize_imports.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl ModularizeImportsTransformer {
4040
skip_default_conversion: v.skip_default_conversion,
4141
handle_default_import: false,
4242
handle_namespace_import: false,
43+
style: None,
4344
}),
4445
)
4546
})

turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use turbopack_ecmascript::{CustomTransformer, TransformContext};
1515
/// cost of the compilation.
1616
#[turbo_tasks::value(serialization = "none", eq = "manual", into = "new", cell = "new")]
1717
pub struct SwcPluginModule(
18-
#[turbo_tasks(trace_ignore)]
18+
#[turbo_tasks(trace_ignore, debug_ignore)]
1919
#[cfg(feature = "swc_ecma_transform_plugin")]
20-
pub swc_core::plugin_runner::plugin_module_bytes::CompiledPluginModuleBytes,
20+
pub swc_core::plugin_runner::plugin_module_bytes::RawPluginModuleBytes,
2121
// Dummy field to avoid turbo_tasks macro complaining about empty struct.
2222
// This is because we can't import CompiledPluginModuleBytes by default, it should be only
2323
// available for the target / platforms that support swc plugins (which can build wasmer)
@@ -28,15 +28,11 @@ impl SwcPluginModule {
2828
pub fn new(plugin_name: &str, plugin_bytes: Vec<u8>) -> Self {
2929
#[cfg(feature = "swc_ecma_transform_plugin")]
3030
{
31-
Self({
32-
use swc_core::plugin_runner::plugin_module_bytes::{
33-
CompiledPluginModuleBytes, RawPluginModuleBytes,
34-
};
35-
CompiledPluginModuleBytes::from(RawPluginModuleBytes::new(
36-
plugin_name.to_string(),
37-
plugin_bytes,
38-
))
39-
})
31+
use swc_core::plugin_runner::plugin_module_bytes::RawPluginModuleBytes;
32+
Self(RawPluginModuleBytes::new(
33+
plugin_name.to_string(),
34+
plugin_bytes,
35+
))
4036
}
4137

4238
#[cfg(not(feature = "swc_ecma_transform_plugin"))]
@@ -200,8 +196,6 @@ impl CustomTransformer for SwcEcmaTransformPluginsTransformer {
200196
// still have to construct from raw bytes internally to perform actual
201197
// transform.
202198
for (_plugin_name, plugin_config, plugin_module) in plugins.drain(..) {
203-
let runtime =
204-
swc_core::plugin_runner::wasix_runtime::build_wasi_runtime(None);
205199
let mut transform_plugin_executor =
206200
swc_core::plugin_runner::create_plugin_transform_executor(
207201
ctx.source_map,
@@ -210,7 +204,7 @@ impl CustomTransformer for SwcEcmaTransformPluginsTransformer {
210204
None,
211205
plugin_module,
212206
Some(plugin_config),
213-
runtime,
207+
Arc::new(swc_plugin_backend_wasmer::WasmerRuntime),
214208
);
215209

216210
serialized_program = transform_plugin_executor

turbopack/crates/turbopack-ecmascript/src/analyzer/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ impl Analyzer<'_> {
972972

973973
// We cannot analyze recursive IIFE
974974
if let Some(ident) = ident
975-
&& contains_ident_ref(&function.body, &ident.to_id())
975+
&& contains_ident_ref(&function.body, ident)
976976
{
977977
return false;
978978
}

0 commit comments

Comments
 (0)