Support for bun runtime
D
Divakar Rajesh S
Currently typescript compilation is a bottleneck when the app is trying to start, taking upto 16seconds in my case. The bun runtime promises and seems to provide faster startup times. We can provide a way to ignore typescript compilation when the runtime is bun. The current implementation looks for the presence of tsconfig.json to identify if the project is a typescript project and dynamically changes the outdir.
Derrick Mehaffy
Bun would certainly be an awesome add but currently it's not compatible with the primary framework we use Koa.js and several of our required dependencies.
Once they have better compatibility though it would be awesome.
Derrick Mehaffy
Bun would certainly be an awesome add but currently it's not compatible with the primary framework we use Koa.js and several of our required dependencies.
Once they have better compatibility though it would be awesome.
D
DJHorse
Derrick Mehaffy: Where do you see Koa isn't supported?
From the bun 1.0 blog entry:
"Server frameworks like Express, Koa, and Hono just work."
Derrick Mehaffy
DJHorse: I personally ran some tests against it and sadly it was not working with Koa, it was throwing errors due to some of the way koa-router works and the way the ctx is handled with some undefined options within the ctx :/
Hopefully in the future they do end up building better support but they may have only tested with a handful of Koa's packages and not some of the more popular ones.
D
DJHorse
Derrick Mehaffy: are the tests you used published anywhere? I wouldn't mind taking a look into it
Derrick Mehaffy
DJHorse: No I was just running them locally, the other issue we will likely run into is the driver database packages as the way Knex.js works means we can only use very specific node packages and many of these are binaries that are built for a specific CPU Arch + Node version. For example SQLite3 or better-sqlite3.
Likewise another major dependency like this is sharp/lib-vips which is used for the image optimization process. When Apple first launched the M1 ARM CPU we ran into a ton of problems with this and since bun isn't based on a specific node version these packages fail when trying to use bun.
One day we will probably be able to support bun but I feel that is still quite a ways out (and yes I am aware that bun has it's own native sqlite implementation but that won't work Knex.js and would require massive rewrites for us to use that natively)
Martin Braun
Whether or not bun will prove itself to be a player in that space, it's definitely worth exploring this option.
r
romitkarmakar
This is much needed for faster iteration in the development process.
Shahul Hameed
I have recently read about Bun runtime. I am about to start a project using strapi. I would really love to use strapi along with the benefits of Bun runtime. Thanks