Considering how much I’ve disliked Next.js pretty much from day one, I’ve been surprised how much I’ve enjoyed using Astro to put this site together. Ask me how.
Thanks for asking. First, why don’t I like the behemoth that is Next? A few reasons:
In this case, I want enough to build (largely) static websites, including some data fetching/wrangling features. I want to be able to style them in a reasonable fashion, and I want images to be fairly easy to use without lots of manual hassle. I get all of that with Astro, and so far it has been a pretty elegant ride.
The HTML-aligned template language is lovely, but dropping into a client side UI library (React, Vue et. al.) is there when you need it. That’s nice, and discourages vendor lock in (or at least prevents it being terminal).
The scoped styles (and encouragement to colocate styles with templates) initially rankled me a bit, but once I converted over I found it worked really well. CSS-in-JS is, thankfully, not a thing here, but it is still easy enough to do things like share colours globally.
Maybe. I’m honestly not sure. There is (presumably) power squirrelled away in the depths of Next’s feature set which isn’t replicated in Astro. Is any of it truly essential? I couldn’t say. Without trying to build a large scale web application in Astro, I think it’d be foolish to make a claim either way.
But I’d also wager than the vast majority of sites built with Next aren’t like that. I’d be amazed if even a small percentage of users did anything remotely close to the perimeter of what’s possible. So until I was to hit that ceiling, I’d stick to the (in my opinion) much more aligned-with-the-spirit-of-the-web Astro.
That was my initial plan. I tried Zola and really wanted to like it, but I didn’t. It builds a site in milliseconds but everything felt a bit unfinished and even getting it to use relative links was a pain. I also looked at 11ty and Hugo but honestly, the amount of time I’d spend figuring out how they do things I’d prefer to invest in reinventing the wheel 😉 over here.
So there we have it. A few rambling points about my few days tinkering with Astro. Nothing has especially annoyed me so far and I’d definitely like to explore using it in my day job. 8/10, 9/10 with rice.