speced / speced/respec

Put xref data into Web IDL validation process

Open
#2,435 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
806
Forks
434
Avg merge
1d 21h
Merged PRs (30d)
32

Description

[Exposed=Window]
interface MyInterface {
  // DOMMatrixInit is a dictionary that requires default value `{}`
  // but our validator does not warn here because it does not know it's a dictionary
  // as our IDL validation is currently completely independent from xref.
  void method(optional DOMMatrixInit init);
};

The current setup is to parse IDL and immediately pass the results to validator.

My current thoughts:

  1. Parse IDL,
  2. Detect undefined references, with two possible ways...
    • Extract directly from parser result data by abusing writer hooks. I locally have working code for this, but this creates a duplicate work because core/dfn-finder already does this by searching DOM tree...
    • Or, wait until xref and dfn-finder completes their work and somehow get the needed data from the DOM tree. Not sure how.
  3. Pass the undefined references to xref
  4. Convert them to WebIDL2-compatible format
  5. Pass the result to validator

Contributor guide

Open the contributing guide

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

The current flow parses IDL and immediately sends it to the validator; begin by tracing that flow alongside core/dfn-finder and the xref integration described in the issue. Define the handoff for undefined references and verify completion by confirming xref data reaches the WebIDL validator in the required compatible format.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.