Skip to content

feat: add first-class Bun and Deno runtime support#309

Merged
lazarv merged 5 commits intomainfrom
feat/bun-deno
Feb 20, 2026
Merged

feat: add first-class Bun and Deno runtime support#309
lazarv merged 5 commits intomainfrom
feat/bun-deno

Conversation

@lazarv
Copy link
Owner

@lazarv lazarv commented Feb 20, 2026

First-class Bun & Deno runtime support

Until now, @lazarv/react-server has been a Node.js-first framework with experimental adapter-level support for alternative runtimes. This PR promotes Bun and Deno to fully supported, first-class runtimes — from project scaffolding all the way through development, production builds, and deployment.

What changes for users

Zero-config runtime detection — When you run react-server build or react-server start under Bun or Deno, the framework now automatically detects the runtime and applies the correct adapter. No manual adapter: "bun" or adapter: "deno" configuration is needed anymore (though explicit overrides and --no-adapter still work).

Scaffolding just workscreate-react-server now detects the runtime you're using at project creation time and automatically configures package.json scripts accordingly:

  • Bun projects get bun --bun react-server ... scripts and trustedDependencies
  • Deno projects get deno run -A npm:@lazarv/react-server ... scripts and a deno.json with nodeModulesDir: "manual" + byonm
  • Node.js projects continue to work exactly as before

Simplified production start — Instead of requiring users to manually run .bun/start.mjs or .deno/start.mjs, the standard react-server start command now handles everything, including import map generation for Deno and proper process spawning for both runtimes.

What changes under the hood

  • Runtime-aware module loading — New loader plugins (lib/loader/bun.mjs and lib/loader/deno.mjs) handle the differences in how each runtime resolves @lazarv/react-server/dist/... specifiers, manifest files, and prebuilt configs during production serving.
  • Dev server rendering for Deno — Since Deno doesn't support Node.js worker_threads, a new process-based rendering pipeline (render-process.mjs, render-process-channel.mjs, render-process-spawn.mjs) communicates over stdio, replacing the worker thread approach while keeping the same external API.
  • Improved sys.mjs process shim — The Deno process polyfill is now more robust (adds on/off/once/stdout/stderr stubs) and no longer overwrites the real process global when Deno's Node compat layer already provides one.

New examples

  • examples/bun/ — A complete Bun example with SSR, client-side hydration, and interactive counter
  • examples/deno/ — A complete Deno example with the same feature set plus react-server.deno.json configuration

Testing

  • Docker-based integration tests for create-react-server covering Node.js, Bun, and Deno — each runtime is tested in an isolated container to verify that scaffolded projects build and start correctly.
  • Vitest snapshot tests verifying the generated project structure for each runtime/preset combination.
  • New CI workflow (.github/workflows/create-react-server.yml) runs these tests automatically on push and PR.

Documentation

Updated the getting started guide and deployment docs (English and Japanese) to reflect that Deno is now fully supported, remove the "not supported yet" notices, and document automatic adapter detection along with simplified deployment commands.

@lazarv lazarv changed the title feat: Add first-class Bun and Deno runtime support feat: add first-class Bun and Deno runtime support Feb 20, 2026
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

✅ Documentation preview deployed to: https://react-server-docs-nfwlm39wz-lazarv-team.vercel.app

@lazarv lazarv merged commit 8332fa7 into main Feb 20, 2026
93 of 94 checks passed
@lazarv lazarv deleted the feat/bun-deno branch February 20, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant