My First Steps as an Astronaut
I’m officially an astronaut! Well, not an actual astronaut who journeys into space. Rather, a happy user of the web framework Astro.
Many in the Astro community affectionately refer to themselves as “Astronauts” – playing on the framework’s name. And now I’m one of them! After four years of managing my web blog with Gatsby, it was time to move on and switch to a different framework.
Photo: © cottonbro / pexels.com
I’ll explain why I left Gatsby behind and what I like about Astro.
Why I dropped Gatsby
I must admit I’ve been lazy! Back in January 2022 I set up my web blog with Gatsby 4. After I was happy with the configuration and everything worked well enough, I never really touched the setup again. I also never updated the project’s dependencies.
The setup simply worked. So, I preferred to spend my time experimenting with new web features and writing blog posts.
Now, four years later, I had to admit to myself that my setup had become completely outdated! The Gatsby CLI felt clunky and slow, and building my web blog for production took up to 15 minutes. Unacceptable!
My first thought was to update to the latest Gatsby version and optimize my setup. But then I came across GitHub issues like “Is GatsbyJS Officially Dead?” and “Is Gatsby discontinued?”. Apparently, the framework is no longer actively developed and has become hopelessly outdated.
“Well, time to move on!”, was my conclusion. After some research on various frameworks for static site generation, I settled on Astro as an ideal fit for me.
What I like about Astro
I’ve now finished setting up my web blog with Astro, maintaining the same basic features:
- A bilingual website in English and German.
- A homepage with a short introduction and a list of recent blog posts.
- An about page with more information about me and the website.
- A blog archive with links to all my published posts.
- Blog posts created from Markdown files.
- Automatic creation of RSS files.
Switching to Astro went pretty smoothly, thanks to its familiar component structure and built-in support for Markdown. Here’s what I especially like about Astro:
- The framework offers very detailed documentation, including an interactive tutorial for building a blog. Perfect for my use case! They even have several migration guides, e.g., Migrating from Gatsby, that explain key differences.
- Astro components (
.astrofiles) make it easy to implement basic building blocks for different pages. If you’re familiar with JSX, you’ll feel right at home! 🤩 - Per default, Astro renders your web pages to fast, static HTML. If you need interactive JavaScript logic, you define a client island: an interactive UI component that is hydrated separately from the rest of the page. I used this concept to add a filter component to my blog archive page. Worked like a charm!
- There’s a vibrant community and a ton of plugins.
The Future Looks Bright
I’m very happy with my choice of framework. Astro is simply delightful to work with. And I have a feeling that I’ve only scratched the surface of what’s possible.
Hopefully, Astro stays open source and alive for a long time. I don’t want to switch framework again in a few years. 😝
Posted on