Initial work for versionsuffix and external-id#2555
Merged
Conversation
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.
This was referenced Jul 1, 2026
Contributor
|
Heads up that gating Right now the Explainer's motivating example puts (component $ESM
(import "slugify"
(external-id "https://esm.unpkg.com/slugify@1.6.6")
(func (param "text" string) (result string)))
) |
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.
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 importa:b/c@1.0.0tomorrow you'd importa:b/c@1. This is not yet fully integrated intowit-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 asexternal-id, though, so I figured I'd at least start to lay the groundwork.(external-id "...")for components -- being introduced in Addexternal-idattribute 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
versionsuffixparsing/validation is gated by a newcm-canon-namesfeature, and theexternal-idparsing/validation is gated behind the preexistingcm-implementsfeature to match the specification's classification.Closes #2551