cd /news/developer-tools/fresh-2-0-graduates-to-beta-adds-vit… · home topics developer-tools article
[ARTICLE · art-8760] src=deno.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

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 `<Head>` component, simplifies React-to-Preact aliasing, and allows Fresh to optionally run as a Vite plugin while remaining fully usable without it.

read3 min views18 publishedSep 2, 2025

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 re, 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 re in islands With Vite providing access to the underlying module graph of each environment, we can now provide proper hot module re (“HMR”) support. Instead of re 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, 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! <Head> component is back! The The beloved <Head> component from Fresh 1.x is back again! It can be used from components to render elements into the <head> portion of an HTML document.
export default function Page() {
return (

<div> <Head> <title>About me</title> </Head>

<h1>About me</h1>
<p>some text about me...</p>

</div>

);
}

This feature isn’t tied to the Vite integration — you can already use it today in a Fresh 2 app. We had removed it in 1.x because the implementation was messy and hurt rendering performance. But with Fresh 2’s cleaner architecture and the chance to explore different approaches, we’ve landed on a much simpler, more efficient solution. Try it out! You can try out the Vite plugin today by running: deno run -Ar jsr:@fresh/init This will guide you through setting up a simple Fresh app that’s ready to be used with Vite. Let us know if you run into any issues! Already using Fresh 1.x? The updated migration guide walks you through upgrading to Fresh 2.0 step by step. Also check out the new guide on deploying to Cloudflare Workers, if that’s your preference. 🚨️ There have been major updates to Deno Deploy! 🚨️

  • Improved Playgrounds with livestreaming logs, traces, and templates like Next.js
  • Automatic and immediate observability and telemetry
  • Simpler management for environment variables and much more!
── more in #developer-tools 4 stories · sorted by recency
── more on @fresh 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/fresh-2-0-graduates-…] indexed:0 read:3min 2025-09-02 ·