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

Add ability to render preview browsers (introduced in BCD 4.0.0) #3997

Merged
merged 3 commits into from
Aug 19, 2021

Conversation

Elchi3
Copy link
Member

@Elchi3 Elchi3 commented Jun 9, 2021

(This will fail as it depends on BCD 4.0.0 which will include mdn/browser-compat-data#10334.
Edit: Marked as draft to prevent it from being merged early. This is ready for review but needs a coordinated merge with the release of BCD 4.0.0.)

For a long time BCD contributors and browser vendors have asked for a way to include preview browsers, that is, data for Firefox Nightly, Chrome Canary, and Safari Technical Preview. In mdn/browser-compat-data#10334 we modeled and agreed on a way forward: The BCD data model will be extended to include a "preview" enum to indicate support in these browsers.

So, BCD 4.0.0 can include compat data like this:

Expand
{
  "api": {
    "ANGLE_instanced_arrays": {
      "__compat": {
        "mdn_url": "https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays",
        "support": {
          "chrome": {
            "version_added": "preview"
          },
          "chrome_android": {
            "version_added": "32"
          },
          "edge": {
            "version_added": "12"
          },
          "firefox": {
            "version_added": "preview"
          },
          "firefox_android": {
            "version_added": true
          },
          "ie": {
            "version_added": "11"
          },
          "opera": {
            "version_added": "19"
          },
          "opera_android": {
            "version_added": "19"
          },
          "safari": {
            "version_added": "preview"
          },
          "safari_ios": {
            "version_added": "8"
          },
          "samsunginternet_android": {
            "version_added": "2.0"
          },
          "webview_android": {
            "version_added": "4.4"
          }
        },
        "status": {
          "experimental": false,
          "standard_track": true,
          "deprecated": false
        }
      },
      "drawArraysInstancedANGLE": {
        "__compat": {
          "mdn_url": "https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE",
          "support": {
            "chrome": {
              "version_added": "32"
            },
            "chrome_android": {
              "version_added": "32"
            },
            "edge": {
              "version_added": "12"
            },
            "firefox": {
              "version_added": "47"
            },
            "firefox_android": {
              "version_added": true
            },
            "ie": {
              "version_added": "11"
            },
            "opera": {
              "version_added": "19"
            },
            "opera_android": {
              "version_added": "19"
            },
            "safari": {
              "version_added": "8",
              "version_removed": "preview"
            },
            "safari_ios": {
              "version_added": "8"
            },
            "samsunginternet_android": {
              "version_added": "2.0"
            },
            "webview_android": {
              "version_added": "4.4"
            }
          },
          "status": {
            "experimental": false,
            "standard_track": true,
            "deprecated": false
          }
        }
      },
      "drawElementsInstancedANGLE": {
        "__compat": {
          "mdn_url": "https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE",
          "support": {
            "chrome": [
              {
                "version_added": "preview"
              },
              {
                "alternative_name": "foo",
                "version_added": "39",
                "version_removed": "45"
              }
            ],
            "chrome_android": {
              "version_added": "32"
            },
            "edge": {
              "version_added": "12"
            },
            "firefox": {
              "version_added": "47"
            },
            "firefox_android": {
              "version_added": true
            },
            "ie": {
              "version_added": "11"
            },
            "opera": {
              "version_added": "19"
            },
            "opera_android": {
              "version_added": "19"
            },
            "safari": {
              "version_added": "8"
            },
            "safari_ios": {
              "version_added": "8"
            },
            "samsunginternet_android": {
              "version_added": "2.0"
            },
            "webview_android": {
              "version_added": "4.4"
            }
          },
          "status": {
            "experimental": false,
            "standard_track": true,
            "deprecated": false
          }
        }
      },
      "vertexAttribDivisorANGLE": {
        "__compat": {
          "mdn_url": "https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE",
          "support": {
            "chrome": [
              {
                "prefix": "webkit",
                "version_added": "15"
              },
              {
                "version_added": "preview"
              }
             ],
            "chrome_android": {
              "version_added": "32"
            },
            "edge": {
              "version_added": "12"
            },
            "firefox": {
              "version_added": "47"
            },
            "firefox_android": {
              "version_added": true
            },
            "ie": {
              "version_added": "11"
            },
            "opera": {
              "version_added": "19"
            },
            "opera_android": {
              "version_added": "19"
            },
            "safari": {
              "version_added": "8"
            },
            "safari_ios": {
              "version_added": "8"
            },
            "samsunginternet_android": {
              "version_added": "2.0"
            },
            "webview_android": {
              "version_added": "4.4"
            }
          },
          "status": {
            "experimental": false,
            "standard_track": true,
            "deprecated": false
          }
        }
      }
    }
  }
}

This PR aims to extend the BCD renderer so that the data can be displayed like this:

Bildschirmfoto 2021-06-09 um 14 17 32

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what I did to test this:

  1. Fetched the Elchi3:preview-browsers branch of mdn/browser-compat-data locally
  2. Fetched the Elchi3:preview-browsers branch of mdn/yari locally, and re-based it on the latest main branch of mdn/yari to prevent an error related to a popularities file.
  3. Changed line 52 in package.json to use my local Elchi3:preview-browsers branch of mdn/browser-compat-data so I'm using the new BCD 4.0.0 data and format:
    "@mdn/browser-compat-data": "file:../browser-compat-data",
  4. Copied the api/ANGLE_instanced_arrays.json from the introduction into my local mdn/browser-compat-data
  5. Ran the tests (looked good)
  6. Ran a complete build of the English docs (no errors)
  7. Checked the BCD table that was built locally (looked good!)

image

I did have to make one minor change that's also necessary to change in this PR (see below), but otherwise, this looks good to me!

@Elchi3
Copy link
Member Author

Elchi3 commented Aug 12, 2021

Thank you so much Ryan! 🎉

Copy link
Contributor

@escattone escattone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Elchi3! This is ready to go once version 4.0.0 of @mdn/browser-compat-data is released and Yari is updated to use that version. 🎉 🚀

FYI, the tests should all pass once Yari is updated to use version 4.0.0 of @mdn/browser-compat-data.

@ddbeck
Copy link
Contributor

ddbeck commented Aug 19, 2021

📣 BCD v4.0.0 just dropped! 📣

When Yari upgrades to v4.0.0, this PR needs to go along with it.

@Elchi3 Elchi3 marked this pull request as ready for review August 19, 2021 14:58
@peterbe
Copy link
Contributor

peterbe commented Aug 19, 2021

What are some good pages to test it on?

@escattone escattone merged commit 9a9cc5e into mdn:main Aug 19, 2021
@Elchi3 Elchi3 deleted the preview-browsers branch August 19, 2021 16:35
@caugner caugner added the browser-compat issues related to the browser compatibility data tables (BCD) label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-compat issues related to the browser compatibility data tables (BCD)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants