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

use bun instead of node #38

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

use bun instead of node #38

wants to merge 3 commits into from

Conversation

sylv
Copy link
Owner

@sylv sylv commented Jan 7, 2024

bun run ./src/main.ts worked first try so I couldn't resist.
can't be merged until bun install --production filters dev deps properly.
as-is, this works if you install node in the image and use that to run the next standalone build output. but doing that is cringe.

issues

  • stream/promises is missing types but bun seems to support it...?
  • docker builds are currently huge maybe probably because of bun install --production still installs devDependencies of packages in the workspace oven-sh/bun#8033 but if thats our images might just barely beat the base nodejs alpine image in size 👉👈
  • minifying the api build output shaves off a few more mb, but error messages then include a snippet of code that is many thousands of characters long
  • bun is missing TextDecoderStream or something which is necessary for next middleware because next uses a special runtime even for standalone builds because of course and no theres no way to switch to nodejs as a runtime. but only for middleware, because of course.
    • replacing nextjs with vite+vite-plugin-ssr would be fun
    • the only other alternative is replacing the middleware with something else, which seems somehow worse
  • sharp is listed as a dependency which means it ends up unbundled in the final docker image. it might be possible to make it a devDependency and bundle it?

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