Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes with version ranges #17857

Open
foolip opened this issue Sep 22, 2022 · 4 comments
Open

Notes with version ranges #17857

foolip opened this issue Sep 22, 2022 · 4 comments
Labels
meeting agenda Issues or pull requests in need of discussion in a project meeting. schema Isses or pull requests regarding the JSON schema files used in this project.

Comments

@foolip
Copy link
Contributor

foolip commented Sep 22, 2022

Notes are used a lot in BCD to inform readers about specific bugs that affect certain versions of a browser. There are two predominant styles for this, shown by example here:

A note including the affected version:

"firefox": {
"version_added": "20",
"notes": "Before Firefox 27, only single-line flexbox is supported."
},

Multiple support statements, using version_added and version_removed:

"chrome": [
{
"version_added": "22"
},
{
"version_added": "1",
"version_removed": "22",
"partial_implementation": true,
"notes": "Only supported for <a href='https://developer.mozilla.org/docs/Web/API/HTMLElement'><code>HTMLElement</code></a>, not all <code>Element</code> objects, such as <a href='https://developer.mozilla.org/docs/Web/API/SVGElement'><code>SVGElement</code></a>."
}
],

The data for the "visibilitychange" change event in #17854 is great example of how complicated things can get with the multi-statement style, requiring repeated notes.

Some issues with the current approach:

  • Not consistent
  • Versions inside of notes are not (easily) machine readable
  • Multiple support statements require duplication when there are overlapping bugs
  • Neither style can easily be converted into the style of footnotes on caniuse.com, where there each note has a number, and each release has a number of footnotes. https://caniuse.com/border-image is a good example of this.

I would like us to consider adopting a different structure, where notes can have version ranges independent from the main version_added and version_removed. Mock proposal with the "visibilitychange" case, with simplified notes to make it cleaner:

{
  "version_added": "7",
  "notes": [
    {
      "version_fixed": "14.1",
      "note": "The event is not fired when navigating away from a document."
    },
    {
      "version_fixed": "14",
      "note": "The event does not bubble."
    },
    {
      "version_fixed": "10.1",
      "partial_implementation": true,
      "note": "The <code>onvisibilitychange</code> event handler property is not supported"
    }
  ]
}

cc @Elchi3 @queengooborg

@foolip foolip added schema Isses or pull requests regarding the JSON schema files used in this project. meeting agenda Issues or pull requests in need of discussion in a project meeting. labels Sep 22, 2022
@foolip
Copy link
Contributor Author

foolip commented Sep 22, 2022

@Fyrd do you have thoughts on what would work best for caniuse.com?

@foolip
Copy link
Contributor Author

foolip commented Dec 19, 2022

cc @ddbeck

@ddbeck
Copy link
Collaborator

ddbeck commented Dec 21, 2022

I love the idea of adding structure to notes—it's something I've long wished for. There's a lot to be won from structuring notes, both in terms of data quality and consistency and making it work better for consumers.

