Changelog

oven-sh/bun · · 25 commits

Bun rewires core parsers and state machines

Major refactors land across HTTP, Redis, SQL, DNS, shell, S3, and tests, plus crash-reporting and image-decoding fixes.

HTTP/2 and HTTP parser internals move off C libs (dylan-conway7ca8771, dylan-conway9183b4e)

Bun replaces llhttp and ls-hpack with Rust implementations for HTTP/1 and HTTP/2. That removes the external parser dependencies and changes core request framing/compression behavior, including Node-compatible header-table handling and connection-close semantics.

Redis/Valkey command handling is refactored and fixed (aliiaab4cd6, alii67d1f55, alii93c2ed1, aliid3d074e)

The Redis client core and JS bridge were split into clearer state machines with less shared mutable state, and command generation now uses shared bodies instead of per-method copies. The follow-up fixes argument-shaping bugs around nullish values and tightens GC ownership so callbacks keep the right JS object alive.

Postgres and MySQL protocol cores are rewritten as enum-driven state machines (alii7bc51bb, alii122cd81)

Both SQL clients move protocol/session logic out of JS-coupled code into Rust crates with explicit enums and fewer borrowed JS types. This is a substantial internal simplification that should make the database paths easier to reason about and less error-prone.

HTMLRewriter sheds VM-level sink tracking (alii30261e2)

The HTMLRewriter implementation is heavily reorganized: pipe state is consolidated into enums, handler wrappers now carry their pipe more directly, and a pile of old indirection types and VM bookkeeping disappears. This is a deep refactor of a hot API surface that should reduce complexity and leaked-state hazards.

Shell, S3 upload, cron, DNS, and test runner all get major state-machine simplifications (alii5ada9ff, alii30bd4bc, aliicc9beee, aliia6cf912, alii8b92a2b, alii61ef7e1)

Several subsystems were rewritten to remove JS-coupled state and duplicate control flow: shell builtins share one output path, S3 uploads are driven by a single sink-backed state machine, cron jobs move into a standalone crate, DNS resolves after c-ares returns, parallel test scheduling gets its own crate, and matcher logic is centralized. These are broad maintainability wins with direct behavior fixes mixed in.

CSS property tables become data-driven (aliif0b87b5)

CSS property metadata is collapsed into one generated table instead of thousands of hand-written enum/match lines. This is a major codegen refactor that reduces drift and should make property additions and parsing changes much easier.

Crash reports now preserve signed return addresses (dylan-conwaybd0219e)

Crash handling is updated for WebKit builds that sign return addresses on arm64, and Bun now strips those signatures before walking frames or printing faulting registers. That makes stack traces and crash reports accurate again on PAC-enabled systems.

WebP lossy decoding matches libwebp for large coefficients (dylan-conwayd567513)

Large-lossy WebP coefficient handling is corrected so decoded pixels line up with libwebp again across CPUs. The fix adjusts the inverse-DCT path and adds golden coverage for the regression.

Filesystem, syscalls, and Windows wrappers are hardened (dylan-conway77ad7a5, dylan-conway0dff10a, dylan-conway52cf8be, dylan-conwaydc4a34e)

A broad cleanup routes libc/Win32 calls through bun_sys, tightens which wrappers are safe, and fixes a few Node-visible behavior differences like retry-on-EINTR and correct rmdir/mkdtemp semantics. The Windows and POSIX wrappers are also made safer and more explicit about ownership and handle behavior.

Other misc changes

  • Test-only JavaScriptCore regression bundle added.
  • Dependency/version bumps and build-script updates.
  • License/documentation updates for newly embedded third-party code.
  • Small internal refactors and cleanup across bindings and helpers.