Fresh 1.4 – Faster Page Loads, Layouts and More
Fresh 1.4 adds optional ahead-of-time asset compilation via `deno task build`, which serves island assets roughly 45-60x faster on serverless cold starts than on-the-fly JIT compilation; a ~30kB search island that took 4.28s now revives near-instantly. The development server still uses JIT. The release also lets `_app.tsx` render the full html/head/body document, with a fallback to the old template when no html tag is rendered. New features include nested and async `_layout` files with opt-out config, `defineRoute`/`defineLayout`/`defineApp` typing helpers, parenthesized route groups that don't affect URLs, and private `(_components)` and `(_islands)` folders for colocating code.
Related posts
- Fresh 1.0
Deno mediumAdeptFresh is a full stack web framework for Deno that renders pages just-in-time on the server and ships zero JavaScript to the client by default, using the islands architecture so only explicitly opted-in components are hydrated in the browser. It uses Preact and JSX/TSX on both server and client, has file-system routing with handlers for custom responses and async data loading, and has no build step: TypeScript and JSX are transpiled on demand, so deployments are near-instant. Version 1.0 is declared production-ready and is well suited to edge runtimes such as Deno Deploy, Netlify Edge Functions and Supabase Edge Functions.
- Fresh 1.3 – Simplified Route Components and More
Deno mediumAdeptFresh 1.3 lets route components be async functions that load data directly, removing the handler-plus-props-interface boilerplate, while the existing ctx.render() pattern keeps working. Plugins can now inject routes and middlewares, thrown handler errors fall back to the _500.tsx template, and Preact error boundaries can catch rendering errors. Multiple islands can be exported from one file to cut requests, best when grouping islands used on the same page. The release also adds Fresh-specific lint rules, clearer error messages, and uses the now-stable Deno.serve API when available.
- A Gentle Introduction to Islands
Deno mediumAdeptIslands architecture renders pages as static HTML and hydrates only isolated interactive Preact components, avoiding the whole-page, top-down hydration that ships framework JS even for static content. Fresh implements it by reading islands from the generated fresh.gen.ts manifest and using Preact's options.vnode hook during SSR to wrap each island in frsh-id:index HTML comments. It then emits a hydration script only when islands were encountered. In the browser, a revive function walks the DOM for those comments and renders each component with its serialized props, so pages with no islands ship zero JavaScript. Astro's client directives, partial hydration in Marko, React Server Components and Qwik's resumability are compared as alternative approaches.
- Fresh 1.2 – welcoming a full-time maintainer, sharing state between islands, limited npm support, and more
Deno mediumAdeptFresh 1.2 brings on Preact maintainer Marvin Hagemeister as full-time lead after a backlog of 60+ unreviewed PRs, and ships features centred on islands. Island props can now carry circular objects, Uint8Arrays and Preact Signals beyond plain JSON, which lets islands share state through a common signal. Islands also accept server-rendered JSX children, recovered from the HTML alone, and can nest, with inner islands treated as ordinary Preact components. Other additions include limited npm: specifier support (not yet on Deno Deploy), custom HEAD handlers, status and header overrides on ctx.render, island subdirectories, an async renderAsync plugin hook, and a createHandler helper for testing.
- Fresh 1.5: Partials, client side navigation and more
Deno mediumAdeptFresh 1.5 introduces Partials, a client-side navigation model where marked regions of a page are swapped with server-rendered HTML without a full reload, preserving island state. Developers opt in with an f-client-nav attribute and <Partial name> wrappers, can point links at slimmed partial endpoints via f-partial, return multiple partials in one response, and choose replace, prepend or append merge modes. The release also adds automatic data-current/data-ancestor attributes for active link styling, configurable esbuild targets, an exposed esbuild metafile for bundle analysis, a new dev error overlay, automatic CSP nonces on inline scripts, and experimental buildStart/buildEnd plugin hooks.