Releases: withastro/astro
[email protected]
Major Changes
-
#16610
c63e7e4Thanks @matthewp! - Adds background dev server management for AI coding agents.When an AI coding agent is detected,
astro devnow automatically starts the dev server as a detached background process. This prevents the dev server from blocking the agent's terminal and allows it to continue working while the server runs.A lock file (
.astro/dev.json) is written when the dev server starts, recording the server's URL, port, and PID. This prevents duplicate servers from being started for the same project.New flag and subcommands
astro dev --background— Start the dev server as a background process (this is what runs automatically when an agent is detected).astro dev stop— Stop a running background dev server.astro dev status— Check if a dev server is running and display its URL, PID, and uptime.astro dev logs— View logs from a background dev server. Use--follow(-f) to stream new output as it's written.
These allow you to start and manage dev servers programmatically and were designed with AI coding agents in mind.
What should I do?
No action is required. If you are not using an AI coding agent,
astro devbehaves exactly as before. If you are using an agent, background mode is enabled automatically — the agent will receive the server URL and PID, and can useastro dev stopto shut it down.To opt out of automatic background mode when an agent is detected, set the environment variable
ASTRO_DEV_BACKGROUND=0before runningastro dev. -
#16725
10229f7Thanks @ArmandPhilippot! - Removes deprecated APIs exported fromastro:transitions.In Astro 6.x, some helpers available in
astro:transitionsandastro:transitions/clientwere deprecated.In Astro 7.0, the following APIs can no longer be used in your project:
TRANSITION_BEFORE_PREPARATIONTRANSITION_AFTER_PREPARATIONTRANSITION_BEFORE_SWAPTRANSITION_AFTER_SWAPTRANSITION_PAGE_LOADisTransitionBeforePreparationEvent()isTransitionBeforeSwapEvent()createAnimationScope()
What should I do?
Remove any occurrence of
createAnimationScope():-import { createAnimationScope } from 'astro:transitions';Replace any occurrence of the other APIs using the lifecycle event names directly:
-import { - TRANSITION_AFTER_SWAP, - isTransitionBeforePreparationEvent, -} from 'astro:transitions/client'; -console.log(isTransitionBeforePreparationEvent(event)); +console.log(event.type === 'astro:before-preparation'); -console.log(TRANSITION_AFTER_SWAP); +console.log('astro:after-swap');
Learn more about all utilities available in the View Transitions Router API Reference.
Patch Changes
-
#16980
1f07343Thanks @matthewp! - Removesstate.provide(),state.resolve(),state.finalizeAll(), andApp.Providersfrom the public advanced routing API. These context provider extension points are now internal-only. If you were using them in an integration, uselocalsto share per-request state instead. -
#16982
1e000e2Thanks @matthewp! - Improves the warning when accessingAstro.sessionwithout session storage configured. Thesessionproperty is now always defined on the context object, and accessing it without configuration logs a helpful message instead of silently returningundefined. -
#16990
ebeb830Thanks @ocavue! - FixesAstro.request.urlnot reflecting validatedX-Forwarded-Proto/X-Forwarded-Hostheaders whensecurity.allowedDomainsis configured. Previously, onlyAstro.urlwas updated with the forwarded origin whileAstro.request.urlretained the socket-derived URL, causing the two to diverge behind TLS-terminating proxies.
@astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
-
#16969
4a31f90Thanks @Princesseuh! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Settingmarkdown.syntaxHighlightto'prism'now highlights your code blocks with Prism.// astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, });
-
Updated dependencies [
4a31f90]:- @astrojs/[email protected]
@astrojs/[email protected]
Minor Changes
-
#16969
4a31f90Thanks @Princesseuh! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Settingmarkdown.syntaxHighlightto'prism'now highlights your code blocks with Prism.// astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, });
@astrojs/[email protected]
Patch Changes
-
#16990
ebeb830Thanks @ocavue! - Fixes a build crash when usingexperimental.advancedRoutingwith a customfetchFilethat statically importscffrom@astrojs/cloudflare/fetch. The circular dependency between@astrojs/cloudflare/fetchandastro/app/entrypointcausedcreateApporcreateGetEnvto beundefinedat module evaluation time. Initialization is now deferred to the firstcf()call, breaking the cycle. -
#16671
fd926fdThanks @alexanderniebuhr! - Removes deprecations warnings added in Astro v6 for Cloudflare specific Astro.locals properties. -
Updated dependencies [
1f07343,1e000e2,c63e7e4,ebeb830,10229f7]:- [email protected]
- @astrojs/[email protected]
[email protected]
Patch Changes
-
#16926
1b39ae8Thanks @narendraio! - PreventsApp.match()from throwing on request paths that contain an invalid percent-sequence. -
#16924
2c0bc94Thanks @astrobot-houston! - Fixes an issue where editing a client-side component (e.g. withclient:idle,client:load, etc.) caused an unnecessary full program reload of the backend during development. -
#16958
2c1d50fThanks @fkatsuhiro! - Fixes a bug where static file endpoints usinggetStaticPathswith.htmlin dynamic param values (e.g.{ path: 'file.html' }) would fail with aNoMatchingStaticPathFounderror during build. The.htmlsuffix is no longer incorrectly stripped from endpoint route pathnames. -
#16855
c610cdaThanks @astrobot-houston! - Fixes dynamic routes returning 500 "TypeError: Missing parameter" when using domain-based i18n routing in SSR. -
#16946
606c37bThanks @ematipico! - FixesAstro.routePatternto preserve original casing of dynamic parameter names from filenames. Previously, a file atsrc/pages/blog/[postId].astrowould return/blog/[postid]forAstro.routePatterndue to an internal.toLowerCase()call. It now correctly returns/blog/[postId]. -
#16720
16d49b6Thanks @thomas-callahan-collibra! - Fix an issue where dynamic routes would return the string[object Object]instead of the expected content, in certain runtimes. -
#16703
17390a6Thanks @henrybrewer00-dotcom! - Fixes styles being stripped when the project root is started with a path whose case differs from the actual filesystem case (e.g. runningastro devfromd:\dev\appwhile the folder on disk isD:\dev\app). -
#16855
c610cdaThanks @astrobot-houston! - FixesAstro.currentLocalereturning the default locale instead of the domain's locale on dynamic routes served from a mapped domain.
@astrojs/[email protected]
Patch Changes
-
#16955
9a93d68Thanks @Princesseuh! - Updates Sätteri processor to v0.8.0. See its changelog for details on bugs fixed and features added. -
Updated dependencies [
9a93d68]:- @astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
- #16955
9a93d68Thanks @Princesseuh! - Updates Sätteri processor to v0.8.0. See its changelog for details on bugs fixed and features added.
[email protected]
Patch Changes
-
#16900
17a0fbdThanks @ocavue! - Bumpsdevaluedependency to v5.8.1 -
#16016
0d85e1bThanks @felmonon! - Fix a false positive in the dev toolbar accessibility audit for anchors with text inside closed<details>elements. -
#16911
79c6c46Thanks @astrobot-houston! - Fixes a bug whereexperimental.advancedRoutingwithastro/honohandlers threwTypeError: Cannot read properties of undefined (reading 'route')for unmatched routes instead of rendering the custom 404 page. -
#16899
239c469Thanks @matthewp! - Fixes a false "does not call the middleware() handler" warning when usingastro()in a customsrc/app.tsand the first request is a redirect route. -
#16887
493acdbThanks @astrobot-houston! - FixesredirectToDefaultLocalenot working after the Advanced Routing refactoring. -
#16908
ef53ab9Thanks @florian-lefebvre! - Improves optimized fallbacks generation when using the Fonts API by using better metrics for bold variants