← Back
2026-01-17 4 min read

Astro might be my new favourite framework

Why I switched from React to Astro for my blog - zero JavaScript by default, incredible docs, and sub-14KB bundles for better performance.

So, I finally tried Astro following the news of the Cloudflare acquisition. I first heard about it from Theo on his live stream about shipping and using Astro to build his startup, and honestly, between his take and the acquisition news, I was anticipated to try a new framework.

I had grown bored with my current setup. My blog is written using Bun with plain ReAct (TypeScript) and Tailwind CSS—not because the stack is bad, but because of performance and the setup overhead whenever I want to create a new blog post or portfolio page. Bun is great for the backend, and React is excellent for building SPAs, but neither is well suited for plain HTML, SEO-focused pages, simple landing pages, static sites, or content-driven applications where the final bundle should ideally be under 14KB rules. That’s why I wanted to give Astro a try.

When I first visited the Astro website, their value proposition immediately caught my attention: “the world’s fastest framework for marketing sites, blogs, and e-commerce websites.” What makes Astro compelling is that it compiles your application to HTML by default. It aims to reduce—or even eliminate—the amount of JavaScript shipped to the client. This is the opposite of React’s model, which typically ships HTML plus a large JavaScript bundle. As a result, Astro delivers content much faster due to a smaller payload, improves the user experience on mobile, and makes sites easier to index for search engines.

After reading the documentation and following the tutorial, I have to give Astro credit. The documentation so fuking amazing (AWS please read and learn from Astro). It is clear, intuitive, and easy to follow. Even though I do not write TypeScript exclusively, the tutorial felt seamless and approachable. It walks you through nearly every feature needed to build a simple blog. I recommend you should tried it your self

My overall impression after the tutorial is that Astro is highly component-based, similar to React, but without the boilerplate. You still have layouts and components, but the setup is much lighter. In my previous Bun-based portfolio, I had to write a significant amount of code just to handle routing and page structure using ReAct Router, custome generate content based on .md files. Astro, on the other hand, comes with built-in content generation and auto routing. I can simply create a .md file, add it to the repository, and Astro automatically generates the corresponding page. The setup is extremely straightforward.

Another feature I really like is ‘Islands’. Astro allows you to embed JavaScript components into otherwise static HTML pages. These components can depend on user state, and only those specific parts are shipped and rendered on the client, which saves a lot of resources. This also works on the server side. In React, achieving this level of granularity is much more complex, but in Astro, you simply add a client: or server: directive, and it just works.

That said, I did run into one issue with deployment. I host my applications on AWS S3 with CloudFront. Previously, with single-page applications, I could simply point CloudFront to the bucket and everything worked because all routes resolved to a single entry file. Since Astro generates a separate HTML file for each route, I needed to write a small CloudFront Function to rewrite incoming routes so they map correctly to the corresponding HTML files in the S3 bucket.

Here is the script I add into my CloudFront to trick the routing:

function handler(event) {
  var request = event.request;
  var uri = request.uri;

  // If URI ends with '/', append index.html
  if (uri.endsWith('/')) {
    request.uri += 'index.html';
  }
  // If URI has no file extension, append /index.html
  else if (!uri.includes('.')) {
    request.uri += '/index.html';
  }

  return request;
}

Overall, I think it’s a great framework, it IS NOT for every things, the astro framework still lack of neccessary features for building complex application, integrate with database, authentication, etc less than NextJS. However, if you are building a blog, a landing page, or a marketing site, you have to give it a try.

P/S: The current blog post, I migrate to Astro completely using Claude Code (Opus 4.5). I asked Claude to migrate using the example Astro Blog demo I follow from the tutorial as a reference. It did the whole thing in just 10 minutes. Perfect, not a single error (see how easy Astro is to use). After that I add a bun of new feature and publish this blog post. I already love Astro.

Again, Thank you @Theo for the recommendation. You guys should watch his youtube thingy