Aquesta és una versió anterior. La versió actual és la 1.4.4. Bun Baseline 1.4.4 · Data de publicació:
Fitxers d’instal·lació 1.3.13
| Arquitectura | Tipus | Àmbit | Mida del fitxer | Baixa | SHA256 |
|---|---|---|---|---|---|
| 64 bits | ZIP → Portable | — | — | github.com | VirusTotal |
L’enllaç i l’SHA256 provenen del manifest comunitari del Gestor de paquets del Windows. Convé comparar el hash del fitxer baixat abans d’executar-lo.
Notes de la versió
Fixes 82 issues (addressing 381 👍). bun test --parallel, --isolate, --shard, and --changed, bun install streams tarballs to disk using 17x less memory, source maps use 8x less memory, 5.5x faster gzip with zlib-ng, Range request support in Bun.serve(), SHA3 in node:crypto and WebCrypto, ws+unix:// WebSocket client, and many bugfixes and Node.js compatibility improvements
bun test --isolate and --parallel
Two new flags for bun test that dramatically speed up large test suites:
--isolate runs each test file in a fresh global environment within the same process. Between files Bun drains microtasks, closes sockets, cancels timers, kills subprocesses, and creates a clean global object. A VM‑level transpilation cache means shared dependencies are only parsed once.
--parallel[=N] distributes test files across up to N worker processes (defaults to CPU count). Files are partitioned for cache locality, idle workers steal work, and output remains identical to serial execution.
bun test --shard
Split test files across multiple CI runners with the new --shard flag (syntax M/N). Files are sorted by path and distributed round‑robin. Works with --changed and --randomize. Invalid inputs produce clear errors.
bun test --changed
Runs only test files affected by git changes by building the import graph and filtering to changed dependencies. Supports uncommitted changes, specific commits/branches, and works with --watch for continuous re‑filtering.
bun install streams tarballs to disk
bun install now extracts package tarballs while downloading, using only in‑flight HTTP chunks plus fixed buffers. Integrity hashing runs incrementally. Streaming extraction is enabled by default; can be disabled with BUN_FEATURE_FLAG_DISABLE_STREAMING_INSTALL=1.
Faster bun install with isolated linker
In a peer‑heavy monorepo, bun install --linker=isolated reduces install time dramatically (e.g., from 20.5s to 2.4s).
Source maps use up to 8x less memory
Source map representation rearchitected to a compact bit‑packed binary format (~2.4 B per mapping vs ~20 B). Memory usage drops from ~11 MB to ~2.9 MB for a large TypeScript project. Decoding cost is near zero; lookups ~6 % slower.
Bun’s runtime uses 5% less memory
Upgraded mimalloc to v3 and added libpas scavenger support on Windows & Linux, reducing baseline memory usage and fixing hangs/crashes.
Upgraded JavaScriptCore engine
Merged 1,316 upstream commits into WebKit’s JavaScriptCore, bringing numerous performance improvements and bug fixes.
Performance improvements from upstream
- Inline cache for array.length = N
- Inline cache for undefined, true, false, null as property keys
- String length folding in DFG/FTL
- toUpperCase intrinsic JIT‑intrinsified
- String#indexOf single‑character fast path
- Redundant mov removed from await/yield bytecode
- Cached default date formatters
- Wider bulk copy in GC‑safe memcpy/memmove
- SIMD‑accelerated equalIgnoringASCIICase
- SIMD fast path for identifier parsing
Faster addEventListener, dispatchEvent, and DOM events
Cherry‑picked ~270 upstream WebKit commits improve event system and promise internals.
File streaming improvements
Response(Bun.file(path)) and static routes now stream incrementally on SSL and Windows, reducing memory usage for large files.
Range Request Support in Bun.serve()
Bun.serve() now handles HTTP Range requests for file‑backed responses, returning 206 Partial Content or 416 as appropriate. Supports suffix, open‑ended, and standard RFC 9110 ranges.
Up to 5.5x faster gzip compression with zlib‑ng
Upgraded to zlib‑ng 2.3.3 with SIMD acceleration. Significant speedups for gzipSync, deflate, createGzip streams, etc.
Faster array iteration in Bun’s internals
Array iteration up to 1.43× faster for common cases by reading elements directly from JSC’s butterfly memory.
SHA3 support in WebCrypto and node:crypto
Adds SHA3‑224/256/384/512 to crypto.createHash, crypto.createHmac, crypto.getHashes, crypto.subtle.digest, and crypto.subtle.sign/verify.
X25519 deriveBits support in SubtleCrypto
SubtleCrypto.deriveBits() now works with X25519, fully implementing the spec and rejecting small‑order public keys.
WebSocket client: support ws+unix:// and wss+unix://
Allows WebSocket connections over Unix domain sockets with ws+unix:// and wss+unix:// URLs, matching npm ws behavior.
Standalone HTML now inlines file‑loader assets imported from JS
bun build --compile --target browser now inlines assets imported via the file loader as data: URIs, producing fully self‑contained HTML.
bunx claude and bunx @anthropic‑ai/claude‑code fix
bunx claude is now an alias for bunx @anthropic‑ai/claude‑code.
Bugfixes
Node.js compatibility improvements
- Fixed worker lifecycle crashes (terminate, message sending, natural exit)
- Fixed tls.connect({host,port}) behavior when servername omitted
- Fixed rare TLS passphrase crash
- Fixed process.ppid caching; now updates on each access
- Fixed --cpu-prof output format to match Chrome DevTools
- Fixed socket.setTimeout() firing incorrectly during active reads
- Fixed node:http2.createServer (h2c) advertising invalid ENABLE_PUSH
- Fixed rare crash in StringDecoder.prototype.write()
- Fixed crash on process exit with native N‑API modules wrapping parent objects
- Fixed node:dgram source‑specific membership option inversion
- Fixed os.freemem() on Linux reading MemAvailable
- Fixed rare fs.watch() deadlock
- Fixed rare path.win32.resolve crash
- Fixed rare fs.writeSync crash on Windows
- Fixed race condition in root certificate initialization with workers
- Fixed syscalls on macOS spurious EINTR errors
- Fixed export { "a b c" } from './b.mjs' syntax error
- Fixed Error.captureStackTrace() when stackTraceLimit non‑numeric
- Fixed preventDefault() on non‑passive listeners following passive ones
- Fixed WebIDL integer conversion rounding half‑to‑even
- Fixed data races in BroadcastChannel with workers
Bun APIs
- Fixed Bun.inspect() and console.log() showing [class Function] for certain constructors
- Fixed server.stop() hanging
- Fixed file descriptor leaks in static file routes
- Fixed error handler returning file‑backed Response being dropped
- Fixed duplicate Content‑Length headers on file responses
- Fixed Bun.SQL MySQL adapter hanging on multi‑statement queries (regression from v1.2.12)
- Fixed Bun.YAML.parse rare crash
- Fixed reading sliced non‑regular file blobs
- Fixed panic on extremely large file size during Bun.file() reads and improved OOM error propagation
- Fixed hypothetical crash in Bun.RedisClient after command error
- Fixed Bun.pathToFileURL crash on Windows
- Fixed MKADDRESSBOOK CardDAV method being rewritten to GET
- Fixed AbortSignal memory leak in WebSocket upgrade request
- Fixed ~1 KB memory leak per --hot reload cycle
- Fixed memory leak in Glob.scan() and Glob.scanSync()
Web APIs
- Fixed controller.abort() on queued fetch requests leaving promise pending
- Fixed memory leak in AbortSignal.timeout()
- Fixed fetch() hanging with tls.checkServerIdentity in error cases
- Fixed rare crash when aborting fetch()
- Fixed fetch() with HTTP_PROXY injecting incorrect default ports
- Fixed rare crash when ws.close() on wss:// through HTTP CONNECT proxy
- Fixed tiny memory leak in WebSocket client send buffers
- Fixed hypothetical crash when resolving a promise
- Fixed hypothetical crash with numeric‑index string keys and shared ArrayBuffer/TypedArray
bun install
- Fixed bunx @anthropic‑ai/claude‑code failing to determine executable
JavaScript bundler
- Fixed bun build --compile producing broken binaries on macOS ARM64 (v1.3.12 regression)
- Fixed HTML import etag not updating when referenced JS/CSS chunks changed
- Fixed bun build --compile broken executables on NixOS/Guix hosts
- Fixed crash in Bun.build when resolver races with failed sibling import
- Fixed crash from resolver auto‑installing invalid npm package names
CSS Parser
- Fixed CSS bundler stripping top‑level @layer ordering declarations
bun test
- Fixed toMatchSnapshot() failing with --rerun-each, retry, or repeats due to snapshot counter not resetting
Windows
- Fixed race condition in runtime transpiler causing crashes with concurrent threads
- Fixed crash on Windows caused by NaN/+inf values in internal timer
- Fixed rare crash in readFile for files >2 GB
- Fixed rare crash in fs.readdir with malformed directory entries from third‑party drivers
- Fixed resource exhaustion in libpas leading to crashes in long‑running processes
JavaScript engine
- Fixed RegExp exec/test not reloading after ToLength(lastIndex) coercion
- Fixed import { "*" as x } not treated as namespace import
- Fixed TypedArray iterator .next() with detached buffers
- Fixed Date.toLocaleString() crash from Worker
- Fixed multiple YARR backtracking and capture bugs
- Fixed class instance field eval context propagation through arrow functions
- Fixed DFG constant folding crash and unsound BitAnd results with negative masks
Internal / Runtime
- Fixed debugger pause pegging CPU core at 100%; now thread sleeps until debugger resumes
- Fixed deadlock between memory allocator and thread pool freezing compiled executables on macOS arm64
- Fixed 8 memory‑accounting bugs in libpas
- Fixed several potential crashes from early‑exit control flow affecting HTTP decompression, Request/Response bodies, Bun.build plugins, and named pipe listeners on Windows
- Fixed potential socket layer crash dereferencing context loop pointer after unlink
- Fixed hypothetical crash involving event loop timer sweep iterator
- Improved HTTP chunked encoding parser hardening