WebAssembly / WebAssembly/component-model

wit: Propagate feature gate annotations to inner items

Open
#559 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
1.4k
Forks
130
Avg merge
2d 1h
Merged PRs (30d)
15

Description

I think that these two snippets should be equivalent:

@since(version = 0.1.0)
interface handler {
  handle: func();

  @since(version = 0.2.0);
  new-handle: func();
}
@since(version = 0.1.0)
interface new-interface {
  @since(version = 0.1.0)
  hello: func();

  @since(version = 0.2.0);
  new-handle: func();
}

The more explicit version would be the canonical form reflected in the parse tree.

I think this goes beyond just authoring convenience. When every item is annotated it becomes more difficult to pick out the exceptional items; see e.g. https://github.com/WebAssembly/wasi-http/blob/main/wit/types.wit

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the WIT parser and its parse-tree representation, then compare how interface-level and item-level @since annotations are recorded. Use the two snippets in the issue as the behavioral example; done means the implicit annotations are represented explicitly and the exceptional newer item remains distinguishable.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.