diff --git a/bin/self_build.rs b/bin/self_build.rs index dc479a8de..a2ab97e48 100644 --- a/bin/self_build.rs +++ b/bin/self_build.rs @@ -49,7 +49,7 @@ fn main() -> Result<()> { valid_lifting_optimization: false, }; - let transpiled = js_component_bindgen::transpile(adapted_component, opts)?; + let transpiled = js_component_bindgen::transpile(&adapted_component, opts)?; for (filename, contents) in transpiled.files.iter() { let outfile = PathBuf::from("./obj").join(filename); diff --git a/crates/js-component-bindgen-component/src/lib.rs b/crates/js-component-bindgen-component/src/lib.rs index 760b4247c..a7040dbf7 100644 --- a/crates/js-component-bindgen-component/src/lib.rs +++ b/crates/js-component-bindgen-component/src/lib.rs @@ -61,7 +61,7 @@ impl JsComponentBindgen for JsComponentBindgenComponent { files, imports, mut exports, - } = transpile(component, opts) + } = transpile(&component, opts) .map_err(|e| format!("{:?}", e)) .map_err(|e| e.to_string())?; diff --git a/crates/js-component-bindgen/src/lib.rs b/crates/js-component-bindgen/src/lib.rs index 4b9bfc661..036eb8824 100644 --- a/crates/js-component-bindgen/src/lib.rs +++ b/crates/js-component-bindgen/src/lib.rs @@ -79,7 +79,7 @@ pub fn generate_types( /// Generate the JS transpilation bindgen for a given Wasm component binary /// Outputs the file map and import and export metadata for the Transpilation #[cfg(feature = "transpile-bindgen")] -pub fn transpile(component: Vec, opts: TranspileOpts) -> Result { +pub fn transpile(component: &[u8], opts: TranspileOpts) -> Result { let name = opts.name.clone(); let mut files = files::Files::default(); @@ -89,7 +89,7 @@ pub fn transpile(component: Vec, opts: TranspileOpts) -> Result, opts: TranspileOpts) -> Result