You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

wit-component

Package Overview
Dependencies
Maintainers
0
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wit-component - cargo Package Compare versions

Comparing version
0.244.0
to
0.245.0
tests/components/wasm-init-task/component.wat

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

+1
-1
{
"git": {
"sha1": "d4e317f22c3bace76cb3205003bcc34b4929037d"
"sha1": "42127681cc850a4dc62824efc3786e25aa5f9910"
},
"path_in_vcs": "crates/wit-component"
}

@@ -247,3 +247,3 @@ # This file is automatically @generated by Cargo.

"gimli",
"hashbrown",
"hashbrown 0.15.4",
"log",

@@ -453,2 +453,8 @@ "pulley-interpreter",

[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "form_urlencoded"

@@ -485,3 +491,3 @@ version = "1.2.1"

dependencies = [
"foldhash",
"foldhash 0.1.5",
"serde",

@@ -491,2 +497,11 @@ ]

[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"foldhash 0.2.0",
]
[[package]]
name = "heck"

@@ -617,5 +632,5 @@ version = "0.5.0"

name = "id-arena"
version = "2.2.1"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005"
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"

@@ -645,9 +660,10 @@ [[package]]

name = "indexmap"
version = "2.10.0"
version = "2.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
dependencies = [
"equivalent",
"hashbrown",
"hashbrown 0.16.1",
"serde",
"serde_core",
]

@@ -794,3 +810,3 @@

"crc32fast",
"hashbrown",
"hashbrown 0.15.4",
"indexmap",

@@ -913,3 +929,3 @@ "memchr",

"bumpalo",
"hashbrown",
"hashbrown 0.15.4",
"log",

@@ -1206,8 +1222,8 @@ "rustc-hash",

name = "wasm-encoder"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319"
checksum = "95d568e113f706ee7a7df9b33547bb80721f55abffc79b3dc4d09c368690e662"
dependencies = [
"leb128fmt",
"wasmparser 0.244.0",
"wasmparser 0.245.0",
]

@@ -1217,5 +1233,5 @@

name = "wasm-metadata"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
checksum = "ce52b194ec202d029751081d735c1ae49c1bacbdc2634c821a86211e3751300c"
dependencies = [

@@ -1231,4 +1247,4 @@ "anyhow",

"url",
"wasm-encoder 0.244.0",
"wasmparser 0.244.0",
"wasm-encoder 0.245.0",
"wasmparser 0.245.0",
]

@@ -1243,3 +1259,3 @@

"bitflags",
"hashbrown",
"hashbrown 0.15.4",
"indexmap",

@@ -1252,8 +1268,8 @@ "semver",

name = "wasmparser"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
checksum = "48a767a48974f0c8b66f211b96e01aa77feed58b8ccce4e7f0cff0ae55b174d4"
dependencies = [
"bitflags",
"hashbrown",
"hashbrown 0.16.1",
"indexmap",

@@ -1276,9 +1292,9 @@ "semver",

name = "wasmprinter"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09390d7b2bd7b938e563e4bff10aa345ef2e27a3bc99135697514ef54495e68f"
checksum = "6b79e39af628dc03572ecd42fab1265480d943db5858dab748142a5ce0644bb5"
dependencies = [
"anyhow",
"termcolor",
"wasmparser 0.244.0",
"wasmparser 0.245.0",
]

@@ -1299,3 +1315,3 @@

"encoding_rs",
"hashbrown",
"hashbrown 0.15.4",
"indexmap",

@@ -1499,5 +1515,5 @@ "libc",

name = "wast"
version = "244.0.0"
version = "245.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2e7b9f9e23311275920e3d6b56d64137c160cf8af4f84a7283b36cfecbf4acb"
checksum = "75ffc7471e16a6f3c7a3c3a230314915b5dcd158e5ef13ccda2f43358a9df00c"
dependencies = [

@@ -1508,3 +1524,3 @@ "bumpalo",

"unicode-width",
"wasm-encoder 0.244.0",
"wasm-encoder 0.245.0",
]

@@ -1514,5 +1530,5 @@

name = "wat"
version = "1.244.0"
version = "1.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbf35b87ed352f9ab6cd0732abde5a67dd6153dfd02c493e61459218b19456fa"
checksum = "d6bcac6f915e2a84a4c0d9df9d41ad7518d99cda13f3bb83e3b8c22bf8726ab6"
dependencies = [

@@ -1699,3 +1715,3 @@ "wast",

name = "wit-component"
version = "0.244.0"
version = "0.245.0"
dependencies = [

@@ -1713,10 +1729,10 @@ "anyhow",

"serde_json",
"wasm-encoder 0.244.0",
"wasm-encoder 0.245.0",
"wasm-metadata",
"wasmparser 0.244.0",
"wasmprinter 0.244.0",
"wasmparser 0.245.0",
"wasmprinter 0.245.0",
"wasmtime",
"wast",
"wat",
"wit-parser 0.244.0",
"wit-parser 0.245.0",
]

@@ -1744,7 +1760,8 @@

name = "wit-parser"
version = "0.244.0"
version = "0.245.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
checksum = "b5cda4f69fdc5a8d54f7032262217dd89410a933e3f86fdad854f5833caf3ccb"
dependencies = [
"anyhow",
"hashbrown 0.16.1",
"id-arena",

@@ -1758,3 +1775,3 @@ "indexmap",

"unicode-xid",
"wasmparser 0.244.0",
"wasmparser 0.245.0",
]

@@ -1761,0 +1778,0 @@

@@ -14,5 +14,5 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

edition = "2021"
rust-version = "1.81.0"
rust-version = "1.82.0"
name = "wit-component"
version = "0.244.0"
version = "0.245.0"
authors = ["Peter Huene <peter@huene.dev>"]

@@ -77,2 +77,3 @@ build = false

version = "1.0.58"
default-features = false

@@ -83,3 +84,4 @@ [dependencies.bitflags]

[dependencies.indexmap]
version = "2.7.0"
version = "2.13.0"
features = ["std"]
default-features = false

@@ -102,3 +104,3 @@

[dependencies.wasm-encoder]
version = "0.244.0"
version = "0.245.0"
features = [

@@ -111,7 +113,7 @@ "std",

[dependencies.wasm-metadata]
version = "0.244.0"
version = "0.245.0"
default-features = false
[dependencies.wasmparser]
version = "0.244.0"
version = "0.245.0"
features = [

@@ -126,3 +128,3 @@ "simd",

[dependencies.wast]
version = "244.0.0"
version = "245.0.0"
optional = true

@@ -132,3 +134,3 @@ default-features = false

[dependencies.wat]
version = "1.244.0"
version = "1.245.0"
optional = true

@@ -138,3 +140,3 @@ default-features = false

[dependencies.wit-parser]
version = "0.244.0"
version = "0.245.0"
features = [

@@ -158,3 +160,3 @@ "decoding",

[dev-dependencies.wasm-metadata]
version = "0.244.0"
version = "0.245.0"
features = ["oci"]

@@ -164,3 +166,3 @@ default-features = false

[dev-dependencies.wasmparser]
version = "0.244.0"
version = "0.245.0"
features = [

@@ -175,3 +177,3 @@ "simd",

[dev-dependencies.wasmprinter]
version = "0.244.0"
version = "0.245.0"
features = ["component-model"]

@@ -181,3 +183,3 @@ default-features = false

[dev-dependencies.wat]
version = "1.244.0"
version = "1.245.0"
features = ["component-model"]

@@ -229,2 +231,5 @@ default-features = false

priority = 0
check-cfg = ["cfg(fuzzing)"]
check-cfg = [
"cfg(fuzzing)",
"cfg(debug_check_try_op)",
]

@@ -25,3 +25,3 @@ use wit_parser::abi::WasmType;

}
WorldItem::Type(id) => {
WorldItem::Type { id, .. } => {
push_imported_type_intrinsics(&mut wat, resolve, None, *id, mangling);

@@ -51,3 +51,3 @@ }

}
WorldItem::Type(_) => {}
WorldItem::Type { .. } => {}
}

@@ -69,3 +69,3 @@ }

}
WorldItem::Type(_) => {}
WorldItem::Type { .. } => {}
}

@@ -72,0 +72,0 @@ }

@@ -6,6 +6,33 @@ use super::EncodingState;

use wit_parser::{
Enum, Flags, Function, Handle, InterfaceId, Record, Resolve, Result_, Tuple, Type, TypeDefKind,
TypeId, TypeOwner, Variant,
Enum, Flags, Function, Handle, InterfaceId, Param, Record, Resolve, Result_, Tuple, Type,
TypeDefKind, TypeId, TypeOwner, Variant,
};
/// A view of `&[Param]` that compares and hashes by name and type only,
/// ignoring source spans.
#[derive(Clone)]
struct ParamSignatures<'a>(&'a [Param]);
impl PartialEq for ParamSignatures<'_> {
fn eq(&self, other: &Self) -> bool {
self.0.len() == other.0.len()
&& self
.0
.iter()
.zip(other.0)
.all(|(a, b)| a.name == b.name && a.ty == b.ty)
}
}
impl Eq for ParamSignatures<'_> {}
impl std::hash::Hash for ParamSignatures<'_> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
for p in self.0 {
p.name.hash(state);
p.ty.hash(state);
}
}
}
/// Represents a key type for interface function definitions.

