Movatterモバイル変換


[0]ホーム

URL:


Bun logoBunBun
Bun v1.2.7
Bun.CookieMap is a Map-like API for getting & setting cookies. Bun's TypeScript type declarations have been rewritten to eliminate conflicts wit...
Bun v1.2.6
Faster, more compatible node:crypto. `timeout` option in Bun.spawn. Support for `module.children` in `node:module`. Connect to PostgreSQL via un...
Bun v1.2.5
Improvements to the frontend dev server, CSS modules support, a full rewrite of Node-API, faster `Sign`, `Verify`, `Hash`, `Hmac` from `node:cry...
Bun v1.2.4
Up to 60% faster Bun.build on macOS, codesigning support for single-file executables on macOS, dev server stability improvements, fixes a regres...
Bun v1.2.3
Bun gets a full-featured frontend development toolchain with incredibly fast hot reloading and bundling. Built-in routing for Bun.serve() makes ...
Bun v1.2.2
JavaScript idle memory usage drops by 10–30%. Fixes regression impacting vite build. Reliability improvements to Bun.SQL, Bun.S3Client, Bun's CS...

Bun v1.1.16


Chloe Caruso ·June 23, 2024

Bun v1.1.16 is here! This release fixes 41 bugs (addressing 221 👍). lcov code coverage reports in bun test, Install dependencies from private git repositories including Gitlab and Bitbucket.Buffer.from(string, "base64") gets 6x - 30x faster on large input. Bug fixes tobun patch,bun install, N-APi addons, transpiler bugfixes and Node.js compatibility improvements.

We're hiringsystems engineers in San Francisco to build the future of JavaScript!

Previous releases

  • v1.1.14 fixes 63 bugs (addressing 519 👍). Patch node_modules withbun patch. ORM-less object mapping inbun:sqlite. Log allfetch() calls as acurl command. Node.js compatibility improvements. bun install bugfixes,bun:sqlite bugfixes, Windows bugfixes. And more.
  • v1.1.10 fixes 20 bugs. 2x faster uncached bun install on Windows.fetch() uses up to 2.8x less memory. Several bugfixes to bun install, sourcemaps, Windows reliability improvements and Node.js compatibility improvements
  • v1.1.0 Bundows. Windows support is here!

To install Bun

curl
npm
powershell
scoop
brew
docker
curl
curl -fsSL https://bun.sh/install| bash
npm
npm install -g bun
powershell
powershell -c"irm bun.sh/install.ps1|iex"
scoop
scoop install bun
brew
brew tap oven-sh/bun
brew install bun
docker
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun

To upgrade Bun

bun upgrade

LCOV code coverage reporter

When usingbun test --coverage, coverage reports can be exported to the standard lcov format using--coverage-reporter lcov

buntest --coverage --coverage-reporter lcov

By default this outputs acoverage/lcov.info file. The coverage directory can be changed with--coverage-dir

To always enable coverage reporting, two new options have been added tobunfig.toml:

bunfig.toml
[test]# always enable coveragecoverage=true# newcoverageReporter= ["text","lcov"]# default ["text"]coverageDir="./path-to-folder"# default "coverage"

Thanks to@exoego for implementing this.

bun install git ssh repositories

bun install now supports authenticating via ssh to install dependencies from private git repositories. These are cloned using your git SSH key viagit clone.

bun i git@github.com:paperclover/secret-utilities.git
installed secret-utilities@git+ssh://git@github.com:paperclover/secret-utilities.git#5a7279074f22e98d64507cb5149633c73897395f1 package installed [904.00ms]

This makesbun install easier to use when working with private repositories from Gitlab, Bitbucket, or other git hosting services. GitHub repositories were sometimes impacted by this issue, but less frequently.

Thanks to@Eckhardt-D for implementing this!

Buffer.from(string, "base64") gets 6x-30x faster on large input

By changing our base64 decoding implementation to usingsimdutf, usingBuffer.from(string, "base64") is much faster, especially on large input:

In the next version of Bun

Buffer.from(str, "base64") gets 6x - 30x faster on large input, thanks to@lemire's simdutfpic.twitter.com/iFgI0Vv3sQ

— Jarred Sumner (@jarredsumner)June 19, 2024

Output Source Map URLs inbun build

To tell browser devtools where to find sourcemaps, tooling inserts a//# sourceMappingURL= comment at the end of files.

Previously, Bun didn't expose a way to link to external, non-inline sourcemaps via this comment.

You can now use--sourcemap=linked to tell Bun to insert a//# sourceMappingURL= comment at the end of the bundled file, linking to the external sourcemap.

bun build src/app.tsx --outdir ./dist --sourcemap=linked --minify

This will produce the directorydist withapp.js andapp.js.map, and the comment//# sourceMappingURL=app.js.map to load the sourcemap for debugging.

Thanks to@paperclover for implementing this.

console.log now prints non-indexed properties on arrays

Bun now shows prints non-indexed properties on arrays, for example:

non-indexed-properties.ts
const arr= ['a','b','c'];arr['five']=5;console.log(arr);
bun non-indexed-properties.ts
[ "a", "b", "c", five: 5 ]

Fixed: WebSocket connectionerror event now includes amessage

When a WebSocket connection fails, the error event now includes amessage property with a more detailed error message.

const ws=newWebSocket("ws://localhost:8080");ws.addEventListener("error", (error)=> {  console.log(error.message);});// The message previously only was in the "close" event:ws.addEventListener("close", (close)=> {  console.log(close);});

This prints the following error message:

WebSocket connection to'ws://localhost:8080/' failed: Failed to connect

Instead of only including relevant information in theclose event, theerror event on connection failure now includes amessage property with an error message.

Fixed: Crash in console.log with WebSocket connection errors

When a WebSocket fails to connect, it emits both theerror andclose events.

const ws=newWebSocket("ws://localhost:8080");ws.addEventListener("error", (error)=> {// Connection error emitted});ws.addEventListener("close", ()=> {// Connection did not fully open, but it is still closed});

Previously, printingconsole.log(error) from a WebSocket connection error would sometimes cause a crash. The code incorrectly assumed that anErrorEvent always contained a non-nullerror. This has been fixed, and our test coverage has been improved to cover this edge case.

Fixed: Bun Shell & bun run with non-ascii cwd on Windows

A bug affecting Bun Shell andbun run when run in a directory with non-ascii characters has been fixed thanks to@dylan-conway.

Fixed: non-ascii characters in TypeScript enums

An enum with non-ascii keys would get mangled. This has been fixed.

unicode-enum.ts
enumX {  a,  b,  ç,}console.log(X);

Fixed: Assertion failure with experimental decorator on abstract property

An assertion failure would occur when using an experimental TypeScript decorator on an abstract property. This has been fixed, thanks to@forcefieldsovereign.

Fixed: ZWJ and ZWNJ characters in transpiler

A crash that would occur when a file contained a Zero Width Joiner (ZWJ) or Zero Width Non-Joiner (ZWNJ) character inside of a property name has been fixed.

Fixed: Crash inmodule.mock

An edge case with usingmodule.mock on modules that previously failed to load causing a crash has been fixed thanks to@paperclover.

Fixed:process.execArgv

process.execArgv lets you return arguments passed to the Bun runtime, in comparison to the program arguments inprocess.argv. In certain cases, non-runtime parameters were mistakenly included. Thanks to@paperclover for fixing this.

Fixed: Ignore optional dependencies that do not exist

Before, installing the package@laihoe/demoparser2 would fail due to an optional dependency on a package that was never published to NPM. Bun now matchesnpm's behavior by simply ignoring these missing packages, since they are declared as optional dependencies.

Thanks to@dylan-conway

Fixed: N-API modules re-assigningmodule.exports

A bug where Bun incorrectly handled N-API modules that re-assignedmodule.exports has been fixed.

Previously, Bun would ignore the return value of the module, causing the module to not be loaded correctly. This has been fixed, and Bun now correctly loads N-API modules that re-assignmodule.exports. This waas most noticable whenmodule.exports was assigned to a function.

Along the way, we've also fixed a potential crash when loading N-API modules that take a long time to initialize.

Fixed:bun:sqlite'schanges field always 0 in statement.run()

A bug in prepared statements causeddb.prepare(...).run(...) to return 0 in certain cases instead of the number of changes from the statement.db.run(...) was not affected.

Fixed:bun patch in workspace packages

Bugs related tobun patch --commit diffing files in nestednode_modules directories causing patch failures have been fixed.

Thanks to@zackradisic

Internal: Bun updated Zig to version 0.13

In#9965, Bun was upgraded to use the latest release of the Zig compiler. This makes Bun easier to contribute to, as there are a handful of language server, build system, and overall code quality improvements.

Bug fixes within the Zig standard library have fixed some bugs in Bun; most notably the Windowsfix for handling WTF-16 (a looser version of UTF-16) within paths and environment. This fixes some rare edge cases where the errorInvalidUTF8 was reported with very little context. Thanks to@squeek502.

One important build system improvement for the team and contributors is the ability to ensure that all platforms (Linux, Mac, and Windows) compile successfully without having to wait for CI to finish running. Contributors can now test-compile the code for all targets withbun run zig-check in the Bun repository.

Thanks to 9 contributors!


Bun v1.1.14

Bun v1.1.17


[8]ページ先頭

©2009-2025 Movatter.jp