browser-compat-data icon indicating copy to clipboard operation
browser-compat-data copied to clipboard

Add Bun to BCD

Open queengooborg opened this issue 1 year ago • 8 comments

This PR is a draft of what it would look like to add Bun and its data to BCD, if we desired to do so. Note: this draft is meant to be a proof of concept for #18484.

Releases are obtained from Bun's GitHub repository. Compatibility data is obtained from unjs/runtime-compat.

queengooborg avatar Jun 19 '24 06:06 queengooborg

is there anything needed to push this along/fill out more data? happy to pitch in if it'd help

nektro avatar Sep 27 '24 19:09 nektro

This is just a proof of concept right now, and is awaiting owner consensus to add!

queengooborg avatar Sep 27 '24 19:09 queengooborg

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Oct 08 '24 12:10 github-actions[bot]

Since Bun is currently covered by runtime-compat, I would suggest closing this PR for now.

caugner avatar Dec 10 '24 16:12 caugner

NodeJS and Deno are also covered by runtime-compat, but we include data for both of them in BCD. I think that it's helpful to include Bun's data in BCD especially as there's been lots of consumer interest, and runtime-compat only obtains the data for the latest versions of each runtime.

I would like to keep this PR open as a draft as a reminder to come to a decision.

queengooborg avatar Dec 10 '24 19:12 queengooborg

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Jan 16 '25 16:01 github-actions[bot]

This pull request has merge conflicts that must be resolved before it can be merged.

github-actions[bot] avatar Apr 15 '25 10:04 github-actions[bot]

@caugner bumping this, we would really love it if your team added support!

connerlphillippi avatar Apr 23 '25 23:04 connerlphillippi

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

github-actions[bot] avatar Jul 02 '25 23:07 github-actions[bot]

Following up here - is there anything we can do at Bun to help get this merged?

alii avatar Jul 11 '25 22:07 alii

Getting your review has been the biggest help already, thanks @alii!

I'll be bringing this up again in the next BCD meeting call (which happens every Tuesday at 2am PT / 10am UK / 11am CET, and is open to anyone who wants to participate) to see where we're at!

queengooborg avatar Jul 13 '25 00:07 queengooborg

As discussed in the previous meeting, new features may potentially be introduced in patch releases. I will be updating this PR in the near future to track patch releases, as well as update the documentation regarding patch releases, and have marked this PR as a draft in the meantime.

queengooborg avatar Jul 16 '25 11:07 queengooborg

Alright, this PR has now been updated to track patch releases for Bun -- and from the updates to the data, it looks like it's a good thing we did!

queengooborg avatar Jul 18 '25 10:07 queengooborg

To add a new browser to BCD, we require machine-readable release information, including version numbers, release dates, links to release notes or changelogs, and (if applicable) underlying engine version numbers.

You've added a new file browsers/bun.json that contains this info. What I don't see is automated updates to this file. We need at least a follow-up issue filed for this. This needs a script in scripts/update-browser-releases/ basically.

I can file a follow-up issue for this!

a compelling data-automation story (e.g., using mdn-bcd-collector to generate data updates)

I think this is in progress, see openwebdocs/mdn-bcd-collector#2582. How far can this be automated? Would it be possible to make it so that the collector sends automated BCD PRs? I'm not volunteering to run the collector for bun regularly and to create BCD PRs. Is anyone volunteering to do this?

Running tests is made possible by https://github.com/unjs/runtime-compat, which runs tests on the latest versions of Bun (and other runtimes). The Bun team is currently looking into expanding its capabilities so that it can run on additional versions of Bun (and in exchange, NodeJS and Deno). In the meantime, I've devised a temporary solution, which was how this PR was created!

queengooborg avatar Jul 29 '25 00:07 queengooborg

Thanks Florian for the notes here!

Re/ automation, we'd be happy to set something up to run the necessary scripts in CI and submit a pull request on new releases of Bun. Would that be a good idea/useful?

alii avatar Aug 01 '25 01:08 alii

That would be very useful!

Elchi3 avatar Aug 01 '25 09:08 Elchi3

It is surprising to me that other javascript/ folders haven't seen bun additions (statements/operators/grammar/etc.).

I just found out why this is: it appears that this is an issue with unjs/runtime-compat-data (which is providing the backbone for generating these results). RCD appears to be isolating only the JavaScript builtins when running tests. I've submitted a PR to resolve this upstream, and am now updating this PR accordingly!

queengooborg avatar Aug 13 '25 19:08 queengooborg

(PR Review Companion is failing, because it uses the release data from the main branch. As this is an edge-case, the review companion output wouldn't be that helpful anyways, it probably doesn't justify taking the risk of using the PR release data in the review companion.)

caugner avatar Aug 14 '25 16:08 caugner

With the final updates to the data applied, and a plan to set up automatic results collection (which will also apply to Node.js and Deno) in the near future, are there any other details that need addressing?

queengooborg avatar Aug 14 '25 17:08 queengooborg

I still don't see:

  1. A BCD issue that tracks implementing auto-updating browsers/bun.json
  2. BCD documentation how to update bun data when there is a new bun release. Or alternatively: an issue on the bun project to implement automation that sends PRs to BCD whenever there is a new bun release impacting compat data.

Elchi3 avatar Aug 15 '25 09:08 Elchi3

I've opened #27599 for automating the release data for all JavaScript runtimes!

Regarding documentation about updating Bun data, we don't really have that for any runtime that we track in BCD? I do think that's a good idea since we talk about using the mdn-bcd-collector for browsers, but we don't really talk about using runtime-compat for Node.js and Deno yet, and we should probably hold off on documenting it until RCD has been updated to run on all runtime versions, not just the latest!

queengooborg avatar Aug 16 '25 15:08 queengooborg

I've opened #27599 for automating the release data for all JavaScript runtimes!

Thanks!

Regarding documentation about updating Bun data, we don't really have that for any runtime that we track in BCD? I do think that's a good idea since we talk about using the mdn-bcd-collector for browsers, but we don't really talk about using runtime-compat for Node.js and Deno yet, and we should probably hold off on documenting it until RCD has been updated to run on all runtime versions, not just the latest!

Could be that we don't have that for deno and node but the guidelines have become stricter (see https://github.com/mdn/browser-compat-data/pull/27213). The goal here is to not add new runtimes/browsers to BCD anymore that outdate quickly. We still need to fix that for node and deno but for new additions (bun), it makes sense to have a plan from the start.

Elchi3 avatar Aug 18 '25 08:08 Elchi3

I have just opened an OWD project proposal regarding this, to establish a proper plan for not only automatically testing Bun, but Node.js and Deno as well (since I think that a plan for one is a plan for all): https://github.com/openwebdocs/project/issues/229

queengooborg avatar Aug 25 '25 10:08 queengooborg

As we discussed in our weekly meeting, I have pulled the changes from #27625 into this PR, so that everything is added all in one go!

queengooborg avatar Aug 26 '25 09:08 queengooborg

Thank you everyone! 🎉

alii avatar Aug 26 '25 18:08 alii