Skip to content

Adopt Component Model implements annotations (🏷️) for the next WASI 0.3.x release #942

Description

@ricochet

This issue proposes that WASI adopt the Component Model's implements annotation feature (gated as 🏷️ in the Component Model's gated features), following the process described in CONTRIBUTING.md § Adopting Component Model features.

Feature

The 🏷️ gate covers the (implements "I") and (external-id ...) attributes on plain-named instance imports and exports (Explainer § Import and Export Definitions). The implements annotation records that a plain-named instance import or export implements a particular WIT interface, which allows a component to import (or export) more than one instance of the same interface under distinct names while preserving the semantic link to that interface for toolchains, bindings generators, hosts, and composition tooling:

(component
  (import "primary"   (implements "wasi:keyvalue/store") (instance ...))
  (import "secondary" (implements "wasi:keyvalue/store") (instance ...))
)

In WIT, this is surfaced through plain-named interface imports:

world w {
  import primary: store;
  import secondary: store;
}

The companion external-id attribute closes the naming-expressivity gap for plain names, letting hosts distinguish concrete instances (e.g. (implements "wasi:keyvalue/store") (external-id "user-db-prod:region-a")).

Stability

Iteration and feedback

Implementation experience preceded and shaped the spec merge:

Feedback from these implementations was incorporated into the final design before the spec PRs merged.

WASI APIs that would depend on it

No impact on current set of 0.3.x WIT definitions. However importing multiple instances of the same interface is a long-standing need for WASI consumers whose hosts provide more than one backend:

Note that, per the adoption process, not all Component Model features are surfaced directly in WASI WIT definitions. Adopting 🏷️ does not require any change to already-released wasi:* packages; it makes the feature part of the baseline that runtimes and toolchains must support for the release that adopts it, so that the proposals above (and composition/virtualization tooling built around WASI worlds) can rely on it.

Requested action

Per CONTRIBUTING.md § Adopting Component Model features, we believe the stability criteria are met: the design is complete, and the feature has been through a phase of iteration and feedback across multiple implementations.

We therefore aim to add a vote to an upcoming WASI Subgroup meeting agenda to adopt the Component Model implements feature (🏷️) for inclusion in the next WASI 0.3.x release. Once adopted:

  • Stable (@since-gated) WASI APIs in the next release may depend on the
    feature.
  • The release notes for that version call out the newly adopted Component
    Model feature.
  • From that release onward, 🏷️ is part of the baseline set of Component
    Model features required to implement that WASI version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions