Astro 7.0 release notes / what's new
Astro 7.0 release notes / what's new
Astro 7.0 focuses on drastic build speed improvements and expanded developer control over the request pipeline. By migrating core compilation and processing tasks to Rust and integrating Vite 8, Astro 7 reduces overall build times by 15-61% in official benchmarks.
Build Performance Gains via Rust Migration
Astro 7 achieves its speed increases by replacing JavaScript-based bottlenecks with native Rust implementations. The most significant gains are seen in sites with heavy .astro component usage and large volumes of Markdown content.
Rust-Powered .astro Compiler
The .astro compiler has been fully rewritten in Rust, replacing a previous Go-based implementation. This new compiler introduces several behavioral changes to ensure correctness:
- Strict HTML Compilation: The compiler no longer silently corrects invalid HTML (e.g., auto-closing tags). Unclosed tags now produce errors.
- JSX-style Whitespace: Whitespace between elements is now collapsed following JSX conventions, meaning newlines between inline elements no longer produce visible spaces unless explicitly defined.
- Native Binaries: The compiler ships as native binaries with a WASM fallback, utilizing
oxcfor parsing andLightning CSSfor CSS scoping.
Sätteri: The New Rust Markdown Pipeline
Astro 7 replaces the default Markdown and MDX pipeline with Sätteri, a Rust-powered processor. This removes the dependency on the unified (remark/rehype) ecosystem for default processing, which was previously a primary bottleneck for large sites.
Sätteri provides built-in support for features that previously required separate plugins, including:
- GFM (tables, footnotes, task lists)
- Smart punctuation and Heading IDs
- Math, Wikilinks, and Frontmatter (YAML/TOML)
- Container directives
For users who require specific remark or rehype plugins, the unified-based pipeline remains available via @astrojs/markdown-remark.
Queued Rendering
Now stable and enabled by default, the queued rendering engine is approximately 2.4x faster than the previous recursive rendering approach. It utilizes a queue-based loop to render components, which reduces memory overhead and increases speed, particularly on pages with dense expressions.
Vite 8 and Rolldown Integration
Astro 7 upgrades to Vite 8, which introduces Rolldown, a Rust-based bundler that replaces both esbuild and Rollup. Rolldown is reported to be 10-30x faster than Rollup in benchmarks. Most Astro projects will see faster builds without requiring configuration changes, as Vite 8 includes a compatibility layer for existing esbuild and rollupOptions.
Advanced Routing and Request Control
Astro 7 introduces a src/fetch.ts entrypoint, allowing developers to take full control of the request pipeline. This adopts the standard fetch handler pattern used by Cloudflare Workers, Deno, and Bun.
Hono Integration
The new routing system is compatible with Hono, enabling developers to integrate Hono middleware into Astro applications. This allows for precise ordering of middleware, such as ensuring authentication runs before Astro Actions or wrapping only page rendering with timing middleware.
Route Caching and CDN Providers
Route caching is now stable, providing a platform-agnostic API (Astro.cache) to control on-demand rendered responses. Developers can set maxAge, swr (stale-while-revalidate), and tags for targeted invalidation.
Experimental CDN Cache Providers
Astro 7 adds experimental providers for Netlify, Vercel, and Cloudflare (private beta). These providers push caching directives to the host's edge network, allowing cache hits to be served directly from the CDN without invoking the server function.
AI-Assisted Development Enhancements
Astro 7 introduces features specifically designed for AI coding agents to interact with the dev server more effectively:
- Background Dev Server: Using
astro dev --background, the server runs as a managed process. Astro can automatically detect AI agents and enable this mode, preventing zombie processes and duplicate instances via a lockfile. - JSON Logging: To support machine-readable feedback and integration with log aggregation services (Kibana, CloudWatch), Astro now supports structured JSON logging via
astro dev --jsonor configuration. - Health Endpoint: A
/_astro/statusendpoint is provided for agents to query server readiness.
Community Insights and Feedback
Community discussion highlights a mix of excitement over the performance gains and concerns regarding the shift toward strictness.
"The switch to strict HTML compilation is just not cool, and actively prevents upgrading sites which need to deal with remote content that is not written in strict HTML."
Other users noted the reduction in dependency counts, with Astro moving from 247 dependencies in v6 to 190 in v7, signaling a trend toward a leaner core. Some users expressed concern over the rapid versioning cycle, while others praised the ease of building SEO-optimized sites compared to legacy systems like WordPress.