@@ -15,3 +42,3 @@ #[derive(Hash, PartialEq, Eq, Clone)]

async_: bool,
params: &'a [(String, Type)],
params: ParamSignatures<'a>,
result: &'a Option<Type>,

@@ -107,3 +134,3 @@ }

async_: func.kind.is_async(),
params: &func.params,
params: ParamSignatures(&func.params),
result: &func.result,

@@ -134,7 +161,7 @@ };

resolve: &'a Resolve,
params: &'a [(String, Type)],
params: &'a [Param],
) -> Result<Vec<(&'a str, ComponentValType)>> {
params
.iter()
.map(|(name, ty)| Ok((name.as_str(), self.encode_valtype(resolve, ty)?)))
.map(|p| Ok((p.name.as_str(), self.encode_valtype(resolve, &p.ty)?)))
.collect::<Result<_>>()

@@ -203,6 +230,6 @@ }

}
TypeDefKind::FixedSizeList(ty, elements) => {
TypeDefKind::FixedLengthList(ty, elements) => {
let ty = self.encode_valtype(resolve, ty)?;
let (index, encoder) = self.defined_type();
encoder.fixed_size_list(ty, *elements);
encoder.fixed_length_list(ty, *elements);
ComponentValType::Type(index)

@@ -333,3 +360,2 @@ }

self.encode_optional_valtype(resolve, c.ty.as_ref())?,
None, // TODO: support defaulting case values in the future
))

@@ -336,0 +362,0 @@ })

@@ -89,6 +89,6 @@ use crate::encoding::types::{TypeEncodingMaps, ValtypeEncoder};

}
WorldItem::Type(t) => {
WorldItem::Type { id, .. } => {
component.interface = None;
component.import_types = true;
component.encode_valtype(resolve, &Type::Id(*t))?;
component.encode_valtype(resolve, &Type::Id(*id))?;
component.import_types = false;

@@ -115,3 +115,3 @@ continue;

}
WorldItem::Type(_) => unreachable!(),
WorldItem::Type { .. } => unreachable!(),
};

@@ -118,0 +118,0 @@ component.outer.export(&name, ty);

@@ -113,3 +113,3 @@ use super::{Adapter, ComponentEncoder, LibraryInfo, RequiredOptions};

}
WorldItem::Type(_) => true,
WorldItem::Type { .. } => true,
})

@@ -255,7 +255,7 @@ };

let import_map_key = match item {
WorldItem::Function(_) | WorldItem::Type(_) => None,
WorldItem::Function(_) | WorldItem::Type { .. } => None,
WorldItem::Interface { .. } => Some(name),
};
let interface_id = match item {
WorldItem::Function(_) | WorldItem::Type(_) => None,
WorldItem::Function(_) | WorldItem::Type { .. } => None,
WorldItem::Interface { id, .. } => Some(*id),

@@ -274,4 +274,4 @@ };

}
WorldItem::Type(ty) => {
interface.add_type(required, resolve, *ty);
WorldItem::Type { id, .. } => {
interface.add_type(required, resolve, *id);
}

@@ -323,3 +323,3 @@ WorldItem::Interface { id, .. } => {

WorldItem::Interface { id, .. } => id,
WorldItem::Function(_) | WorldItem::Type(_) => {
WorldItem::Function(_) | WorldItem::Type { .. } => {
live.add_world_item(resolve, item);

@@ -366,3 +366,3 @@ continue;

for (_, item) in world.imports.iter() {
if let WorldItem::Type(id) = item {
if let WorldItem::Type { id, .. } = item {
live.add_type_id(resolve, *id);

@@ -441,6 +441,7 @@ }

| Import::ThreadNewIndirect { .. }
| Import::ThreadSwitchTo { .. }
| Import::ThreadSuspendToSuspended { .. }
| Import::ThreadSuspend { .. }
| Import::ThreadResumeLater
| Import::ThreadYieldTo { .. } => {}
| Import::ThreadSuspendTo { .. }
| Import::ThreadUnsuspend
| Import::ThreadYieldToSuspended { .. } => {}
}

@@ -459,3 +460,3 @@ }

WorldItem::Interface { id, .. } => *id,
WorldItem::Type(_) => unreachable!(),
WorldItem::Type { .. } => unreachable!(),
};

@@ -462,0 +463,0 @@ let mut set = HashSet::new();

@@ -92,5 +92,5 @@ //! Definition for encoding of custom sections within core wasm modules of

includes: Default::default(),
include_names: Default::default(),
package: Some(package),
stability: Default::default(),
span: Default::default(),
});

@@ -173,3 +173,3 @@ resolve.packages[package]

}
WorldItem::Type(_) => {}
WorldItem::Type { .. } => {}
}

