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(bun): Add bun adapter #1059

Merged
merged 5 commits into from
Sep 14, 2023
Merged

Conversation

pan93412
Copy link
Contributor

@pan93412 pan93412 commented Sep 12, 2023

Experimental but works 🚀

image

TODOs

Usage

The --bun flag is essential; otherwise, this server will be spawned by Node.

export START_ADAPTER="solid-start-bun"

bun run --bun build
bun run --bun start

Benchmark

wrk command: wrk -t8 -c500 -d10s --latency "http://localhost:3000"
system: macOS 13.5.2, on Apple M1.

Platform Base RAM usage Requests/sec RAM usage after wrk
Node 22.2MB 3107.68 126.5MB
Bun 16.8MB 7057.49 112.2MB

@pan93412 pan93412 force-pushed the pan93412/bun-support branch from 11d4a9f to d1ae2e4 Compare September 12, 2023 05:31
@pan93412 pan93412 changed the title feat(bun): Add experimental bun adapter feat(bun): Add bun adapter Sep 12, 2023
@pan93412 pan93412 force-pushed the pan93412/bun-support branch from 717671e to 2799e4c Compare September 12, 2023 15:18
@pan93412 pan93412 marked this pull request as ready for review September 12, 2023 15:29
@ryansolid ryansolid merged commit bbe34f3 into solidjs:main Sep 14, 2023
5 of 9 checks passed
@ryansolid
Copy link
Member

Thank you

@pan93412 pan93412 deleted the pan93412/bun-support branch September 14, 2023 23:18
@hardywu
Copy link
Contributor

hardywu commented Oct 4, 2023

crypto module error

Import named 'KeyObject' not found in module 'crypto'.

on import of "jose" .
Commands executed are

export START_ADAPTER="solid-start-bun"

bun run --bun dev

Scripts() from solid-js/web is not working correctly

And HydrationScript, NoHydration are missing in .solid/server/entry-server.js

Should be caused by #oven-sh/bun/issues/4667

@hardywu
Copy link
Contributor

hardywu commented Oct 8, 2023

Found a temporary workaround solution, i.e. installing and running the solid-start env with npm or pnpm ( any env that is not bun ).
Build the bun production codes in ./dist use the bun adapter.
What we get could be deployed with bun with no issues.

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.

3 participants