Skip to content

Initial work for versionsuffix and external-id#2555

Merged
fitzgen merged 4 commits into
bytecodealliance:mainfrom
alexcrichton:external-id
Jul 2, 2026
Merged

Initial work for versionsuffix and external-id#2555
fitzgen merged 4 commits into
bytecodealliance:mainfrom
alexcrichton:external-id

Conversation

@alexcrichton

@alexcrichton alexcrichton commented Jul 1, 2026

Copy link
Copy Markdown
Member

This is intended to at least start laying groundwork and implementation for two features in the component model that this repository does not yet implement:

  • (versionsuffix "...") for components -- introduced in Interface version canonicalization WebAssembly/component-model#536 this is intended to pave a path forward to canonicalizing versions in component imports/exports in the future. For example where today you'd import a:b/c@1.0.0 tomorrow you'd import a:b/c@1. This is not yet fully integrated into wit-component, however, and further work will be necessary for bindings generators as well to take advantage of this. It's all encoded in the same place as external-id, though, so I figured I'd at least start to lay the groundwork.

  • (external-id "...") for components -- being introduced in Add external-id attribute WebAssembly/component-model#672 this is intended to attach arbitrary metadata to imports/exports in a component. This is surfaced in WIT as an @external-id("...") attribute. This should be hooked up throughout this implementation to WIT and such such that the implementation is intended to be complete. There's probably something I forgot, but all the major pieces should be there.

The versionsuffix parsing/validation is gated by a new cm-canon-names feature, and the external-id parsing/validation is gated behind the preexisting cm-implements feature to match the specification's classification.

Closes #2551

This is intended to at least start laying groundwork and implementation
for two features in the component model that this repository does not
yet implement:

* `(versionsuffix "...")` for components -- introduced in
  WebAssembly/component-model#536 this is intended to pave a path
  forward to canonicalizing versions in component imports/exports in the
  future. For example where today you'd import `a:b/c@1.0.0` tomorrow
  you'd import `a:b/c@1`. This is not yet fully integrated into
  `wit-component`, however, and further work will be necessary for
  bindings generators as well to take advantage of this. It's all
  encoded in the same place as `external-id`, though, so I figured I'd
  at least start to lay the groundwork.

* `(external-id "...")` for components -- being introduced in
  WebAssembly/component-model#672 this is intended to attach arbitrary
  metadata to imports/exports in a component. This is surfaced in WIT as
  an `@external-id("...")` attribute. This should be hooked up
  throughout this implementation to WIT and such such that the
  implementation is intended to be complete. There's probably something
  I forgot, but all the major pieces should be there.

The `versionsuffix` parsing/validation is gated by a new
`cm-canon-names` feature, and the `external-id` parsing/validation is
gated behind the preexisting `cm-implements` feature to match the
specification's classification.
@alexcrichton alexcrichton requested a review from a team as a code owner July 1, 2026 23:00
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team July 1, 2026 23:00
@ricochet

ricochet commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Heads up that gating external-id to instances is different from the spec PR. IMO gating on instances is the right call so we should funnel that back to the spec. AKA right now this PR has external_id only on WorldItem::Interface, not on Function/TypeDef.

Right now the Explainer's motivating example puts external-id on a bare func import:

(component $ESM
  (import "slugify"
    (external-id "https://esm.unpkg.com/slugify@1.6.6")
    (func (param "text" string) (result string)))
)

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fitzgen fitzgen added this pull request to the merge queue Jul 2, 2026
Merged via the queue into bytecodealliance:main with commit a001d3c Jul 2, 2026
37 checks passed
@alexcrichton alexcrichton deleted the external-id branch July 2, 2026 19:55
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.

wast: WASM_PARENS_DEPTH too high on aarch64-unknown-linux-gnu

3 participants