@@ -415,3 +415,3 @@ }

.context("failed to merge WIT package sets together")?;
let world = remap.map_world(world, None)?;
let world = remap.map_world(world, Default::default())?;
let exports = self.resolve.worlds[world].exports.keys().cloned().collect();

@@ -418,0 +418,0 @@ self.resolve

@@ -9,5 +9,2 @@ use anyhow::{Result, anyhow, bail};

// NB: keep in sync with `crates/wit-parser/src/ast/lex.rs`
const PRINT_F32_F64_DEFAULT: bool = true;
/// A utility for printing WebAssembly interface definitions to a string.

@@ -24,4 +21,2 @@ pub struct WitPrinter<O: Output = OutputToString> {

emit_docs: bool,
print_f32_f64: bool,
}

@@ -42,6 +37,2 @@

emit_docs: true,
print_f32_f64: match std::env::var("WIT_REQUIRE_F32_F64") {
Ok(s) => s == "1",
Err(_) => PRINT_F32_F64_DEFAULT,
},
}

@@ -367,9 +358,9 @@ }

};
for (i, (name, ty)) in func.params.iter().skip(params_to_skip).enumerate() {
for (i, param) in func.params.iter().skip(params_to_skip).enumerate() {
if i > 0 {
self.output.str(", ");
}
self.print_name_param(name);
self.print_name_param(&param.name);
self.output.str(": ");
self.print_type_name(resolve, ty)?;
self.print_type_name(resolve, &param.ty)?;
}

@@ -418,4 +409,4 @@ self.output.str(")");

match import {
WorldItem::Type(t) => match name {
WorldKey::Name(s) => types.push((s.as_str(), *t)),
WorldItem::Type { id, .. } => match name {
WorldKey::Name(s) => types.push((s.as_str(), *id)),
WorldKey::Interface(_) => unreachable!(),

@@ -475,3 +466,3 @@ },

// Types are handled separately
WorldItem::Type(_) => unreachable!(),
WorldItem::Type { .. } => unreachable!(),
});

@@ -502,3 +493,3 @@ }

// Types are handled separately
WorldItem::Type(_) => unreachable!(),
WorldItem::Type { .. } => unreachable!(),
}

@@ -553,16 +544,4 @@ }

Type::S64 => self.output.ty("s64", TypeKind::BuiltIn),
Type::F32 => {
if self.print_f32_f64 {
self.output.ty("f32", TypeKind::BuiltIn)
} else {
self.output.ty("f32", TypeKind::BuiltIn)
}
}
Type::F64 => {
if self.print_f32_f64 {
self.output.ty("f64", TypeKind::BuiltIn)
} else {
self.output.ty("f64", TypeKind::BuiltIn)
}
}
Type::F32 => self.output.ty("f32", TypeKind::BuiltIn),
Type::F64 => self.output.ty("f64", TypeKind::BuiltIn),
Type::Char => self.output.ty("char", TypeKind::BuiltIn),

@@ -621,3 +600,3 @@ Type::String => self.output.ty("string", TypeKind::BuiltIn),

}
TypeDefKind::FixedSizeList(ty, size) => {
TypeDefKind::FixedLengthList(ty, size) => {
self.output.ty("list", TypeKind::BuiltIn);

@@ -806,4 +785,4 @@ self.output.generic_args_start();

}
TypeDefKind::FixedSizeList(inner, size) => {
self.declare_fixed_size_list(resolve, ty.name.as_deref(), inner, *size)?
TypeDefKind::FixedLengthList(inner, size) => {
self.declare_fixed_length_list(resolve, ty.name.as_deref(), inner, *size)?
}

@@ -1048,3 +1027,3 @@ TypeDefKind::Type(inner) => match ty.name.as_deref() {

fn declare_fixed_size_list(
fn declare_fixed_length_list(
&mut self,

@@ -1243,2 +1222,3 @@ resolve: &Resolve,

| "async"
| "map"
)

@@ -1245,0 +1225,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet