Bun bun-v0.0.72stable Released Mar 17, 2022
Impact Score: 5/10

bun v0.0.72

Source available β€” automated, not human-reviewed

Component: bun Β· Channel: stable. Automated analysis, not a compatibility certification. How this works.

Analysis updated: 2026-11-01.

Compatibility not verified β€” check source notes
πŸ“„ .MD
⚑ Executive Summary (TL;DR)

Bun bun-v0.0.72. Source highlight: This release adds source maps for JS output, several web APIs to bun.js (and `HTMLRewriter`), parser support for ES2022 syntax, improves parsing speed for long strings, makes `bun dev` 10% faster on macOS and fixes a lot of crashes.

Who Does This Impact? (Role-Based Analysis)

πŸ’» Software Engineers & Devs

Check the source notes against the package and APIs you use before upgrading.

πŸ“Š Product & Engineering Leads

Use the documented changes to assess relevance to your product; release frequency alone is not a quality measure.

βš™οΈ DevOps & Security

Verify the target version, runtime requirements and rollback procedure in the official documentation.

⚑ Performance & Enhancements (1)

  • Improve HMR performance when multiple tabs are open (pooling websocket threads)

πŸ”§ Bug Fixes & Patches (6)

  • Fixed UTF-8 bug with console.`{time, count, timeEnd, profile, profileEnd, count, countReset}`
  • Fix Program terminates with pending promises #122
  • Fix a memory leak with microtasks - d0a9b404c39842755b452b93547ee85fe2b368ad
  • Fix bug causing async wasm compilation to never run - 7b8113c7c70bb3bf6916404123e1c30c233a2d6c
  • Fix crash on macOS that sometimes occurred when closing the tab
  • Fixed several memory leaks and cases where bun would sometimes segfault
πŸ“„ View Raw Release Notes (Original Developer Log)
To upgrade: ```bash bun upgrade ``` ### What's new This release adds source maps for JS output, several web APIs to bun.js (and [`HTMLRewriter`](https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/)), parser support for ES2022 syntax, improves parsing speed for long strings, makes `bun dev` 10% faster on macOS and fixes a lot of crashes. Note: the WASM build is not quite ready yet, but I'm working on it! The main thing I'm uncertain of is whether to release it with `Bun.Transpiler` as the API, or with a partially-implemented `esbuild`-compatible API. So if you would like to use it and have opinions there, do say ## bun.js Thanks to source maps, errors in bun.js show the source code instead of the transpiled code now: <img width="457" alt="image" src="https://user-images.githubusercontent.com/709451/158721576-7e903d66-ce97-475e-afec-04635942cd44.png"> <details> <summary>Previously, it looked like this</summary> Note the incorrect line numbers and the missing `if (true)` branch – bun's transpiler removed the dead code, but that can make it harder to read the code <img width="326" alt="image" src="https://user-images.githubusercontent.com/709451/158721698-0236c7d8-6204-4c74-982b-969d6d9e3c5e.png"> </details> New APIs: - [`HTMLRewriter`](https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/) – fast jQuery-like streaming HTML parser API in Cloudflare Workers, powered by LOLHTML (the same parser in cloudflare workers) - [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout), [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/setInterval), [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/clearTimeout), and [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/clearInterval) - [`Response.clone`](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone), [`Request.clone`](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone), [`Request.bodyUsed`](https://developer.mozilla.org/en-US/docs/Web/API/Request/bodyUsed), [`Response.bodyUsed`](https://developer.mozilla.org/en-US/docs/Web/API/Response/bodyUsed), [`Response.headers`](https://developer.mozilla.org/en-US/docs/Web/API/Response/headers) - [`atob`](https://developer.mozilla.org/en-US/docs/Web/API/atob), [`btoa`](https://developer.mozilla.org/en-US/docs/Web/API/btoa) - [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob), including [`Blob.text()`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/text), [`Blob.slice()`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/slice), [`Blob.arrayBuffer()`](https://developer.mozilla.org/en-US/docs/Web/API/Blob/arrayBuffer) and [`Request.blob()`](https://developer.mozilla.org/en-US/docs/Web/API/Request/blob), [`Response.blob()`](https://developer.mozilla.org/en-US/docs/Web/API/Response/blob) - [`console.trace()`](https://developer.mozilla.org/en-US/docs/Web/API/console/trace) is now implemented - `Bun.inspect` lets you format like `console.log` but get back a string - `Bun.unsafe.arrayBufferToString(buffer)` lets you quickly & unsafely cast an ArrayBuffer-like object to a string. Useful when you've already encoded the string. Misc: - `console.log` support for JSX! - `ResolveError.prototype.toString()` and `BuildError.prototype.toString()` work as expected - `console.log` support for `Request`, `Response`, `Headers` - async node fs functions now have a compatibility wrapper that runs the sync version in the next tick. non-blocking support will come eventually - Unlike the Web API, [`FetchEvent.respondWith`](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith) will automatically await any promises now - Fixed UTF-8 bug with console.`{time, count, timeEnd, profile, profileEnd, count, countReset}` - Fix Program terminates with pending promises #122 - Fix a memory leak with microtasks - d0a9b404c39842755b452b93547ee85fe2b368ad - Fix bug causing async wasm compilation to never run - 7b8113c7c70bb3bf6916404123e1c30c233a2d6c ## bun dev - Source Maps for non-bundled code - 10% faster http requests on macOS - Reduce HMR latency by using better syscalls (send multiple messages in one syscall with sendmsg) - Improve HMR performance when multiple tabs are open (pooling websocket threads) - Send β€œDate” header - Fix crash on macOS that sometimes occurred when closing the tab - Fixed several memory leaks and cases where bun would sometimes segfault ## bun install - `bun pm cache` prints the cache dir path - Fix bug when parsing package.json that has non-ascii characters ## bun run - Set $npm_config_user_agent - Set $npm_package_json - Set $NODE and $npm_node_exec path based on what’s available in $PATH ## bun create - Fix a crash due to allocation failure - 2d1538e698654150a00a1b2187dfc811a0d15395 ## JavaScript Transpiler - Source Maps support for unbundled code (app code) - 69% faster at parsing long strings - [microbenchmark] 10% faster at parsing HTML entity codes in JSX - Support for static initialization blocks (ES2022) - Support for private static class fields and methods (ES2022) - Support for private static class brand checks (ES2022) - Support for private identifiers (ES2019) - Fix printing bug in strings that have certain escape sequences and non-ascii characters - Always print escaped Unicode codepoints instead of the original. This more closely matches what Babel & esbuild do - For TypeScript classes, match the semantics of useDefineForClassFields for fields and constructor arguments `Bun.Transpiler`: - `autoImportJSX` flag lets you enable or disable importing auto-importing the `jsxImportSource`. - `allowBunRuntime` flag lets you disable importing bun's runtime code. This is useful if you want to use bun as just a transpiler. It is disabled by default, as I would expect people to use `Bun.Transpiler` mostly for other environments than bun itself ## Infrastructural changes I started using the debug build of mimalloc, bun's memory allocator for the debug builds of bun and that uncovered a few otherwise difficult-to-reproduce crashes - fix crash when upgrade checker ends – 00977c75ba090587140f3e110c51e30016c8efb3 - fix crash when http thread goes to sleep - 1316dd1a4fcd25b0a81621b57c5f25c8674cd2db