Change8

astro@6.3.0

Breaking Changes
📦 astroView on GitHub →
2 breaking6 features1 deprecations🔧 6 symbols

Summary

This release introduces experimental advanced routing, allowing users to fully customize the request handling pipeline via `src/app.ts`. It also enhances security by disabling SVG processing by default and improves remote image optimization by handling redirects.

⚠️ Breaking Changes

  • Astro will no longer rasterize SVG image sources by default in its default image service and endpoint for security reasons. Users relying on this behavior must explicitly enable it by setting `image.dangerouslyProcessSVG: true` in `astro.config.mjs`.
  • If remote image optimization encounters a redirect chain that does not resolve to a domain listed in `image.domains` or a pattern in `image.remotePatterns`, Astro will now fail with an error instead of silently ignoring the redirect.

Migration Steps

  1. To use advanced routing, enable it in `astro.config.mjs` via `experimental: { advancedRouting: true }` and create a `src/app.ts` file.
  2. If you were relying on SVG rasterization in the default image service, add `image: { dangerouslyProcessSVG: true }` to your configuration.
  3. If you use `AstroCookies.consume()`, switch from the static call to the instance method call on the cookies object.
  4. If you encounter failures with remote image optimization due to redirects, ensure the final destination domain is listed in `image.domains` or covered by `image.remotePatterns`.

✨ New Features

  • Introduced `experimental.advancedRouting` option to allow users to take full control of Astro's request handling pipeline by creating a `src/app.ts` file.
  • Advanced routing supports two entrypoints: `astro/fetch` (low-level Web Fetch API) and `astro/hono` (integrating Astro handlers with Hono middleware).
  • Added a new `consume()` instance method to `AstroCookies` which marks cookies as consumed and returns `Set-Cookie` header values.
  • Added retry and error event handling for `astro-island` hydration import failures to mitigate unrecoverable errors from transient network issues.
  • Added support for tracking up to 10 redirects when optimizing remote images, failing with an error if the final URL is not permitted by `image.domains` or `image.remotePatterns`.
  • Added `image.dangerouslyProcessSVG` flag to optionally re-enable processing of SVG image inputs by the default image service.

Affected Symbols

⚡ Deprecations

  • The static method `AstroCookies.consume(cookies)` is deprecated. Use the new instance method `AstroCookies.consume()` instead.