Has Anyone Tried to Run Their Meteor Build with Bun.js?

What the title says.

Bun — fast all-in-one JavaScript runtime

4 Likes

Is it possible? . I would like to know as well

Server-side, the main prerequisite would be for Bun to support Fibers (which comes back to Node not even supporting Fibers anymore and a lot of the impetus behind Meteor 3.0 needing to work without fibers).

(It might be possible to run Meteor without fibers already, but I imagine nothing specific to Meteor would work, since Meteor Methods, WebApp, and Collections require it… I think…)

Also curious. Bun just hit 1.0. Maybe now is a good time to experiment with Meteor 3.0 alpha without Fibers.

2 Likes

Both Bun and Deno runtimes should be tried. I’m not sure what details are involved but if someone has an idea how to perform the swap, write it up in Dev.to so some of us can try it too.

1 Like

Video of Bun 1.0 https://www.youtube.com/watch?v=BsnCpESUEqM . Would be great to use it with Meteor 3

3 Likes

After Meteor 3 I think it will be worth trying to look into re-building Meteor on top of Bun. Let’s not have any illusions here.
This will not be an easy process (both Deno and Bun). Pretty much a pre-requisite is full migration to npm packages.
In case of Bun that seems to me (on a first look) to be it for the most part (will have to change the build plugins as well). In case of Deno, last time I looked it will require a few more steps.

6 Likes

Yes. Definitely any path will be hard.

Talking about Meteor 2 this would be the first step

https://twitter.com/FilipeNevola/status/1702089249464484163?t=8hfPAJevlH_WCnlCekRxpQ&s=19

But I couldn’t find anything about coroutines in JSC

1 Like

For Meteor 3 the path should be simpler as Bun already implements partially async_hooks but we always need to remember that Meteor has many pieces.

Runtime should be ok as Bun is trying to be compatible with Node.js but bundler and other stuff are Meteor specific and built from scratch.

The good news in this area is that Bun also does many other things like Meteor so it could be an opportunity for Meteor to do less and rely more in external tools.

8 Likes

With Node.js 20, Bun and Deno I did some database connect tests, creating single executeable tests, and checking what CPU/OS support is available:

3 Likes

@hschmaiske

It seems that you tried Bun with Meteor here a little. How far did you get?