Astro

It’s incredibly easy to find poorly made single-page applications (SPA) today. These applications break user expectations by not acting like standard webpages. The page title doesn’t update on navigation, the back/forward buttons don’t work, the scroll position is not saved, and refreshing the page causes surprising behavior.

A particularly bad site might be poorly optimized and take a while to load on a slow connection or perform poorly when rendered client-side.

SPAs tend to be written with libraries like React and Vue. They are great for developer productivity, and I find them a joy to use. What I don’t like is the amount of work that goes into making them feel like first-class citizens of the web. You have the handle the above, and so much more! What about SEO or users that disable JavaScript?

Many sites do need the interactivity that these libraries provide, but there are plenty that don’t. Content-heavy sites, like this one, are mostly read and have little client-side interaction that would require JavaScript. You could write the site with plain HTML/CSS, but you lose the excellent tooling that React provides. Alternatives include server-side rendering with a host like Vercel or static site generation with heavy software like Gatsby.

I was determined not to compromise. I didn’t want to buy into Vercel and certainly didn’t want a super complicated build process with a bunch of buy-in.

Enter Astro.

It’s a perfect fit. By default, it outputs sites with zero JavaScript. Using familiar React-ish syntax, you can pass props or call JS at compile time in your components. You get the development speed up while also providing sites that perform great and respect your users.

The feature list is jam-packed, and everything seems to work. The documentation is thorough, and it is a joy to use.

I migrated this blog over to Astro in a couple of days, and I was able to add a bunch of new functionality with little effort, such as generated Open Graph images and an RSS feed that updates automatically.

The site now has zero client-side JavaScript and does not need a server beyond static file hosting. The code is pretty similar to what it was before.

I would highly recommend checking out Astro. I’m only scratching the surface of what you can do with it.

Posts from blogs I like

Pikmin 3: No Fruit, No Problem - 0 Fruit in 2h24m

Want to watch this in your video player of choice? Take this: https://cdn.xeiaso.net/file/christine-static/video/2024/pikmin-3-0-fruit/2/index.m3u8 Recently I saw @TheBacklogs do a Pikmin 3 challenge run where they collected 0 fruit to beat the game. I thought I could do better, so I beat it in 2 hours 24 minutes. Full run without commentary: https://youtu.be/nHFIn74-mLk @TheBacklogs' run: https://youtu.be/eSEUdgVX7o4 My website: https://xeiaso.net My Mastodon: …

via Xe Iaso's blog May 04, 2024

Copyleft licenses are not “restrictive”

One may observe an axis, or a “spectrum”, along which free and open source software licenses can be organized, where one end is “permissive” and the other end is “copyleft”. It is important to acknowledge, however, that though copyleft can be found at the opposite end of an axis with respect to permissive, it is not synonymous with the linguistic antonym of permissive – that is, copyleft licenses are not “restrictive” by comparison with permissive licenses. Aside: Free software is not synonymous with copyle…

via Drew DeVault's blog April 19, 2024

Airfoil

The dream of soaring in the sky like a bird has captivated the human mind for ages. Although many failed, some eventually succeeded in achieving that goal. These days we take air transportation for granted, but the physics of flight can still be puzzling. In this article we’ll investigate what makes airplanes fly by looking at the forces generated by the flow of air around the aircraft’s wings. More specifically, we’ll focus on the cross section of those wings to reveal the shape of an airfoil – you can see…

via Bartosz Ciechanowski February 27, 2024