pwshub.com

Bun v1.1.33

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

This release fixes 8 bugs including: JSX symbol collisions with imports, bun install slowdowns, skipping optional dependencies, optional dependency postinstall failures, and an assertion failure in the CSS parser.

To install Bun

curl

curl -fsSL https://bun.sh/install | bash

powershell

powershell -c "irm bun.sh/install.ps1|iex"

docker

docker run --rm --init --ulimit memlock=-1:-1 oven/bun

To upgrade Bun

Fixed: NPM_CONFIG_TOKEN environment variable

A bug reading the NPM_CONFIG_TOKEN environment variable due to lowercase letters was fixed. The diff was:

-  "NPM_CONFIG_token",
+  "NPM_CONFIG_TOKEN",

Reduced bun install max simultaneous connections

bun install was using 256 as the default maximum number of simultaneous network connections. Allowing this many connections at once could cause install slowdowns while fetching dependency tarballs and manifests. We've reduced the default to 64 with and without a proxy.

Fixed: optional = false in bunfig.toml

Our docs mention setting optional = false in bunfig.toml will skip optional dependencies during installs, but the implementation was missing. This is now working as expected thanks to @Eckhardt-D!

bunfig.toml

[install]
optional = false

Deleting optional dependencies on postinstall failure

When an optional dependency lifecycle script fails, bun will now ignore the error and continue with the installation. Additionally, the directory will be deleted from node_modules to prevent unexpected errors from using a half-installed package.

Fixed thanks to @dylan-conway!

Fixed: JSX symbol collisions

A bug was fixed where imports sharing the same name as a JSX symbol would cause bun to fail to include the JSX import source in the transpiled output, resulting in a reference error. For example, running tests in the hono repository:

bun test runtime-tests/bun/index.test.tsx

✗ JSX Middleware > Should return rendered HTML with Layout [0.12ms]
254 |     app.post('/about/some/thing', (c) => c.text('About Page 3tier'))
255 |     app.get('/bravo', (c) => c.html('Bravo Page'))
256 |     app.get('/Charlie', async (c, next) => {
257 |       c.setRenderer((content, head) => {
258 |         return c.html(
259 |           <html>
                ^
ReferenceError: Can't find variable: jsx
      at /Users/dylan/code/hono/runtime-tests/bun/index.test.tsx:259:11
      at /Users/dylan/code/hono/src/compose.ts:74:23

Fixed thanks to @snoglobe!

Fixed: assertion failure in the CSS parser

A hashing function in the CSS parser was casting a u64 to a u32 without telling zig safety checks to ignore truncating non-zero bits. This was fixed by using the @truncate zig builtin function.

Single quotes in module resolution error messages

When bun fails to resolve a module or package, the error message has been changed to use single quotes instead of double quotes. This fixes the optional-require package, which checks for the package name surrounded by single quotes.

index.js

require('does-not-exist');
// before: Cannot find package "does-not-exist" from "/path/to/index.js"
// after:  Cannot find package 'does-not-exist' from '/path/to/index.js'

Fixed thanks to @nektro!

Thanks to 10 contributors!

Source: bun.sh

Related stories
1 month ago - Fixes 130 bugs (addressing 250 👍). `bun pm pack`, faster `node:zlib`. Static routes in Bun.serve(). ReadableStream support in response.clone() & request.clone(). Per-request timeouts. Cancel method in ReadableStream is called. `bun run`...
1 month ago - This release fixes 40 bugs (addressing 51 👍). Compile & run C from JavaScript. 30x faster path.resolve. Named pipes on Windows. Several Node.js compatibility improvements and bugfixes.
1 month ago - Fixes 21 bugs (addressing 22 👍). Fixes issue with proxying requests with axios. N-API (napi) support in compiled C. Faster typed arrays in `bun:ffi` with 'buffer' type. Fixes issue with bundling imported .wasm files in `bun build`. Fixes...
2 weeks ago - Fixes 57 bugs (addressing 150 👍) Bun's CSS bundler is here (and very experimental). `bun publish` is a drop-in replacement for `npm publish`. `bun build --bytecode` compiles to bytecode leading to 2x faster start time. Bun.color()...
6 days ago - Fixes 41 bugs (addressing 595 👍). node:http2 server and gRPC server support, ca and cafile support in bun install, Bun.inspect.table, bun build --drop, iterable SQLite queries, iterator helpers, Promise.try, Buffer.copyBytesFrom, and...
Other stories
4 hours ago - Kelly O’Connell, Chief Product Officer at ActiveCampaign, talks about how leadership, structure, and culture change as a company scales. The post Leader Spotlight: How leadership changes with scale, with Kelly O’Connell appeared first on...
4 hours ago - A dropshipping product research tool is an automated program designed to identify trending products by analyzing seller data and sales trends over specific time periods. It efficiently extracts top-selling items which saves significant...
6 hours ago - Warehouse management software allows businesses to optimize their supply chain process, improve warehouse efficiency, and manage order fulfillment. With the rise of eCommerce merchants, global markets, and rising customer expectations,...
9 hours ago - One of the best things about the Raspberry Pi 5 (other than the performance boost over its predecessor) is how much easier it is to add an SSD. And using an SSD with the Raspberry Pi 5 is a no-brainer if you’re running a proper desktop OS...
11 hours ago - When you’re building a website, it’s important to make sure that it’s fast. People have little to no patience for slow-loading websites. So as developers, we need to use all the techniques available to us to speed up our site’s...