Astro 5.7 released with experimental fonts API, SVG components, and stable sessions API
Astro has released version 5.7 of its web framework, introducing several new features and enhancements for content-driven websites. This update includes an experimental fonts API that allows developers to utilize fonts from their file system and supported providers such as Google Fonts, Fontsource, and Bunny through a unified API. The feature aims to enhance site performance with sensible defaults and automatic optimizations, including fallback font generation.
The Astro sessions API has reached a stable status, making it ready for production use. This API enables secure data storage tied to specific users as they navigate a site, with data stored server-side, allowing for larger data storage without the limitations or security concerns associated with cookies. This functionality is beneficial for maintaining user data, shopping carts, and form states without requiring client-side JavaScript.
Astro now also supports local SVG files as components, simplifying the process of inlining SVGs into HTML. Previously, this required manual conversion or third-party integrations, but with this update, SVGs can be used as Astro components with ease.
Additionally, the virtual module astro:config is now stable, offering a type-safe way to import a subset of the Astro configuration. Version 5.7 also includes various minor enhancements and bug fixes to improve overall functionality.
