Plumb external-id on component import/export#13874
Merged
alexcrichton merged 1 commit intoJul 14, 2026
Merged
Conversation
alexcrichton
approved these changes
Jul 13, 2026
This plumbs the `(external-id "...")` annotation added in wasm-tools 0.253.0 through Wasmtime's type reflection, mirroring implements. The annotation is a free-form host-defined identifier which is ignored by type checking and is intended to tell the host how to satisfy an import (or interpret an export), e.g. distinguishing two imports of the same interface by a platform-native resource id. The field is added to `ComponentExternData` in wasmtime-environ and populated from wasmparser in both the type-conversion and nested instance exports, including func- and type-level annotations. New public API `ComponentExtern::external_id` field alongside `implements`. wasmparser validates `(external-id)` behind the same `cm-implements` gate as `(implements)`, so `Config::wasm_component_model_implements(true)` enables both. Note that adding a public field to `ComponentExtern` is a breaking change for any embedder constructing or exhaustively destructuring it. Signed-off-by: Bailey Hayes <bailey@cosmonic.com>
ricochet
force-pushed
the
worktree-external-id
branch
from
July 14, 2026 00:22
b3e51e4 to
d6bea9c
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 14, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 14, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 14, 2026
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 plumbs
(external-id "...")annotation added in wasm-tools through Wasmtime's type reflection, mirroring implements. The annotation is a free-form host-defined identifier which is ignored by type checking and is intended to tell the host how to satisfy an import (or interpret an export), e.g. distinguishing two imports of the same interface by a platform-native resource id.The field is added to
ComponentExternDatain wasmtime-environ and populated from wasmparser in both the type-conversion and nested instance exports, including func- and type-level annotations.wasmparser validates
(external-id)behind the samecm-implementsgate as(implements), soConfig::wasm_component_model_implements(true)enables both.Note that adding a public field to
ComponentExternis a breaking change for any embedder constructing or exhaustively destructuring it.