diff --git a/crates/js-component-bindgen-component/src/lib.rs b/crates/js-component-bindgen-component/src/lib.rs index 646ca102e..2cfd8c914 100644 --- a/crates/js-component-bindgen-component/src/lib.rs +++ b/crates/js-component-bindgen-component/src/lib.rs @@ -169,7 +169,7 @@ impl bindings::Guest for JsComponentBindgenComponent { .build(); let files = js_component_bindgen::generate_types(&name, resolve, world, opts) - .with_context(|| format!("generating types for [{}]", &name)) + .with_context(|| format!("generating types for [{}]", name)) .map_err(|e| e.to_string())?; Ok(files) diff --git a/crates/js-component-bindgen/src/esm_bindgen.rs b/crates/js-component-bindgen/src/esm_bindgen.rs index 3162bb6c8..3c312d14d 100644 --- a/crates/js-component-bindgen/src/esm_bindgen.rs +++ b/crates/js-component-bindgen/src/esm_bindgen.rs @@ -57,9 +57,9 @@ impl EsmBindgen { ImportBinding::Local(local) => { panic!( "Internal bindgen error: Import '{}' cannot be both an interface '{}' and a function '{}'", - &path[0..i + 1].join("."), - &path[i + 1..].join("."), - &local[0], + path[0..i + 1].join("."), + path[i + 1..].join("."), + local[0], ); } }; diff --git a/crates/js-component-bindgen/src/transpile_bindgen.rs b/crates/js-component-bindgen/src/transpile_bindgen.rs index 1cb58c8c0..2f7e789fe 100644 --- a/crates/js-component-bindgen/src/transpile_bindgen.rs +++ b/crates/js-component-bindgen/src/transpile_bindgen.rs @@ -3056,7 +3056,7 @@ impl<'a> Instantiator<'a, '_> { "import:{import}-{maybe_iface_member}-{func_name}", import = import_specifier, maybe_iface_member = maybe_iface_member.as_deref().unwrap_or(""), - func_name = &func.name + func_name = func.name ), &func.name, ) @@ -3073,7 +3073,7 @@ impl<'a> Instantiator<'a, '_> { "import:async-{import}-{maybe_iface_member}-{func_name}", import = import_specifier, maybe_iface_member = maybe_iface_member.as_deref().unwrap_or(""), - func_name = &func.name + func_name = func.name ), &func.name, ) diff --git a/crates/xtask/src/build/jco.rs b/crates/xtask/src/build/jco.rs index 46630a127..c6c53af59 100644 --- a/crates/xtask/src/build/jco.rs +++ b/crates/xtask/src/build/jco.rs @@ -144,6 +144,13 @@ fn transpile(args: TranspileArgs) -> Result<()> { transpile_components(BuildType::Debug).context("transpiling all components (debug)")?; } + // The debug bootstrap above transpiles *all* components (including this + // one) into the same `obj/.component.wasm` paths, overwriting the + // release component written earlier with the debug build. Re-write ours + // so that `jco opt` (and the transpile below) operates on the release + // component, not the debug one. + fs::write(&component_path, &adapted_component)?; + let jco_script_path = format!( "{}", WORKSPACE_DIR.join("packages/jco/src/jco.js").display()