Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Bun runtime #112

Merged
merged 1 commit into from
Jan 23, 2025
Merged

feat: support Bun runtime #112

merged 1 commit into from
Jan 23, 2025

Conversation

lazarv
Copy link
Owner

@lazarv lazarv commented Jan 23, 2025

This PR adds Bun support with a minimum version of Bun v1.1.45.

The most prominent change is the compatibility fallback workaround on how streams are being used with the SSR worker. Node.js supports passing streams to a worker, while Bun doesn't and it was necessary to pass buffers directly instead of using a stream.

Adds workaround to switch NODE_ENV to production when using @lazarv/react-server in production mode as React needs to resolve to the appropriate module in production.

A Bun plugin was implemented to resolve the react and react/jsx-dev-runtime modules to their react-server versions in development mode.

Using fsevents in file watchers is disabled when using Bun, while the server restart option is disabled in the development server when using Bun as there's a known issue with Vite restarting the server.

Fixes how the logger instance is initiated in production mode.

Updates the "Get Started" page in the documentation to include instructions on how to use Bun when working with @lazarv/react-server and also includes a minor tweak on the styling of the documentation sidebar navigation.

Copy link

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

@lazarv lazarv merged commit 44033c0 into main Jan 23, 2025
8 checks passed
@lazarv lazarv deleted the feat/bun branch January 23, 2025 14:44
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