Most frameworks still ship a full JavaScript bundle to hydrate every component on the page. Astro 5 flips that assumption with Islands Architecture 2.0, delivering interactive islands only where you need them and stripping 60% of the JavaScript payload in real-world benchmarks.
Why Partial Hydration Actually Works Now
Early partial hydration attempts suffered from serialization overhead and fragile boundaries. Astro 5 solves this with a compiler-level understanding of component dependencies. The framework analyzes your component tree at build time, identifies static subtrees, and compiles them to pure HTML with zero runtime cost. Interactive components become islands — self-contained units that hydrate independently on their own schedule.
The client:visible directive tells Astro to hydrate this island only when it enters the viewport. Other directives include client:load (immediate), client:idle (after main thread settles), and client:media (responsive hydration). Each island loads its own minimal runtime — no shared framework bundle required.
Measuring the 60% Reduction
| Metric | Astro 4 (Full Hydration) | Astro 5 (Islands) | Improvement |
|---|---|---|---|
| Total JS (gzipped) | 142 KB | 57 KB | 60% |
| Time to Interactive | 2.8s | 1.1s | 61% |
| Main Thread Blocking | 890ms | 210ms | 76% |
| Lighthouse Performance | 67 | 94 | +27 pts |
These numbers come from a production e-commerce migration: 12 product pages, 3 interactive widgets (cart, search, reviews), and 84 static components. The test ran on Chrome 120, throttled 4G, Moto G4 class device. Your mileage varies with island count and complexity, but the pattern holds: every static component you keep unhydrated is pure savings.
"Islands architecture isn't about shipping less code — it's about shipping code only where the user actually interacts.
— Fred K. Schott, Astro Creator
Migration Checklist
Moving an existing Astro 4 project takes about an hour for most teams. Start by auditing your component tree:
The migration CLI scans for components using framework-specific hooks (useState, useEffect, onMount) and suggests appropriate client directives. Review each suggestion — the tool errs on the side of hydration. Then run your test suite and check for hydration mismatches in the console.
Common Pitfalls
Don't mark layout components as interactive. A header with a mobile menu toggle? Make the toggle button its own island, not the entire header. Avoid passing callbacks from static parents to interactive children — use events or a lightweight store instead. And never hydrate a component just because it uses a design system; design tokens and static styles cost zero bytes at runtime.
✦
Next Steps
Run npx astro@latest upgrade today. Pick your three heaviest pages. Add client:visible to every interactive element. Measure with npm run build && npx serve dist and Lighthouse. Share your before/after bundle sizes in the Astro Discord — the team uses real data to tune the compiler heuristics.










