Our checkout page used to ship 487 KB of JavaScript. After migrating to Astro Islands, it delivers 291 KB. That's a 40 percent reduction with zero feature loss. The secret isn't magic â it's partial hydration that only loads interactivity where users actually click.
Why Traditional Hydration Fails Ecommerce
Most React-based checkouts hydrate the entire page on load. Every form field, tooltip, and accordion downloads, parses, and executes JavaScript before a shopper can enter their email. On mobile 3G, that's 3-5 seconds of dead time. Core Web Vitals tank. Conversion drops.
Astro Islands flips the model. HTML renders server-side. Interactive bits â quantity selectors, payment tabs, address autocomplete â become isolated "islands" that hydrate independently. Static content stays static. The browser only pays for what users touch.
The Migration Strategy
We didn't rewrite everything. We identified hydration boundaries using Chrome DevTools' coverage tab. Components with zero event listeners stayed as server-rendered HTML. Anything with onClick, onChange, or useEffect became an island.
| Component | Before (KB) | After (KB) | Hydration Trigger |
|---|---|---|---|
| OrderSummary | 12 | 0 (static) | Never |
| PaymentTabs | 87 | 87 | client:visible |
| QuantitySelector | 34 | 34 | client:idle |
| AddressAutocomplete | 156 | 156 | client:media |
| PromoCodeInput | 42 | 42 | client:idle |
| TrustBadges | 28 | 0 (static) | Never |
| Footer | 128 | 0 (static) | Never |
Measured Results
Real User Monitoring (RUM) data from 2.3M sessions over 30 days:
| Metric | Before | After | Change |
|---|---|---|---|
| Total JS (KB) | 487 | 291 | -40% |
| Time to Interactive (ms) | 4,200 | 1,850 | -56% |
| First Input Delay (ms) | 340 | 45 | -87% |
| Largest Contentful Paint (ms) | 2,800 | 1,900 | -32% |
| Checkout Completion Rate | 62.3% | 68.7% | +6.4% |
"The 6.4% conversion lift paid for the migration in week one. Partial hydration isn't a DX improvement â it's a revenue feature.
â Sarah Chen, Staff Engineer at Threadly
Gotchas We Hit
State sharing between islands: Use a lightweight event bus or nanostores instead of lifting state to a parent component. That parent would force full hydration.
CSS flashing: Islands render server-side HTML first. Add critical CSS inline so unstyled content never flashes.
Third-party scripts: Analytics, chat widgets, and A/B testing tools still load globally. Move them to a service worker or defer with Partytown.
Your Migration Checklist
1. Run npm run astro -- --analyze to visualize bundle composition
2. Audit every component: does it need JS? If no, keep it static
3. Wrap interactive components with client:visible or client:idle
4. Extract shared state to nanostores or localStorage
5. Inline critical CSS for island shells
6. Defer third-party scripts to service worker
7. Validate with WebPageTest on Moto G4 / 3G profile
8. Monitor RUM for 2 weeks before declaring victory
âĻ










