Islands Architecture: Partial Hydration
You'll learn how to hydrate only the interactive parts of your page, leaving static content as plain HTML for maximum performance.
The Core Idea
Instead of hydrating your entire page (which costs CPU time and JavaScript execution), Islands Architecture treats interactive components as isolated "islands" of interactivity in a sea of static HTML. Only these islands get hydrated with JavaScript, while everything else remains as lightweight, static HTML that doesn't need hydration at all.
Think of it like a newspaper: most of the content is static text and images you just read. Only a few interactive elements (like a crossword puzzle or interactive chart) need special functionality. Why load and execute JavaScript for the static parts?
How It Works in Practice
Frameworks like Astro and Fresh implement this pattern. You write your page mostly as static components (HTML, CSS), then explicitly mark which components need interactivity:
<!-- Astro example -->
<Layout>
<Header /> <!-- Static HTML, no hydration -->
<Article> <!-- Static HTML, no hydration -->
<p>This is static content...</p>
</Article>
<Comments client:load /> <!-- Island! This gets hydrated -->
<Footer /> <!-- Static HTML, no hydration -->
</Layout>
Only the <Comments /> component ships JavaScript to the browser and hydrates. Everything else is just HTML.
The Performance Win
This dramatically reduces:
- JavaScript bundle size (only island code ships)
- Time to Interactive (less code to parse and execute)
- CPU usage (no hydration work for static content)
Key Takeaway: Islands Architecture achieves partial hydration by only shipping JavaScript and hydrating interactive components, treating the rest of your page as static HTML—giving you the benefits of SSR without the full cost of page-wide hydration.