Astro 1.0 Release

Astro's 1.0 release marks the beginning of an awesome static site generator.

Astro's Logo

Update: Version 1.0 is old news, check out Astro 2.0, Astro 3.0, and Astro 4.0!

Astro recently announced that it had released version 1.0. Astro is a static site generator that focuses on performance and shipping minimal JavaScript to the browser. It has a novel “island architecture” where you can partially hydrate a page with interactivity. In fact, Astro is the very thing generating this blog. I wrote about my initial experience with Astro in a post earlier this year.

Just a few days before the release, I started upgrading this website from v0.22 to the latest release candidate. The migration guide was very thorough and I was able to avoid anything painful. The biggest change came from the fact that the RSS feed generation was moved from the getStaticPaths function to a separate module. I believe this is a smart move and would allow developers to easily build RSS feeds for things unrelated to pages. For example, this could serve to create topic-specific RSS feeds for a blog.

In my previous post, I mentioned that I had run into some issues using getStaticPaths. After reading the docs, I found out that the getStaticPaths function is run in an isolated scope, and therefore cannot access any variables outside of that scope. The exception to this is any imports that are made in that same file. I use some constants defined in a different file to reuse some strings between the page and the getStaticPaths function.

If you want to learn more about Astro, the best place to start is astro.build. There is also an “Awesome List” for Astro: github.com/one-aalam/awesome-astro. The creator of Astor, Fred K. Schott, appeared on the JS Party podcast to talk about the release of Astro 1.0 and its unique architecture. Listen to episode #238 for that talk.

Related Posts