mdn / browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
4.91k stars 1.98k forks source link

Add Bun runtime to BCD #18484

Open programandoconro opened 1 year ago

programandoconro commented 1 year ago

What type of issue is this?

Request to add a new browser

What information was incorrect, unhelpful, or incomplete?

I was experimenting today with Bun and it actually includes fetch by default. I know Bun is still in beta but due to its recently boom in popularity, I was expecting to see in the support data.

What did you expect to see?

Bun as supporting fetch in the data.

Did you test this? If so, how?

Yep, fetch seems to work fine in Bun.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://github.com/oven-sh/bun

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

MDN metadata

MDN page report details * Query: `api.fetch` * Report started: 2022-12-27T07:23:57.806Z
queengooborg commented 1 year ago

I haven't heard of Bun until now, but this is a request to track the Bun runtime in BCD, correct?

programandoconro commented 1 year ago

Hello, thank you for you mail. Well, in here https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#browser_compatibility there is a table of browser compatibility. At the very end, there is a section with a 'server' icon, where node and dino are grouped. In that section, I was expecting to also see bun. Bun is also using native fetch and its popularity is increasing because it claims to be 'blazingly' fast as no other. thank you.

On Wed, Dec 28, 2022 at 9:25 AM queengooborg @.***> wrote:

I haven't heard of Bun until now, but this is a request to track the Bun runtime in BCD, correct?

— Reply to this email directly, view it on GitHub https://github.com/mdn/browser-compat-data/issues/18484#issuecomment-1366278343, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6LYNRNFTNUIZ4MRWADT2DWPOCG5ANCNFSM6AAAAAATKGEB74 . You are receiving this because you authored the thread.Message ID: @.***>

queengooborg commented 1 year ago

Okay, so it is then -- I'll modify the issue to better represent this, and relay it to the rest of the BCD owners to get their opinion, since tracking a new runtime in BCD is a large commitment (adding an entire runtime to the infrastructure just for one or a few features would be pointless after all).

programandoconro commented 1 year ago

Thank you.

2022年12月28日(水) 18:17 queengooborg @.***>:

Okay, so it is then -- I'll modify the issue to better represent this, and relay it to the rest of the BCD owners to get their opinion, since tracking a new runtime in BCD is a large commitment (adding an entire runtime to the infrastructure just for one or a few features would be pointless after all).

— Reply to this email directly, view it on GitHub https://github.com/mdn/browser-compat-data/issues/18484#issuecomment-1366495248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL6LYNTA6Q774FJSRRP6LRLWPQATTANCNFSM6AAAAAATKGEB74 . You are receiving this because you authored the thread.Message ID: @.***>

whinc commented 1 year ago

bun has released v1.0.0 at September 8, 2023

lgarron commented 1 year ago

I would be really glad to see this in browser compat data. Where node-ts and deno walked, bun is running.

It is by far the most straightforward way to run TypeScript code without a compilation step — both for server code and client code. A lot of web-compatible code (e.g. web workers, to name just one example) runs in bun with zero modification, making it extremely simple to iterate and test code without separate build steps of polyfills. It is an ideal tool for coding anything using web technologies.

I expect that I will be starting to orient my personal web development flow around what is available in browsers and bun, at least as much as node compatibility, and I'd be glad to be able to use MDN as a reference for that.

queengooborg commented 12 months ago

Hey all! We have discussed adding Bun to BCD in the most recent BCD meeting. We have guidelines for adding new browsers (see the corresponding docs), and only the last two are currently met.

To track Bun in BCD, we will need the following:

In other words, we will need interest from either the rest of MDN (https://github.com/mdn/yari), CanIUse (https://www.caniuse.com), or another large consumer of BCD (such as JetBrains or Visual Studio). We will also need contributors who are interested and able to review data relating to Bun, either two independent individuals or one individual associated with Bun who is willing to maintain Bun-related data.

lgarron commented 11 months ago
  • reviewers (e.g., two or more people with interest and ability to test data relating to new and existing releases, or at least one reviewer acting on behalf of the vendor)

I'd be happy to volunteer as an independent reviewer.

Is there data on roughly how much work load this is initially, and then on an ongoing basis?

(It looks like there are ≈1800 entries for both deno and node at the moment, I assume they got added in smaller batches?)

queengooborg commented 10 months ago

Thank you for your interest, @lgarron! Apologies for not responding until now -- we at Open Web Docs have been working hard on another project (see https://github.com/openwebdocs/project/issues/168), and this had slipped off of our radar.

For the most part, I would say that the compatibility data for Bun can be added over time, so the initial work can be performed in smaller batches. The responsibility for a reviewer for an engine would be the following:

For web browsers, we have a system implemented to do this automatically (https://mdn-bcd-collector.gooborg.com) by running code for many features and collecting the results, then compiling them into BCD changes. However, it is not yet designed to run in standalone JS runtimes like Node.js, Deno and Bun, so we must rely on contributors to maintain that data. We aim to implement support in the future, but that has also been on our backburner. (If anyone's interested in contributing to add support, however, I will happily review and accept PRs related to that goal!)

queengooborg commented 3 months ago

Hey all! I wanted to give an update on where we're at in regards to adding Bun.

A sister project called runtime-compat-data by UnJS was developed and launched recently, which uses the collector and its tests to detect compatibility and generate a support report for various runtimes, including NodeJS, Deno and Bun.

Because it uses the collector, the results generated are in the same structure as BCD. As such, we have been able to use it to update our own NodeJS and Deno data!

I'm going to revisit the idea of adding Bun in our next BCD meeting call!