Add Bun to BCD
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.
is there anything needed to push this along/fill out more data? happy to pitch in if it'd help
This is just a proof of concept right now, and is awaiting owner consensus to add!
This pull request has merge conflicts that must be resolved before it can be merged.
Since Bun is currently covered by runtime-compat, I would suggest closing this PR for now.
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.
This pull request has merge conflicts that must be resolved before it can be merged.
This pull request has merge conflicts that must be resolved before it can be merged.
@caugner bumping this, we would really love it if your team added support!
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).
Following up here - is there anything we can do at Bun to help get this merged?
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!
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.
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!
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.jsonthat 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 inscripts/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!
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?
That would be very useful!
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!
(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.)
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?
I still don't see:
- A BCD issue that tracks implementing auto-updating browsers/bun.json
- 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.
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!
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.
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
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!
Thank you everyone! 🎉