add implements support#1756
Queued
ricochet wants to merge 2 commits into
Queued
Conversation
vados-cosmonic
previously approved these changes
Jul 23, 2026
vados-cosmonic
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 🚀
This is basically ready, nothing but nits here -- thanks for knocking this out @ricochet. Shame we can't fully be sure it will work given the lack of support of try_table/exnref across engines (TIL), but certainly happy to land support for this sooner rather than later.
3 tasks
Updates the wasmtime family (wasmtime, wasmtime-environ) from 46 to 47.0.2 (enabling wasmtime-environ's `anyhow` feature for error conversions), the wasm-tools family (wasm-encoder, wasm-metadata, wasmparser, wasmprinter, wat, wast, wit-component, wit-parser) from 0.253 to 0.254, and wit-bindgen(-core) from 0.59 to 0.60. Migration notes: - the per-instance flags global now holds a single boolean `may_leave` flag rather than a MAY_ENTER|MAY_LEAVE bitmask, so the generated JS global is initialized to `1` - wasmtime-environ 47's FACT-generated adapters wrap calls in exception barriers (`try_table` + `catch_all`) when the exceptions feature is enabled. The multi-memory augmenter learns to re-encode `try_table`, and a new `supports_wasm_exnref` transpile option (default off) controls whether the exceptions feature is enabled during validation, since the resulting core modules only run behind a flag (e.g. --experimental-wasm-exnref) in today's JS engines.
Adds support for the component model `implements` proposal (WebAssembly/component-model#613 and bytecodealliance#672): - `import label: ns:pkg/iface` / `export label: iface` in WIT: named (labeled) imports and exports of interfaces, including importing the same interface under multiple labels. Transpiled bindings import each label under its own specifier, and `--map` entries for the implemented interface id apply to labeled imports (label-specific mappings win) - resource-bearing interfaces imported under multiple labels resolve each label's resource class through that import instance's own resource table rather than the wit type, which is shared by all labels - `jco types` aliases each label to the shared interface module - `@external-id("...")` attributes round-trip through embed/new/print/wit - `(implements "...")` name validation is enabled during transpile via `WasmFeatures::CM_IMPLEMENTS` Adds an `implements-labels` rust test component exercising labeled imports and exports end to end at runtime. Note: binaries carrying `(external-id ...)` names can be produced and printed but not yet transpiled -- wasmtime-environ 47 embeds wasmparser 0.252, which predates external-id name-option parsing (0.253); support lands with the next wasmtime-environ release.
ricochet
force-pushed
the
worktree-implements
branch
from
July 23, 2026 14:58
6c613e0 to
54c832b
Compare
vados-cosmonic
self-requested a review
July 23, 2026 15:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for the component model
implementsproposal (WebAssembly/component-model#613 and WebAssembly/component-model#672):import label: ns:pkg/iface/export label: ifacein WIT: named (labeled) imports and exports of interfaces, including importing the same interface under multiple labels. Transpiled bindings import each label under its own specifier, and--mapentries for the implemented interface id apply to labeled imports (label-specific mappings win)jco typesaliases each label to the shared interface module@external-id("...")attributes round-trip through embed/new/print/wit(implements "...")name validation is enabled during transpile viaWasmFeatures::CM_IMPLEMENTSNote: binaries carrying
(external-id ...)names can be produced and printed but not yet transpiled. wasmtime-environ 47 embeds wasmparser 0.252, which predates external-id name-option parsing (0.253).This also updates wasmtime-environ from 46.0.1 to 47.0.2, enabling its
anyhowfeature for error conversions. Migration notes:may_leaveflag rather than a MAY_ENTER|MAY_LEAVE bitmask, so the generated JS global is initialized to1try_table+catch_all) when the exceptions feature is enabled. The multi-memory augmenter learns to re-encodetry_table, but the exceptions feature is masked off the transpile validator for now since the resulting core modules would only run behind --experimental-wasm-exnref in today's JS engines.I went ahead and bumped js-component-bindgen to 2.1.0 as this is a new feature. Is that the preferred flow here?