-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Research: Schema comparison caniuse and BCD #4051
Comments
Browsers in BCD and in caniuseBrowsers that map (in bold: tier 1 browsers):
Browsers that don't map:
(updated to remove edge_mobile, which will soon be gone from BCD) |
Browser version differencesFor browsers that are in both, BCD and in caniuse:
Observations:
|
Comparing core compat data structuresFor readability, I've taken IE to illustrate this, but note that caniuse always lists every version number for a browser and adds a support modifier like "u", "n", "a", etc. Indicating no supportCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"n",
"10":"n",
"11":"n"
}, BCD "ie": {
"version_added": false
}, Indicating simple supportCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"y",
"10":"y",
"11":"y"
}, BCD: "ie": {
"version_added": "9"
}, Indicating unknown supportCaniuse: "ie":{
"5.5":"u",
"6":"u",
"7":"u",
"8":"u",
"9":"u",
"10":"u",
"11":"u"
}, BCD: "ie": {
"version_added": null
}, Indicating support behind a flag and later enabled by defaultCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"n d #1",
"10":"n d #1",
"11":"y"
},
"notes_by_num":{
"1":"Can be enabled in IE by setting the about:config preference foo.bar.enabled to true",
} BCD: "ie": [
{
"version_added": "11"
},
{
"version_added": "9",
"flags": [
{
"name": "foo.bar.enabled",
"type": "preference",
"value_to_set": "true"
}
]
}
], Indicating partial supportCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"a #1",
"10":"a #1",
"11":"y"
},
"notes_by_num":{
"1":"Partial support refers to foo bar.",
} BCD: "ie": [
{
"version_added": "11"
},
{
"version_added": "9",
"partial_support": true,
"notes": "Does not support foo bar."
}
], Indicating prefixed supportCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"y x",
"10":"y x",
"11":"y"
} BCD: "ie": [
{
"version_added": "11"
},
{
"version_added": "9",
"prefix": "-ms"
}
], Indicating support via polyfillCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"p",
"10":"p",
"11":"p"
} BCD has no data structure for this. We often fall back to notes for things not in our data model, but afaik haven't done so for polyfills. "ie": {
"version_added": false
}, Indicating support removalCaniuse: "ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"y",
"10":"y",
"11":"n"
} BCD: "ie": {
"version_added": "9",
"version_removed": "11"
}, |
Comparing meta data structuresBoth data structures come with certain meta data that sometimes map directly or indirectly. Some things don't map at all, though.
|
Very interesting @Elchi3 ! I had a few random observations. polyfillsI found this issue today because I was reading https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 again, and especially @torgo 's comment, and went looking to see if anyone had already filed a bug in browser-compat-data about this. It seems like such a good idea, because BCD is exactly the context where someone might want to know about polyfills, and IMO if we could integrate this we could just remove all those Wiki polyfills, which currently fill me with so much sadness. So it's interesting that caniuse represents polyfills. Unless I mistaken though, the "p" notation doesn't give you a way to link to a particular polyfill, which seems like it would be most useful. BCD issue for this: #3280. bugsWe've also talked about explicitly supporting bug links: #126 although it foundered a bit on whether we should restrict it to implementation bugs for unsupported features (i.e. the bug that tracks the feature's development). But I thought this comment was really good. keywordsI think these help a lot with usability in caniuse: if you don't know the exact name of a thing, you can search and and have a good chance of finding it. We have a persistent request for the ability to show BCD for a collection of related things (see e.g. https://discourse.mozilla.org/t/browser-compatibility-tables-for-api-overviews/33832) and perhaps something like this would be able to deliver that. For example in that Discourse post there was chat about displaying compat for "web components" and caniuse handles this rather well: https://caniuse.com/#search=web%20components. I worry that it will become a big mess like tags in the Wiki, but perhaps not, since we have a review step (and could even have a list of allowed tags that are updated separately from the data). |
This research lead to a collaboration: https://hacks.mozilla.org/2019/09/caniuse-and-mdn-compat-data-collaboration/ Closing as no further research is planned for the moment. |
We would like to do some research on how the data and schema of caniuse compares to the data of BCD.
For example, a feature in caniuse and a feature in BCD:
https://github.com/Fyrd/caniuse/blob/master/features-json/css-any-link.json
https://github.com/mdn/browser-compat-data/blob/master/css/selectors/any-link.json
Caniuse right now has 516 features in https://github.com/Fyrd/caniuse/tree/master/features-json. They are of different granularity: sometimes it is a single feature like the any-link selector, sometimes it is a whole feature-set like "CSS Grid". In BCD, we have a hierarchical structure which attempts to always go down to the individual features, because that's what makes our data useful for re-use for the machines in e.g. in static code analysis, or for displaying in IDEs and reference docs, etc.
A while ago, I started looking into the coverage part of caniuse and started to map features to BCD entries, to see how there is much overlap or not. There actually is some and so the following table might be helpful for doing the schema / data comparison and research (it is not complete, but a research probe). These are 200 features that map (out of the 516 in total. Again, this probe isn't complete, I bet that 80% or so of caniuse would probably at least map to BCD features).
The last BCD release had 11380 total features, so BCD is much more granular and probably covers a lot more of the web platform (although our data is not fully complete, see the year goal for 2019). For that reason, caniuse might be interested in importing or using the BCD data side by side with their own data.
So, we need to look into how the two data schemas compare and if it is possible, for example, to compute a caniuse data entry from BCD data.
So, this task is mostly about writing up a schema comparison and making a plan for next steps.
The text was updated successfully, but these errors were encountered: