Astro.js

Francesco Ciannavei

Astro.js

This site's frontend is Astro, running on Cloudflare Workers with the Cloudflare adapter. Its islands architecture won me over: it generates fast pages and adds interactivity only where it's needed. In the Astro ecosystem I've also had two pull requests merged, one of which I needed to upgrade this site to Astro 7.

How a page reaches you

There's no build per piece of content. When you request a page, Astro renders it by calling the REST API of the Laravel CMS, and the page goes into Astro's standard Cloudflare cache. Later requests are served from the cache.

When I edit content, I clear the cache: from the Cloudflare dashboard, or with a Bash script run from the GitHub workflow. The frontend is deployed to Workers with Wrangler from GitHub Actions, as described on the CI/CD page. At first I also stored pages in R2; now I use only Astro's Cloudflare cache.

The upgrade to Astro 7

This site uses the dynamic-import integration from gratelets, which didn't support the newer Astro versions. I wanted to move to Astro 7, skipping 6, so I added Astro 6 and 7 support in pull request #173, which was merged.

The Italian docs

In pull request #13154 to the Astro docs, I translated the navigation, the UI strings and the "Why Astro" page into Italian. It was merged. The JavaScript side of the frontend is described on its own page.

Rating
5/10

Where i've used it: