---
title: "A Gentle Introduction to Islands"
description: "Islands 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."
url: "https://swe.quest/articles/a-gentle-introduction-to-islands-51c545953d15b8b9"
canonical: "https://deno.com/blog/intro-to-islands"
source: "Deno"
published: "2023-04-26"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 10
tags: ["frontend","web-performance","javascript","typescript"]
---

# A Gentle Introduction to Islands

A post on [Deno](https://swe.quest/sources/deno.md), published 2023-04-26, 10 min read, Deep dive. Original: [https://deno.com/blog/intro-to-islands](https://deno.com/blog/intro-to-islands)

## Summary

Islands 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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Web performance](https://swe.quest/tags/web-performance.md) (Web & mobile)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- server-side rendering
- React/Preact components ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- hydration basics

## Keywords

Fresh, Deno, Preact, islands architecture, Astro, Qwik, React Server Components, Next.js

## Related posts

- [Fresh 1.0](https://swe.quest/articles/fresh-1-0-407c9d4b84f51b2c.md): Deno · 2022-06-28 · Medium · 5 min read · Frontend, JavaScript, TypeScript, Web performance, CDN & edge
  Fresh 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.
- [Fresh 1.4 – Faster Page Loads, Layouts and More](https://swe.quest/articles/fresh-1-4-faster-page-loads-layouts-and-more-0ba54de19820b6f5.md): Deno · 2023-08-16 · Medium · 7 min read · Frontend, Web performance, TypeScript
  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.
- [Fresh 1.2 – welcoming a full-time maintainer, sharing state between islands, limited npm support, and more](https://swe.quest/articles/fresh-1-2-welcoming-a-full-time-maintainer-sharing-state-between-islands-ccf0a74d8fb68678.md): Deno · 2023-06-15 · Medium · 7 min read · Frontend, JavaScript, TypeScript
  Fresh 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.
- [Fresh 1.3 – Simplified Route Components and More](https://swe.quest/articles/fresh-1-3-simplified-route-components-and-more-3694b69f8671c9dd.md): Deno · 2023-07-18 · Medium · 6 min read · Frontend, TypeScript
  Fresh 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.
- [The Future (and the Past) of the Web is Server Side Rendering](https://swe.quest/articles/the-future-and-the-past-of-the-web-is-server-side-rendering-8de1b9934a1b9dca.md): Deno · 2023-02-01 · Medium · 12 min read · Frontend, Web performance, JavaScript
  Server-side rendering is presented as the answer to bloated client-side apps, with median page weight up 388% on desktop and 1288% on mobile over ten years.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
