π Patch Changes
- #10215
a013182d322a3969e39d647aad75ec10f8bd1ed7Thanks @matthewp! - Fixes edge middleware calling nested routes
a013182d322a3969e39d647aad75ec10f8bd1ed7 Thanks @matthewp! - Fixes edge middleware calling nested routes3cc20109277813ccb9578ca87a8b0d680a73c35c Thanks @matthewp! - Fix loading client-scripts in dev with ISR2ffc5721bc22631c44d90ac43ec27fdb0b5b2d1b Thanks @florian-lefebvre! - Prevents infinite redirects when Astro trailingSlash configuration is set to "always" and βvercel.jsonβ trailingSlash configuration is set to true#9987 0699f34d5c4481c027c4d29d73944f79f97008df Thanks @lilnasy! - Implements verification for edge middleware. This is a security measure to ensure that your serverless functions are only ever called by your edge middleware and not a third party.
When edgeMiddleware is enabled, the serverless function will now respond with 403 Forbidden for requests that are not verified to have come from the generated edge middleware. No user action is necessary.
#9714 e2fe51c828dc7ea8204788e59e3953fe36c97836 Thanks @lilnasy! - Introduces a new config option, isr, that allows you to deploy your project as an ISR function. ISR (Incremental Static Regeneration) caches your on-demand rendered pages in the same way as prerendered pages after first request.
To enable this feature, set isr to true in your Vercel adapter configuration in astro.config.mjs:
export default defineConfig({ output: 'server', adapter: vercel({ isr: true }),});By default, ISR responses are cached for the duration of your deployment. You can further control caching by setting an expiration time or prevent caching entirely for certain routes.
You can change the length of time to cache routes this by configuring an expiration value in seconds:
export default defineConfig({ output: 'server', adapter: vercel({ isr: { // caches all pages on first request and saves for 1 day expiration: 60 * 60 * 24, }, }),});To implement Vercelβs Draft mode, or On-Demand Incremental Static Regeneration (ISR), you can create a bypass token and provide it to the isr config along with the paths to exclude from caching:
export default defineConfig({ output: 'server', adapter: vercel({ isr: { // A secret random string that you create. bypassToken: '005556d774a8', // Paths that will always be served fresh. exclude: ['/api/invalidate'], }, }),});bc1742df9423ba66e33dcbf65fbebf67a236175d Thanks @matthewp! - Fix regression with bundling of @libsql/client041fdd5c89920f7ccf944b095f29e451f78b0e28 Thanks @ematipico! - Adds experimental support for internationalization domains#9885 49e0c24d7f90d00e986533fcf546665967540ce7 Thanks @matthewp! - Better ignores for Vercel file-tracer
The Vercel adapter has a file-tracer it uses to detect which files should be moved over to the dist/ folder. When itβs done, it prints warnings for things that it detected that maybe should be moved.
This change expands how we do ignores so that:
.pnpm.@libsql/client is ignored, a package we know is not bundled.3435b7f1e1ca38fdee8f3b89e2d2667f125d01b5 Thanks @lilnasy! - Fixes an issue where the serverless function ignored cookies added using Astro.cookies.05adaaa2d217a3ecb34244d9b40603f35cef4a37 Thanks @lilnasy! - Fixes an issue where edge middleware did not work.d6edc7540864cf5d294d7b881eb886a3804f6d05 Thanks @ematipico! - Breaking: Minimum required Astro version is now 4.2.0.
Reorganizes internals to be more maintainable.
d7f1903cded3e864b392d1dd7502672d37936f11 Thanks @lilnasy! - Fixes an issue where the serverless function could not respond with a prerendered 404 page.#9591 22a5405b4a4b7948458ad170b0a7bde6954058c1 Thanks @lilnasy! - Fixes an issue where 404.astro was not used in static mode.
#9598 bd8fa7acd23ba6e7afa2c435807bd5fd6b24f505 Thanks @lilnasy! - Marks the speedInsights configuration as deprecated. Vercel has migrated features of the Speed Insights API into a framework-agnostic library with @vercel/speed-insights. See Vercel Speed Insights Quickstart for instructions on how to use the library instead.
7b586a6e23e25653814db9adea9674ec3a9bd535 Thanks @lilnasy! - Fixes an issue where a build could not complete on Node 21.1baf0b0d3cbd0564954c2366a7278794fad6726e Thanks @sarah11918! - Updates README#9199 49aa215a0 Thanks @lilnasy! - The internals of the integration have been updated to support Astro 4.0. Make sure to upgrade your Astro version as Astro 3.0 is no longer supported.
#9184 a145ac07e Thanks @bluwy! - Removes deprecated analytics option. Use the webAnalytics option instead.
#9263 3cbd8ea75 Thanks @bluwy! - Removes the deprecated @astrojs/vercel/edge export. You should use @astrojs/vercel/serverless instead with the edgeMiddleware option.