Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add implements clause support to wac#200

Draft
ricochet wants to merge 1 commit intobytecodealliance:mainfrom
ricochet:implements
Draft

Add implements clause support to wac#200
ricochet wants to merge 1 commit intobytecodealliance:mainfrom
ricochet:implements

Conversation

@ricochet
Copy link
Contributor

@ricochet ricochet commented Mar 1, 2026

DO NOT MERGE until we can pin to a release of wasm-tools with implements.
Follow that work at: bytecodealliance/wasm-tools#2453

Support the component model's [implements=<I>]L name form, which allows
importing/exporting the same interface multiple times under different
plain-name labels (e.g., primary/backup stores).

See the spec change here:
WebAssembly/component-model#613

  • Extract the interface name from implements names in Package::from_bytes
    so Interface.id is set correctly (e.g., "wasi:keyvalue/store" instead
    of the raw "[implements=wasi:keyvalue/store]primary")
  • Skip instance deduplication for implements imports during graph
    encoding so both imports are preserved
  • Use entry().or_insert() for the instances map in both TypeEncoder and
    CompositionGraphEncoder to prevent a second implements import from
    overwriting the first's alias index

Support the component model's [implements=<I>]L name form, which allows
importing/exporting the same interface multiple times under different
plain-name labels (e.g., primary/backup stores).

- Extract the interface name from implements names in Package::from_bytes
  so Interface.id is set correctly (e.g., "wasi:keyvalue/store" instead
  of the raw "[implements=<wasi:keyvalue/store>]primary")
- Skip instance deduplication for implements imports during graph
  encoding so both imports are preserved
- Use entry().or_insert() for the instances map in both TypeEncoder and
  CompositionGraphEncoder to prevent a second implements import from
  overwriting the first's alias index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant