๐ Patch Changes
- #10400
629c9d7c4d96ae5711d95601e738b3d31d268116Thanks @mingjunlu! - Fixes an issue where dev toolbar x-ray didnโt escape props content.
629c9d7c4d96ae5711d95601e738b3d31d268116 Thanks @mingjunlu! - Fixes an issue where dev toolbar x-ray didnโt escape props content.#10392 02aeb01cb8b62b9cc4dfe6069857219404343b73 Thanks @martrapp! - Fixes broken types for some functions of astro:transitions/client.
#10390 236cdbb611587692d3c781850cb949604677ef82 Thanks @bholmesdev! - Adds --help reference for new db and studio CLI commands

#10206 dc87214141e7f8406c0fdf6a7f425dad6dea6d3e Thanks @lilnasy! - Allows middleware to run when a matching page or endpoint is not found. Previously, a pages/404.astro or pages/[...catch-all].astro route had to match to allow middleware. This is now not necessary.
When a route does not match in SSR deployments, your adapter may show a platform-specific 404 page instead of running Astroโs SSR code. In these cases, you may still need to add a 404.astro or fallback route with spread params, or use a routing configuration option if your adapter provides one.
#9960 c081adf998d30419fed97d8fccc11340cdc512e0 Thanks @StandardGage! - Allows passing any props to the <Code /> component
#10102 e3f02f5fb1cf0dae3c54beb3a4af3dbf3b06abb7 Thanks @bluwy! - Adds a new experimental.directRenderScript configuration option which provides a more reliable strategy to prevent scripts from being executed in pages where they are not used.
This replaces the experimental.optimizeHoistedScript flag introduced in v2.10.4 to prevent unused componentsโ scripts from being included in a page unexpectedly. That experimental option no longer exists and must be removed from your configuration, whether or not you enable directRenderScript:
import { defineConfig } from 'astro/config';
export default defineConfig({ experimental: { optimizeHoistedScript: true, directRenderScript: true }});With experimental.directRenderScript configured, scripts are now directly rendered as declared in Astro files (including existing features like TypeScript, importing node_modules, and deduplicating scripts). You can also now conditionally render scripts in your Astro file.
However, this means scripts are no longer hoisted to the <head> and multiple scripts on a page are no longer bundled together. If you enable this option, you should check that all your <script> tags behave as expected.
This option will be enabled by default in Astro 5.0.
#10130 5a9528741fa98d017b269c7e4f013058028bdc5d Thanks @bluwy! - Stabilizes markdown.shikiConfig.experimentalThemes as markdown.shikiConfig.themes. No behaviour changes are made to this option.
#10189 1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd Thanks @peng! - Adds the option to pass an object to build.assetsPrefix. This allows for the use of multiple CDN prefixes based on the target file type.
When passing an object to build.assetsPrefix, you must also specify a fallback domain to be used for all other file types not specified.
Specify a file extension as the key (e.g. โjsโ, โpngโ) and the URL serving your assets of that file type as the value:
import { defineConfig } from 'astro/config';
export default defineConfig({ build: { assetsPrefix: { js: 'https://js.cdn.example.com', mjs: 'https://js.cdn.example.com', // if you have .mjs files, you must add a new entry like this png: 'https://images.cdn.example.com', fallback: 'https://generic.cdn.example.com', }, },});#10252 3307cb34f17159dfd3f03144697040fcaa10e903 Thanks @Princesseuh! - Adds support for emitting warning and info notifications from dev toolbar apps.
When using the toggle-notification event, the severity can be specified through detail.level:
eventTarget.dispatchEvent( new CustomEvent('toggle-notification', { detail: { level: 'warning', }, }));#10186 959ca5f9f86ef2c0a5a23080cc01c25f53d613a9 Thanks @Princesseuh! - Adds the ability to set colors on all the included UI elements for dev toolbar apps. Previously, only badge and buttons could be customized.
#10136 9cd84bd19b92fb43ae48809f575ee12ebd43ea8f Thanks @matthewp! - Changes the default behavior of transition:persist to update the props of persisted islands upon navigation. Also adds a new view transitions option transition:persist-props (default: false) to prevent props from updating as needed.
Islands which have the transition:persist property to keep their state when using the <ViewTransitions /> router will now have their props updated upon navigation. This is useful in cases where the component relies on page-specific props, such as the current page title, which should update upon navigation.
For example, the component below is set to persist across navigation. This component receives a products props and might have some internal state, such as which filters are applied:
<ProductListing transition:persist products={products} />Upon navigation, this component persists, but the desired products might change, for example if you are visiting a category of products, or you are performing a search.
Previously the props would not change on navigation, and your island would have to handle updating them externally, such as with API calls.
With this change the props are now updated, while still preserving state.
You can override this new default behavior on a per-component basis using transition:persist-props=true to persist both props and state during navigation:
<ProductListing transition:persist-props="true" products={products} />#9977 0204b7de37bf626e1b97175b605adbf91d885386 Thanks @OliverSpeir! - Supports adding the data-astro-rerun attribute on script tags so that they will be re-executed after view transitions
<script is:inline data-astro-rerun> ...</script>#10145 65692fa7b5f4440c644c8cf3dd9bc50103d2c33b Thanks @alexanderniebuhr! - Adds experimental JSON Schema support for content collections.
This feature will auto-generate a JSON Schema for content collections of type: 'data' which can be used as the $schema value for TypeScript-style autocompletion/hints in tools like VSCode.
To enable this feature, add the experimental flag:
import { defineConfig } from 'astro/config';
export default defineConfig({ experimental: { contentCollectionJsonSchema: true }});This experimental implementation requires you to manually reference the schema in each data entry file of the collection:
{ "$schema": "../../../.astro/collections/test.schema.json", "test": "test"}Alternatively, you can set this in your VSCode json.schemas settings:
"json.schemas": [ { "fileMatch": [ "/src/content/test/**" ], "url": "../../../.astro/collections/test.schema.json" }]Note that this initial implementation uses a library with known issues for advanced Zod schemas, so you may wish to consult these limitations before enabling the experimental flag.
#10130 5a9528741fa98d017b269c7e4f013058028bdc5d Thanks @bluwy! - Migrates shikiji to shiki 1.0
#10268 2013e70bce16366781cc12e52823bb257fe460c0 Thanks @Princesseuh! - Adds support for page mutations to the audits in the dev toolbar. Astro will now rerun the audits whenever elements are added or deleted from the page.
#10217 5c7862a9fe69954f8630538ebb7212cd04b8a810 Thanks @Princesseuh! - Updates the UI for dev toolbar audits with new information
#10360 ac766647b0e6156b7c4a0bb9a11981fe168852d7 Thanks @nmattia! - Fixes an issue where some CLI commands attempted to directly read vite config files.
#10291 8107a2721b6abb07c3120ac90e03c39f2a44ab0c Thanks @bluwy! - Treeshakes unused Astro component scoped styles
#10368 78bafc5d661ff7dd071c241cb1303c4d8a774d21 Thanks @Princesseuh! - Updates the base tsconfig.json preset with jsx: 'preserve' in order to fix errors when importing Astro files inside .js and .ts files.
Updated dependencies [c081adf998d30419fed97d8fccc11340cdc512e0, 1ea0a25b94125e4f6f2ac82b42f638e22d7bdffd, 5a9528741fa98d017b269c7e4f013058028bdc5d, a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18]:
33583e8b31ee8a33e26cf57f30bb422921f4745d Thanks @lilnasy! - Fixes an issue where elements slotted within interactive framework components disappeared after hydration.#10355 8ce9fffd44b0740621178d61fb1425bf4155c2d7 Thanks @ematipico! - Fixes a regression where full dynamic routes were prioritized over partial dynamic routes. Now a route like food-[name].astro is matched before [name].astro.
#10356 d121311a3f4b5345e344e31f75d4e7164d65f729 Thanks @mingjunlu! - Fixes an issue where getCollection might return undefined when content collection is empty
#10325 f33cce8f6c3a2e17847658cdedb015bd93cc1ee3 Thanks @lilnasy! - Fixes an issue where ctx.site included the configured base in API routes and middleware, unlike Astro.site in astro pages.
#10343 f973aa9110592fa9017bbe84387f22c24a6d7159 Thanks @ematipico! - Fixes some false positive in the dev toolbar a11y audits, by adding the a element to the list of interactive elements.
#10295 fdd5bf277e5c1cfa30c1bd2ca123f4e90e8d09d9 Thanks @rossrobino! - Adds a prefetch fallback when using the experimental.clientPrerender option. If prerendering fails, which can happen if Chrome extensions block prerendering, it will fallback to prefetching the URL. This works by adding a prefetch field to the speculationrules script, but does not create an extra request.
a2e9b2b936666b2a4779feb00dcb8ff0ab82c2ec Thanks @matthewp! - Fixes @astrojs/db loading TS in the fixturesf2e60a96754ed1d86001fe4d5d3a0c0ef657408d Thanks @FredKSchott! - Fixes an issue where slotting interactive components within a โclient:onlyโ component prevented all component code in the page from running.#10281 9deb919ff95b1d2ffe5a5f70ec683e32ebfafd05 Thanks @lilnasy! - Fixes an issue where 404.astro was ignored with i18n routing enabled.
#10279 9ba3e2605daee3861e3bf6c5768f1d8bced4709d Thanks @lilnasy! - Fixes an issue where returning redirect responses resulted in missing files with certain adapters.
#10319 19ecccedaab6d8fa0ff23711c88fa7d4fa34df38 Thanks @lilnasy! - Fixes an issue where streaming SSR responses sometimes failed with โiterator.result is not a functionโ on node-based adapters.
#10302 992537e79f1847b590a2e226aac88a47a6304f68 Thanks @florian-lefebvre! - Fixes an issue that causes static entrypoints build to fail because of the path in certain conditions. Specifically, it failed if the path had an extension (like .astro, .mdx etc) and such extension would be also within the path (like ./.astro/index.astro).
#10298 819d20a89c0d269333c2d397c1080884f516307a Thanks @Fryuni! - Fix an incorrect conflict resolution between pages generated from static routes and rest parameters
4bc360cd5f25496aca3232f6efb3710424a14a34 Thanks @sanman1k98! - Fixes jerky scrolling on IOS when using view transitions.#10278 a548a3a99c2835c19662fc38636f92b2bda26614 Thanks @Princesseuh! - Fixes original images sometimes being kept / deleted when they shouldnโt in both MDX and Markdoc
#10280 3488be9b59d1cb65325b0e087c33bcd74aaa4926 Thanks @bholmesdev! - Finalize db API to a shared db/ directory.
5e3e74b61daa2ba44c761c9ab5745818661a656e Thanks @Princesseuh! - Fixes dev toolbar warning about using the proper loading attributes on images using data: URIs#10287 a90d685d7 Thanks @ematipico! - Fixes an issue where in Node SSR, the image endpoint could be used maliciously to reveal unintended information about the underlying system.
Thanks to Google Security Team for reporting this issue.
#10274 e556151603a2f0173059d0f98fdcbec0610b48ff Thanks @lilnasy! - Fixes a regression introduced in v4.4.5 where image optimization did not work in dev mode when a base was configured.
#10263 9bdbed723e0aa4243d7d6ee64d1c1df3b75b9aeb Thanks @martrapp! - Adds auto completion for astro: event names when adding or removing event listeners on document.
#10284 07f89429a1ef5173d3321e0b362a9dc71fc74fe5 Thanks @Princesseuh! - Fixes an issue where in Node SSR, the image endpoint could be used maliciously to reveal unintended information about the underlying system.
Thanks to Google Security Team for reporting this issue.
#10247 fb773c9161bf8faa5ebd7e115f3564c3359e56ea Thanks @martrapp! - Fixes an issue where transition:animate="none" still allowed the browser-native morph animation.
#10248 8ae5d99534fc09d650e10e64a09b61a2807574f2 Thanks @ematipico! - Fixes an issue where multiple injected routes with the same entrypoint but different pattern were incorrectly cached, causing some of them not being rendered in the dev server.
#10250 57655a99db34e20e9661c039fab253b867013318 Thanks @log101! - Fixes the overwriting of localised index pages with redirects
#10239 9c21a9df6b03e36bd78dc553e13c55b9ef8c44cd Thanks @mingjunlu! - Improves the message of MiddlewareCantBeLoaded for clarity
#10222 ade9759cae74ca262b988260250bcb202235e811 Thanks @martrapp! - Adds a warning in DEV mode when using view transitions on a device with prefer-reduced-motion enabled.
#10251 9b00de0a76b4f4b5b808e8c78e4906a2497e8ecf Thanks @mingjunlu! - Fixes TypeScript type definitions for Code component theme and experimentalThemes props
#10221 4db82d9c7dce3b73fe43b86020fcfa326c1357ec Thanks @matthewp! - Prevents errors in templates from crashing the server
#10219 afcb9d331179287629b5ffce4020931258bebefa Thanks @matthewp! - Fix dynamic slots missing hydration scripts
#10220 1eadb1c5290f2f4baf538c34889a09d5fcfb9bd4 Thanks @Princesseuh! - Fixes some built-in apps of the dev toolbar not closing when clicking the page
#10154 e64bd0740b44aed5cfaf67e5c37a1c56ed4442f4 Thanks @Cherry! - Fixes an issue where config.vite.build.assetsInlineLimit could not be set as a function.
#10196 8fb32f390d40cfa12a82c0645928468d27218866 Thanks @lilnasy! - Fixes an issue where a warning about headers being accessed in static mode is unnecessarily shown when i18n is enabled.
#10199 6aa660ae7abc6841d7a3396b29f10b9fb7910ce5 Thanks @lilnasy! - Fixes an issue where prerendered pages had access to query params in dev mode.
#10195 903eace233033998811b72e27a54c80d8e59ff37 Thanks @1574242600! - Fix build failure caused by read-only files under /public (in the presence of client-side JS).
#10205 459f74bc71748279fe7dce0688f38bd74b51c5c1 Thanks @martrapp! - Adds an error message for non-string transition:name values
#10208 8cd38f02456640c063552aef00b2b8a216b3935d Thanks @log101! - Fixes custom headers are not added to the Node standalone server responses in preview mode
#10143 7c5fcd2fa817472f480bbfbbc11b9ed71a7210ab Thanks @bluwy! - Improves the default optimizeDeps.entries Vite config to avoid globbing server endpoints, and respect the srcDir option
#10197 c856c729404196900a7386c8426b81e79684a6a9 Thanks @Princesseuh! - Fixes errors being logged twice in some cases
#10166 598f30c7cd6c88558e3806d9bc5a15d426d83992 Thanks @bluwy! - Improves Astro style tag HMR when updating imported styles
#10194 3cc20109277813ccb9578ca87a8b0d680a73c35c Thanks @matthewp! - Fixes an issue related to content collections usage in browser context caused by csssec
a46249173edde66b03c19441144272baa8394fb4 Thanks @ematipico! - Fixes an issue with the i18n.routing types, where an internal transformation was causing the generation of incorrect types for integrations.#9795 5acc3135ba5309a566def466fbcbabd23f70cd68 Thanks @lilnasy! - Refactors internals relating to middleware, endpoints, and page rendering.
#10105 1f598b372410066c6fcd41cba9915f6aaf7befa8 Thanks @negativems! - Fixes an issue where some astro commands failed if the astro config file or an integration used the global crypto object.
#10165 d50dddb71d87ce5b7928920f10eb4946a5339f86 Thanks @ematipico! - Fixes an issue where the i18n.routing object had all its fields defined as mandatory. Now they all are optionals and shouldnโt break when using astro.config.mts.
#10132 1da9c5f2f3fe70b0206d1b3e0c01744fa40d511c Thanks @bluwy! - Simplifies internal Vite preview server teardown
#10163 b92d35f1026f3e99abb888d1a845bdda4efdc327 Thanks @mingjunlu! - Fixes an issue where audit fails to initialize when encountered <a> inside <svg>
#10079 80f8996514e6d0546e94bd927650cd4ab2f1fa2f Thanks @ktym4a! - Fix integrationData fetch to always be called even if View Transition is enabled.
#10139 3c73441eb2eaba767d6dad1b30c0353195d28791 Thanks @bluwy! - Fixes style-only change detection for Astro files if both the markup and styles are updated

#9614 d469bebd7b45b060dc41d82ab1cf18ee6de7e051 Thanks @matthewp! - Improves Node.js streaming performance.
This uses an AsyncIterable instead of a ReadableStream to do streaming in Node.js. This is a non-standard enhancement by Node, which is done only in that environment.
#10001 748b2e87cd44d8bcc1ab9d7e504703057e2000cd Thanks @bholmesdev! - Removes content collection warning when a configured collection does not have a matching directory name. This should resolve i18n collection warnings for Starlight users.
This also ensures configured collection names are always included in getCollection() and getEntry() types even when a matching directory is absent. We hope this allows users to discover typos during development by surfacing type information.
#10074 7443929381b47db0639c49a4d32aec4177bd9102 Thanks @Princesseuh! - Add a UI showing the list of found problems when using the audit app in the dev toolbar
#10099 b340f8fe3aaa81e38c4f1aa41498b159dc733d86 Thanks @martrapp! - Fixes a regression where view transition names containing special characters such as spaces or punctuation stopped working.
Regular use naming your transitions with transition: name is unaffected.
However, this fix may result in breaking changes if your project relies on the particular character encoding strategy Astro uses to translate transition:name directives into values of the underlying CSS view-transition-name property. For example, Welcome to Astro is now encoded as Welcome_20to_20Astro_2e.
This mainly affects spaces and punctuation marks but no Unicode characters with codes >= 128.
#9976 91f75afbc642b6e73dd4ec18a1fe2c3128c68132 Thanks @OliverSpeir! - Adds a new optional astro:assets image attribute inferSize for use with remote images.
Remote images can now have their dimensions inferred just like local images. Setting inferSize to true allows you to use getImage() and the <Image /> and <Picture /> components without setting the width and height properties.
---import { Image, Picture, getImage } from 'astro:assets';const myPic = await getImage({ src: 'https://example.com/example.png', inferSize: true });---
<Image src="https://example.com/example.png" inferSize alt="" /><Picture src="https://example.com/example.png" inferSize alt="" />Read more about using inferSize with remote images in our documentation.
#10015 6884b103c8314a43e926c6acdf947cbf812a21f4 Thanks @Princesseuh! - Adds initial support for performance audits to the dev toolbar
#10116 4bcc249a9f34aaac59658ca626c828bd6dbb8046 Thanks @lilnasy! - Fixes an issue where the dev server froze when typescript aliases were used.
#10096 227cd83a51bbd451dc223fd16f4cf1b87b8e44f8 Thanks @Fryuni! - Fixes regression on routing priority for multi-layer index pages
The sorting algorithm positions more specific routes before less specific routes, and considers index pages to be more specific than a dynamic route with a rest parameter inside of it.
This means that /blog is considered more specific than /blog/[...slug].
But this special case was being applied incorrectly to indexes, which could cause a problem in scenarios like the following:
//blog/blog/[...slug]The algorithm would make the following comparisons:
/ is more specific than /blog (incorrect)/blog/[...slug] is more specific than / (correct)/blog is more specific than /blog/[...slug] (correct)Although the incorrect first comparison is not a problem by itself, it could cause the algorithm to make the wrong decision.
Depending on the other routes in the project, the sorting could perform just the last two comparisons and by transitivity infer the inverse of the third (/blog/[...slug > / > /blog), which is incorrect.
Now the algorithm doesnโt have a special case for index pages and instead does the comparison soleley for rest parameter segments and their immediate parents, which is consistent with the transitivity property.
#10120 787e6f52470cf07fb50c865948b2bc8fe45a6d31 Thanks @bluwy! - Updates and supports Vite 5.1
#10096 227cd83a51bbd451dc223fd16f4cf1b87b8e44f8 Thanks @Fryuni! - Fixes edge case on i18n fallback routes
Previously index routes deeply nested in the default locale, like /some/nested/index.astro could be mistaked as the root index for the default locale, resulting in an incorrect redirect on /.
#10112 476b79a61165d0aac5e98459a4ec90762050a14b Thanks @Princesseuh! - Renames the home Astro Devoolbar App to astro:home
#10117 51b6ff7403c1223b1c399e88373075972c82c24c Thanks @hippotastic! - Fixes an issue where create astro, astro add and @astrojs/upgrade would fail due to unexpected package manager CLI output.