Change8

astro@6.0.0-alpha.1

Breaking Changes
📦 astro
11 breaking3 features2 deprecations🔧 17 symbols

Summary

Astro v6.0 introduces major breaking changes including an upgrade to Zod v4, removal of several experimental flags in favor of stable configuration options, and significant updates to the Adapter and Integration APIs.

⚠️ Breaking Changes

  • Astro v6.0 upgrades to Zod v4 for schema validation. Update schemas to be compatible with Zod v4.
  • Removed support for routes with percent-encoded percent signs (e.g. %25).
  • Removed the option to define dynamic schemas in content loaders as functions. Use the new 'createSchema()' property instead.
  • Removed 'RouteData.generate' from the Integration API.
  • Removed 'setManifestData' method from 'App' and 'NodeApp' in the Adapter API.
  • Removed 'experimental.failOnPrerenderConflict' flag. Use the new 'prerenderConflictBehavior' configuration option.
  • Removed exposed 'astro:actions' internals.
  • Changed the shape of 'SSRManifest' properties and added new required properties in the Adapter API.
  • Changed integration hooks and HMR access patterns in the Integration API.
  • Removed the unused 'astro:ssr-manifest' virtual module.
  • Removed 'experimental.csp' flag. Use the new 'security.csp' configuration option.

Migration Steps

  1. Upgrade Zod to v4 and update schema validation logic.
  2. Replace function-based dynamic schemas in content loaders with the 'createSchema()' property.
  3. Update Adapter implementations to include new required 'SSRManifest' properties.
  4. Remove calls to 'App.setManifestData' and 'NodeApp.setManifestData' in custom adapters.
  5. Replace 'experimental.failOnPrerenderConflict' with 'prerenderConflictBehavior' in astro.config.
  6. Replace 'experimental.csp' with 'security.csp' in astro.config.
  7. Update imports from 'astro:content' (for 'z' and 'astro:schema') to 'astro/zod'.

✨ New Features

  • Added 'prerenderConflictBehavior' configuration option to handle conflicting prerendered routes ('error', 'warn', or 'ignore').
  • Added 'security.csp' configuration option to replace the experimental CSP flag.
  • Added optional properties 'devEntrypoint' and 'entryType' to 'setAdapter()' for better adapter entrypoint handling.

🔧 Affected Symbols

ZodLoader APIRouteData.generatecreateSchemaastro:transitionsApp.setManifestDataNodeApp.setManifestDataexperimental.failOnPrerenderConflictprerenderConflictBehaviorastro:schemaastro:contentastro/zodastro:actionsSSRManifestastro:ssr-manifestsetAdaptersecurity.csp

⚡ Deprecations

  • Deprecated exposed 'astro:transitions' internals.
  • Deprecated 'astro:schema' and 'z' from 'astro:content' in favor of 'astro/zod'.