π Patch Changes
- Updated dependencies [
b7a1bd9]:- @astrojs/internal-helpers@0.13.0
- @astrojs/underscore-redirects@1.0.4
b7a1bd9]:
882dd98 Thanks @florian-lefebvre! - Refactors internal bundling and code transforms to use Viteβs Oxc-based transformWithOxc and Rolldown instead of esbuild. These packages no longer depend on esbuild directly.6fb83da Thanks @matthewp! - Fixes Netlify Image CDN patterns generated from image.remotePatterns pathnames ending in /** so they only match paths below that directory, consistent with Astroβs own pattern matching. Previously, a pattern like /public/** also matched sibling paths sharing the prefix, such as /public-assets/.7a698ca Thanks @astro-factory! - Fixes skew protection to include the build assets directory (/_astro/ by default) in skew-protection.json patterns, preventing lazy-hydrated islands from loading duplicate framework instances after a redeployf8e9458]:
05763a0]:
8c193f6]:
0891ac9]:
90c98ae Thanks @adamchal! - When session: false is set in astro.config, the adapter no longer auto-wires the Netlify Blobs session driver. Combined with the matching astro change, this lets the session runtime tree-shake out of the function bundle.c895b12]:
#17368 ee74c28 Thanks @matthewp! - Fixes the generated Netlify Image CDN remote_images patterns so that regex metacharacters (such as .) in image.remotePatterns (hostname, pathname) and image.domains are matched literally instead of behaving like wildcards. This makes the generated patterns consistent with how Astro matches these values elsewhere.
Updated dependencies []:
eb6f97e]:
#17245 f56d9e7 Thanks @astrobot-houston! - Adds edgeFunctions to the devFeatures adapter option, allowing users to disable Netlify Edge Function emulation during astro dev
Some npm packages that access the filesystem at initialization (e.g. node-html-parser) fail inside the edge function sandbox with βReading or writing files with Edge Functions is not supported yet.β You can now disable edge function emulation to avoid this error:
import netlify from '@astrojs/netlify';import { defineConfig } from 'astro/config';
export default defineConfig({ adapter: netlify({ devFeatures: { edgeFunctions: false, }, }),});Edge functions will still work in production builds and via netlify dev.
#17249 02b73b0 Thanks @ematipico! - Fixes an issue where the peerDependencies field used incorrect dependencies.
Updated dependencies []:
#16335 9a53f77 Thanks @ascorbic! - Adds a CDN cache provider for Astro route caching on Netlify
Import cacheNetlify() from @astrojs/netlify/cache and set it as your cache provider:
import { defineConfig } from 'astro/config';import netlify from '@astrojs/netlify';import { cacheNetlify } from '@astrojs/netlify/cache';
export default defineConfig({ adapter: netlify(), cache: { provider: cacheNetlify(), },});Use Astro.cache.set() in your pages and API routes to cache responses on Netlifyβs edge network. The provider uses Netlifyβs durable cache so cached responses are shared across all edge nodes, reducing function invocations.
---Astro.cache.set({ maxAge: 300, tags: ['products'] });const data = await fetchProducts();---
<ProductList items={data} />You can also set cache rules for groups of routes in your config:
cache: { provider: cacheNetlify() },routeRules: { '/products/[...slug]': { maxAge: 3600, tags: ['products'] }, '/api/[...path]': { maxAge: 60, swr: 600 },},Purge cached responses by tag or path from any API route or server endpoint:
export async function POST({ request, cache }) { await cache.invalidate({ tags: ['products'] }); return new Response('Purged');}
// Path-based invalidationawait cache.invalidate({ path: '/products/123' });Both tag-based and path-based invalidation are supported.
#16693 9e6edc2 Thanks @ArmandPhilippot! - Fixes a link in the documentation specifying where to open an issue for the adapter.
Updated dependencies []: