mdn/browser-compat-data

Data on things that aren't browsers?

littledan opened this issue · 9 comments

Developers write code which is designed to work in various environments, and think about compatibility across them, for example:

  • Node.js (missing some web APIs, but others are supported)
  • Transpilers like Babel and TypeScript (for JavaScript language features)
  • Bundlers (module system features)
  • Polyfills (these exist for some things and not others)

Would this repository be a good place to store this kind of information, potentially?

Related effort: https://github.com/littledan/js-shared-interfaces

Many MDN articles include polyfills right in them (if they are relatively simple) - for example, most of the array methods like https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find#Polyfill

Others include links, often in the 'see also' section, either directly or by linking to something which itself does.

Caniuse puts this sort of thing sometimes under 'resources'.

Like browser support, this seems kind of like the sort of thing it would be good to do one way and manage pretty easily.. Is anyone open to that? I'm not super familiar with the schema and I don't see a place for it - but it seems like even if this is limited to browser compat data, linking people how to transpile/polyfill seems tremendously helpful until it reaches full support, and knowing where to look and where to put it seems good.

There is a lot in this issue :) We started think about some things but there is no detailed plan for all of what you mentioned.

Nodejs is part of this repo and so far we've mostly populated data for ECMAScript features, but there are first PRs submitted to also add nodejs for certain Web APIs (we need to tweak the wiki compat table rendering to also add nodejs there when it makes sense).

We haven't thought about which transpilers or bundlers to include, or if any at all.

For Polyfills, I have thoughts in this discourse thread, unfortunately, it wasn't a priority or there just wasn't enough time to implement any of it yet. https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500

Really happy to hear that all of this stuff is potentially in scope for you, if the work is put into it! Would this be a good area for me to direct potential contributors to?

For now, adding compat data about nodejs is probably the one thing here that is non-controversial or requires no plan-making and/or discussions etc on how to move forward. So, for that, I'd welcome contributions (=PRs).
For the other things mentioned (Polyfills, transpilers, bundlers etc), I think we first have to make a plan and agree on an exact way forward for MDN and BCD. Discourse is a great place to discuss and I'm happy if people participate in discussions.

Is there a good URL I could point to to describe how Node compat data is welcome?

Not yet, but we want to write docs on how to find and contribute compat data for each browser of this repo. See #3226. I will prioritize that issue.

Eventually I would definitely like for us to be rid of polyfills on MDN. We should instead be providing links to good places to get them for a given API. If we can't find a good one out there, then we could offer them on Github, perhaps.

I requested to add JSDOM support information a while back in #3180, but that got rejected.

We've added guidelines to describe the requirements for adding a browser/engine to BCD, and since this issue was opened, we've added both NodeJS and Deno to our data. I think the guideline additions are sufficient for closing this issue, along with precious discussion above.