Journal

Why I Moved My Frontend Stack to Astro

Back to Blog
June 15, 2026
Blog
Why I Moved My Frontend Stack to Astro

Most frontend frameworks treat JavaScript as the default runtime. Astro treats it as a last resort. That shift in philosophy changed how I think about shipping web applications.

The Problem with Default Hydration

Every React, Vue, or Svelte component on a page ships JavaScript to the client, even if it does nothing after the initial render. A static blog post, a marketing page, a documentation layout — they all carry hydration overhead. The browser downloads, parses, and executes code just to re-render HTML that already exists.

This isn’t theoretical. I profiled a mid-size marketing site (80 components, mostly static content). Hydration added 340KB of JavaScript to a page that needed zero client-side interactivity. Time-to-interactive dropped from 1.2s to 3.8s on a throttled connection.

Astro’s approach: ship zero JavaScript by default. Components render at build time. The HTML arrives complete, and the browser does no extra work. No framework runtime. No hydration pass. No wasted cycles.

Island Architecture: Interactive Where It Matters

“Astro ships no JS” is an oversimplification. The framework supports interactive components through what they call Islands Architecture.

Here’s how it works: every component renders statically on the server. If you need client-side interactivity — a search bar, a cart widget, a form with live validation — you explicitly opt in using the client:load directive:

<Header />
<SearchBar client:load />
<Footer />

The Header and Footer ship zero JavaScript. The SearchBar hydrates immediately on the client. You can also use client:visible (hydrate when the component enters the viewport) or client:idle (hydrate when the main thread is free).

This isn’t just about bundle size. It’s logic-first engineering. You decide what needs to be interactive, and everything else stays on the server. The architecture forces you to think about whether a component truly requires client-side state before you add it.

Component Flexibility Without Lock-In

Astro doesn’t care which UI library you use. React, Vue, Svelte, Solid, Preact — they all work as components within the same project. I can use a React data table in one section and a Svelte animation in another without committing to a single ecosystem.

This matters more than it sounds. Most teams don’t have a clean single-library codebase. Migration from Vue to React, or integrating a third-party component built in a different framework, becomes trivial. You’re not rewriting components — you’re composing them at the page level.

The client: directives work identically regardless of the underlying framework, so the mental model stays consistent.

Vite Under the Hood

Astro runs on Vite, which means fast cold starts, instant hot module replacement, and native ESM during development. If you’ve used Vite with React or Vue, the DX feels familiar. If you haven’t, you’ll notice the difference immediately: build times drop from seconds to milliseconds, and the dev server starts almost instantly.

Astro’s content layer (for markdown, MDX, and structured data) integrates directly with the Vite pipeline. No separate data-fetching step, no build-time data fetching that feels bolted on. Content sources — local files, APIs, CMS platforms — are treated as first-class citizens with type-safe schemas.

Where Astro Falls Short

Astro isn’t a replacement for every frontend scenario. It’s a poor fit for:

  • Highly interactive applications — dashboards, real-time collaboration tools, complex forms with cascading state. If most of your page needs to be interactive, you’re fighting the architecture.
  • Single-page applications — Astro can handle them via client:only="react", but you’re essentially using React with extra steps.
  • Teams committed to a single SPA framework — if your entire product is a React SPA, the migration cost doesn’t justify the benefits.

The honest assessment: Astro excels at content-heavy sites where most components don’t need to be interactive. Blogs, documentation, marketing pages, e-commerce product pages, portfolio sites. If more than 30-40% of your page content requires client-side interactivity, you’re better served by a traditional SPA framework.

The Bottom Line

Moving to Astro forced a useful discipline: justifying every byte of JavaScript shipped to the client. The default isn’t “add a component and it’s interactive” — it’s “add a component, and it’s static until you prove it needs to be interactive.”

That inversion changed how I architect web projects. Performance stopped being an optimization step and became a design constraint. The result: faster pages, smaller bundles, and a codebase where interactivity is a deliberate choice rather than an assumption.

If your workload is content-first, Astro is the most efficient tool I’ve found. If it’s not, the framework will feel like friction. Know which one you’re building.

Tags

Architecture
Frontend Development