I picked Astro over Next.js

I initially built this website with React + Next.js + Tailwind. Pretty neat stack, in my opinion. But I realized, that the React part was a complete overkill.

Vojta Struhár
2 min readNov 28, 2022

React at its core is meant for creating interactive websites. My website is basically entirely static — my CV, some projects and a blog. Next could definitely do all of that — but there was a better way.

Astro — simple, straight to the point

The blog you are just reading made me rewrite the project in the new framework. It just checked all the boxes for me — and there aren’t very many:

  • Easy markdown rendering

I knew I wanted to do a blog on here eventually. With React, I would have to use a library + storage + fetching and what not. Having static files rendered as blog posts is just awesomer.

  • First class Tailwind support

Gotta love the rear breeze.

  • React is still an option

I feel much safer going with Astro knowing, that I can fall back on familiar React components, if need be. Astro boils them down to HTML during build — no unnecessary JS is shipped to the browser!

Next might be faster, actually

One thing I see mentioned with Astro is that is fast. And it is — pure HTML and the smallest possible javascript sounds like a speed recipe. But never underestimate Next, it is truly amazing.

Astro — simple load speed test
Next.js — simple load speed test

I think that image optimization is where Next gains the most advantage. Most of the my homepage size actually comes from the few photos I have there. With Next, they are scaled down to the resolution needed — you can upload your photos in the highest quality you have and Next will make them fast.

Conclusion

I found myself guilty of answering a question before it was even finished. I didn’t give much thought to what my website actually needs and jumped straight to React, because it’s what I know. And then ended up rewriting small portion of it :)

Don’t just go for the benchmark numbers. Think about what you really want and need — and choose according to that!

If you found value in this article, a clap or a follow would be much appreciated!

Originally published at https://www.vojtechstruhar.com

--

--

Vojta Struhár
Vojta Struhár

Written by Vojta Struhár

Always on the lookout for a smarter way to code. Mac enjoyer 🍎, Web developer 🕸️, Game developer 👾