Astro 4.2 boosts accessibility, image optimization features

Latest upgrade of the web framework for content-driven websites also introduces experimental prerendering and routing priority capabilities.

shutterstock offset 2244835187 the Pleiades star cluster aka the Seven Sisters a reflection nebula
Vincent Whiteman Images / Shutterstock

Following fast in the footsteps of the Astro 4.1 release, Astro 4.2 has arrived, bringing improvements to accessibility rules and the ability for remark plugins to customize image optimization.

The Astro 4.2 release also introduces prerendering using the Speculation Rules API and reworked routing priority for injected routes, both experimental features.

Launched January 19, Astro 4.2 marks the first release of the framework of almost all community-built features. Installation instructions for Astro can be found on GitHub.

Improved accessibility rules added to the Astro Dev Tool Bar in Astro 4.0 have been improved to be more accurate, following a meticulous reading of WCAG (Web Content Accessibility Guidelines). Also, remark plugins now can customize how images are optimized in Markdown files. Previously, every image included in these files using the native syntax used Astro’s default settings for image optimizations. With the update, remark plugins now can add properties to image nodes to customize optimization.

In an experimental capability, prefetch now has support for prerendering pages using the currently Chromium-exclusive Speculation Rules AP to prerender pages on the client and run the client-side JavaScript on pages the user is likely to visit next, allowing for a faster browser experience.

Another experimental feature reworks priority for injected routes. With an experimental flag enabled, routes injected using the injectroute() API, as well as redirects, will follow the same priority order that routes from the filesystems do, which should provide more stable, consistent priority ordering rules for all project routes.

A new redirectToDefaultLocale config option provides the ability to disable automatic redirects of the root URL to the default location when prefixDefaultLocale: true is set. This is now possible with the new redirectToDefaultLocale: false option.

Release notes for Astro 4.2 can be found on GitHub. Astro is a web framework for building content-driven websites like blogs, marketing websites, and e-commerce sites. It is is best-known for pioneering a new front-end architecture to reduce JavaScript overhead and complexity compared to other frameworks.

Copyright © 2024 IDG Communications, Inc.