Thinking aloud here:

  • Where do notes go that are introduced after the start of a support statement?

    For instance, suppose a feature was introduced in version 10, a noteworthy bug introduced in version 11, and a fix introduced in version 12.

    One answer is that notes can have full versioning symmetry with support statements (that is, notes have effective version_added and version_removed fields). That would suggest that notes are a practically a parallel structure to support, which is an interesting prospect to say the least. (As an author, it'd be very frustrating to work with a compat-level "notes" key—separately as a peer to "support"—but the principle of the thing is not wrong.)

    If the answer is no, I think we still have the possibility of note duplication (e.g., a bug might persist across multiple support statements), though I'd expect rather less frequently.

  • version_fixed implies that notes only describe bugs, which I don't think is quite right (e.g., none of the notes describing APIs moved on the inheritance chain is a bug per se). But it's suggestive of even more structure, to the point of annotating types of notes.

    For example, you might use a strictly-controlled "subject" field to constrain note contents or to require additional fields:

    [
      {
        "subject": "bug",
        "version_removed": "10",
        "note": "The method erroneously returns an integer instead of a floating point number.",
        "citation": "https://bugtracker.example.com/1234/"  // required field for bugs?
      },
      {
        "subject": "spec-change",
        "version_removed": "20",
        "note": "The <code>Example</code> interface itself is not present, but many of the methods are available on the <code>OtherInterface</code>."
      },
      {
        "subject": "misc",
        "note": "This has a surprising, but spec-complaint, behavior."
      }
    ]

    With this sort of structure, you'd open the door to lots of note automation, such as enforcing text style specific to note genres or generating PRs for resolved bugs.

  • On the specific matter of note duplication and consistency, I know that a great many notes are duplicates. On the authoring side (i.e., don't expose this to consumers), it might be nice to have notes by reference to a centralized collection:

    [
      {
        "note_ref": "chromium-bug-5678"
      }
    ]

    Where the actual note gets inlined out of a shared notes.json or somesuch (this, to me, is a much friendlier abstraction than "mirror", which is quite opaque). Not only would you get the benefit of all notes for the same topic being the same, but you'd also get the benefit of authoring the notes in one place, where it'd be more obvious that you've written notes in a non-standard style or tone.

foolip added a commit to foolip/browser-compat-data that referenced this issue Apr 22, 2024
The history of this feature is complicated, with a long history of
prefixed support and recent extened syntax which should also work with
the prefixed form because it's defined as an alias:
https://drafts.csswg.org/css-images-4/#deprecated

This would be nicer with mdn#17857
but for now this results in split entries with duplicated notes.

The details:

-webkit-image-set() was implementated in WebKit 536.4 for Safari:
WebKit/WebKit@63ee6e4
https://github.com/WebKit/WebKit/blob/63ee6e4e5f867a55faedef4a7f02fb1b9775dd7b/Source/WebCore/Configurations/Version.xcconfig

It was enabled in WebKit 536.8 for Chromium:
WebKit/WebKit@68a3754
https://github.com/WebKit/WebKit/blob/68a3754b19f8e92fabfc263b17baad33a895bd35/Source/WebCore/Configurations/Version.xcconfig

That maps to Safari 6 and Chrome 20. The data previously said Chrome 21,
so Chrome 20 was confirmed in BrowserStack using this test:
https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=12632

image-set() was unprefixed in WebKit 603.1.11 (Safari 10.1):
WebKit/WebKit@ea622e8
https://github.com/WebKit/WebKit/blob/ea622e8b67a6bc11cc45d1d34953ac795df4dfb3/Source/WebCore/Configurations/Version.xcconfig

The extended syntax was added in WebKit 610.1.1 (Safari 14):
WebKit/WebKit@5269267
https://github.com/WebKit/WebKit/blob/52692677632e50f8d0e3a4b0f62c94e5520a47d9/Source/WebCore/Configurations/Version.xcconfig

WebKit/WebKit@5269267
foolip added a commit to foolip/browser-compat-data that referenced this issue Apr 22, 2024
The history of this feature is complicated, with a long history of
prefixed support and recent extened syntax which should also work with
the prefixed form because it's defined as an alias:
https://drafts.csswg.org/css-images-4/#deprecated

This would be nicer with mdn#17857
but for now this results in split entries with duplicated notes.

The details:

-webkit-image-set() was implementated in WebKit 536.4 for Safari:
WebKit/WebKit@63ee6e4
https://github.com/WebKit/WebKit/blob/63ee6e4e5f867a55faedef4a7f02fb1b9775dd7b/Source/WebCore/Configurations/Version.xcconfig

It was enabled in WebKit 536.8 for Chromium:
WebKit/WebKit@68a3754
https://github.com/WebKit/WebKit/blob/68a3754b19f8e92fabfc263b17baad33a895bd35/Source/WebCore/Configurations/Version.xcconfig

That maps to Safari 6 and Chrome 20. The data previously said Chrome 21,
so Chrome 20 was confirmed in BrowserStack using this test:
https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=12632

image-set() was unprefixed in WebKit 603.1.11 (Safari 10.1):
WebKit/WebKit@ea622e8
https://github.com/WebKit/WebKit/blob/ea622e8b67a6bc11cc45d1d34953ac795df4dfb3/Source/WebCore/Configurations/Version.xcconfig

The extended syntax was added in WebKit 610.1.1 (Safari 14):
WebKit/WebKit@5269267
https://github.com/WebKit/WebKit/blob/52692677632e50f8d0e3a4b0f62c94e5520a47d9/Source/WebCore/Configurations/Version.xcconfig
ddbeck pushed a commit that referenced this issue Apr 24, 2024
The history of this feature is complicated, with a long history of
prefixed support and recent extened syntax which should also work with
the prefixed form because it's defined as an alias:
https://drafts.csswg.org/css-images-4/#deprecated

This would be nicer with #17857
but for now this results in split entries with duplicated notes.

The details:

-webkit-image-set() was implementated in WebKit 536.4 for Safari:
WebKit/WebKit@63ee6e4
https://github.com/WebKit/WebKit/blob/63ee6e4e5f867a55faedef4a7f02fb1b9775dd7b/Source/WebCore/Configurations/Version.xcconfig

It was enabled in WebKit 536.8 for Chromium:
WebKit/WebKit@68a3754
https://github.com/WebKit/WebKit/blob/68a3754b19f8e92fabfc263b17baad33a895bd35/Source/WebCore/Configurations/Version.xcconfig

That maps to Safari 6 and Chrome 20. The data previously said Chrome 21,
so Chrome 20 was confirmed in BrowserStack using this test:
https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=12632

image-set() was unprefixed in WebKit 603.1.11 (Safari 10.1):
WebKit/WebKit@ea622e8
https://github.com/WebKit/WebKit/blob/ea622e8b67a6bc11cc45d1d34953ac795df4dfb3/Source/WebCore/Configurations/Version.xcconfig

The extended syntax was added in WebKit 610.1.1 (Safari 14):
WebKit/WebKit@5269267
https://github.com/WebKit/WebKit/blob/52692677632e50f8d0e3a4b0f62c94e5520a47d9/Source/WebCore/Configurations/Version.xcconfig
@foolip
Copy link
Contributor Author

foolip commented Apr 25, 2024

#22939 is a good example of the need for this. I needed to use 6 entries in the compat statements array, because the API was both prefixed and unprefixed, and there were two different states of partial support. 2 times 3 is 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting agenda Issues or pull requests in need of discussion in a project meeting. schema Isses or pull requests regarding the JSON schema files used in this project.
Projects
None yet
Development

No branches or pull requests

2 participants