The Astro team was busy before the holidays, releasing Astro 5.1 on Dec. 19. This minor release of the web development framework included a new experimental feature called sessions and improved caching for images, according to core maintainer Matt Kane.
It also incorporates extra tools for working with Astro Actions, which allow you to define and call backend functions such as data fetching, JSON parsing and input validation with type safety.
Sessions provide a way to keep track of per-user data like login status, flash messages or shopping carts, Kane explained.
“Sessions let you securely store temporary data tied to a specific user — with no client-side storage required,” he wrote. “Sessions work by storing data on the server and only sending a session ID as a cookie to the client. You can then get and set the session data in your Astro pages and components, API endpoints, Astro Actions and middleware. The API and data are the same for each of them.”
He includes the code to show how to access the session object. He also adds that when sessions is stable, Astro’s official adapters will automatically configure a default driver, but while it’s experimental, this is something developers will have to do.
This release also includes remote image caching. Previously, image caching between builds was limited to local images.
“Now, Astro will cache remote images as well, reducing the need to re-download and re-transform images on every build,” he wrote. “It uses conditional requests with If-Modified-Since or If-None-Match headers to determine whether the image is still fresh and will use the cached version unless the source image has changed.”
The feature will work with any host that supports conditional requests.
Meet Boa, an Experimental JavaScript Compiler Written in Rust
Boa, an experimental Javascript lexer, parser and compiler written in Rust, released version 0.20 at the end of 2024. Boa makes it easy to embed a JavaScript engine in projects and can be used from WebAssembly, according to a blog post about the release.
“Boa also exists to serve as a Rust implementation of the EcmaScript specification; there will be areas where we can utilize Rust and its fantastic ecosystem to make a fast, concurrent and safe engine,” the About Boa page explained.
Feature highlights of Boa include the Temporal API, which is a new set of built-in objects and functions designed to be a more modern replacement for the Date object, the post notes. It does this by “providing a more feature-rich and flexible API for working with dates and times,” the team notes.
“It is currently a stage 3 proposal, and we are working alongside the TC39 champions to put together a solid Rust implementation,” the blog post stated. “Since Temporal is such an extensive specification, we have done most of the work outside of Boa so that it can be used in other projects.”
Boa also supports nightly releases, and added support for the stage 3 proposal Atomics.pause
, which is used to pause the execution of a thread for a specific amount of time.
The full post outlines a number of optimizations and performance improvements in this release. For those who’d like to play, the Boa site includes a playground.
Flutter and Dart Update in December
Google’s open source cross-platform mobile application framework Flutter released version 3.27, which includes progress with Impeller and improvements to the Cupertino widgets.
The framework supports iOS, Android, the web, Windows, MacOS and Linux, and the update includes improvements across these platforms.
This release introduces new features in DevTools, such as support for validating iOS deep link settings in the Flutter Deep Links tool and improvements to the workflow for working with “offline” data. The release also fixed a developer pain point: if the app crashed while debugging a memory issue, developers would lose memory tool data. That’s been addressed by allowing developers to view the most recent memory tool data in DevTools after an app disconnects.
It also includes a new Flutter Inspector.
“The Flutter Inspector has undergone some major changes to improve usability and enhance your UI debugging journey,” the team wrote. “Enable the new Inspector by toggling the ‘New Inspector’ setting.”
There’s also an experimental feature that supports WebAssembly builds.
The Flutter blog post also emphasized this release was a “testament to the incredible energy and collaboration of the Flutter community,” with more than 1,400 commits form 187 contributors. That’s noteworthy because it comes on the heels of Flutter being forked by developers Matt Carroll and Jesse Ezell, who were frustrated by the frameworks’ responsiveness to fix requests. The plan is for the fork to stay closely aligned with Flutter and to be used as a stopgap until Flutter can update.
Dart, the language that Flutter uses, also upgraded in December. Dart 3.6 introduces a new feature called digit separators. The language now supports underscores (_) as digit separators, which will help make long number literals more readable, noted Dart technical writer Marya Belanger.
It also incorporated new features in the pub ecosystem: pub download counts and pub workspaces.
“A workspace is a tightly related group of packages developed, resolved and released together,” Belanger explained. “The pub workspaces feature ensures that packages in a monorepo share a consistent set of dependencies. This forces you to resolve dependency conflicts between your grouped packages as they arise, rather than facing confusion when you start using the package.”
The post New Astro Releases Incorporates Sessions, New Astro Actions Tools appeared first on The New Stack.