Tools

AI-generated text

Bun 1.4 debuts Bun.WebView and a shot-scraper-style JSON API prototype

Bun 1.4 was released with a wide range of new features, performance gains and thousands of bug fixes.

Bun 1.4 debuts Bun.WebView and a shot-scraper-style JSON API prototype

Bun 1.4 has been released — the first stable version after the project’s Rust rewrite a few months ago. The release notes largely downplay the rewrite while listing numerous new features and measurable performance improvements.

According to the release material, Bun 1.4 includes:

  • +1,517 tests from the Node.js test suite, the largest increase in Node.js compatibility since Bun 1.0.
  • Over 2,900 fixed issues.
  • A 5x reduction in idle CPU usage.
  • Up to 35% reduced memory usage.
  • Approximately 50% faster startup on Linux.

The release also adds several new APIs and commands, among them Bun.Image, Bun.WebView, Bun.markdown, Bun.cron(), Bun.Terminal, bun run --parallel, bun test --parallel, bun audit fix, bun dedupe, and bun prune.

Bun.WebView: built-in browser automation

One notable addition is Bun.WebView, which provides first-class support for browser automation in Bun core. The feature works in two ways: using native WebKit on macOS or by controlling a local Chromium process via the Chrome DevTools Protocol (CDP). This enables direct page control and JavaScript execution from within the Bun environment.

Why it matters: WebView integration can simplify building workflows that require loading pages, manipulating the DOM, or running remote JavaScript, without requiring separate browser-control libraries and extra configuration.

Prototype: a shot-scraper-style JSON API in TypeScript

To explore the new capability, the author had Claude Code build a TypeScript server prototype implementing a shot-scraper-style web API. The prototype is designed to load a webpage and execute JavaScript against it, similar to the shot-scraper CLI, and to measure the RAM needed to run such a service.

Using the referenced TypeScript server implementation, the experiments measured memory usage in a containerized environment (cgroups). The tests indicate that running a full Chromium against complex pages required roughly 192–256 MB of container RAM.

It is important to note these figures reflect the specific prototype and test environment: actual requirements will vary depending on page complexity, Chromium version, and configuration.

Why this matters

Bun 1.4 marks a significant step for Node.js compatibility and runtime performance while adding built-in tools for web automation and server-side workflows. Bun.WebView in particular could be useful for developers and automation systems because it simplifies browser-based interactions and may reduce the need for external dependencies.

The prototype results show that a Chromium-driven workflow can run with moderate memory requirements in containers, but real-world resource needs will depend on the use case.

Tags

browsers, javascript, ai, rust, typescript, generative-ai, llms, coding-agents, bun