Goodbye Gatsby, hello Astro
I moved two mostly static sites from Gatsby to Astro. Most of the gain came from deleting JavaScript they never needed.
- Engineering
- Web
- Performance
I moved my portfolio from Gatsby to Astro, then did the same with the Virya website. The obvious result was speed, but what I liked most was predictability. Mobile Lighthouse measurements that used to wander around settled close to one second, and desktop LCP became consistently tiny.
Why Gatsby didn't fit
Both sites are mostly static, which I probably should have paid attention to earlier.
Gatsby made every heading, paragraph and image part of a React application, even when none of them needed to do anything after appearing on screen. Astro starts from the opposite assumption: HTML first, JavaScript only when I explicitly ask for it. That fits a portfolio and a band site much better.
The migration was mostly deletion
The migration itself was straightforward. I kept the JSON content, routes and images, rewrote static components as .astro files, then went through every remaining interactive part with one question: why does this need hydration?
Deciding what to hydrate
Some components had a good answer. Merch, forms, live events, Signal, AREA and staff tools need state. Others didn't. The hero text and scroll-to-top control became small browser scripts. Components below the fold load only when visible or idle. Video no longer competes with the first paint just because it's on the page.
Keeping the game separate
When something needs to be a full application rather than an island, I keep it out of Astro entirely. Synesthesia ships separately as Godot Web, so the main site doesn't carry a game engine on every page view.
Switching to Preact
Switching compatible islands to Preact removed roughly 37 kB of JavaScript per page at the time. More useful than the number was seeing exactly where client code still lived and why.
Server routes for Virya
Virya was the more interesting migration, because the site now has Stripe checkout, InPost, multilingual pages, a browser field game, fan accounts and a Rust backend behind it. I kept the public pages static-first and moved trusted work to server routes. Admin keys never reach browser JavaScript, and a slow external service can't block the rest of the site.
Results
Both sites still reach 100 in the Lighthouse categories I track. Astro helped, but most of the optimisation was simple: ship static HTML, hydrate the few things that move and delete framework code where plain web technology is enough.