← All work

Rebuild · Speed (Self-initiated project)

sohailrana.com: React to Astro Rebuild, 78% Less JavaScript

Client
My own portfolio site
From → To
React + Vite single-page app → Astro
Stack
Astro, TypeScript, Tailwind CSS, Netlify
Key result
78% less JavaScript, mobile PageSpeed 91, desktop 96
sohailrana.com on laptop, tablet and phone after the rebuild from React to Astro

01 / The problem

My site was a React + Vite single-page app. It looked right in a browser, but the HTML the server sent was nearly empty: one div, with all the content built by JavaScript after the page loaded.

That had two costs. Visitors downloaded a full JavaScript app just to read static text. And search engines and AI tools that don't run JavaScript saw an empty page, which matters more now that clients search with ChatGPT and Perplexity as well as Google.

02 / The approach

  1. Rebuilt the site in Astro, which renders every page to HTML at build time
  2. Kept JavaScript only for the parts that need interaction, loaded as small islands
  3. Cut the JavaScript sent to the browser by 78%
  4. Kept the same design, with the codebase in TypeScript

03 / The scores

  • Mobile PageSpeed report for sohailrana.com: Performance 91, Accessibility 96, Best Practices 100, SEO 100, Agentic Browsing 3 of 3

    Mobile: Performance 91, Accessibility 96, Best Practices 100, SEO 100.

  • Desktop PageSpeed report for sohailrana.com: Performance 96, Accessibility 96, Best Practices 100, SEO 100, Agentic Browsing 3 of 3

    Desktop: Performance 96, Accessibility 96, Best Practices 100, SEO 100.

Both pass all 3 of Lighthouse's Agentic Browsing checks, which test whether AI agents can read and use the site.

You're reading this page on the rebuilt site, so you can check it yourself: run it through PageSpeed Insights, or view the page source and see the full text in the HTML.

04 / The result

  • Every page readable as plain HTML by Google and AI search tools
  • 78% less JavaScript
  • Mobile PageSpeed 91, desktop 96
  • SEO and Best Practices 100 on both

This is the same rebuild I offer clients whose sites are slow or locked into a builder.

What I'd do for you

Is your site a React app or a page builder that loads slowly? Send me the link and I'll tell you what a move to Astro would take.

Send me your site

Working with an agency? See how I build for studios →