Introduction
From Fresh
Fresh and Ascua's site kit share the model —file routes, server-rendered HTML and islands—. What maps one to one, what changes, and what Ascua does not have yet.
In October 2026 the Deno team joined Cloudflare. The Deno runtime gets one more year of fixes and security patches, Deno Deploy shuts down in six months, and the announcement says nothing about Fresh. If you have a Fresh site and are looking for where to take it, this page compares the two honestly.
What is alike. Ascua's site kit has the same model as Fresh: one page per route file, HTML rendered on the server and JavaScript only in islands. Folders, layouts, middleware, data loading and forms map almost one to one.
What changes. Fresh writes components in JSX with Preact; Ascua, in
view templates, with no JSX and no Virtual DOM. Migrating is not renaming
files: the components have to be rewritten. The structure stays.
Where it runs. The same Ascua build runs on Node, Bun, Deno and workerd
—the Workers runtime, also on your own servers—. You can stay on Deno from
start to finish. See Sites.
Side by side
| Fresh 2 | Ascua |
|---|---|
deno run -Ar jsr:@fresh/init |
deno run -A npm:create-ascua |
routes/about.tsx |
src/routes/about.ts |
routes/blog/[slug].tsx |
src/routes/blog/[slug].ts |
routes/old/[...path].tsx |
src/routes/old/[...path].ts |
routes/docs/[[version]].tsx |
src/routes/docs/[[version]].ts |
routes/(marketing)/about.tsx |
src/routes/(marketing)/about.ts |
routes/_layout.tsx |
src/routes/_layout.ts |
routes/_middleware.ts |
src/routes/_middleware.ts |
ctx.state |
locals |
f-client-nav and <Partial name="main"> |
site: { partials: true } and data-partial="main" |
await ctx.next() |
await next(), the same: a Response to change or replace |
routes/_app.tsx |
index.html, the shell |
routes/_404.tsx |
src/routes/404.ts |
routes/_error.tsx |
src/routes/500.ts, with the error in props.error |
islands/counter.tsx |
src/islands/counter.ts, with defineIsland |
handler with GET and page({ … }) |
export async function load() → prop data |
throw new HttpError(404) |
throw notFound() |
handler with POST and ctx.req.formData() |
export const actions |
handlers with GET, PUT, DELETE… |
export const PUT: RequestHandler, one per method |
| Manual validation | validate with field or any Standard Schema |
| CSRF plugin | Built in: same-origin forms only |
useSignal from @preact/signals |
signal from ascua |
| Partials, for forms | enhance() from an island |
| Deno Deploy | Node, Bun, Deno, workerd, Cloudflare Workers |
A page with data
In Fresh, the GET handler loads and the page receives data:
// Fresh: routes/projects/[id].tsx
export const handler = define.handlers({
async GET(ctx) {
const project = await db.projects.findOne(ctx.params.id);
if (!project) throw new HttpError(404);
return page({ project });
},
});
export default define.page<typeof handler>(({ data }) => (
<div>
<h1>{data.project.name}</h1>
<p>{data.project.stars} stars</p>
</div>
));In Ascua, load() receives the route params and what it returns arrives as
data:
// Ascua: src/routes/projects/[id].ts
import { notFound } from "vite-plugin-ascua/site";
export async function load({ id }: { id: string }) {
const project = await db.projects.findOne(id);
if (!project) throw notFound();
return project;
}
type Project = Awaited<ReturnType<typeof load>>;
export const title = ({ data }: { data: Project }) => data.name;
export default function ProjectPage({ data }: { data: Project }) {
return view`
<div>
<h1>${data.name}</h1>
<p>${data.stars} stars</p>
</div>`;
}title, description, head and lang are exports of the route, not a
separate component. On a static site, a route with params says which pages to
generate with paths(); with a server (site: { mode: "server" }), any value
reaches load().
An island
Fresh puts islands in islands/ and uses them like any other component:
// Fresh: islands/counter.tsx
import { useSignal } from "@preact/signals";
export default function Counter(props: { start: number }) {
const count = useSignal(props.start);
return <button onClick={() => (count.value += 1)}>Count: {count}</button>;
}In Ascua the island declares the schema of its props, which travel as JSON:
// Ascua: src/islands/counter.ts
import { defineIsland, p, signal } from "ascua";
function Counter(props: { start: number }) {
const count = signal(props.start);
return view`<button onclick=${() => count.update((n) => n + 1)}>Count: ${() => count()}</button>`;
}
export const CounterIsland = defineIsland("counter", { start: p.number }, Counter);// the page
import { CounterIsland } from "../islands/counter.js";
export default function Home() {
return view`<main><CounterIsland start=${3}/></main>`;
}The differences:
- A signal is a function. You read it with
count(), notcount.value, and in the template it goes inside() => …so the text updates. - Props are validated. The schema in
defineIslandchecks what arrived from the server when hydrating. It takespor any Standard Schema (Zod, Valibot…). Date,Map,Set,URL,bigint, with their schema. Fresh serializes them on its own; in Ascua they travel as JSON and the schema (p.date,p.map(…)…) says what they become on arrival. Server-rendered JSX as island children does not travel.- The client adopts the HTML. When hydrating, Ascua uses the nodes that came from the server instead of creating them again.
A form
In Fresh, the POST handler reads the form, validates by hand and redirects
with a hand-written 303:
// Fresh: routes/subscribe.tsx
export const handler = define.handlers({
async POST(ctx) {
const form = await ctx.req.formData();
const email = form.get("email")?.toString();
// validate…
const headers = new Headers();
headers.set("location", "/thanks-for-subscribing");
return new Response(null, { status: 303, headers });
},
});In Ascua it is an action, with validation and the redirect included:
// Ascua: src/routes/subscribe.ts
import { fail, field, fields, redirect, validate, type ActionContext, type FormResult } from "vite-plugin-ascua/site";
const Subscription = fields({ email: field.email() });
export const actions = {
async default({ formData }: ActionContext) {
const result = await validate(Subscription, formData);
if (!result.ok) return fail(400, result);
await subscribe(result.data.email);
throw redirect("/thanks-for-subscribing");
},
};
export default function Subscribe({ form }: { form?: FormResult<typeof Subscription> }) {
const error = form?.ok === false ? form.errors.email : "";
return view`
<form method="post">
<input name="email" type="email">
<p class="error">${error ?? ""}</p>
<button>Subscribe</button>
</form>`;
}With no configuration, the action only accepts same-origin forms —the CSRF
check that is a plugin in Fresh—, the body has a size limit and the page goes
out with a Content-Security-Policy that hashes every inline script. To send it
without reloading, put the form in an island with enhance() from
vite-plugin-ascua/form. The validation messages of field follow the
site's language: ascua({ site: { lang: "en" } }) —sites made with
create-ascua in English already have it—, and each one takes a message.
Middleware
// Ascua: src/routes/admin/_middleware.ts
import { redirect, type MiddlewareContext } from "vite-plugin-ascua/site";
export default async function ({ cookies, locals }: MiddlewareContext) {
const id = await cookies.getSigned("session");
if (!id) throw redirect("/login");
locals.user = await findUser(id);
}It runs before the routes of its folder and the ones inside, before actions and
load(). What it leaves in locals reaches load(), the actions and the
layouts. setHeaders adds headers to the response. To wrap the route like
Fresh's ctx.next(), call await next(): it returns the Response, which
can be changed or replaced.
What Ascua does not have yet
Better to know it before, not halfway through the migration:
- JSX. If the team does not want to leave JSX, Ascua is not for that project.
- Server HTML inside an island. Fresh passes already rendered JSX as a prop or child; in Ascua an island receives data, not markup.
- Skipping the layout on one page (
skipInheritedLayouts,skipAppWrapper): every page inherits the_layout.tsof its folders. - Partials that add (
mode="append"/"prepend"): Ascua's replace the region. - More types in island props: Fresh also carries
RegExp,Uint8Array,Temporaland repeated references; Ascua,Date,URL,Map,Setandbigint. - Built-in middleware for CORS and trailing slashes: written with
_middleware.ts. - All the docs in English. The guides for everyday work —getting
started, reactivity, templates, Show and For, remote data, sites, security,
passkeys— and this one are in English. Components, styles, the router,
forms, testing and the API reference are in Spanish for now. The kit's
messages follow
site.lang, build errors followLANG, and the runtime's console warnings are in English.
Where to start
- Create a site with
deno run -A npm:create-ascua my-site --template serverand copy your shell (_app.tsx) toindex.html. - Move the routes without islands first: the layout, the pages with
load()and the 404. They render without JavaScript, so you can compare them with the old site page by page. - Then the islands, one by one, each with its schema.
- Last, the forms, turning each
POSThandler into an action.