Aquesta és una versió anterior. La versió actual és la 1.4.5. Bun Profile 1.4.5 · 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 |
| ARM64 | 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ó
bun test --isolate and bun test --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 all sockets, cancels timers, kills subprocesses, and creates a clean global object. A VM-level transpilation cache means shared dependencies are only parsed once — subsequent files reuse the cached source, skipping redundant transpilation entirely.
--parallel[=N] distributes test files across up to N worker processes (defaults to CPU count). Files are partitioned for cache locality, and idle workers steal work from the busiest remaining queue. Workers automatically run with --isolate between files. Output remains identical to serial execution — per-test console.log/console.error output is buffered and flushed atomically, so files never interleave.
Run tests with isolation (fresh global per file):
bun test --isolate ./tests
Run tests in parallel across all CPU cores:
bun test --parallel ./tests
Run tests in parallel with 8 workers:
bun test --parallel=8 ./tests
Both flags work with existing options including --bail, --randomize, --dots, JUnit reporting, LCOV coverage, and snapshots. All transpiler/resolver flags (--define, --loader, --tsconfig-override, --conditions, etc.) are forwarded to workers. JEST_WORKER_ID and BUN_TEST_WORKER_ID in bun test --parallel are also set as environment variables.
bun test --shard=M/N for splitting tests across CI jobs
Split test files across multiple CI runners with the new --shard flag, matching the syntax used by Jest, Vitest, and Playwright.
# In a GitHub Actions matrix with 3 jobs:
bun test --shard=1/3
bun test --shard=2/3
bun test --shard=3/3
Test files are sorted by path for determinism and distributed round-robin across shards, keeping each shard balanced to within one file of each other. The shard index is 1‑based (1 <= index <= count).
Composes naturally with other flags:
- --changed — sharding is applied after the changed‑files filter
- --randomize — shuffle happens after shard selection, within the shard
If a shard ends up with zero files (e.g. 2 test files with --shard=5/5), it exits 0 gracefully rather than erroring. Invalid inputs like 0/3, 4/3, or 1/0 produce a clear error message and exit non‑zero.
bun test --changed
bun test now supports a --changed flag that only runs test files affected by your git changes. This works by building the full import graph of your test files and filtering down to only those that transitively depend on a file that git reports as changed.
Run tests affected by uncommitted changes (unstaged + staged + untracked):
bun test --changed
Run tests affected by changes since a specific commit, branch, or tag:
bun test --changed=HEAD~1
bun test --changed=main
Combine with --watch to re‑filter on every restart:
bun test --changed --watch
When combined with --watch, editing any local source file — even one not currently imported by the selected tests — triggers a re‑run. Each restart re‑queries git, so the filtered set always tracks the working tree.
bun install streams tarballs to disk
bun install now extracts package tarballs while they are still downloading, instead of buffering the entire .tgz and decompressed .tar in memory before extraction. Only the in‑flight HTTP chunks plus libarchive’s fixed per‑archive buffers are needed — the full archive is never materialized in memory.
Integrity hashing runs incrementally over the compressed bytes and is verified before the extracted tree is promoted into the cache. Streaming extraction is enabled by default. If you encounter issues, it can be disabled by setting BUN_FEATURE_FLAG_DISABLE_STREAMING_INSTALL=1.
Faster bun install with isolated linker
In a peer‑heavy monorepo, bun install --linker=isolated; now completes in seconds where installs previously hung.
Source maps use up to 8x less memory
Bun’s internal source map representation has been rearchitected to a compact bit‑packed binary format, reducing memory usage to ~2.4 bytes per mapping (down from ~20 bytes). Decoding cost is near zero; lookups are ~6 % slower, but overall memory footprint is dramatically lower.
Bun’s runtime uses 5% less memory
Memory allocators upgraded: mimalloc v3 and libpas scavenger support for Windows & Linux, reducing baseline memory usage and fixing hangs/crashes in long‑running processes.
Upgraded JavaScriptCore engine
Merged 1,316 upstream commits into WebKit’s JavaScriptCore, bringing 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
Responses created with new Response(Bun.file(path)) or static routes in Bun.serve() now stream incrementally on SSL and Windows, reducing memory usage for large files.
Range Request Support in Bun.serve()
Bun.serve() now handles Range requests for file‑backed responses, returning 206 Partial Content or 416 when invalid. Supports suffix, open‑ended, and standard RFC 9110 range forms.
Up to 5.5x faster gzip compression with zlib‑ng
Upgraded to zlib‑ng 2.3.3, providing SIMD‑accelerated compression. Significant speedups across gzip/deflate operations.
Faster array iteration in Bun’s internals
Array iteration in internal C++/Zig code is up to 1.43× faster for common cases by reading elements directly from JSC’s butterfly memory.
SHA3 support in WebCrypto and node:crypto
Added SHA3‑224, SHA3‑256, SHA3‑384, SHA3‑512 algorithms to both Web Crypto API and node:crypto.
X25519 deriveBits support in SubtleCrypto
SubtleCrypto.deriveBits() now works with X25519, fully implementing spec‑compliant key agreement.
WebSocket client: support ws+unix:// and wss+unix://
WebSocket client can connect over Unix domain sockets using ws+unix:// and wss+unix:// URL schemes.
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 now works as a shorthand for bunx @anthropic‑ai/claude‑code.
Bugfixes
Node.js compatibility improvements:
- Fixed worker lifecycle crashes and termination issues.
- Fixed tls.connect host handling, passphrase option crashes, and process.ppid caching.
- Fixed --cpu-prof output format, socket.setTimeout behavior, node:http2.createServer ENABLE_PUSH setting, StringDecoder crashes, native N‑API module finalizer order, dgram source‑specific membership options, os.freemem on Linux, rare fs.watch deadlock, path.win32.resolve crash, fs.writeSync crash on Windows, root certificate race condition, macOS syscalls EINTR handling, re‑export clause handling, Error.captureStackTrace with non‑numeric stackTraceLimit, preventDefault on non‑passive listeners, WebIDL integer conversion rounding, BroadcastChannel data races.
Bun APIs:
- Fixed Bun.inspect and console.log class name display.
- Fixed server.stop hanging, file descriptor leaks, error handler drops, duplicate Content‑Length headers, MySQL adapter hangs, YAML parse crashes, sliced file blob crashes, large file size fstat panic, RedisClient crash on GC, pathToFileURL Windows crash, MKADDRESSBOOK method handling, AbortSignal memory leak in WebSocket upgrade, ~1 KB memory leak per hot reload, memory leak in Glob.scan.
Web APIs:
- Fixed fetch abort behavior, AbortSignal.timeout leak, fetch hanging with tls.checkServerIdentity, fetch crash on abort, proxy port injection bug, ws.close crash behind CONNECT proxy, WebSocket client send buffer leak, promise resolution crash, record conversion crash.
bun install:
- Fixed bunx @anthropic‑ai/claude‑code executable detection.
JavaScript bundler:
- Fixed bun build --compile broken binaries on macOS ARM64 and NixOS/Guix, HTML import etag stale cache, resolver race crashes, invalid npm package name handling.
CSS Parser:
- Fixed stripping of top‑level @layer ordering declarations.
bun test:
- Fixed toMatchSnapshot failing with --rerun-each, retry, or repeats.
Windows:
- Fixed runtime transpiler race condition, timer degenerate delay crash, readFile >2 GB crash, fs.readdir malformed entry crash, libpas resource exhaustion, pthread_once and mprotect issues.
JavaScript engine:
- Fixed RegExp exec/test ToLength issue, namespace import handling, TypedArray iterator with detached buffers, Date.toLocaleString crash in Worker, YARR backtracking bugs, class field eval context, DFG constant folding crash.
Internal / Runtime:
- Fixed debugger pause CPU usage, macOS arm64 deadlock, 8 libpas memory‑accounting bugs, various early‑exit state crashes, socket layer context pointer dereference, event loop timer sweep iterator crash, hardened HTTP chunked encoding parser.