@astrojs/netlify@7.0.0
Breaking Changes📦 astroView on GitHub →
⚠ 3 breaking✨ 5 features🐛 4 fixes⚡ 2 deprecations🔧 8 symbols
Summary
Astro v6 is released, upgrading the core bundler to Vite v7.0 and introducing significant updates to adapter configuration, including stabilizing features and deprecating old options. Key changes involve renaming experimental flags and updating session driver configuration syntax.
⚠️ Breaking Changes
- The adapter feature `experimentalStatiHeaders` has been stabilized and renamed to `staticHeaders`. If using this feature, change `experimentalStaticHeaders: true` to `staticHeaders: true` in adapter configurations.
- The configuration option `experimental.csp` has been removed and replaced with `security.csp`. Users must update their configuration to use the new path.
- Astro v6 upgrades to Vite v7.0, which may introduce breaking changes related to Vite configuration or behavior.
Migration Steps
- Review the [v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#vite-70) due to the upgrade to Vite v7.0.
- If using `experimentalStaticHeaders`, rename it to `staticHeaders` in adapter configurations.
- If using `edgeMiddleware`, replace it with `middlewareMode: 'edge'` in adapter configurations.
- If configuring session drivers, update configuration from string-based specification to the new object shape using imported drivers (e.g., `sessionDrivers.redis({...})`).
- If configuring CSP, update configuration from `experimental.csp` to `security.csp`.
✨ New Features
- Astro v6 upgrades to Vite v7.0 for the development server and production bundler.
- Adds support for the `fit` option to the image service.
- Adds new `middlewareMode` adapter feature.
- Adds new session driver object shape for configuration flexibility.
- Adds a new `clientAddress` option to the `createContext()` function in middleware, allowing explicit control over the client IP address.
🐛 Bug Fixes
- Fixes builds failing with "Entry module cannot be external" error when using the Netlify adapter.
- Fixes server-rendered routes returning 404 errors due to a configuration error in the build output affecting Netlify routing.
- Fixes the image CDN being used in development despite being disabled in certain cases.
- Fixes a case where `build.serverEntry` would not be respected when using the new Adapter API.
Affected Symbols
⚡ Deprecations
- The `edgeMiddleware` option in adapter configurations is deprecated and should be replaced with `middlewareMode: 'edge'`. It will be removed in a future major release.
- Specifying the session driver as a string (e.g., `driver: 'redis'`) is deprecated. Users should transition to specifying the driver as an object using imported functions (e.g., `driver: sessionDrivers.redis({...})`).