Fresh 2.0 Graduates to Beta, Adds Vite Support Fresh 2.0 has graduated to beta after 63 alpha releases, introducing Vite integration that provides hot module reloading, access to the Vite plugin ecosystem, and 9–12× faster boot times through on-demand route loading and server code bundling. The update also brings back the `` component, simplifies React-to-Preact aliasing, and allows Fresh to optionally run as a Vite plugin while remaining fully usable without it. Fresh 2.0 Graduates to Beta, Adds Vite Support After 63 alpha releases, Fresh 2.0 is graduating to beta. These betas are effectively release candidates — the architecture is now stable, and the last big change has landed. That change is Vite integration. With the new plugin, Fresh can now optionally run as a Vite plugin, giving developers access to hot module reloading, the full Vite plugin ecosystem, and modern tooling for both client and server code — all while remaining fully usable without Vite. import { defineConfig } from "vite"; import { fresh } from "@fresh/plugin-vite"; export default defineConfig { plugins: fresh , } ; The Fresh Vite plugin fully embraces Vite’s new Environment API to leverage the power of the plugin ecosystem for both server code and client code. For configuration details, see the Fresh docs. Hot module reloading in islands With Vite providing access to the underlying module graph of each environment, we can now provide proper hot module reloading “HMR” support. Instead of reloading the page and losing all state, HMR allows UI elements to be swapped out whilst keeping the current page alive. Right now, this is scoped to island code and server-only changes will still reload the page. 10x faster boot times A lot of care has been spent on making the production output as efficient as possible. In Fresh 2, routes are now loaded on demand — only the code needed to handle a request is loaded and executed. With the Vite plugin, we’re going a step further and will bundle the server code to reduce the number of files that need to be resolved and loaded. As a result, starting a Fresh app in production is an order-of-magnitude faster. In our projects, we’ve seen boot times improve by 9–12×, depending on project size. We measure this from the moment the process starts until the app is ready to handle requests. That time usually includes resolving files, loading and instantiating modules, and other work done by the JavaScript engine. Here are the boot numbers for the Fresh website: - Before: 86ms - After: 8ms react aliasing Out of the box Aliasing react , react-dom and other packages to preact/compat has always been a bit tricky. This mapping often needed to be manually specified, and required app code to use esm.sh instead of pulling dependencies directly from npm . Having to be conscious about this was never an ideal setup. With our Vite plugin, this will be taken care of for you. Install third party npm packages as usual and never run into aliasing issues again