JavaScriptDeveloper Tools

Bun 1.4: Built-In Browser Automation, 5x Lower CPU

Bun 1.4 JavaScript runtime featuring Bun.WebView headless browser, Node.js compatibility improvements, and Rust rewrite performance gains
Bun 1.4 ships stable with built-in headless browser automation, 5x lower CPU usage, and 7x faster CI installs

Bun 1.4 went stable on August 20, and most of the coverage is still fixated on the Rust rewrite controversy. That misses the point. What actually shipped for developers is a built-in headless browser that handles most automation scripts without a Puppeteer install, the largest Node.js compatibility jump since 1.0, and warm CI installs that are up to 7x faster. The rewrite is the foundation — but it is not the story.

Bun.WebView: Drop Puppeteer for Most Scripts

Bun 1.4 ships Bun.WebView, an experimental headless browser API built directly into the runtime. On macOS it uses the system WebKit — nothing to install. On Linux and Windows it drives an already-installed Chrome, Chromium, or Edge over the Chrome DevTools Protocol.

You get navigation, clicks, scrolls, JavaScript execution, and screenshots (PNG, JPEG, WebP), all from TypeScript or JavaScript without a separate npm package. Clicks and scrolls are real user input events, not DOM simulation. Simon Willison already built a shot-scraper-style JSON API on day one of the stable release.

const browser = await Bun.WebView.launch({ headless: true });
const page = await browser.newPage();
await page.goto("https://example.com");
const screenshot = await page.screenshot({ type: "png" });
await Bun.write("out.png", screenshot);
await browser.close();

The honest take: This covers roughly 80% of the “I just need to screenshot this page” and lightweight scraping use cases. For production E2E test suites with cross-browser requirements, Playwright remains the answer. But if you are writing a cron script that grabs a screenshot or a scraper that needs to click through a JS-rendered page, the overhead of adding Puppeteer just went away.

Node.js Compatibility: +1,517 Tests, New Target Is Node 26

Node.js compatibility has been the main reason teams stay on Node rather than migrate to Bun. Bun 1.4 makes the biggest single-release dent in that gap since version 1.0: 1,517 newly passing tests from the Node.js test suite, 2,900+ issues fixed, and the compatibility target bumped from Node 24.3.0 to Node 26.3.0.

Previously missing APIs that now work: worker_threads socket sharing via node:cluster, node:repl, and node:domain. If you have code that was silently failing on those, this release unblocks it.

Two breaking changes worth knowing. First, process.versions.node now reports 26.3.0 — if your code or a dependency checks for a specific Node version range, audit that. Second, when Bun runs as node (via the --bun shim or a node symlink), it no longer auto-loads .env* files. Use --env-file explicitly, or just run bun file.js as usual — that behavior is unchanged.

The remaining hard migration blockers are native addons compiled with node-gyp: sharp, native bcrypt, ffmpeg wrappers. Everything else is getting safer with each release, and several of those specific packages have Bun-native equivalents in 1.4 anyway.

Built-In APIs: The Zero-Dependency Philosophy in Practice

Bun 1.4 adds built-in alternatives to six common npm packages: Bun.markdown (replaces marked and remark), Bun.Image (replaces sharp for image processing), JSON5 and JSONL parsing, Bun.Terminal (replaces node-pty), and a cron API (replaces node-cron). The parallel test runner also ships stable.

This is a deliberate philosophy: fewer dependencies means a smaller attack surface and fewer supply chain events. For greenfield CLI tools and scripts, the calculus shifts — you do not need to reach for npm to parse markdown or schedule a task. For existing production apps, there is no rush to refactor toward these APIs, but they change the “do I add this dependency?” conversation for new features.

Performance: What the Rust Rewrite Actually Delivered

The shipped numbers: 5x lower idle CPU usage, 35% less memory for HTTP servers, 50% faster startup on Linux, and a binary that is 20% smaller. HTTP throughput in Express-style benchmarks sits around 52,000 requests per second versus Node.js at around 13,000. Those are real, consistent gains across the test suite.

The global virtual store for the package installer deserves a mention. Enable it with BUN_INSTALL_GLOBAL_STORE=1 or set install.globalStore = true in bunfig.toml. It is opt-in because it changes how canonical paths work, which matters for pnpm compatibility. With it on, warm CI installs on large monorepos run up to 7x faster, because packages are symlinked from a shared cache instead of copied into every project’s node_modules.

# Enable global virtual store
BUN_INSTALL_GLOBAL_STORE=1 bun install

# Or set in bunfig.toml
[install]
globalStore = true

The Rewrite: One Honest Paragraph

From May 3 to May 14, Jarred Sumner ran 64 instances of Claude Fable 5 across four Git worktrees and converted 535,496 lines of Zig into Rust in 11 days at a cost of roughly 65,000 in API credits. The resulting code has 13,044 unsafe blocks — hand-written Rust of similar size averages around 73. About 3,986 of those are standard FFI boundaries into JavaScriptCore and BoringSSL, which is normal for any runtime. Roughly 4,530 carry Zig-era ownership patterns across. Five functions have been flagged as genuinely unsound. Zig creator Andrew Kelley has been publicly critical. The community reaction on Lobsters was not flattering. What is true regardless of that debate: all benchmarks match or beat 1.3, the unsafe blocks are labeled debt rather than invisible risk, and the runtime is shipping at a pace that is hard to ignore.

How to Upgrade

bun upgrade

Check the official Bun 1.4 release notes for the full breaking changes list. Audit any code that inspects process.versions.node directly, and test any native addon that was compiled against a specific Node ABI. For everything else, the upgrade is expected to be straightforward.

Bun 1.4 is a meaningful release. If you are already on Bun, upgrade. If you have been waiting on Node.js compatibility to consider a migration, this is the best the compatibility story has ever looked. The rewrite controversy will continue — the runtime does not care and neither should your CI pipeline.

Full Bun.WebView documentation is available in the Bun docs.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:JavaScript