Skip to content

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.

2 participants