Releases

Astro 6.0 Arrives with Experimental Rust Compiler, Fonts API, and More

What started as an AI experiment in Astro's codebase quickly prompted the team to ask: "Why isn't this the default?" Astro 6.0 ships with an opt-in Rust compiler to answer that.

Jamie Taylor2 min read
Published
Listen to this article0:00 min
Share this article:
Astro 6.0 Arrives with Experimental Rust Compiler, Fonts API, and More
AI-generated illustration

What started as an AI experiment while updating Astro's Go compiler quickly moved from "can this work?" to "why isn't this the default?" That origin story, told in Astro's own release notes, captures the headline feature of Astro 6.0: an experimental Rust-based compiler for `.astro` files, packaged as `@astrojs/compiler-rs` and designed to eventually replace the Go compiler that has powered the framework since its early days.

The Rust compiler is opt-in and disabled by default. Enabling it requires installing the companion package with `npm install @astrojs/compiler-rs`, then adding `experimental: { rustCompiler: true }` to your `astro.config.mjs` via `defineConfig`. The Astro team describes the compiler as faster, producing stronger diagnostics, and "in some cases even more reliable than our current Go compiler," with a stated goal of making it the default in a future major release. The team also confirmed it is "actively exploring more Rust-powered tooling across Astro, with more to share soon."

Before enabling it, there are two documented limitations worth understanding. Unlike the Go compiler, the Rust compiler will not auto-correct invalid HTML structure; a pattern like `<p><div>Bad nesting</div></p>` is left exactly as written, which means projects that relied on the Go compiler's silent corrections may see different output or build errors. Additionally, the Rust compiler currently does not emit the metadata required for dev toolbar audits to function correctly.

Astro 6.0 also ships an experimental queued rendering strategy, which replaces the framework's current recursive component rendering with a two-pass approach: the first pass traverses the component tree and emits an ordered queue, and the second pass renders it. Early benchmarks show up to 2x faster rendering, with the team planning to make queued rendering the default strategy in Astro v7. Experimental route caching ships alongside it.

Beyond the experimental features, the release moves two previously experimental capabilities to stable: the Content Security Policy API, which now auto-hashes scripts and styles and generates headers from a single config flag, and Live Content Collections. The new built-in Fonts API lets developers configure typefaces from local files or providers like Google, with Astro handling downloading, caching, and preloading links automatically.

Remote image handling also improves in 6.0. Astro now caches remote images between builds using conditional HTTP requests with `If-Modified-Since` or `If-None-Match` headers to check freshness, skipping the download and transformation step unless the source image has actually changed. The feature works with any host that supports conditional requests.

Under the hood, the dev server and build pipeline were rebuilt on Vite's Environment API, meaning `astro dev` now runs your exact production runtime locally rather than a simulation of it. The redesigned `astro dev` experience supports custom runtimes as well.

To upgrade an existing project, the recommended path is `npx @astrojs/upgrade`, which hands off to an interactive CLI. Manual upgraders can run `npm install astro@latest`; new projects use `npm create astro@latest`. Feedback on the Rust compiler can be submitted through the RFC for the new compiler, linked in Astro's reference documentation.

Know something we missed? Have a correction or additional information?

Submit a Tip
Your Topic
Today's stories
Updated daily by AI

Name any topic. Get daily articles.

You pick the subject, AI does the rest.

Start Now - Free

Ready in 2 minutes

Discussion

More Rust Programming News