GoogleChrome / chromium-dashboard

Chrome Status Dashboard
https://www.chromestatus.com
Apache License 2.0
637 stars 362 forks source link

Use MDN's browser-compat-data for browser status info #566

Open connorshea opened 6 years ago

connorshea commented 6 years ago

browser-compat-data is a project by the team at MDN to track browser support for pretty much every web feature. It's used to build the browser compatibility tables on MDN.

Using the data from this package would come with a few benefits:

For example, the new Array.prototype.flatMap() feature is represented in the browser-compat-data package as javascript.builtins.array.flatMap. The Chrome Status page suggests that Firefox doesn't support flatMap, but the browser-compat-data project lists it as supported in Firefox 62.

I'm not sure how the Chromium dashboard is built, but I imagine you could associate a given feature with its identifier in browser-compat-data (e.g. javascript.builtins.array.flatMap) and then pull the data from there when generating features.json.

The package doesn't track every feature from every possible spec, so features that are still in very early stages may not be tracked and data would have to continue to be gathered manually.

ebidel commented 6 years ago

Definitely want to do something better in this space. Stale data doesn't help anyone. It's been on the wishlist for a long time to incorporate the data from other browser vendors, and more recently, the MDN compat data. We've just never found the time to prioritize the update.

I think one of the biggest challenges is just figuring out the mapping from MDN feature names to chromestatus feature ids. We want to automate as much of that as possible so chromium engineers don't have to do lookups themselves when creating new entries. Do you know if there's an online web service/endpoint to query the full browser compat json?

and....would you be interested in helping with a PR? :)

Related: https://github.com/GoogleChrome/chromium-dashboard/issues/224, https://github.com/GoogleChrome/chromium-dashboard/issues/114, https://github.com/GoogleChrome/chromium-dashboard/issues/506, https://github.com/GoogleChrome/chromium-dashboard/issues/288.

connorshea commented 6 years ago

Unfortunately I'm not aware of any service that has the full JSON available, but I do have a project where I generate a data.json file that has all of the browser compat data in it.

This is the file that generates the data.json, and you should be able to use something like it to do the same thing when you want to query the full dataset.

connorshea commented 6 years ago

And I'd be interesting in helping with a PR if I can get some guidance on how it'd be integrated into the site :)

connorshea commented 6 years ago

So I've installed the chromium-dashboard locally and got it running, and I suppose I didn't realize it was an application where features are added via a web form. I'd assumed it was some sort of static JSON file that was updated manually, so this is interesting :)

I'd assume the best course of action would be to allow the user to type the name of their feature into an input which would make the app search for the given feature in the browser-compat-data. At that point, you could select the feature (e.g. javascript.builtins.array.flatMap) and then data for Firefox, Edge, etc. would be updated.

Ideally the inputs for Edge, Firefox, etc. would be disabled (with a manual override if necessary?) so the data could be updated without manual intervention whenever a new BCD package was released.

The main problem is what happens when you add a BCD item to an existing feature, and I'm not sure what the ideal implementation would be for that.

I'd interested to hear if you have any better ideas for how this could be implemented :)