Bun Update: Should I switch?

Covenant Ifeoluwa
4 min readMay 10, 2024

--

Late 2023, I wrote about Bun, stating most importantly how fast it is. Now here’s my 50 cents after scraping the internet for users experience so you don’t have to. Note that most of the information to be highlighted here are based on the experience of developers in different communities who have adopted the package manager as a primary driver for their projects.

At first, Let’s talk about the major updates from Bun team since my last article. If you don’t know what Bun is or you haven’t read my previous article, you can find it here.

  1. Bun supports windows, Yay!
    In the earlier release of Bun does not run natively on Windows as of 1.0.7. We can use WSL to bridge this gap however. Which you also need to be on a recent version of Windows that supports WSL (Windows 10 build 19046 or higher. Or Windows 11) but in the version 1.1, the Bun team released an update with support for Windows. That means everything from the runtime, test runner, package manager, bundler — it all works on Windows.

To get started with Bun on Windows, run the following command in your terminal:

powershell -c "irm bun.sh/install.ps1 | iex"

2. bun.report is Bun’s new crash reporter
As a new node-js compatible package manager, feedbacks are necessary which will help the Bun team improve and easily fix bugs, That’s why in Bun v1.1.5, I wrote a compact new format for Zig and C++ crash reports. The crash report fits in a ~150 byte URL containing zero personal information.

It is also important to note in a bid to compare NodeJS to Bun that while Node.js is a powerful runtime for JavaScript, it doesn’t natively support TypeScript files. To execute TypeScript in a Node.js environment, external dependencies are required. One common approach is to use a build step to transpile TypeScript (TS) into JavaScript (JS) and then run the resulting JS code. In contrast, Bun offers a more streamlined approach. It comes with a JavaScript transpiler integrated into the runtime. This allows you to directly run .js, .ts, .jsx and .tsx files. Bun's built-in transpiler seamlessly converts these files to vanilla JavaScript, facilitating immediate execution without additional steps.

Now I think that’s enough praising for bun, let’s start talking about the issues fellow developers has had with bun over the last few months of using it as a primary package manager.

As of now, Bun.js is simply not superior to Node.js. As we are all hyped about the speed it is easy to overlook the major problems that will hinder development speed. So without further ado… Let’s dive right in.

1. `bun update` Does Not Update your `package.json` File

Now this one is a real bummer.

Daniel Craciun a popular developer states the below:

When I run bun update inside my Next.js project, the following happens:

  1. The packages update
  2. The package.json file remains the same
The package.json seems unchanged

This issue unfortunately is still open on Github

2.`bunx` Cannot Install Latest Package Versions.

Daniel Craciun went on to also state this very important problem he discovered. Unfortunately, this issue is still open on GitHub.

A workaround is to run npx create-ndpt-app rather than bunx, we all hope this gets fixed in the near future.

3. Lack of Ecosystem

Unlike Node.js, bun has not been around for merely as long, and as a result there is limited documentation and help due to the Lack of Ecosystem.

This, however, is changing as the JavaScript community begins to adopt bun in their applications.

But due to the countless bugs and issues that exist, the rate of adoption is not as fast as it should be.

In conclusion, while Bun has made significant strides in terms of Windows support and introducing features like bun.report for crash reporting, it still faces some critical challenges that may deter developers from fully embracing it as a primary package manager.

Issues such as `bun update` not updating the `package.json` file and limitations with `bunx` in installing the latest package versions are significant hurdles that need to be addressed. Additionally, the lack of a mature ecosystem compared to Node.js contributes to a slower adoption rate and fewer resources for developers seeking assistance.

While the speed of Bun is commendable, it’s essential to consider these drawbacks carefully before making a switch. Developers should weigh the benefits of Bun’s performance against the potential workflow disruptions caused by its current limitations.

Ultimately, the decision to switch to Bun should be made after thorough evaluation of its suitability for individual project requirements and tolerance for its existing shortcomings. As Bun continues to evolve, addressing these issues will be crucial in gaining broader acceptance within the developer community.

--

--