You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like the toolchain provided by Vite+ and don't want to let it go, but I also really like some of the runtime features provided by Bun, and additionally there are some frameworks and libraries that only run on Bun. There is no explicit support for this in Vite+ since it is intended to run with the vp env-managed Node version. The only documented support is Bun as the package manager, which is not what I'm talking about here.
After giving it some thought, I don't really see anything preventing the use of Vite+ and Bun's runtime together. Vite+ is a development toolchain, and an app's runtime is inherently separate from that. I'm even ok with Vite+ using Node internally to run all of its contained tools (i.e. run Vite, Oxfmt, Oxlint with managed Node), I just need the application code to be able to use Bun APIs. I want to know what configuration I need to be aware of to make sure that Vite's dev server can interact with a separate Bun process for the actual app.
One potential issue here that I'm aware of is testing. vp test would use Vitest running on managed Node, but the actual app code under test expects a Bun runtime. A few ways I can think of to resolve that:
Disable Vitest and just use bun test for this case
Abstract the Bun-specific API calls behind an adapter and use a Node-compatible adapter for unit tests
In a perfect world, it would be really nice if Vite+ had first-class support for managing and running on Node-compatible runtimes like Bun and Deno. I recognize that there are more pressing features though.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I really like the toolchain provided by Vite+ and don't want to let it go, but I also really like some of the runtime features provided by Bun, and additionally there are some frameworks and libraries that only run on Bun. There is no explicit support for this in Vite+ since it is intended to run with the
vp env-managed Node version. The only documented support is Bun as the package manager, which is not what I'm talking about here.After giving it some thought, I don't really see anything preventing the use of Vite+ and Bun's runtime together. Vite+ is a development toolchain, and an app's runtime is inherently separate from that. I'm even ok with Vite+ using Node internally to run all of its contained tools (i.e. run Vite, Oxfmt, Oxlint with managed Node), I just need the application code to be able to use Bun APIs. I want to know what configuration I need to be aware of to make sure that Vite's dev server can interact with a separate Bun process for the actual app.
One potential issue here that I'm aware of is testing.
vp testwould use Vitest running on managed Node, but the actual app code under test expects a Bun runtime. A few ways I can think of to resolve that:bun testfor this caseIn a perfect world, it would be really nice if Vite+ had first-class support for managing and running on Node-compatible runtimes like Bun and Deno. I recognize that there are more pressing features though.
All reactions