Skip to content

Commit

Permalink
schema: Allow optional implementation_url
Browse files Browse the repository at this point in the history
This change updates the compat-data schema and docs to allow per-browser
optional implementation_url values to be specified in the support data
for any browser; detailed description:

> An optional changeset URL or commit URL for the change which implemented
> the feature in the source code for the associated browser; e.g. a
> https://trac.webkit.org/changeset/ URL for a changeset whose subject
> line is in the form *"Enable [feature name/description]."* or *"Enable
> [feature name/description] by default."*. The presence of an
> `implementation_url` value indicates that the associated browser has
> spec-conformant support for the feature in its source code. Therefore,
> an `implementation_url` value can be added even if the feature hasn't
> yet shipped in a stable release, but instead only in a Nightly, Canary,
> or Technology Preview release — or even if the feature hasn't yet
> shipped in any release at all, but has only landed in the source code
> for the associated browser.

mdn#6896 (comment)
and mdn#6896 (comment)
are where the idea for this change arose. In summary, the rationale is to
have a record in BCD of what changeset landed support for a feature in a
particular browser’s codebase. Among other use cases, we have downstream
consumers who care only whether or not there’s an implementation of the
feature in a particular browser engine — even if that implementation
hasn’t yet actually shipped in a major release.
  • Loading branch information
sideshowbarker committed Nov 18, 2020
1 parent 3bcefe9 commit 1c5ea4f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions schemas/compat-data-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ Example for two flags required:
}
```

#### `implementation_url`

An optional changeset URL or commit URL for the change which implemented the feature in the
source code for the associated browser; e.g. a https://trac.webkit.org/changeset/ URL for a
changeset whose subject line is in the form _"Enable [feature name/description]."_ or
_"Enable [feature name/description] by default."_. The presence of an `implementation_url`
value indicates that the associated browser has spec-conformant support for the feature in
its source code. Therefore, an `implementation_url` value can be added even if the feature
hasn't yet shipped in a stable release, but instead only in a Nightly, Canary, or Technology
Preview release — or even if the feature hasn't yet shipped in any release at all, but has
only landed in the source code for the associated browser.

#### `partial_implementation`

A `boolean` value indicating whether or not the implementation of the sub-feature
Expand Down
6 changes: 6 additions & 0 deletions schemas/compat-data.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"required": ["type", "name"]
}
},
"implementation_url": {
"type": "string",
"format": "uri",
"pattern": "^http(s)?:\/\/[^#]+#.+",
"description": "An optional changeset URL or commit URL for the change which implemented the feature in the source code for the associated browser."
},
"partial_implementation": {
"type": "boolean",
"description": "A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example)."
Expand Down
7 changes: 7 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ export interface SimpleSupportStatement {
*/
value_to_set?: string;
}[];

/**
* An optional changeset URL or commit URL for the change which implemented the feature in the
* source code for the associated browser; e.g. a https://trac.webkit.org/changeset/ URL.
*/
implementation_url?: string;

/**
* A `boolean` value indicating whether or not the implementation of the sub-feature follows
* the current specification closely enough to not create major interoperability problems.
Expand Down

0 comments on commit 1c5ea4f

Please sign in to comment.