๐ Core Identity
- Astro: Web framework optimized for content-driven sites (blogs, docs, e-commerce, portfolios).
- Pioneered Islands Architecture โ reduces JavaScript overhead compared to SPAs.
โ๏ธ Key Features
- Islands Architecture: Selective hydration of interactive components; rest of page is static HTML rendered on server. Uses MPA, unlike SPAs that hydrate everything client-side.
- UI-agnostic: Supports React, Vue
- Content collections: Type-safe Markdown management with validation.
- Integrations: MDX, Partytown, hundreds of APIs/hooks for customization.
๐ฎ๐ฒ Island Architecture
- a frontend design pattern where most of the page is delivered as static HTML, while small, isolated sections (โislandsโ) are hydrated with JavaScript for interactivity.
- Astro popularized this approach by making it a first-class feature, allowing developers to mix multiple frameworks in one project.
- Traditional SPAs hydrate the entire page โ heavy JS bundles, slower initial load. Islands hydrate only whatโs necessary, hence better TTFB and LCP
- Best Fit: Sites with mostly static content and selective interactivity (blogs, docs, e-commerce).
๐๏ธ Client Islands
- Hydrated on the client side. Examples: carousels, dropdown menus, search bars.
- Astro directives:
client:load โ hydrate immediately.
client:idle โ hydrate when browser is idle.
client:visible โ hydrate only when scrolled into view.
- Benefit: Fine-grained control over when JS runs.