jrandolf opened PR #14872 from jrandolf:component-extern-api to bytecodealliance:main:
This fills a few gaps in how
implementsandexternal-idare exposed to embedders:
- Export lookups with attributes.
Component::get_export_externandInstance::get_export_externwork likeget_exportbut return atypes::ComponentExtern, so the export's attributes are available without iteratingcomponent_type().exports(). The data was already stored but never read. The C API getswasmtime_component_get_export_externandwasmtime_component_instance_get_export_extern, plus C++ wrappers. These take a&strname rather thanimpl ExportLookup, because attributes belong to the name an item is exported under.- Root type imports. Imports of types at the root of a component, e.g.
(import "t" (external-id "x") (type (eq $u))), now show up incomponent_type().imports(), matching root type exports and nested component types. They still don't need to be defined in aLinker.- Lifetimes.
ComponentExternvalues fromtypes::Componentandtypes::ComponentInstancenow borrow only from the type, not from the&Engine. This lets thebindgen!named_importscode drop its workaround of cloning the engine and collecting matching imports up front. One side effect there: if alookupfails, earlier matching imports have already been defined in the linker.#[non_exhaustive].ComponentExternis now#[non_exhaustive], so fields like the version suffix can be added later. This breaks code that builds it with a struct literal or destructures it exhaustively. Nothing in the repo does, and it's otherwise only produced by Wasmtime.Closes #14862
jrandolf edited PR #14872.
jrandolf has marked PR #14872 as ready for review.
jrandolf removed the review request for wasmtime-core-reviewers from PR #14872.
jrandolf requested pchickey for a review on PR #14872.
jrandolf requested wasmtime-core-reviewers for a review on PR #14872.
:cross_mark: jrandolf closed without merge PR #14872.
jrandolf commented on PR #14872:
We don't have a concrete need for this, so I'm closing it.
Last updated: Oct 31 2026 at 23:03 UTC