The Vite team recently announced Vite 6, which they labeled as a significant major release. Vite 6 introduces the Environment API, a feature that targets framework authors. With the Environment API, authors may for instance support edge deployment cases and offer a dev experience closer to that of production.
Since Vite’s first official release in 2021, new JavaScript runtimes (i.e., other than Node.js) have emerged. The last State of JavaScript yearly survey estimates that those runtimes (e.g., Deno, Bun, Workerd, Edge Runtime) represent 10% of the usage. Other non-traditional runtimes include Electron, Tauri, and React Native. Where previous versions of Vite would handle one bundle for the browser and one bundle for Node.js Server-Side Rendering (SSR), Vite 6 enables running and bundling in non-Node.js runtimes.
The team behind Vike, a framework built on top of Vite, explained in more detail:
It’s a low-level API and you’ll probably never directly interact with it, but its impact is profound for users.
[…]
The most notable benefit is that you’ll be able to develop directly against edge environments […] while getting the full Vite experience such as HMR.
In other words, you will develop code that works equally well between dev and prod. You’ll get a unified stack.
This is a major milestone for edge deployment, as you will develop for the edge (Cloudflare Workers, Vercel Edge, …) as conveniently as for a Node.js/Bun/Deno server.
While the new capability required a large refactoring, the Vite team largely managed to maintain backward compatibility. Developers building a single-page application (SPA), will see no change to their workflow. Similarly, existing custom SSR setups should continue to work. Developers with SSR use cases however may now use the Environment API to streamline their development life cycle.
The release note however mentions that the new APIs are experimental. Feedback from the ecosystem of Vite’s end users, framework/plugin authors, and runtime providers is welcome and will be instrumental in stabilizing the API for Vite 7. Feedback can be posted in an open GitHub discussion.
For the full list of features released with Vite 6, developers should refer to the release note. Developers may also review the Environment API Guides on Vite’s documentation site.
Some developers on Reddit confirmed a painless migration to Vite 6:
[punkpeye] Literally didn’t change anything in the codebase
Another reported the importance of the release for plugin developers and framework authors:
[jessepence] Congratulations to the Vite team on another awesome release! The environment API is a game-changer for framework authors. It will make it much easier to implement runtime dependent features like RSCs.
Vite is distributed under the MIT open-source license. Contributions are welcome and must follow Vite’s contributing guide.