Reviewing BCD changes

When reviewing BCD pull requests created using mdn-bcd-collector, it helps to have a high-level understanding of how it works and what kinds of errors are common.

Basically, feature tests are run on multiple versions of the same browser and support ranges are inferred. A test could be as simple as 'fetch' in window. If that test returns false in Chrome 1-41 and returns true in Chrome 42 and later, { "version_added": 42 } will be inferred.

How the script works

The update-bcd.js script works as follows:

What to look out for

These errors are worth looking out for:

Changes to option parameter data

In v8.0.0, a new function was introduced (bcd.testOptionParam()) which allowed for the testing of option parameter support. For example, given the Window.scroll() method, it can determine if the top option parameter in Window.scroll({top: 0}) has been accessed. However, there are still a few caveats with this approach:

Minor Safari version changes

In v6.1.1, a major update was made to the useragent parser involving minor version numbers for browsers (specifically, Safari). As such, newer pull requests may be opened that change the minor version of a browser. If a newer collector version includes a change to a browser's minor version, then always trust the newer collector over the old one. (For example, if a collector PR for v6.0.8 was merged that indicates the feature was added in Safari 15.5, but there is a new PR with collector v6.1.2 that changes the version number to Safari 15.4, then trust Safari 15.4 to be the version number.)