Support for Bun - Preparedness to support different underlying runtimes/bundlres/test runners. #11048
Replies: 19 comments 57 replies
-
Follow up on this discussion – Bun is the latest on a trend to create tools to manage Javascript projects, but that are not built for Javascript themselves. The obvious/biggest reason for this change is performance. These tools are built using languages that provide better performance (like Rust or Zig). It will be difficult for JS-based tools (or runtimes) to compete or keep up against these tools. The overall arching question about this discussion is: What is NX`s stand regarding this trend? Is NX prepared for this future? (e.g. swapping dependency on webpack or babel) |
Beta Was this translation helpful? Give feedback.
-
This is a duplicate of #11049 which states bun needs more time to mature before it is considered as a replacement. |
Beta Was this translation helpful? Give feedback.
-
Is bun ready yet?
|
Beta Was this translation helpful? Give feedback.
-
I've started on experimental bun support with bun install and task runner https://github.com/Jordan-Hall/nx-bun Currently supports bun create and run. Will add bundle is shortly |
Beta Was this translation helpful? Give feedback.
-
Sorry for spam on this. Last comment for now, I think it would be extremely useful for all node API to be imported with "node:..." such as import path from "node:path" this explicitly would be useful as it appears all new runtime are going to support node |
Beta Was this translation helpful? Give feedback.
-
Bun is 1.0 now :) |
Beta Was this translation helpful? Give feedback.
-
I just wanted to throw in 2 cents from the cheap seats: I too am very interested in Bun, especially for runtime support and would like to add my encouragement for the nx team to continue investigating. Not meaning any disrespect to Jordan Hall, but I am not familiar with his development, and would generally trust a native (supported) NX solution/option more. Anyway, love your work :-) |
Beta Was this translation helpful? Give feedback.
-
This would be awesome as a local alternative to nodejs, right now it's missing a lot of node APIs. However the speed is insane, I have been using it for only 2-3 days. |
Beta Was this translation helpful? Give feedback.
-
Bun is a new JavaScript runtime, bundler, and test runner that is still in its early stages of development. It is a promising project, but it is also controversial. Some people believe that Bun is too ambitious and that it is trying to do too much. They argue that it is trying to replace a number of well-established tools, such as Node.js, Webpack, and Jest. Others believe that Bun has the potential to be a major player in the JavaScript ecosystem. They argue that it is a more modern and efficient way to develop JavaScript applications. Only time will tell whether Bun will be successful. However, it is a project worth keeping an eye on. |
Beta Was this translation helpful? Give feedback.
-
Just thought i'll provide an update to @nx-bun/nx package (https://github.com/Jordan-Hall/nx-bun) Every new version now will be migrated. They just 1 PR to fix to add build target (But that will not affect 99% of users wanting to use bun) The only thing holding it back to submit to nx registry and version 1 is testing. All done manually, so this is being worked on. Following that the following is being added in order
|
Beta Was this translation helpful? Give feedback.
-
No need for custom task runner (unless it to use pure bun api - pointless) bun 1.0.2 now allows nx run in bun runetime |
Beta Was this translation helpful? Give feedback.
-
is it possible to write a custom executor that uses the Bun apis, e.g. to read files? |
Beta Was this translation helpful? Give feedback.
-
Just thought I'd chime in as I've been using bun as a package manager for a couple of weeks. It mostly works, the only thing I've noticed is that nx doesn't detect package changes when working out what's affected:
Presumably nx needs a npm/yarn/pnpm lockfile for that - maybe generating a yarn lockfile from bun will help. |
Beta Was this translation helpful? Give feedback.
-
Any update on interest here from the nrwl side @AgentEnder / @StalkAltan ? Bun has definitely tipped over into the mainstream by this point and really worth revisiting. |
Beta Was this translation helpful? Give feedback.
-
I've been hacking in bun, now that it is 1.0, into my nx setup and it is resulting in a 4x speedup on my production projects and a 30% speed up on my public template project. I've documented this in this feature request which has a full reproduction and numbers: Supporting bun moves NX up to the next level in terms of build and test speed. It is a no brainer from my perspective since it is mostly a drop in replacement for node execution wise. |
Beta Was this translation helpful? Give feedback.
-
Please merge for Bun.js support on NX: #22283 |
Beta Was this translation helpful? Give feedback.
-
The PR to support Bun as a package manager is planned for Nx 19 (in two weeks). #22602 Thanks to @Jordan-Hall for the PR and helping to land this. We'll use this as a starting point for future Bun support (i.e. as a runtime). |
Beta Was this translation helpful? Give feedback.
-
Bun package manager support was released in 19.1.
|
Beta Was this translation helpful? Give feedback.
-
How would we switch package manager for an existing project/workspace? |
Beta Was this translation helpful? Give feedback.
-
Update from Nx Team:
Bun package manager support was released in 19.1.
There has been a lot of noise around the beta release of Bun. The runtime looks very promising and complete (runtime, bundler, transpiler, and package manager all in one). It replaces node (or deno), webpack, and yarn (or npm).
Beta Was this translation helpful? Give feedback.
All reactions