Releases: withastro/astro
[email protected]
Major Changes
-
#14956
0ff51dfThanks @matthewp! - Astro v6.0 upgrades to Zod v4 for schema validation - (v6 upgrade guidance) -
#14759
d7889f7Thanks @florian-lefebvre! - Updates how schema types are inferred for content loaders with schemas (Loader API) - (v6 upgrade guidance) -
#14306
141c4a2Thanks @ematipico! - Removes support for routes with percent-encoded percent signs (e.g.%25) - (v6 upgrade guidance) -
#14759
d7889f7Thanks @florian-lefebvre! - Removes the option to define dynamic schemas in content loaders as functions and adds a new equivalentcreateSchema()property (Loader API) - (v6 upgrade guidance) -
#14306
141c4a2Thanks @ematipico! - RemovesRouteData.generatefrom the Integration API - (v6 upgrade guidance) -
#14989
73e8232Thanks @florian-lefebvre! - Deprecates exposedastro:transitionsinternals - (v6 upgrade guidance) -
#14758
010f773Thanks @florian-lefebvre! - Removes thesetManifestDatamethod fromAppandNodeApp(Adapter API) - (v6 upgrade guidance) -
#14826
170f64eThanks @florian-lefebvre! - Removes theexperimental.failOnPrerenderConflictflag and replaces it with a new configuration optionprerenderConflictBehavior- (v6 upgrade guidance) -
#14923
95a1969Thanks @florian-lefebvre! - Deprecatesastro:schemaandzfromastro:contentin favor ofastro/zod- (v6 upgrade guidance) -
#14844
8d43b1dThanks @trueberryless! - Removes exposedastro:actionsinternals - (v6 upgrade guidance) -
#14306
141c4a2Thanks @ematipico! - Changes the shape ofSSRManifestproperties and adds several new required properties in the Adapter API - (v6 upgrade guidance) -
#14306
141c4a2Thanks @ematipico! - Changes integration hooks and HMR access patterns in the Integration API - (v6 upgrade guidance) -
#14306
141c4a2Thanks @ematipico! - Removes the unusedastro:ssr-manifestvirtual module - (v6 upgrade guidance)
Minor Changes
-
#14306
141c4a2Thanks @ematipico! - Adds new optional properties tosetAdapter()for adapter entrypoint handling in the Adapter APIChanges:
- New optional properties:
devEntrypoint?: string | URL- specifies custom dev server entrypointentryType?: 'self' | 'legacy-dynamic'- determines if the adapter provides its own entrypoint ('self') or if Astro constructs one ('legacy-dynamic', default)
Migration: Adapter authors can optionally add these properties to support custom dev entrypoints. If not specified, adapters will use the legacy behavior.
- New optional properties:
-
#14826
170f64eThanks @florian-lefebvre! - Adds an optionprerenderConflictBehaviorto configure the behavior of conflicting prerendered routesBy default, Astro warns you during the build about any conflicts between multiple dynamic routes that can result in the same output path. For example
/blog/[slug]and/blog/[...all]both could try to prerender the/blog/post-1path. In such cases, Astro renders only the highest priority route for the conflicting path. This allows your site to build successfully, although you may discover that some pages are rendered by unexpected routes.With the new
prerenderConflictBehaviorconfiguration option, you can now configure this further:prerenderConflictBehavior: 'error'fails the buildprerenderConflictBehavior: 'warn'(default) logs a warning and the highest-priority route winsprerenderConflictBehavior: 'ignore'silently picks the highest-priority route when conflicts occur
import { defineConfig } from 'astro/config'; export default defineConfig({ + prerenderConflictBehavior: 'error', }); -
#14946
95c40f7Thanks @ematipico! - Removes theexperimental.cspflag and replaces it with a new configuration optionsecurity.csp- (v6 upgrade guidance)
Patch Changes
- #14982
6849e38Thanks @Princesseuh! - Fixes images outside the project directory not working when using astro:assets in development mode
@astrojs/[email protected]
Minor Changes
- #14946
95c40f7Thanks @ematipico! - Removes theexperimental.cspflag and replaces it with a new configuration optionsecurity.csp- (v6 upgrade guidance)
@astrojs/[email protected]
@astrojs/[email protected]
@astrojs/[email protected]
Minor Changes
- #14946
95c40f7Thanks @ematipico! - Removes theexperimental.cspflag and replaces it with a new configuration optionsecurity.csp- (v6 upgrade guidance)
@astrojs/[email protected]
Minor Changes
- #14946
95c40f7Thanks @ematipico! - Removes theexperimental.cspflag and replaces it with a new configuration optionsecurity.csp- (v6 upgrade guidance)
Patch Changes
- Updated dependencies []:
- @astrojs/[email protected]
@astrojs/[email protected]
@astrojs/[email protected]
Major Changes
-
#14306
141c4a2Thanks @ematipico! - Changes the API for creating a customentrypoint, replacing thecreateExports()function with a direct export pattern.What should I do?
If you're using a custom
entryPointin your Cloudflare adapter config, update your existing worker file that usescreateExports()to reflect the new, simplified pattern:my-entry.ts
import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; import { handle } from '@astrojs/cloudflare/handler'; import { DurableObject } from 'cloudflare:workers'; class MyDurableObject extends DurableObject<Env> { constructor(ctx: DurableObjectState, env: Env) { super(ctx, env); } } export function createExports(manifest: SSRManifest) { const app = new App(manifest); return { default: { async fetch(request, env, ctx) { await env.MY_QUEUE.send('log'); return handle(manifest, app, request, env, ctx); }, async queue(batch, _env) { let messages = JSON.stringify(batch.messages); console.log(`consumed from our queue: ${messages}`); }, } satisfies ExportedHandler<Env>, MyDurableObject: MyDurableObject, }; }
To create the same custom
entrypointusing the updated API, export the following function instead:my-entry.ts
import { handle } from '@astrojs/cloudflare/utils/handler'; export default { async fetch(request, env, ctx) { await env.MY_QUEUE.send("log"); return handle(manifest, app, request, env, ctx); }, async queue(batch, _env) { let messages = JSON.stringify(batch.messages); console.log(`consumed from our queue: ${messages}`); } } satisfies ExportedHandler<Env>,
The manifest is now created internally by the adapter.
-
#14306
141c4a2Thanks @ematipico! - Development server now runs in workerdastro devnow runs your Cloudflare application using Cloudflare's workerd runtime instead of Node.js. This means your development environment is now a near-exact replica of your production environment—the same JavaScript engine, the same APIs, the same behavior. You'll catch issues during development that would have only appeared in production, and features like Durable Objects, Workers Analytics Engine, and R2 bindings work exactly as they do on Cloudflare's platform.To accommodate this major change to your development environment, this update includes breaking changes to
Astro.locals.runtime, removing some of its properties.What should I do?
Update occurrences of
Astro.locals.runtimeas shown below:Astro.locals.runtimeno longer contains theenvobject. Instead, import it directly:import { env } from 'cloudflare:workers';
Astro.locals.runtimeno longer contains thecfobject. Instead, access it directly from the request:Astro.request.cf;
Astro.locals.runtimeno longer contains thecachesobject. Instead, use the globalcachesobject directly:caches.default.put(request, response);
Astro.locals.runtimeobject is replaced withAstro.locals.cfContextwhich contains the CloudflareExecutionContext:const cfContext = Astro.locals.cfContext;
Minor Changes
-
#14306
141c4a2Thanks @ematipico! - Adds support forastro previewcommandDevelopers can now use
astro previewto test their Cloudflare Workers application locally before deploying. The preview runs using Cloudflare's workerd runtime, giving you a staging environment that matches production exactly—including support for KV namespaces, environment variables, and other Cloudflare-specific features.
Patch Changes
- Updated dependencies []:
- @astrojs/[email protected]
[email protected]
Patch Changes
-
#14985
c016f10Thanks @florian-lefebvre! - Fixes a case where JSDoc annotations wouldn't show for fonts related APIs in the Astro config -
#14973
ed7cc2fThanks @amankumarpandeyin! - Fixes performance regression and OOM errors when building medium-sized blogs with many content entries. Replaced O(n²) object spread pattern with direct mutation ingenerateLookupMap. -
#14958
70eb542Thanks @ascorbic! - Gives a helpful error message if a user setsoutput: "hybrid"in their Astro config.The option was removed in Astro 5, but lots of content online still references it, and LLMs often suggest it. It's not always clear that the replacement is
output: "static", rather thanoutput: "server". This change adds a helpful error message to guide humans and robots. -
#14901
ef53716Thanks @Darknab! - Updates theglob()loader to log a warning when duplicated IDs are detected -
Updated dependencies [
d8305f8]:- @astrojs/[email protected]
[email protected]
Patch Changes
- #14988
a3a20d8Thanks @Princesseuh! - Retries failed deploy