Unverified Commit 624df11a authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

fix(next-swc-wasm): Only enable turbo-rcstr's napi feature when building the…

fix(next-swc-wasm): Only enable turbo-rcstr's napi feature when building the next-swc-napi crate/package (#80390)

Fixes https://vercel.slack.com/archives/C04KC8A53T7/p1749584921462879

```
pnpm swc-build-wasm
```
parent cd156f92
......@@ -250,7 +250,7 @@ next-custom-transforms = { path = "crates/next-custom-transforms" }
# Turbopack
auto-hash-map = { path = "turbopack/crates/turbo-tasks-auto-hash-map" }
turbo-prehash = { path = "turbopack/crates/turbo-prehash" }
turbo-rcstr = { path = "turbopack/crates/turbo-rcstr", features = ["napi"] }
turbo-rcstr = { path = "turbopack/crates/turbo-rcstr" }
turbo-esregex = { path = "turbopack/crates/turbo-esregex" }
turbo-persistence = { path = "turbopack/crates/turbo-persistence" }
turbo-tasks-malloc = { path = "turbopack/crates/turbo-tasks-malloc", default-features = false }
......
......@@ -98,7 +98,7 @@ swc_core = { workspace = true, features = [
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
lightningcss-napi = { workspace = true }
tokio = { workspace = true, features = ["full"] }
turbo-rcstr = { workspace = true }
turbo-rcstr = { workspace = true, features = ["napi"] }
turbo-tasks = { workspace = true }
turbo-tasks-backend = { workspace = true }
turbo-tasks-fs = { workspace = true }
......
......@@ -3,51 +3,11 @@
/* tslint:disable */
/* eslint-disable */
/**
* @param {string} s
* @param {any} opts
* @returns {any}
*/
export function minifySync(s: string, opts: any): any
/**
* @param {string} s
* @param {any} opts
* @returns {Promise<any>}
*/
export function minify(s: string, opts: any): Promise<any>
/**
* @param {any} s
* @param {any} opts
* @returns {any}
*/
export function transformSync(s: any, opts: any): any
/**
* @param {any} s
* @param {any} opts
* @returns {Promise<any>}
*/
export function transform(s: any, opts: any): Promise<any>
/**
* @param {string} s
* @param {any} opts
* @returns {any}
*/
export function parseSync(s: string, opts: any): any
/**
* @param {string} s
* @param {any} opts
* @returns {Promise<any>}
*/
export function parse(s: string, opts: any): Promise<any>
/**
* @param {string} value
* @param {any} opts
* @returns {any}
*/
export function mdxCompileSync(value: string, opts: any): any
/**
* @param {string} value
* @param {any} opts
* @returns {Promise<any>}
*/
export function mdxCompile(value: string, opts: any): Promise<any>
......@@ -15,9 +15,11 @@ turbo-tasks-hash = { workspace = true }
serde = { workspace = true }
new_debug_unreachable = "1.0.6"
shrink-to-fit = { workspace = true }
napi = { workspace = true, optional = true }
rustc-hash = { workspace = true }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
napi = { workspace = true, optional = true }
[dev-dependencies]
criterion = { workspace = true }
......
......@@ -361,7 +361,10 @@ impl ShrinkToFit for RcStr {
fn shrink_to_fit(&mut self) {}
}
#[cfg(feature = "napi")]
#[cfg(all(feature = "napi", target_family = "wasm"))]
compile_error!("The napi feature cannot be enabled for wasm targets");
#[cfg(all(feature = "napi", not(target_family = "wasm")))]
mod napi_impl {
use napi::{
bindgen_prelude::{FromNapiValue, ToNapiValue, TypeName, ValidateNapiValue},
......
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