Bun's new text-based lockfile
Bun v1.1.39 introduces bun.lock, a JSONC text lockfile enabled via `bun install --save-text-lockfile`, replacing the hard-to-review binary bun.lockb and planned as the default in Bun v1.2. Existing bun.lockb or package-lock.json files are migrated with resolutions preserved, and GitHub diffs, VS Code highlighting and tools like Dependabot can now read the lockfile. Cached no-op installs with the text lockfile are 30% faster than v1.1.38's binary path, because the speed comes from structure-of-arrays layouts with indices instead of pointers, an 8-byte small string optimization in Zig, and careful use of syscalls like clonefile and memfd_create, not from the binary format.
Related posts
- Bun v1.1.39
Bun mediumAdept
Bun v1.1.39 introduces bun.lock, a human-readable text lockfile that improves git diffs and works with tools like Dependabot and Renovate, and makes cached bun install 30% faster. It adds streaming fetch() request bodies (chunked transfer encoding, or Content-Length when the size is known) and a zero-copy native onBeforeParse plugin API for Bun.build(), written in Rust via napi.rs, that runs in Bun's threadpool. Other changes include inline snapshot tests in bun:test, heap snapshots that count native memory, a 15% peak-RSS reduction for churned WebSocket server connections, full Node test-suite parity for string_decoder, punycode and querystring, and a WebKit upgrade bringing Error.isError and a 44% faster String.prototype.at.
- Bun v1.1.40
Bun mediumAdept
Bun v1.1.40 fixes 14 bugs and adds an `install.saveTextLockfile` option in bunfig.toml so the text-based `bun.lock` format can be the default ahead of Bun v1.2. It fixes a v1.1.39 regression where `process.on` could crash in Workers, single-file executables or macros, and corrects N-API BigInt handling (trailing zeros in `napi_create_bigint_words` and the unset `lossless` flag) that affected DuckDB. Git/GitHub dependency installs are more reliable, because their dependencies aren't known until download. A WebKit upgrade fixes DFG JIT edge cases and a lock that could unlock too early.
- Bun v1.3.2
Bun mediumAdept
Bun 1.3.2 restores hoisted installs as the default for existing workspaces and adds a lockfile configVersion field so future default changes don't break existing projects. New projects using workspaces still default to isolated installs. The release speeds up bun install by smarter postinstall script handling, reported as 6x faster in a Next.js plus Vite repo. It also adds --cpu-prof CPU profiling in Chrome DevTools format, an onTestFinished test hook, a ServerWebSocket subscriptions getter and a spawnSync isolated event loop. Many Node.js, N-API, TLS, CSS and install compatibility bugs are fixed.
- Bun v1.1.16
Bun mediumAdept
Bun v1.1.16 fixes 41 bugs and adds lcov output for `bun test --coverage`, configurable in bunfig.toml. It also adds SSH-authenticated installs from private git repositories such as GitLab and Bitbucket, and a `--sourcemap=linked` option for `bun build`. Switching base64 decoding to simdutf makes `Buffer.from(string, "base64")` 6x–30x faster on large inputs. Other fixes cover N-API modules that reassign `module.exports`, `bun:sqlite` returning a wrong `changes` count from prepared statements, WebSocket error messages and crashes, and transpiler handling of non-ASCII and zero-width characters. Internally, Bun moved to Zig 0.13, which brings a WTF-16 path fix on Windows and a cross-platform `zig-check` build target.
- Bun v1.1.30
Bun mediumAdept
Bun v1.1.30 adds an experimental CSS parser and bundler, a LightningCSS port rewritten from Rust to Zig. It flattens @import chains and CSS imported from JS/TS module graphs into one file per entrypoint. `bun build --bytecode` precompiles to JavaScriptCore bytecode for about 2x faster startup, at the cost of files up to 8x larger, with source kept as a fallback for async functions, generators and eval. Other changes include `bun publish` as a drop-in for `npm publish` with workspace version rewriting, CommonJS output, BoringSSL-backed RSA functions that run 30x faster, zombie-process cleanup on `bun test` timeouts, and a prototype-pollution mitigation that makes native APIs ignore Object.prototype.