Change8

astro@7.0.0

Breaking Changes
📦 astroView on GitHub →
5 breaking6 features1 deprecations🔧 20 symbols

Summary

This major release upgrades Astro to Vite v8, defaults to the faster Rust compiler, and changes the default Markdown processor to Sätteri. It also introduces background dev server management and makes advanced routing the default behavior.

⚠️ Breaking Changes

  • The default value for `compressHTML` is now 'jsx', which strips whitespace based on JSX rules. This may change rendered output where whitespace between inline elements was previously meaningful. To restore previous behavior, set `compressHTML: true` (HTML-aware compression) or `compressHTML: false` (preserve all whitespace).
  • The `@astrojs/db` package and associated CLI commands (`astro db`, `astro login`, `astro logout`, `astro link`, `astro init`) have been removed. Users must migrate to alternatives like Node.js built-in SQLite, Drizzle ORM, or other database libraries.
  • The Go-based compiler has been replaced by the Rust-based compiler (`@astrojs/compiler-rs`) as the default. The Rust compiler is stricter regarding invalid syntax (e.g., unclosed HTML tags will throw errors) and no longer attempts to correct semantically invalid HTML. The `experimental.rustCompiler` flag must be removed from `astro.config.mjs`.
  • Markdown processing now defaults to Sätteri (`@astrojs/markdown-satteri`) instead of the remark/rehype pipeline. If you rely on remark/rehype plugins, you must install `@astrojs/markdown-remark` and explicitly configure `markdown.processor: unified()` in `astro.config.mjs`.
  • Advanced routing is now enabled by default. The default entrypoint for advanced routing has changed from `src/app.ts` to `src/fetch.ts`. If you used a custom entrypoint, you must move its configuration from `experimental.advancedRouting.fetchFile` to the top-level `fetchFile` configuration option in `astro.config.mjs`.

Migration Steps

  1. If you relied on the old whitespace handling in HTML output, update your configuration by setting `compressHTML: true` or `compressHTML: false`.
  2. If you were using Astro DB, remove `@astrojs/db` dependency and migrate your database logic to alternatives like Node.js built-in SQLite or Drizzle ORM.
  3. Remove `experimental.rustCompiler` flag from `astro.config.mjs` if it was set.
  4. If you need to keep using the remark/rehype pipeline for Markdown, install `@astrojs/markdown-remark` and configure `markdown.processor: unified()` in `astro.config.mjs`.
  5. If you were using advanced routing and had a custom entrypoint defined as `experimental.advancedRouting.fetchFile`, move this configuration to the top-level `fetchFile` option in `astro.config.mjs` and rename your entrypoint to `src/fetch.ts` if possible.
  6. If you were using advanced routing and did not have a custom entrypoint, ensure your entrypoint is now named `src/fetch.ts` or explicitly configure `fetchFile: 'app.ts'` (or another name) if you wish to keep using `src/app.ts`.

✨ New Features

  • Upgraded to Vite v8.
  • Default HTML compression (`compressHTML`) now uses JSX rules, preserving meaningful whitespace within lines but stripping surrounding whitespace.
  • Introduced background dev server management for AI coding agents: `astro dev` automatically runs in the background when an agent is detected. New subcommands: `astro dev --background`, `astro dev stop`, `astro dev status`, and `astro dev logs`.
  • Replaced the Go compiler with the faster and more reliable Rust-based compiler (`@astrojs/compiler-rs`) as the default.
  • Markdown rendering now defaults to the native Sätteri pipeline (`@astrojs/markdown-satteri`).
  • Advanced routing is now enabled by default, providing full control over request flow and first-class support for frameworks like Hono.

Affected Symbols

⚡ Deprecations

  • The deprecated `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` options in `astro.config.mjs` still work but now require `@astrojs/markdown-remark` to be used.