Web Development: Bun 1.3 Becomes Full-Stack JavaScript Runtime

The new version of Bun includes numerous innovations for full-stack development, as well as a client for Redis and its open-source fork Valkey.

listen Print view
JavaScript logo

(Image: Trismegist san/Shutterstock.com)

3 min. read
Contents

The JavaScript toolkit Bun 1.3 has been released. Announced as its largest release to date, the toolkit, with its four components—Runtime, Bundler, Test Runner, and Package Manager—offers, among other things, a full-stack dev server in Bun.serve(), an integrated Redis client, and improved compatibility with Node.js.

Web Development Conference: Ideas Wanted
enterJS 2026

(Image: jaboy/123rf.com)

The Call for Proposals for enterJS 2026 on June 16 and 17 in Mannheim has started. Until November 12, the organizers are looking for presentations and workshops on JavaScript and TypeScript, frameworks, tools and libraries, security, UX, and more.

With version 1.3, Bun is considered by the development team to be a battery-included full-stack JavaScript runtime that offers “first-class support” for frontend development. HTML imports have been possible since Bun 1.2, but the new release adds hot reloading and integrated routing. Thanks to the newly added support for parameterized and catch-all routes, the same API can now be used for frontend and backend in Bun.serve(). Routes can handle dynamic path parameters, like :id and different handlers for different HTTP methods. The Bun team demonstrates the revised routing in the announcement post:

import { serve, sql } from "bun";
import App from "./myReactSPA.html";

serve({
  port: 3000,
  routes: {
    "/*": App,

    "/api/users": {
      GET: async () => Response.json(await sql`SELECT * FROM users LIMIT 10`),

      POST: async (req) => {
        const { name, email } = await req.json();
        const [user] = await sql`
          INSERT INTO users ${sql({ name, email })}
          RETURNING *;
        `;
        return Response.json(user);
      },
    },

    "/api/users/:id": async (req) => {
      const { id } = req.params;
      const [user] = await sql`SELECT * FROM users WHERE id = ${id} LIMIT 1`;
      if (!user) return new Response("User not found", { status: 404 });
      return Response.json(user);
    },

    "/healthcheck.json": Response.json({ status: "ok" }),
  },
});

The bundler included in Bun can now also package frontend and backend applications in a single build.

Bun.SQL has evolved from an integrated PostgreSQL client to a unified API for MySQL/MariaDB, PostgreSQL, and SQLite -- without any further dependencies. As the Bun team explains, the integrated API not only reduces the number of dependencies required in a project but also offers performance improvements compared to using existing npm packages like postgres or mysql2.

Bun 1.3 also features an integrated Redis client. This can handle not only the in-memory database Redis but also with its BSD-licensed fork Valkey under the umbrella of the Linux Foundation. Bun's Redis client is said to be characterized by high speed and support for all standard operations -- a total of 66 commands -- including hashes (HSET/HGET), lists (LPUSH/LRANGE), and sets.

Bun aims to serve as a faster and simpler “drop-in” replacement for Node.js-- because, according to Bun developer Jarred Sumner, Node.js has gained new layers of tooling over the years, which has reduced speed and increased complexity. In the new release, Bun is moving closer to full Node.js compatibility. Among other things, support for the VM module, node:test, and performance monitoring are included.

The initial support for the node:test module uses bun:test under the hood for a unified testing experience. Thus, according to the Bun team, Node.js tests can be executed with the performance advantages of Bun's native test runner.

import { test, describe } from "node:test";
import assert from "node:assert";

describe("Math", () => {
  test("addition", () => {
    assert.strictEqual(1 + 1, 2);
  });
});

Interested parties can find detailed information on these and all other updates in Bun 1.3 in the Bun blog.

(mai)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.