From 1c5ea4f5d918ec352c2ef7e531655588ef4a71b5 Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Wed, 18 Nov 2020 19:37:24 +0900 Subject: [PATCH] schema: Allow optional implementation_url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. https://github.com/mdn/browser-compat-data/issues/6896#issuecomment-707928572 and https://github.com/mdn/browser-compat-data/issues/6896#issuecomment-708876962 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. --- schemas/compat-data-schema.md | 12 ++++++++++++ schemas/compat-data.schema.json | 6 ++++++ types.d.ts | 7 +++++++ 3 files changed, 25 insertions(+) diff --git a/schemas/compat-data-schema.md b/schemas/compat-data-schema.md index f4f99287cf111a..e63d23060e35a9 100644 --- a/schemas/compat-data-schema.md +++ b/schemas/compat-data-schema.md @@ -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 diff --git a/schemas/compat-data.schema.json b/schemas/compat-data.schema.json index 033ec7d4dd71c7..9257ae044ca866 100644 --- a/schemas/compat-data.schema.json +++ b/schemas/compat-data.schema.json @@ -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)." diff --git a/types.d.ts b/types.d.ts index e5a8579bbba725..076569e5c0397d 100644 --- a/types.d.ts +++ b/types.d.ts @@ -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.