Closed Elchi3 closed 4 years ago
Browsers that map (in bold: tier 1 browsers):
caniuse | BCD |
---|---|
ie | ie |
edge | edge |
firefox | firefox |
chrome | chrome |
safari | safari |
opera | opera |
ios_saf | safari_ios |
android | webview_android |
op_mobile | opera_android |
and_chrome | chrome_android |
and_ff | firefox_android |
and_uc | uc_android, uc_chinese_android |
samsung | samsunginternet_android |
and_qq | qq_android |
Browsers that don't map:
caniuse | BCD |
---|---|
op_mini | --- |
bb | --- |
ie_mob | --- |
baidu | --- |
kaios | --- |
--- | nodejs |
(updated to remove edge_mobile, which will soon be gone from BCD)
For browsers that are in both, BCD and in caniuse:
caniuse | BCD |
---|---|
ie: 5.5, 6, 7, 8, 9, 10, 11 | ie: 1, 2, 4, 5, 5.5, 6, 7, 8, 9, 10, 11 |
edge: 12, 13, 14, 15, 16, 17, 18, 75 | edge: 12, 13, 14, 15, 16, 17, 18 |
firefox: 2-68 | firefox: 1-71 |
chrome: 4-77 | chrome: 1-77 |
safari: 3.1, 3.2, 4, 5, 5.1, 6, 6.1, 7, 7.1, 8, 9, 9.1, 10, 10.1, 11, 11.1, 12, 12.1, TP | safari: 1, 1.1, 1.2, 1.3, 2, 3, 4, 4.1, 5, 5.1, 6, 6.1, 7, 8, 9, 9.1, 10, 10.1, 11, 11.1, 12, 12.1, |
opera: 9, 9.5-9.6, 10.0-10.1, 10.5, 10.6, 11, 11.1, 11.5, 11.6, 12, 12.1, 15-58 | opera: 2, 3, 3.5, 3.6, 4, 5, 5.1, 6, 7, 7.1, 7.2, 7.5, 8, 8.5, 9, 9.1, 9.2, 9.5, 9.6, 10, 10.1, 10.5, 10.6, 11, 11.1, 11.5, 11.6, 12, 12.1, 15-62 |
ios_saf: 3.2, 4.0-4.1, 4.2-4.3, 5.0-5.1, 6.0-6.1, 7.0-7.1, 8, 8.1-8.4, 9.0-9.2, 9.3, 10.0-10.2, 10.3, 11.0-11.2, 11.3-11.4, 12.0-12.1, 12.2 (a few versions are treated as one) | safari_ios: 1, 2, 3, 3.1, 3.2, 4, 4.2, 4.3, 5, 5.1, 6, 6.1, 7, 7.1, 8, 8.1, 8.4, 9, 9.1, 9.2, 9.3, 10, 10.1, 10.2, 10.3, 11, 11.1, 11.3, 12, 12.2 |
android: 2.1, 2.2, 2.3, 3, 4, 4.1, 4.2-4.3, 4.4, 4.4.3-4.4.4, 67 | webview_android: 1, 1.1, 1.5, 1.6, 2, 2.2, 2.3, 3, 4, 4.1, 4.2, 4.4, 4.4.3, 37-76 |
op_mobile: 10, 11, 11.1, 11.5, 12, 12.1, 46 | opera_android: 10.1, 11, 11.1, 11.5, 12, 12.1, 14, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 |
and_chrome: 74 | chrome_android: 18, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 |
and_ff: 66 | firefox_android: 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 |
samsung: 4, 5.0-5.4, 6.2-6.4, 7.2-7.4, 8.2, 9.2 | samsunginternet_android: 1.0, 1.5, 1.6, 2.0, 2.1, 3.0, 3.2, 4.0, 4.2, 5.0, 5.2, 5.4, 6.0, 6.2, 6.4, 7.0, 7.2, 7.4, 8.0, 8.2, 9.0, 9.2 |
and_uc: 11.8 | uc_android, uc_chinese_android: (entirely different but unmaintained) |
and_qq: 1.2 | qq_android: 8, 7.2.1, 7.3.1, 7.5, 7.5.1, 7.6.1, 7.8, 8.1.3, 8.2 |
Observations:
For 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.
Caniuse:
"ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"n",
"10":"n",
"11":"n"
},
BCD
"ie": {
"version_added": false
},
Caniuse:
"ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"y",
"10":"y",
"11":"y"
},
BCD:
"ie": {
"version_added": "9"
},
Caniuse:
"ie":{
"5.5":"u",
"6":"u",
"7":"u",
"8":"u",
"9":"u",
"10":"u",
"11":"u"
},
BCD:
"ie": {
"version_added": null
},
Caniuse:
"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"
}
]
}
],
Caniuse:
"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."
}
],
Caniuse:
"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"
}
],
Caniuse:
"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
},
Caniuse:
"ie":{
"5.5":"n",
"6":"n",
"7":"n",
"8":"n",
"9":"y",
"10":"y",
"11":"n"
}
BCD:
"ie": {
"version_added": "9",
"version_removed": "11"
},
Both data structures come with certain meta data that sometimes map directly or indirectly. Some things don't map at all, though.
caniuse | BCD |
---|---|
title ("CSS :any-link selector") |
description ("\:any-link\ ") |
description ("The :any-link CSS pseudo-class matches all elements that match :link or :visited") |
--- (mdn-short-descriptions is a separate alpha npm package) |
spec |
spec_url |
status ("wd", "ls") |
status.standard_track (true,false) |
links (array{url,title}) |
--- (mdn_url ) |
bugs |
--- (notes ) |
categories |
--- (tree hierarchy) |
usage_perc_y |
--- |
usage_perc_a |
--- |
ucprefix |
--- |
parent |
--- (tree hierarchy) |
keywords |
--- |
ie_id |
--- |
chrome_id |
--- |
firefox_id |
--- |
webkit_id |
--- |
shown |
--- |
--- | status.experimental |
--- | status.deprecated |
Very interesting @Elchi3 ! I had a few random observations.
I 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: https://github.com/mdn/browser-compat-data/issues/3280.
We've also talked about explicitly supporting bug links: https://github.com/mdn/browser-compat-data/issues/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.
I 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.