Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Created January 21, 2025 22:29
Show Gist options
  • Save alexcrichton/d4821314035c16fb1ba9b4c4fc914a9e to your computer and use it in GitHub Desktop.
Save alexcrichton/d4821314035c16fb1ba9b4c4fc914a9e to your computer and use it in GitHub Desktop.
diff --git a/Cargo.toml b/Cargo.toml
index 24752f0..d63708f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -41,20 +41,20 @@ log = "0.4.22"
semver = "1.0.25"
js-component-bindgen = { path = "./crates/js-component-bindgen" }
structopt = "0.3.26"
-wasm-encoder = "0.221.2"
-wasm-metadata = "0.221.2"
-wasmparser = "0.221.2"
-wasmprinter = "0.221.2"
+wasm-encoder = "0.220.0"
+wasm-metadata = "0.220.0"
+wasmparser = "0.220.0"
+wasmprinter = "0.220.0"
wasmtime-environ = { version = "29.0.0", features = [
"component-model",
"compile",
] }
-wat = "1.221.2"
+wat = "1.220.0"
wit-bindgen = "0.36.0"
wit-bindgen-core = "0.36.0"
-wit-component = { version = "0.221.2", features = ["dummy-module"] }
-wit-parser = "=0.221.2"
+wit-component = { version = "0.220.0", features = ["dummy-module"] }
+wit-parser = "0.220.0"
xshell = "0.2.6"
[dev-dependencies]
-anyhow = { workspace = true }
\ No newline at end of file
+anyhow = { workspace = true }
diff --git a/crates/js-component-bindgen/src/core.rs b/crates/js-component-bindgen/src/core.rs
index e8dccdb..2ff1f64 100644
--- a/crates/js-component-bindgen/src/core.rs
+++ b/crates/js-component-bindgen/src/core.rs
@@ -188,7 +188,9 @@ impl<'a> Translation<'a> {
/// Returns the exports of this module, which are not modified by
/// augmentation.
- pub fn exports(&self) -> &IndexMap<String, EntityIndex> {
+ pub fn exports(
+ &self,
+ ) -> &wasmtime_environ::wasmparser::collections::IndexMap<String, EntityIndex> {
match self {
Translation::Normal(translation) => &translation.module.exports,
Translation::Augmented { original, .. } => &original.module.exports,
@@ -546,7 +548,7 @@ macro_rules! define_visit {
impl<'a> VisitOperator<'a> for CollectMemOps<'_, 'a> {
type Output = ();
- wasmparser::for_each_visit_operator!(define_visit);
+ wasmparser::for_each_operator!(define_visit);
}
impl AugmentedOp {
@@ -772,7 +774,7 @@ macro_rules! define_translate {
impl<'a> VisitOperator<'a> for Translator<'_, 'a> {
type Output = ();
- wasmparser::for_each_visit_operator!(define_translate);
+ wasmparser::for_each_operator!(define_translate);
}
#[derive(Debug, Hash, Eq, PartialEq, Copy, Clone)]
diff --git a/crates/js-component-bindgen/src/lib.rs b/crates/js-component-bindgen/src/lib.rs
index 587babb..8279155 100644
--- a/crates/js-component-bindgen/src/lib.rs
+++ b/crates/js-component-bindgen/src/lib.rs
@@ -80,7 +80,6 @@ pub fn generate_types(
/// Outputs the file map and import and export metadata for the Transpilation
#[cfg(feature = "transpile-bindgen")]
pub fn transpile(component: &[u8], opts: TranspileOpts) -> Result<Transpiled, anyhow::Error> {
- use wasmparser::Validator;
use wasmtime_environ::component::{Component, Translator};
let name = opts.name.clone();
@@ -116,7 +115,7 @@ pub fn transpile(component: &[u8], opts: TranspileOpts) -> Result<Transpiled, an
// that need to be executed to instantiate a component.
let scope = ScopeVec::new();
let tunables = Tunables::default_u32();
- let mut validator = Validator::default();
+ let mut validator = wasmtime_environ::wasmparser::Validator::default();
let mut types = ComponentTypesBuilder::new(&validator);
let (component, modules) = Translator::new(&tunables, &mut validator, &mut types, &scope)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment