Astro 4.13

By
Erika

Astro 4.13 is out now! This release includes stabilized experimental features, logging improvements, and more.

This release includes the following highlights:

To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager:

# Recommended:
npx @astrojs/upgrade
# Manual:
npm install astro@latest
pnpm upgrade astro --latest
yarn upgrade astro --latest

Stable: Request Rewriting

In Astro 4.8, we added experimental support for request rewriting, a powerful feature that can be used to render another page without changing the URL of the browser in Astro pages and endpoints. In Astro 4.13, we’re excited to announce that request rewriting is now stable!

If you were already using request rewriting prior to Astro 4.13, you can now remove the experimental.rewriting option from your Astro config. The feature is now enabled by default.

import { defineConfig } from 'astro';
export default defineConfig({
experimental: {
rewriting: true
}
})

For more information on this feature, check out the Astro rewrites documentation.

Stable: Content Collections JSON Schemas

In Astro 4.5, we introduced the (experimental) ability to automatically generate JSON schemas for data content collections. In Astro 4.13, this feature is now stable!

If you were using content collection JSON schemas in Astro 4.5, you can now remove the experimental.contentCollectionJsonSchema option from your Astro config. The feature is now enabled by default.

import { defineConfig } from 'astro';
export default defineConfig({
experimental: {
contentCollectionJsonSchema: true
}
})

When you define a data content collection in your Astro project, Astro will now automatically generate a JSON schema for the collection. This schema can then be used in your editor to provide autocompletion, validation and more for your data.

For more information on this feature, check out the Astro content collections schema documentation.

Logging Improvements

As part of our endless crusade against slow builds, Astro 4.13 includes a small improvement to the logging output during the build process.

Pages that take a long time will now have their time logged in red, making it easier to spot bottlenecks in your build process.

A screenshot of the terminal showing the output of a build with two pages. One of the page has the time it took to build (603ms) highlighted in red.

May there be fewer of these in your future!

Bug Fixes and Special Thanks

As we do, Astro 4.13 includes more bug fixes and smaller improvements that couldn’t make it into this post! Check out the full release notes to learn more.

Thanks to

and everyone else who contributed to this release.