diff --git a/.changeset/afraid-apricots-buy.md b/.changeset/afraid-apricots-buy.md deleted file mode 100644 index 8be7e9db81..0000000000 --- a/.changeset/afraid-apricots-buy.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'astro': minor ---- - -Adapters can now specify the build output type they're intended for using the `adapterFeatures.buildOutput` property. This property can be used to always generate a server output, even if the project doesn't have any server-rendered pages. - -```ts -{ - 'astro:config:done': ({ setAdapter, config }) => { - setAdapter({ - name: 'my-adapter', - adapterFeatures: { - buildOutput: 'server', - }, - }); - }, -} -``` - -If your adapter specifies `buildOutput: 'static'`, and the user's project contains server-rendered pages, Astro will warn in development and error at build time. Note that a hybrid output, containing both static and server-rendered pages, is considered to be a `server` output, as a server is required to serve the server-rendered pages. diff --git a/.changeset/blue-boats-relax.md b/.changeset/blue-boats-relax.md deleted file mode 100644 index 93d9b51ca2..0000000000 --- a/.changeset/blue-boats-relax.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'astro': major ---- - -Unflag globalRoutePriority - -The previously experimental feature `globalRoutePriority` is now the default in Astro 5. - -This was a refactoring of route prioritization in Astro, making it so that injected routes, file-based routes, and redirects are all prioritized using the same logic. This feature has been enabled for all Starlight projects since it was added and should not affect most users. diff --git a/.changeset/blue-gorillas-accept.md b/.changeset/blue-gorillas-accept.md deleted file mode 100644 index b122a95583..0000000000 --- a/.changeset/blue-gorillas-accept.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes a bug where content types were not generated when first running astro dev unless src/content exists diff --git a/.changeset/blue-sloths-stare.md b/.changeset/blue-sloths-stare.md deleted file mode 100644 index 53ab43b2ef..0000000000 --- a/.changeset/blue-sloths-stare.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'astro': patch ---- - -`render()` signature now takes `renderOptions` as 2nd argument - -The signature for `app.render()` has changed, and the second argument is now an options object called `renderOptions` with more options for customizing rendering. - -The `renderOptions` are: - -- `addCookieHeader`: Determines whether Astro will set the `Set-Cookie` header, otherwise the adapter is expected to do so itself. -- `clientAddress`: The client IP address used to set `Astro.clientAddress`. -- `locals`: An object of locals that's set to `Astro.locals`. -- `routeData`: An object specifying the route to use. diff --git a/.changeset/blue-socks-doubt.md b/.changeset/blue-socks-doubt.md deleted file mode 100644 index 638e22e080..0000000000 --- a/.changeset/blue-socks-doubt.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -'astro': minor ---- - -Adds experimental support for built-in SVG components. - - -This feature allows you to import SVG files directly into your Astro project as components. By default, Astro will inline the SVG content into your HTML output. - -To enable this feature, set `experimental.svg` to `true` in your Astro config: - -```js -{ - experimental: { - svg: true, - }, -} -``` - -To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. Astro also provides a `size` attribute to set equal `height` and `width` properties: - -```astro ---- -import Logo from './path/to/svg/file.svg'; ---- - - -``` - -For a complete overview, and to give feedback on this experimental API, see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035). diff --git a/.changeset/brave-elephants-fly.md b/.changeset/brave-elephants-fly.md deleted file mode 100644 index 0c76730279..0000000000 --- a/.changeset/brave-elephants-fly.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'astro': major ---- - -### [changed]: `entryPoint` type inside the hook `astro:build:ssr` -In Astro v4.x, the `entryPoint` type was `RouteData`. - -Astro v5.0 the `entryPoint` type is `IntegrationRouteData`, which contains a subset of the `RouteData` type. The fields `isIndex` and `fallbackRoutes` were removed. - -#### What should I do? -Update your adapter to change the type of `entryPoint` from `RouteData` to `IntegrationRouteData`. - -```diff --import type {RouteData} from 'astro'; -+import type {IntegrationRouteData} from "astro" - --function useRoute(route: RouteData) { -+function useRoute(route: IntegrationRouteData) { - -} -``` diff --git a/.changeset/breezy-brooms-count.md b/.changeset/breezy-brooms-count.md deleted file mode 100644 index bb64e983ae..0000000000 --- a/.changeset/breezy-brooms-count.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': major ---- - -Bumps Vite to ^6.0.1 and handles its breaking changes diff --git a/.changeset/breezy-colts-promise.md b/.changeset/breezy-colts-promise.md deleted file mode 100644 index b552cb7f5e..0000000000 --- a/.changeset/breezy-colts-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/markdoc': patch ---- - -Uses latest version of `@astrojs/markdown-remark` with updated Shiki APIs diff --git a/.changeset/bright-keys-sell.md b/.changeset/bright-keys-sell.md deleted file mode 100644 index 0222aaf51c..0000000000 --- a/.changeset/bright-keys-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes a bug where content config was ignored if it was outside of content dir and has a parent dir with an underscore diff --git a/.changeset/brown-bulldogs-share.md b/.changeset/brown-bulldogs-share.md deleted file mode 100644 index c8cadb11b2..0000000000 --- a/.changeset/brown-bulldogs-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an issue where an incorrect usage of Astro actions was lost when porting the fix from v4 to v5 diff --git a/.changeset/chatty-teachers-sit.md b/.changeset/chatty-teachers-sit.md deleted file mode 100644 index 9e4fd89b45..0000000000 --- a/.changeset/chatty-teachers-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"astro": major ---- - -The lowest version of Node supported by Astro is now Node v18.17.1 and higher. diff --git a/.changeset/chilly-terms-know.md b/.changeset/chilly-terms-know.md deleted file mode 100644 index ea5de66029..0000000000 --- a/.changeset/chilly-terms-know.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -'astro': major ---- - -Updates how the `build.client` and `build.server` option values get resolved to match existing documentation. With this fix, the option values will now correctly resolve relative to the `outDir` option. So if `outDir` is set to `./dist/nested/`, then by default: - -- `build.client` will resolve to `/dist/nested/client/` -- `build.server` will resolve to `/dist/nested/server/` - -Previously the values were incorrectly resolved: - -- `build.client` was resolved to `/dist/nested/dist/client/` -- `build.server` was resolved to `/dist/nested/dist/server/` - -If you were relying on the previous build paths, make sure that your project code is updated to the new build paths. diff --git a/.changeset/clean-camels-drive.md b/.changeset/clean-camels-drive.md deleted file mode 100644 index 4e908a28b9..0000000000 --- a/.changeset/clean-camels-drive.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'astro': major ---- - -Adds a default exclude and include value to the tsconfig presets. `{projectDir}/dist` is now excluded by default, and `{projectDir}/.astro/types.d.ts` and `{projectDir}/**/*` are included by default. - -Both of these options can be overridden by setting your own values to the corresponding settings in your `tsconfig.json` file. diff --git a/.changeset/clean-donuts-walk.md b/.changeset/clean-donuts-walk.md deleted file mode 100644 index 1af111a4be..0000000000 --- a/.changeset/clean-donuts-walk.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@astrojs/markdown-remark': major -'astro': major ---- - -Cleans up Astro-specfic metadata attached to `vfile.data` in Remark and Rehype plugins. Previously, the metadata was attached in different locations with inconsistent names. The metadata is now renamed as below: - -- `vfile.data.__astroHeadings` -> `vfile.data.astro.headings` -- `vfile.data.imagePaths` -> `vfile.data.astro.imagePaths` - -The types of `imagePaths` has also been updated from `Set` to `string[]`. The `vfile.data.astro.frontmatter` metadata is left unchanged. - -While we don't consider these APIs public, they can be accessed by Remark and Rehype plugins that want to re-use Astro's metadata. If you are using these APIs, make sure to access them in the new locations. diff --git a/.changeset/clean-moles-rest.md b/.changeset/clean-moles-rest.md deleted file mode 100644 index 6925bd90cf..0000000000 --- a/.changeset/clean-moles-rest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes a bug where legacy content types were generated for content layer collections if they were in the content directory diff --git a/.changeset/cold-bananas-hear.md b/.changeset/cold-bananas-hear.md deleted file mode 100644 index dfa9ade4af..0000000000 --- a/.changeset/cold-bananas-hear.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Correctly parse values returned from inline loader diff --git a/.changeset/cool-mangos-shop.md b/.changeset/cool-mangos-shop.md deleted file mode 100644 index 893ed22e20..0000000000 --- a/.changeset/cool-mangos-shop.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -'astro': major ---- - -The `locals` object can no longer be overridden - -Middleware, API endpoints, and pages can no longer override the `locals` object in its entirety. You can still append values onto the object, but you can not replace the entire object and delete its existing values. - -If you were previously overwriting like so: - -```js -ctx.locals = { - one: 1, - two: 2 -} -``` - -This can be changed to an assignment on the existing object instead: - -```js -Object.assign(ctx.locals, { - one: 1, - two: 2 -}) -``` diff --git a/.changeset/cuddly-shoes-press.md b/.changeset/cuddly-shoes-press.md deleted file mode 100644 index 65f9fe7ef4..0000000000 --- a/.changeset/cuddly-shoes-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Fixes an issue where the refresh context data was not passed correctly to content layer loaders diff --git a/.changeset/curvy-walls-kneel.md b/.changeset/curvy-walls-kneel.md deleted file mode 100644 index dc04cb0af4..0000000000 --- a/.changeset/curvy-walls-kneel.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -'astro': patch ---- - -Adds a new function `refreshContent` to the `astro:server:setup` hook that allows integrations to refresh the content layer. This can be used, for example, to register a webhook endpoint during dev, or to open a socket to a CMS to listen for changes. - -By default, `refreshContent` will refresh all collections. You can optionally pass a `loaders` property, which is an array of loader names. If provided, only collections that use those loaders will be refreshed. For example, A CMS integration could use this property to only refresh its own collections. - -You can also pass a `context` object to the loaders. This can be used to pass arbitrary data, such as the webhook body, or an event from the websocket. - -```ts - { - name: 'my-integration', - hooks: { - 'astro:server:setup': async ({ server, refreshContent }) => { - server.middlewares.use('/_refresh', async (req, res) => { - if(req.method !== 'POST') { - res.statusCode = 405 - res.end('Method Not Allowed'); - return - } - let body = ''; - req.on('data', chunk => { - body += chunk.toString(); - }); - req.on('end', async () => { - try { - const webhookBody = JSON.parse(body); - await refreshContent({ - context: { webhookBody }, - loaders: ['my-loader'] - }); - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify({ message: 'Content refreshed successfully' })); - } catch (error) { - res.writeHead(500, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify({ error: 'Failed to refresh content: ' + error.message })); - } - }); - }); - } - } -} -``` - diff --git a/.changeset/dirty-bees-repair.md b/.changeset/dirty-bees-repair.md deleted file mode 100644 index 98fc2f714e..0000000000 --- a/.changeset/dirty-bees-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/upgrade': patch ---- - -Fixes an issue where `@astrojs/upgrade` announces integration updates for already up to date packages diff --git a/.changeset/dirty-cooks-explode.md b/.changeset/dirty-cooks-explode.md deleted file mode 100644 index 770ef17999..0000000000 --- a/.changeset/dirty-cooks-explode.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@astrojs/mdx': major ---- - -Handles the breaking change in Astro where content pages (including `.mdx` pages located within `src/pages/`) no longer respond with `charset=utf-8` in the `Content-Type` header. - -For MDX pages without layouts, `@astrojs/mdx` will automatically add the `` tag to the page by default. This reduces the boilerplate needed to write with non-ASCII characters. If your MDX pages have a layout, the layout component should include the `` tag. - -If you require `charset=utf-8` to render your page correctly, make sure that your layout components have the `` tag added. diff --git a/.changeset/dry-lamps-smile.md b/.changeset/dry-lamps-smile.md deleted file mode 100644 index 95f5172a93..0000000000 --- a/.changeset/dry-lamps-smile.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Update error link to on-demand rendering guide diff --git a/.changeset/dry-worms-knock.md b/.changeset/dry-worms-knock.md deleted file mode 100644 index e8412e3be8..0000000000 --- a/.changeset/dry-worms-knock.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -'astro': major ---- - -The `image.endpoint` config now allow customizing the route of the image endpoint in addition to the entrypoint. This can be useful in niche situations where the default route `/_image` conflicts with an existing route or your local server setup. - -```js -import { defineConfig } from "astro/config"; - -defineConfig({ - image: { - endpoint: { - route: "/image", - entrypoint: "./src/image_endpoint.ts" - } - }, -}) -``` diff --git a/.changeset/dull-moles-talk.md b/.changeset/dull-moles-talk.md deleted file mode 100644 index 97d3d0eb28..0000000000 --- a/.changeset/dull-moles-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Prevents Vite emitting an error when restarting itself diff --git a/.changeset/eight-days-sort.md b/.changeset/eight-days-sort.md deleted file mode 100644 index 871f53d32d..0000000000 --- a/.changeset/eight-days-sort.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'astro': major -'@astrojs/mdx': major -'@astrojs/markdown-remark': major -'@astrojs/db': minor -'@astrojs/web-vitals': major -'@astrojs/underscore-redirects': minor ---- - -Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release. - -Starting from this release, no breaking changes will be introduced unless absolutely necessary. - -To learn how to upgrade, check out the [Astro v5.0 upgrade guide in our beta docs site](https://5-0-0-beta.docs.astro.build/en/guides/upgrade-to/v5/). diff --git a/.changeset/eight-seahorses-attend.md b/.changeset/eight-seahorses-attend.md deleted file mode 100644 index 72ead3c15e..0000000000 --- a/.changeset/eight-seahorses-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Handle multiple root nodes on SVG files diff --git a/.changeset/eighty-bags-cross.md b/.changeset/eighty-bags-cross.md deleted file mode 100644 index 734ef71c1d..0000000000 --- a/.changeset/eighty-bags-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Exports the `RenderResult` type diff --git a/.changeset/eighty-boxes-applaud.md b/.changeset/eighty-boxes-applaud.md deleted file mode 100644 index a732758cb9..0000000000 --- a/.changeset/eighty-boxes-applaud.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -'astro': major ---- - -The `astro:env` feature introduced behind a flag in [v4.10.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#x4100) is no longer experimental and is available for general use. If you have been waiting for stabilization before using `astro:env`, you can now do so. - -This feature lets you configure a type-safe schema for your environment variables, and indicate whether they should be available on the server or the client. - -To configure a schema, add the `env` option to your Astro config and define your client and server variables. If you were previously using this feature, please remove the experimental flag from your Astro config and move your entire `env` configuration unchanged to a top-level option. - -```js -import { defineConfig, envField } from 'astro/config' - -export default defineConfig({ - env: { - schema: { - API_URL: envField.string({ context: "client", access: "public", optional: true }), - PORT: envField.number({ context: "server", access: "public", default: 4321 }), - API_SECRET: envField.string({ context: "server", access: "secret" }), - } - } -}) -``` - -You can import and use your defined variables from the appropriate `/client` or `/server` module: - -```astro ---- -import { API_URL } from "astro:env/client" -import { API_SECRET_TOKEN } from "astro:env/server" - -const data = await fetch(`${API_URL}/users`, { - method: "GET", - headers: { - "Content-Type": "application/json", - "Authorization": `Bearer ${API_SECRET_TOKEN}` - }, -}) ---- - - -``` - -Please see our [guide to using environment variables](https://docs.astro.build/en/guides/environment-variables/#astroenv) for more about this feature. diff --git a/.changeset/eighty-crabs-cross.md b/.changeset/eighty-crabs-cross.md deleted file mode 100644 index 57bd3b1f43..0000000000 --- a/.changeset/eighty-crabs-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/solid-js': patch ---- - -Updates vite-plugin-solid to handle Vite 6 diff --git a/.changeset/eighty-donkeys-fly.md b/.changeset/eighty-donkeys-fly.md deleted file mode 100644 index 8cec462363..0000000000 --- a/.changeset/eighty-donkeys-fly.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -'astro': minor ---- - -The following renderer fields and integration fields now accept `URL` as a type: - -**Renderers**: -- `AstroRenderer.clientEntrpoint` -- `AstroRenderer.serverEntrypoint` - -**Integrations**: -- `InjectedRoute.entrypoint` -- `AstroIntegrationMiddleware.entrypoint` -- `DevToolbarAppEntry.entrypoint` diff --git a/.changeset/eighty-ligers-punch.md b/.changeset/eighty-ligers-punch.md deleted file mode 100644 index ee7acbec3b..0000000000 --- a/.changeset/eighty-ligers-punch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@astrojs/svelte': patch ---- - -Fixes an Reference Error that occurred during client transitions diff --git a/.changeset/empty-houses-melt.md b/.changeset/empty-houses-melt.md deleted file mode 100644 index 737cf9d3db..0000000000 --- a/.changeset/empty-houses-melt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': minor ---- - -Updates to Vite 6.0.0-beta.6 diff --git a/.changeset/empty-jobs-impress.md b/.changeset/empty-jobs-impress.md deleted file mode 100644 index 09a57fe391..0000000000 --- a/.changeset/empty-jobs-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'astro': patch ---- - -Explicitly import index.ts to fix types when moduleResolution is NodeNext diff --git a/.changeset/fair-ears-compare.md b/.changeset/fair-ears-compare.md deleted file mode 100644 index a5c3bd3ff5..0000000000 --- a/.changeset/fair-ears-compare.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -'@astrojs/markdoc': minor -'@astrojs/preact': minor -'@astrojs/svelte': minor -'@astrojs/react': minor -'@astrojs/solid-js': minor -'@astrojs/mdx': minor -'@astrojs/vue': minor -'create-astro': minor -'@astrojs/prism': minor -'@astrojs/telemetry': minor -'@astrojs/upgrade': minor -'astro': minor ---- - -Drops node 21 support diff --git a/.changeset/five-jars-hear.md b/.changeset/five-jars-hear.md deleted file mode 100644 index 1385c7f03b..0000000000 --- a/.changeset/five-jars-hear.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -'astro': patch ---- - -Updates Astro's default ` + ``` + + Please see our [guide to using environment variables](https://docs.astro.build/en/guides/environment-variables/#astroenv) for more about this feature. + +- [#11806](https://github.com/withastro/astro/pull/11806) [`f7f2338`](https://github.com/withastro/astro/commit/f7f2338c2b96975001b5c782f458710e9cc46d74) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Removes the `assets` property on `supportedAstroFeatures` for adapters, as it did not reflect reality properly in many cases. + + Now, relating to assets, only a single `sharpImageService` property is available, determining if the adapter is compatible with the built-in sharp image service. + +- [#11864](https://github.com/withastro/astro/pull/11864) [`ee38b3a`](https://github.com/withastro/astro/commit/ee38b3a94697fe883ce8300eff9f001470b8adb6) Thanks [@ematipico](https://github.com/ematipico)! - ### [changed]: `routes` type inside the hook `astro:build:done` + In Astro v4.x, the `routes` type was `RouteData`. + + Astro v5.0 the `routes` type is `IntegrationRouteData`, which contains a subset of the `RouteData` type. The fields `isIndex` and `fallbackRoutes` were removed. + + #### What should I do? + + Update your adapter to change the type of `routes` from `RouteData` to `IntegrationRouteData`. + + ```diff + -import type {RouteData} from 'astro'; + +import type {IntegrationRouteData} from "astro" + + -function useRoute(route: RouteData) { + +function useRoute(route: IntegrationRouteData) { + + } + ``` + +- [#11941](https://github.com/withastro/astro/pull/11941) [`b6a5f39`](https://github.com/withastro/astro/commit/b6a5f39846581d0e9cfd7ae6f056c8d1209f71bd) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Merges the `output: 'hybrid'` and `output: 'static'` configurations into one single configuration (now called `'static'`) that works the same way as the previous `hybrid` option. + + It is no longer necessary to specify `output: 'hybrid'` in your Astro config to use server-rendered pages. The new `output: 'static'` has this capability included. Astro will now automatically provide the ability to opt out of prerendering in your static site with no change to your `output` configuration required. Any page route or endpoint can include `export const prerender = false` to be server-rendered, while the rest of your site is statically-generated. + + If your project used hybrid rendering, you must now remove the `output: 'hybrid'` option from your Astro config as it no longer exists. However, no other changes to your project are required, and you should have no breaking changes. The previous `'hybrid'` behavior is now the default, under a new name `'static'`. + + If you were using the `output: 'static'` (default) option, you can continue to use it as before. By default, all of your pages will continue to be prerendered and you will have a completely static site. You should have no breaking changes to your project. + + ```diff + import { defineConfig } from "astro/config"; + + export default defineConfig({ + - output: 'hybrid', + }); + ``` + + An adapter is still required to deploy an Astro project with any server-rendered pages. Failure to include an adapter will result in a warning in development and an error at build time. + +- [#11788](https://github.com/withastro/astro/pull/11788) [`7c0ccfc`](https://github.com/withastro/astro/commit/7c0ccfc26947b178584e3476584bcaa490c6ba86) Thanks [@ematipico](https://github.com/ematipico)! - Updates the default value of `security.checkOrigin` to `true`, which enables Cross-Site Request Forgery (CSRF) protection by default for pages rendered on demand. + + If you had previously configured `security.checkOrigin: true`, you no longer need this set in your Astro config. This is now the default and it is safe to remove. + + To disable this behavior and opt out of automatically checking that the “origin” header matches the URL sent by each request, you must explicitly set `security.checkOrigin: false`: + + ```diff + export default defineConfig({ + + security: { + + checkOrigin: false + + } + }) + ``` + +- [#11825](https://github.com/withastro/astro/pull/11825) [`560ef15`](https://github.com/withastro/astro/commit/560ef15ad23bd137b56ef1048eb2df548b99fdce) Thanks [@bluwy](https://github.com/bluwy)! - Updates internal Shiki rehype plugin to highlight code blocks as hast (using Shiki's `codeToHast()` API). This allows a more direct Markdown and MDX processing, and improves the performance when building the project, but may cause issues with existing Shiki transformers. + + If you are using Shiki transformers passed to `markdown.shikiConfig.transformers`, you must make sure they do not use the `postprocess` hook as it no longer runs on code blocks in `.md` and `.mdx` files. (See [the Shiki documentation on transformer hooks](https://shiki.style/guide/transformers#transformer-hooks) for more information). + + Code blocks in `.mdoc` files and `` component do not use the internal Shiki rehype plugin and are unaffected. + +- [#11826](https://github.com/withastro/astro/pull/11826) [`7315050`](https://github.com/withastro/astro/commit/7315050fc1192fa72ae92aef92b920f63b46118f) Thanks [@matthewp](https://github.com/matthewp)! - Deprecate Astro.glob + + The `Astro.glob` function has been deprecated in favor of Content Collections and `import.meta.glob`. + + - If you want to query for markdown and MDX in your project, use Content Collections. + - If you want to query source files in your project, use `import.meta.glob`(https://vitejs.dev/guide/features.html#glob-import). + + Also consider using glob packages from npm, like [fast-glob](https://www.npmjs.com/package/fast-glob), especially if statically generating your site, as it is faster for most use-cases. + + The easiest path is to migrate to `import.meta.glob` like so: + + ```diff + - const posts = Astro.glob('./posts/*.md'); + + const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true })); + ``` + +- [#12268](https://github.com/withastro/astro/pull/12268) [`4e9a3ac`](https://github.com/withastro/astro/commit/4e9a3ac0bd30b4013ac0b2caf068552258dfe6d9) Thanks [@ematipico](https://github.com/ematipico)! - The command `astro add vercel` now updates the configuration file differently, and adds `@astrojs/vercel` as module to import. + + This is a breaking change because it requires the version `8.*` of `@astrojs/vercel`. + +- [#11741](https://github.com/withastro/astro/pull/11741) [`6617491`](https://github.com/withastro/astro/commit/6617491c3bc2bde87f7867d7dec2580781852cfc) Thanks [@bluwy](https://github.com/bluwy)! - Removes internal JSX handling and moves the responsibility to the `@astrojs/mdx` package directly. The following exports are also now removed: + + - `astro/jsx/babel.js` + - `astro/jsx/component.js` + - `astro/jsx/index.js` + - `astro/jsx/renderer.js` + - `astro/jsx/server.js` + - `astro/jsx/transform-options.js` + + If your project includes `.mdx` files, you must upgrade `@astrojs/mdx` to the latest version so that it doesn't rely on these entrypoints to handle your JSX. + +- [#11782](https://github.com/withastro/astro/pull/11782) [`9a2aaa0`](https://github.com/withastro/astro/commit/9a2aaa01ea427df3844bce8595207809a8d2cb94) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Makes the `compiledContent` property of Markdown content an async function, this change should fix underlying issues where sometimes when using a custom image service and images inside Markdown, Node would exit suddenly without any error message. + + ```diff + --- + import * as myPost from "../post.md"; + + - const content = myPost.compiledContent(); + + const content = await myPost.compiledContent(); + --- + + + ``` + +- [#11819](https://github.com/withastro/astro/pull/11819) [`2bdde80`](https://github.com/withastro/astro/commit/2bdde80cd3107d875e2d77e6e9621001e0e8b38a) Thanks [@bluwy](https://github.com/bluwy)! - Updates the Astro config loading flow to ignore processing locally-linked dependencies with Vite (e.g. `npm link`, in a monorepo, etc). Instead, they will be normally imported by the Node.js runtime the same way as other dependencies from `node_modules`. + + Previously, Astro would process locally-linked dependencies which were able to use Vite features like TypeScript when imported by the Astro config file. + + However, this caused confusion as integration authors may test against a package that worked locally, but not when published. This method also restricts using CJS-only dependencies because Vite requires the code to be ESM. Therefore, Astro's behaviour is now changed to ignore processing any type of dependencies by Vite. + + In most cases, make sure your locally-linked dependencies are built to JS before running the Astro project, and the config loading should work as before. + +- [#11827](https://github.com/withastro/astro/pull/11827) [`a83e362`](https://github.com/withastro/astro/commit/a83e362ee41174501a433c210a24696784d7368f) Thanks [@matthewp](https://github.com/matthewp)! - Prevent usage of `astro:content` in the client + + Usage of `astro:content` in the client has always been discouraged because it leads to all of your content winding up in your client bundle, and can possibly leaks secrets. + + This formally makes doing so impossible, adding to the previous warning with errors. + + In the future Astro might add APIs for client-usage based on needs. + +- [#11979](https://github.com/withastro/astro/pull/11979) [`423dfc1`](https://github.com/withastro/astro/commit/423dfc19ad83661b71151f8cec40701c7ced557b) Thanks [@bluwy](https://github.com/bluwy)! - Bumps `vite` dependency to v6.0.0-beta.2. The version is pinned and will be updated as new Vite versions publish to prevent unhandled breaking changes. For the full list of Vite-specific changes, see [its changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md). + +- [#11859](https://github.com/withastro/astro/pull/11859) [`3804711`](https://github.com/withastro/astro/commit/38047119ff454e80cddd115bff53e33b32cd9930) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Changes the default `tsconfig.json` with better defaults, and makes `src/env.d.ts` optional + + Astro's default `tsconfig.json` in starter examples has been updated to include generated types and exclude your build output. This means that `src/env.d.ts` is only necessary if you have added custom type declarations or if you're not using a `tsconfig.json` file. + + Additionally, running `astro sync` no longer creates, nor updates, `src/env.d.ts` as it is not required for type-checking standard Astro projects. + + To update your project to Astro's recommended TypeScript settings, please add the following `include` and `exclude` properties to `tsconfig.json`: + + ```diff + { + "extends": "astro/tsconfigs/base", + + "include": [".astro/types.d.ts", "**/*"], + + "exclude": ["dist"] + } + ``` + +- [#11715](https://github.com/withastro/astro/pull/11715) [`d74617c`](https://github.com/withastro/astro/commit/d74617cbd3278feba05909ec83db2d73d57a153e) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Refactor the exported types from the `astro` module. There should normally be no breaking changes, but if you relied on some previously deprecated types, these might now have been fully removed. + + In most cases, updating your code to move away from previously deprecated APIs in previous versions of Astro should be enough to fix any issues. + +- [#12551](https://github.com/withastro/astro/pull/12551) [`abf9a89`](https://github.com/withastro/astro/commit/abf9a89ac1eaec9a8934a68aeebe3c502a3b47eb) Thanks [@ematipico](https://github.com/ematipico)! - Refactors legacy `content` and `data` collections to use the Content Layer API `glob()` loader for better performance and to support backwards compatibility. Also introduces the `legacy.collections` flag for projects that are unable to update to the new behavior immediately. + + :warning: **BREAKING CHANGE FOR LEGACY CONTENT COLLECTIONS** :warning: + + By default, collections that use the old types (`content` or `data`) and do not define a `loader` are now implemented under the hood using the Content Layer API's built-in `glob()` loader, with extra backward-compatibility handling. + + In order to achieve backwards compatibility with existing `content` collections, the following have been implemented: + + - a `glob` loader collection is defined, with patterns that match the previous handling (matches `src/content//**/*.md` and other content extensions depending on installed integrations, with underscore-prefixed files and folders ignored) + - When used in the runtime, the entries have an ID based on the filename in the same format as legacy collections + - A `slug` field is added with the same format as before + - A `render()` method is added to the entry, so they can be called using `entry.render()` + - `getEntryBySlug` is supported + + In order to achieve backwards compatibility with existing `data` collections, the following have been implemented: + + - a `glob` loader collection is defined, with patterns that match the previous handling (matches `src/content//**/*{.json,.yaml}` and other data extensions, with underscore-prefixed files and folders ignored) + - Entries have an ID that is not slugified + - `getDataEntryById` is supported + + While this backwards compatibility implementation is able to emulate most of the features of legacy collections, **there are some differences and limitations that may cause breaking changes to existing collections**: + + - In previous versions of Astro, collections would be generated for all folders in `src/content/`, even if they were not defined in `src/content/config.ts`. This behavior is now deprecated, and collections should always be defined in `src/content/config.ts`. For existing collections, these can just be empty declarations (e.g. `const blog = defineCollection({})`) and Astro will implicitly define your legacy collection for you in a way that is compatible with the new loading behavior. + - The special `layout` field is not supported in Markdown collection entries. This property is intended only for standalone page files located in `src/pages/` and not likely to be in your collection entries. However, if you were using this property, you must now create dynamic routes that include your page styling. + - Sort order of generated collections is non-deterministic and platform-dependent. This means that if you are calling `getCollection()`, the order in which entries are returned may be different than before. If you need a specific order, you should sort the collection entries yourself. + - `image().refine()` is not supported. If you need to validate the properties of an image you will need to do this at runtime in your page or component. + - the `key` argument of `getEntry(collection, key)` is typed as `string`, rather than having types for every entry. + + A new legacy configuration flag `legacy.collections` is added for users that want to keep their current legacy (content and data) collections behavior (available in Astro v2 - v4), or who are not yet ready to update their projects: + + ```js + // astro.config.mjs + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + legacy: { + collections: true, + }, + }); + ``` + + When set, no changes to your existing collections are necessary, and the restrictions on storing both new and old collections continue to exist: legacy collections (only) must continue to remain in `src/content/`, while new collections using a loader from the Content Layer API are forbidden in that folder. + +- [#11660](https://github.com/withastro/astro/pull/11660) [`e90f559`](https://github.com/withastro/astro/commit/e90f5593d23043579611452a84b9e18ad2407ef9) Thanks [@bluwy](https://github.com/bluwy)! - Fixes attribute rendering for non-[boolean HTML attributes](https://developer.mozilla.org/en-US/docs/Glossary/Boolean/HTML) with boolean values to match proper attribute handling in browsers. + + Previously, non-boolean attributes may not have included their values when rendered to HTML. In Astro v5.0, the values are now explicitly rendered as `="true"` or `="false"` + + In the following `.astro` examples, only `allowfullscreen` is a boolean attribute: + + ```astro + +

+

+ + +

+

+ + +

+

+ ``` + + Astro v5.0 now preserves the full data attribute with its value when rendering the HTML of non-boolean attributes: + + ```diff +

+

+ +

+ -

+ +

+ + -

+ +

+ -

+ +

+ ``` + + If you rely on attribute values, for example to locate elements or to conditionally render, update your code to match the new non-boolean attribute values: + + ```diff + - el.getAttribute('inherit') === '' + + el.getAttribute('inherit') === 'false' + + - el.hasAttribute('data-light') + + el.dataset.light === 'true' + ``` + +- [#11770](https://github.com/withastro/astro/pull/11770) [`cfa6a47`](https://github.com/withastro/astro/commit/cfa6a47ac7a541f99fdad46a68d0cca6e5816cd5) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Removed support for the Squoosh image service. As the underlying library `libsquoosh` is no longer maintained, and the image service sees very little usage we have decided to remove it from Astro. + + Our recommendation is to use the base Sharp image service, which is more powerful, faster, and more actively maintained. + + ```diff + - import { squooshImageService } from "astro/config"; + import { defineConfig } from "astro/config"; + + export default defineConfig({ + - image: { + - service: squooshImageService() + - } + }); + ``` + + If you are using this service, and cannot migrate to the base Sharp image service, a third-party extraction of the previous service is available here: https://github.com/Princesseuh/astro-image-service-squoosh + +- [#12231](https://github.com/withastro/astro/pull/12231) [`90ae100`](https://github.com/withastro/astro/commit/90ae100cf482529828febed591172433309bc12e) Thanks [@bluwy](https://github.com/bluwy)! - Updates the automatic `charset=utf-8` behavior for Markdown pages, where instead of responding with `charset=utf-8` in the `Content-Type` header, Astro will now automatically add the `` tag instead. + + This behaviour only applies to Markdown pages (`.md` or similar Markdown files located within `src/pages/`) that do not use Astro's special `layout` frontmatter property. It matches the rendering behaviour of other non-content pages, and retains the minimal boilerplate needed to write with non-ASCII characters when adding individual Markdown pages to your site. + + If your Markdown pages use the `layout` frontmatter property, then HTML encoding will be handled by the designated layout component instead, and the `` tag will not be added to your page by default. + + If you require `charset=utf-8` to render your page correctly, make sure that your layout components contain the `` tag. You may need to add this if you have not already done so. + +- [#11714](https://github.com/withastro/astro/pull/11714) [`8a53517`](https://github.com/withastro/astro/commit/8a5351737d6a14fc55f1dafad8f3b04079e81af6) Thanks [@matthewp](https://github.com/matthewp)! - Remove support for functionPerRoute + + This change removes support for the `functionPerRoute` option both in Astro and `@astrojs/vercel`. + + This option made it so that each route got built as separate entrypoints so that they could be loaded as separate functions. The hope was that by doing this it would decrease the size of each function. However in practice routes use most of the same code, and increases in function size limitations made the potential upsides less important. + + Additionally there are downsides to functionPerRoute, such as hitting limits on the number of functions per project. The feature also never worked with some Astro features like i18n domains and request rewriting. + + Given this, the feature has been removed from Astro. + +- [#11864](https://github.com/withastro/astro/pull/11864) [`ee38b3a`](https://github.com/withastro/astro/commit/ee38b3a94697fe883ce8300eff9f001470b8adb6) Thanks [@ematipico](https://github.com/ematipico)! - ### [changed]: `RouteData.distURL` is now an array + In Astro v4.x, `RouteData.distURL` was `undefined` or a `URL` + + Astro v5.0, `RouteData.distURL` is `undefined` or an array of `URL`. This was a bug, because a route can generate multiple files on disk, especially when using dynamic routes such as `[slug]` or `[...slug]`. + + #### What should I do? + + Update your code to handle `RouteData.distURL` as an array. + + ```diff + if (route.distURL) { + - if (route.distURL.endsWith('index.html')) { + - // do something + - } + + for (const url of route.distURL) { + + if (url.endsWith('index.html')) { + + // do something + + } + + } + } + ``` + +- [#11253](https://github.com/withastro/astro/pull/11253) [`4e5cc5a`](https://github.com/withastro/astro/commit/4e5cc5aadd7d864bc5194ee67dc2ea74dbe80473) Thanks [@kevinzunigacuellar](https://github.com/kevinzunigacuellar)! - Changes the data returned for `page.url.current`, `page.url.next`, `page.url.prev`, `page.url.first` and `page.url.last` to include the value set for `base` in your Astro config. + + Previously, you had to manually prepend your configured value for `base` to the URL path. Now, Astro automatically includes your `base` value in `next` and `prev` URLs. + + If you are using the `paginate()` function for "previous" and "next" URLs, remove any existing `base` value as it is now added for you: + + ```diff + --- + export async function getStaticPaths({ paginate }) { + const astronautPages = [{ + astronaut: 'Neil Armstrong', + }, { + astronaut: 'Buzz Aldrin', + }, { + astronaut: 'Sally Ride', + }, { + astronaut: 'John Glenn', + }]; + return paginate(astronautPages, { pageSize: 1 }); + } + const { page } = Astro.props; + // `base: /'docs'` configured in `astro.config.mjs` + - const prev = "/docs" + page.url.prev; + + const prev = page.url.prev; + --- + + ``` + +- [#12079](https://github.com/withastro/astro/pull/12079) [`7febf1f`](https://github.com/withastro/astro/commit/7febf1f6b58f2ed014df617bd7162c854cadd230) Thanks [@ematipico](https://github.com/ematipico)! - `params` passed in `getStaticPaths` are no longer automatically decoded. + + ### [changed]: `params` aren't decoded anymore. + + In Astro v4.x, `params` in were automatically decoded using `decodeURIComponent`. + + Astro v5.0 doesn't automatically decode `params` in `getStaticPaths` anymore, so you'll need to manually decode them yourself if needed + + #### What should I do? + + If you were relying on the automatic decode, you'll need to manually decode it using `decodeURI`. + + Note that the use of [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent)) is discouraged for `getStaticPaths` because it decodes more characters than it should, for example `/`, `?`, `#` and more. + + ```diff + --- + export function getStaticPaths() { + return [ + + { params: { id: decodeURI("%5Bpage%5D") } }, + - { params: { id: "%5Bpage%5D" } }, + ] + } + + const { id } = Astro.params; + --- + ``` + +### Minor Changes + +- [#11941](https://github.com/withastro/astro/pull/11941) [`b6a5f39`](https://github.com/withastro/astro/commit/b6a5f39846581d0e9cfd7ae6f056c8d1209f71bd) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adapters can now specify the build output type they're intended for using the `adapterFeatures.buildOutput` property. This property can be used to always generate a server output, even if the project doesn't have any server-rendered pages. + + ```ts + { + 'astro:config:done': ({ setAdapter, config }) => { + setAdapter({ + name: 'my-adapter', + adapterFeatures: { + buildOutput: 'server', + }, + }); + }, + } + ``` + + If your adapter specifies `buildOutput: 'static'`, and the user's project contains server-rendered pages, Astro will warn in development and error at build time. Note that a hybrid output, containing both static and server-rendered pages, is considered to be a `server` output, as a server is required to serve the server-rendered pages. + +- [#12067](https://github.com/withastro/astro/pull/12067) [`c48916c`](https://github.com/withastro/astro/commit/c48916cc4e6f7c31e3563d04b68a8698d8775b65) Thanks [@stramel](https://github.com/stramel)! - Adds experimental support for built-in SVG components. + + This feature allows you to import SVG files directly into your Astro project as components. By default, Astro will inline the SVG content into your HTML output. + + To enable this feature, set `experimental.svg` to `true` in your Astro config: + + ```js + { + experimental: { + svg: true, + }, + } + ``` + + To use this feature, import an SVG file in your Astro project, passing any common SVG attributes to the imported component. Astro also provides a `size` attribute to set equal `height` and `width` properties: + + ```astro + --- + import Logo from './path/to/svg/file.svg'; + --- + + + ``` + + For a complete overview, and to give feedback on this experimental API, see the [Feature RFC](https://github.com/withastro/roadmap/pull/1035). + +- [#12226](https://github.com/withastro/astro/pull/12226) [`51d13e2`](https://github.com/withastro/astro/commit/51d13e2f6ce3a9e03c33d80af6716847f6a78061) Thanks [@ematipico](https://github.com/ematipico)! - The following renderer fields and integration fields now accept `URL` as a type: + + **Renderers**: + + - `AstroRenderer.clientEntrpoint` + - `AstroRenderer.serverEntrypoint` + + **Integrations**: + + - `InjectedRoute.entrypoint` + - `AstroIntegrationMiddleware.entrypoint` + - `DevToolbarAppEntry.entrypoint` + +- [#12323](https://github.com/withastro/astro/pull/12323) [`c280655`](https://github.com/withastro/astro/commit/c280655655cc6c22121f32c5f7c76836adf17230) Thanks [@bluwy](https://github.com/bluwy)! - Updates to Vite 6.0.0-beta.6 + +- [#12539](https://github.com/withastro/astro/pull/12539) [`827093e`](https://github.com/withastro/astro/commit/827093e6175549771f9d93ddf3f2be4c2c60f0b7) Thanks [@bluwy](https://github.com/bluwy)! - Drops node 21 support + +- [#12243](https://github.com/withastro/astro/pull/12243) [`eb41d13`](https://github.com/withastro/astro/commit/eb41d13162c84e9495489403611bc875eb190fed) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Improves `defineConfig` type safety. TypeScript will now error if a group of related configuration options do not have consistent types. For example, you will now see an error if your language set for `i18n.defaultLocale` is not one of the supported locales specified in `i18n.locales`. + +- [#12329](https://github.com/withastro/astro/pull/12329) [`8309c61`](https://github.com/withastro/astro/commit/8309c61f0dfa5991d3f6c5c5fca4403794d6fda2) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `astro:routes:resolved` hook to the Integration API. Also update the `astro:build:done` hook by deprecating `routes` and adding a new `assets` map. + + When building an integration, you can now get access to routes inside the `astro:routes:resolved` hook: + + ```js + const integration = () => { + return { + name: 'my-integration', + hooks: { + 'astro:routes:resolved': ({ routes }) => { + console.log(routes); + }, + }, + }; + }; + ``` + + This hook runs before `astro:config:done`, and whenever a route changes in development. + + The `routes` array from `astro:build:done` is now deprecated, and exposed properties are now available on `astro:routes:resolved`, except for `distURL`. For this, you can use the newly exposed `assets` map: + + ```diff + const integration = () => { + + let routes + return { + name: 'my-integration', + hooks: { + + 'astro:routes:resolved': (params) => { + + routes = params.routes + + }, + 'astro:build:done': ({ + - routes + + assets + }) => { + + for (const route of routes) { + + const distURL = assets.get(route.pattern) + + if (distURL) { + + Object.assign(route, { distURL }) + + } + + } + console.log(routes) + } + } + } + } + ``` + +- [#11911](https://github.com/withastro/astro/pull/11911) [`c3dce83`](https://github.com/withastro/astro/commit/c3dce8363be22121a567df22df2ec566a3ebda17) Thanks [@ascorbic](https://github.com/ascorbic)! - The Content Layer API introduced behind a flag in [4.14.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#4140) is now stable and ready for use in Astro v5.0. + + The new Content Layer API builds upon content collections, taking them beyond local files in `src/content/` and allowing you to fetch content from anywhere, including remote APIs. These new collections work alongside your existing content collections, and you can migrate them to the new API at your own pace. There are significant improvements to performance with large collections of local files. For more details, see [the Content Layer RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0050-content-layer.md). + + If you previously used this feature, you can now remove the `experimental.contentLayer` flag from your Astro config: + + ```diff + // astro.config.mjs + import { defineConfig } from 'astro' + + export default defineConfig({ + - experimental: { + - contentLayer: true + - } + }) + ``` + + ### Loading your content + + The core of the new Content Layer API is the loader, a function that fetches content from a source and caches it in a local data store. Astro 4.14 ships with built-in `glob()` and `file()` loaders to handle your local Markdown, MDX, Markdoc, and JSON files: + + ```ts {3,7} + // src/content/config.ts + import { defineCollection, z } from 'astro:content'; + import { glob } from 'astro/loaders'; + + const blog = defineCollection({ + // The ID is a slug generated from the path of the file relative to `base` + loader: glob({ pattern: '**/*.md', base: './src/data/blog' }), + schema: z.object({ + title: z.string(), + description: z.string(), + publishDate: z.coerce.date(), + }), + }); + + export const collections = { blog }; + ``` + + You can then query using the existing content collections functions, and use a simplified `render()` function to display your content: + + ```astro + --- + import { getEntry, render } from 'astro:content'; + + const post = await getEntry('blog', Astro.params.slug); + + const { Content } = await render(entry); + --- + + + ``` + + ### Creating a loader + + You're not restricted to the built-in loaders – we hope you'll try building your own. You can fetch content from anywhere and return an array of entries: + + ```ts + // src/content/config.ts + const countries = defineCollection({ + loader: async () => { + const response = await fetch('https://restcountries.com/v3.1/all'); + const data = await response.json(); + // Must return an array of entries with an id property, + // or an object with IDs as keys and entries as values + return data.map((country) => ({ + id: country.cca3, + ...country, + })); + }, + // optionally add a schema to validate the data and make it type-safe for users + // schema: z.object... + }); + + export const collections = { countries }; + ``` + + For more advanced loading logic, you can define an object loader. This allows incremental updates and conditional loading, and gives full access to the data store. It also allows a loader to define its own schema, including generating it dynamically based on the source API. See the [the Content Layer API RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0050-content-layer.md#loaders) for more details. + + ### Sharing your loaders + + Loaders are better when they're shared. You can create a package that exports a loader and publish it to npm, and then anyone can use it on their site. We're excited to see what the community comes up with! To get started, [take a look at some examples](https://github.com/ascorbic/astro-loaders/). Here's how to load content using an RSS/Atom feed loader: + + ```ts + // src/content/config.ts + import { defineCollection } from 'astro:content'; + import { feedLoader } from '@ascorbic/feed-loader'; + + const podcasts = defineCollection({ + loader: feedLoader({ + url: 'https://feeds.99percentinvisible.org/99percentinvisible', + }), + }); + + export const collections = { podcasts }; + ``` + + To learn more, see [the Content Layer RFC](https://github.com/withastro/roadmap/blob/content-layer/proposals/0050-content-layer.md). + +- [#11980](https://github.com/withastro/astro/pull/11980) [`a604a0c`](https://github.com/withastro/astro/commit/a604a0ca9e0cdead01610b603d3b4c37ab010efc) Thanks [@matthewp](https://github.com/matthewp)! - ViewTransitions component renamed to ClientRouter + + The `` component has been renamed to ``. There are no other changes than the name. The old name will continue to work in Astro 5.x, but will be removed in 6.0. + + This change was done to clarify the role of the component within Astro's View Transitions support. Astro supports View Transitions APIs in a few different ways, and renaming the component makes it more clear that the features you get from the ClientRouter component are slightly different from what you get using the native CSS-based MPA router. + + We still intend to maintain the ClientRouter as before, and it's still important for use-cases that the native support doesn't cover, such as persisting state between pages. + +- [#11875](https://github.com/withastro/astro/pull/11875) [`a8a3d2c`](https://github.com/withastro/astro/commit/a8a3d2cde813d891dd9c63f07f91ce4e77d4f93b) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new property `isPrerendered` to the globals `Astro` and `APIContext` . This boolean value represents whether or not the current page is prerendered: + + ```astro + --- + // src/pages/index.astro + + export const prerender = true; + --- + ``` + + ```js + // src/middleware.js + + export const onRequest = (ctx, next) => { + console.log(ctx.isPrerendered); // it will log true + return next(); + }; + ``` + +- [#12047](https://github.com/withastro/astro/pull/12047) [`21b5e80`](https://github.com/withastro/astro/commit/21b5e806c5df37c6b01da63487568a6ed351ba7d) Thanks [@rgodha24](https://github.com/rgodha24)! - Adds a new optional `parser` property to the built-in `file()` loader for content collections to support additional file types such as `toml` and `csv`. + + The `file()` loader now accepts a second argument that defines a `parser` function. This allows you to specify a custom parser (e.g. `toml.parse` or `csv-parse`) to create a collection from a file's contents. The `file()` loader will automatically detect and parse JSON and YAML files (based on their file extension) with no need for a `parser`. + + This works with any type of custom file formats including `csv` and `toml`. The following example defines a content collection `dogs` using a `.toml` file. + + ```toml + [[dogs]] + id = "..." + age = "..." + + [[dogs]] + id = "..." + age = "..." + ``` + + After importing TOML's parser, you can load the `dogs` collection into your project by passing both a file path and `parser` to the `file()` loader. + + ```typescript + import { defineCollection } from "astro:content" + import { file } from "astro/loaders" + import { parse as parseToml } from "toml" + + const dogs = defineCollection({ + loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text).dogs }), + schema: /* ... */ + }) + + // it also works with CSVs! + import { parse as parseCsv } from "csv-parse/sync"; + + const cats = defineCollection({ + loader: file("src/data/cats.csv", { parser: (text) => parseCsv(text, { columns: true, skipEmptyLines: true })}) + }); + ``` + + The `parser` argument also allows you to load a single collection from a nested JSON document. For example, this JSON file contains multiple collections: + + ```json + { "dogs": [{}], "cats": [{}] } + ``` + + You can seperate these collections by passing a custom `parser` to the `file()` loader like so: + + ```typescript + const dogs = defineCollection({ + loader: file('src/data/pets.json', { parser: (text) => JSON.parse(text).dogs }), + }); + const cats = defineCollection({ + loader: file('src/data/pets.json', { parser: (text) => JSON.parse(text).cats }), + }); + ``` + + And it continues to work with maps of `id` to `data` + + ```yaml + bubbles: + breed: 'Goldfish' + age: 2 + finn: + breed: 'Betta' + age: 1 + ``` + + ```typescript + const fish = defineCollection({ + loader: file('src/data/fish.yaml'), + schema: z.object({ breed: z.string(), age: z.number() }), + }); + ``` + +- [#11698](https://github.com/withastro/astro/pull/11698) [`05139ef`](https://github.com/withastro/astro/commit/05139ef8b46de96539cc1d08148489eaf3cfd837) Thanks [@ematipico](https://github.com/ematipico)! - Adds a new property to the globals `Astro` and `APIContext` called `routePattern`. The `routePattern` represents the current route (component) + that is being rendered by Astro. It's usually a path pattern will look like this: `blog/[slug]`: + + ```astro + --- + // src/pages/blog/[slug].astro + const route = Astro.routePattern; + console.log(route); // it will log "blog/[slug]" + --- + ``` + + ```js + // src/pages/index.js + + export const GET = (ctx) => { + console.log(ctx.routePattern); // it will log src/pages/index.js + return new Response.json({ loreum: 'ipsum' }); + }; + ``` + +- [#11941](https://github.com/withastro/astro/pull/11941) [`b6a5f39`](https://github.com/withastro/astro/commit/b6a5f39846581d0e9cfd7ae6f056c8d1209f71bd) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a new `buildOutput` property to the `astro:config:done` hook returning the build output type. + + This can be used to know if the user's project will be built as a static site (HTML files), or a server-rendered site (whose exact output depends on the adapter). + +- [#12377](https://github.com/withastro/astro/pull/12377) [`af867f3`](https://github.com/withastro/astro/commit/af867f3910ecd8fc04a5337f591d84f03192e3fa) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds experimental support for automatic responsive images + + This feature is experimental and may change in future versions. To enable it, set `experimental.responsiveImages` to `true` in your `astro.config.mjs` file. + + ```js title=astro.config.mjs + { + experimental: { + responsiveImages: true, + }, + } + ``` + + When this flag is enabled, you can pass a `layout` prop to any `` or `` component to create a responsive image. When a layout is set, images have automatically generated `srcset` and `sizes` attributes based on the image's dimensions and the layout type. Images with `responsive` and `full-width` layouts will have styles applied to ensure they resize according to their container. + + ```astro + --- + import { Image, Picture } from 'astro:assets'; + import myImage from '../assets/my_image.png'; + --- + + A description of my image. + + ``` + + This `` component will generate the following HTML output: + + ```html title=Output + A description of my image + ``` + + #### Responsive image properties + + These are additional properties available to the `` and `` components when responsive images are enabled: + + - `layout`: The layout type for the image. Can be `responsive`, `fixed`, `full-width` or `none`. Defaults to value of `image.experimentalLayout`. + - `fit`: Defines how the image should be cropped if the aspect ratio is changed. Values match those of CSS `object-fit`. Defaults to `cover`, or the value of `image.experimentalObjectFit` if set. + - `position`: Defines the position of the image crop if the aspect ratio is changed. Values match those of CSS `object-position`. Defaults to `center`, or the value of `image.experimentalObjectPosition` if set. + - `priority`: If set, eagerly loads the image. Otherwise images will be lazy-loaded. Use this for your largest above-the-fold image. Defaults to `false`. + + #### Default responsive image settings + + You can enable responsive images for all `` and `` components by setting `image.experimentalLayout` with a default value. This can be overridden by the `layout` prop on each component. + + **Example:** + + ```js title=astro.config.mjs + { + image: { + // Used for all `` and `` components unless overridden + experimentalLayout: 'responsive', + }, + experimental: { + responsiveImages: true, + }, + } + ``` + + ```astro + --- + import { Image } from 'astro:assets'; + import myImage from '../assets/my_image.png'; + --- + + This will use responsive layout + + This will use full-width layout + + This will disable responsive images + ``` + + For a complete overview, and to give feedback on this experimental API, see the [Responsive Images RFC](https://github.com/withastro/roadmap/blob/responsive-images/proposals/0053-responsive-images.md). + +- [#12150](https://github.com/withastro/astro/pull/12150) [`93351bc`](https://github.com/withastro/astro/commit/93351bc78aed8f4ecff003268bad21c3b93c2f56) Thanks [@bluwy](https://github.com/bluwy)! - Adds support for passing values other than `"production"` or `"development"` to the `--mode` flag (e.g. `"staging"`, `"testing"`, or any custom value) to change the value of `import.meta.env.MODE` or the loaded `.env` file. This allows you take advantage of Vite's [mode](https://vite.dev/guide/env-and-mode#modes) feature. + + Also adds a new `--devOutput` flag for `astro build` that will output a development-based build. + + Note that changing the `mode` does not change the kind of code transform handled by Vite and Astro: + + - In `astro dev`, Astro will transform code with debug information. + - In `astro build`, Astro will transform code with the most optimized output and removes debug information. + - In `astro build --devOutput` (new flag), Astro will transform code with debug information like in `astro dev`. + + This enables various usecases like: + + ```bash + # Run the dev server connected to a "staging" API + astro dev --mode staging + + # Build a site that connects to a "staging" API + astro build --mode staging + + # Build a site that connects to a "production" API with additional debug information + astro build --devOutput + + # Build a site that connects to a "testing" API + astro build --mode testing + ``` + + The different modes can be used to load different `.env` files, e.g. `.env.staging` or `.env.production`, which can be customized for each environment, for example with different `API_URL` environment variable values. + +- [#12510](https://github.com/withastro/astro/pull/12510) [`14feaf3`](https://github.com/withastro/astro/commit/14feaf30e1a4266b8422865722a4478d39202404) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Changes the generated URL query param from `_astroAction` to `_action` when submitting a form using Actions. This avoids leaking the framework name into the URL bar, which may be considered a security issue. + +- [#11806](https://github.com/withastro/astro/pull/11806) [`f7f2338`](https://github.com/withastro/astro/commit/f7f2338c2b96975001b5c782f458710e9cc46d74) Thanks [@Princesseuh](https://github.com/Princesseuh)! - The value of the different properties on `supportedAstroFeatures` for adapters can now be objects, with a `support` and `message` properties. The content of the `message` property will be shown in the Astro CLI when the adapter is not compatible with the feature, allowing one to give a better informational message to the user. + + This is notably useful with the new `limited` value, to explain to the user why support is limited. + +- [#12071](https://github.com/withastro/astro/pull/12071) [`61d248e`](https://github.com/withastro/astro/commit/61d248e581a3bebf0ec67169813fc8ae4a2182df) Thanks [@Princesseuh](https://github.com/Princesseuh)! - `astro add` no longer automatically sets `output: 'server'`. Since the default value of output now allows for server-rendered pages, it no longer makes sense to default to full server builds when you add an adapter + +- [#11955](https://github.com/withastro/astro/pull/11955) [`d813262`](https://github.com/withastro/astro/commit/d8132626b05f150341c0628d6078fdd86b89aaed) Thanks [@matthewp](https://github.com/matthewp)! - [Server Islands](https://astro.build/blog/future-of-astro-server-islands/) introduced behind an experimental flag in [v4.12.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#4120) is no longer experimental and is available for general use. + + Server islands are Astro's solution for highly cacheable pages of mixed static and dynamic content. They allow you to specify components that should run on the server, allowing the rest of the page to be more aggressively cached, or even generated statically. + + Turn any `.astro` component into a server island by adding the `server:defer` directive and optionally, fallback placeholder content. It will be rendered dynamically at runtime outside the context of the rest of the page, allowing you to add longer cache headers for the pages, or even prerender them. + + ```astro + --- + import Avatar from '../components/Avatar.astro'; + import GenericUser from '../components/GenericUser.astro'; + --- + +
+

Page Title

+
+ + + +
+
+ ``` + + If you were previously using this feature, please remove the experimental flag from your Astro config: + + ```diff + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + experimental { + - serverIslands: true, + }, + }); + ``` + + If you have been waiting for stabilization before using server islands, you can now do so. + + Please see the [server island documentation](https://docs.astro.build/en/guides/server-islands/) for more about this feature. + +- [#12373](https://github.com/withastro/astro/pull/12373) [`d10f918`](https://github.com/withastro/astro/commit/d10f91815e63f169cff3d1daef5505aef077c76c) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Changes the default behavior for Astro Action form requests to a standard POST submission. + + In Astro 4.x, actions called from an HTML form would trigger a redirect with the result forwarded using cookies. This caused issues for large form errors and return values that exceeded the 4 KB limit of cookie-based storage. + + Astro 5.0 now renders the result of an action as a POST result without any forwarding. This will introduce a "confirm form resubmission?" dialog when a user attempts to refresh the page, though it no longer imposes a 4 KB limit on action return value. + + ## Customize form submission behavior + + If you prefer to address the "confirm form resubmission?" dialog on refresh, or to preserve action results across sessions, you can now [customize action result handling from middleware](https://5-0-0-beta.docs.astro.build/en/guides/actions/#advanced-persist-action-results-with-a-session). + + We recommend using a session storage provider [as described in our Netlify Blob example](https://5-0-0-beta.docs.astro.build/en/guides/actions/#advanced-persist-action-results-with-a-session). However, if you prefer the cookie forwarding behavior from 4.X and accept the 4 KB size limit, you can implement the pattern as shown in this sample snippet: + + ```ts + // src/middleware.ts + import { defineMiddleware } from 'astro:middleware'; + import { getActionContext } from 'astro:actions'; + + export const onRequest = defineMiddleware(async (context, next) => { + // Skip requests for prerendered pages + if (context.isPrerendered) return next(); + + const { action, setActionResult, serializeActionResult } = getActionContext(context); + + // If an action result was forwarded as a cookie, set the result + // to be accessible from `Astro.getActionResult()` + const payload = context.cookies.get('ACTION_PAYLOAD'); + if (payload) { + const { actionName, actionResult } = payload.json(); + setActionResult(actionName, actionResult); + context.cookies.delete('ACTION_PAYLOAD'); + return next(); + } + + // If an action was called from an HTML form action, + // call the action handler and redirect with the result as a cookie. + if (action?.calledFrom === 'form') { + const actionResult = await action.handler(); + + context.cookies.set('ACTION_PAYLOAD', { + actionName: action.name, + actionResult: serializeActionResult(actionResult), + }); + + if (actionResult.error) { + // Redirect back to the previous page on error + const referer = context.request.headers.get('Referer'); + if (!referer) { + throw new Error('Internal: Referer unexpectedly missing from Action POST request.'); + } + return context.redirect(referer); + } + // Redirect to the destination page on success + return context.redirect(context.originPathname); + } + + return next(); + }); + ``` + +- [#12475](https://github.com/withastro/astro/pull/12475) [`3f02d5f`](https://github.com/withastro/astro/commit/3f02d5f12b167514fff6eb9693b4e25c668e7a31) Thanks [@ascorbic](https://github.com/ascorbic)! - Changes the default content config location from `src/content/config.*` to `src/content.config.*`. + + The previous location is still supported, and is required if the `legacy.collections` flag is enabled. + +- [#11963](https://github.com/withastro/astro/pull/11963) [`0a1036e`](https://github.com/withastro/astro/commit/0a1036eef62f13c9609362874c5b88434d1e9300) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `createCodegenDir()` function to the `astro:config:setup` hook in the Integrations API + + In 4.14, we introduced the `injectTypes` utility on the `astro:config:done` hook. It can create `.d.ts` files and make their types available to user's projects automatically. Under the hood, it creates a file in `/.astro/integrations/`. + + While the `.astro` directory has always been the preferred place to write code generated files, it has also been prone to mistakes. For example, you can write a `.astro/types.d.ts` file, breaking Astro types. Or you can create a file that overrides a file created by another integration. + + In this release, `/.astro/integrations/` can now be retrieved in the `astro:config:setup` hook by calling `createCodegenDir()`. It allows you to have a dedicated folder, avoiding conflicts with another integration or Astro itself. This directory is created by calling this function so it's safe to write files to it directly: + + ```js + import { writeFileSync } from 'node:fs'; + + const integration = { + name: 'my-integration', + hooks: { + 'astro:config:setup': ({ createCodegenDir }) => { + const codegenDir = createCodegenDir(); + writeFileSync(new URL('cache.json', codegenDir), '{}', 'utf-8'); + }, + }, + }; + ``` + +- [#12379](https://github.com/withastro/astro/pull/12379) [`94f4fe8`](https://github.com/withastro/astro/commit/94f4fe8180f02cf19fb617dde7d67d4f7bee8dac) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a new components exported from `astro/components`: Welcome, to be used by the new Basics template + +- [#11806](https://github.com/withastro/astro/pull/11806) [`f7f2338`](https://github.com/withastro/astro/commit/f7f2338c2b96975001b5c782f458710e9cc46d74) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a new `limited` value for the different properties of `supportedAstroFeatures` for adapters, which indicates that the adapter is compatible with the feature, but with some limitations. This is useful for adapters that support a feature, but not in all cases or with all options. + +- [#11925](https://github.com/withastro/astro/pull/11925) [`74722cb`](https://github.com/withastro/astro/commit/74722cb81c46d4d29c8c5a2127f896da4d8d3235) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Updates `astro/config` import to reference `astro/client` types + + When importing `astro/config`, types from `astro/client` will be made automatically available to your project. If your project `tsconfig.json` changes how references behave, you'll still have access to these types after running `astro sync`. + +- [#12081](https://github.com/withastro/astro/pull/12081) [`8679954`](https://github.com/withastro/astro/commit/8679954bf647529e0f2134053866fc507e64c5e3) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the experimental `contentCollectionsCache` introduced in `3.5.0`. + + Astro Content Layer API independently solves some of the caching and performance issues with legacy content collections that this strategy attempted to address. This feature has been replaced with continued work on improvements to the content layer. If you were using this experimental feature, you must now remove the flag from your Astro config as it no longer exists: + + ```diff + export default defineConfig({ + experimental: { + - contentCollectionsCache: true + } + }) + ``` + + The `cacheManifest` boolean argument is no longer passed to the `astro:build:done` integration hook: + + ```diff + const integration = { + name: "my-integration", + hooks: { + "astro:build:done": ({ + - cacheManifest, + logger + }) => {} + } + } + ``` + +### Patch Changes + +- [#12565](https://github.com/withastro/astro/pull/12565) [`97f413f`](https://github.com/withastro/astro/commit/97f413f1189fd626dffac8b48b166684c7e77627) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug where content types were not generated when first running astro dev unless src/content exists + +- [#11987](https://github.com/withastro/astro/pull/11987) [`bf90a53`](https://github.com/withastro/astro/commit/bf90a5343f9cd1bb46f30e4b331e7ae675f5e720) Thanks [@florian-lefebvre](https://github.com/florian-lefebvre)! - `render()` signature now takes `renderOptions` as 2nd argument + + The signature for `app.render()` has changed, and the second argument is now an options object called `renderOptions` with more options for customizing rendering. + + The `renderOptions` are: + + - `addCookieHeader`: Determines whether Astro will set the `Set-Cookie` header, otherwise the adapter is expected to do so itself. + - `clientAddress`: The client IP address used to set `Astro.clientAddress`. + - `locals`: An object of locals that's set to `Astro.locals`. + - `routeData`: An object specifying the route to use. + +- [#12522](https://github.com/withastro/astro/pull/12522) [`33b0e30`](https://github.com/withastro/astro/commit/33b0e305fe4ecabc30ffa823454395c973f92454) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug where content config was ignored if it was outside of content dir and has a parent dir with an underscore + +- [#12424](https://github.com/withastro/astro/pull/12424) [`4364bff`](https://github.com/withastro/astro/commit/4364bff27332e52f92da72392620a36110daee42) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where an incorrect usage of Astro actions was lost when porting the fix from v4 to v5 + +- [#12438](https://github.com/withastro/astro/pull/12438) [`c8f877c`](https://github.com/withastro/astro/commit/c8f877cad2d8f1780f70045413872d5b9d32ebed) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes a bug where legacy content types were generated for content layer collections if they were in the content directory + +- [#12035](https://github.com/withastro/astro/pull/12035) [`325a57c`](https://github.com/withastro/astro/commit/325a57c543d88eab5e3ab32ee1bbfb534aed9c7c) Thanks [@ascorbic](https://github.com/ascorbic)! - Correctly parse values returned from inline loader + +- [#11960](https://github.com/withastro/astro/pull/11960) [`4410130`](https://github.com/withastro/astro/commit/4410130df722eae494caaa46b17c8eeb6223f160) Thanks [@ascorbic](https://github.com/ascorbic)! - Fixes an issue where the refresh context data was not passed correctly to content layer loaders + +- [#11878](https://github.com/withastro/astro/pull/11878) [`334948c`](https://github.com/withastro/astro/commit/334948ced29ed9ab03992f2174547bb9ee3a20c0) Thanks [@ascorbic](https://github.com/ascorbic)! - Adds a new function `refreshContent` to the `astro:server:setup` hook that allows integrations to refresh the content layer. This can be used, for example, to register a webhook endpoint during dev, or to open a socket to a CMS to listen for changes. + + By default, `refreshContent` will refresh all collections. You can optionally pass a `loaders` property, which is an array of loader names. If provided, only collections that use those loaders will be refreshed. For example, A CMS integration could use this property to only refresh its own collections. + + You can also pass a `context` object to the loaders. This can be used to pass arbitrary data, such as the webhook body, or an event from the websocket. + + ```ts + { + name: 'my-integration', + hooks: { + 'astro:server:setup': async ({ server, refreshContent }) => { + server.middlewares.use('/_refresh', async (req, res) => { + if(req.method !== 'POST') { + res.statusCode = 405 + res.end('Method Not Allowed'); + return + } + let body = ''; + req.on('data', chunk => { + body += chunk.toString(); + }); + req.on('end', async () => { + try { + const webhookBody = JSON.parse(body); + await refreshContent({ + context: { webhookBody }, + loaders: ['my-loader'] + }); + res.writeHead(200, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ message: 'Content refreshed successfully' })); + } catch (error) { + res.writeHead(500, { 'Content-Type': 'application/json' }); + res.end(JSON.stringify({ error: 'Failed to refresh content: ' + error.message })); + } + }); + }); + } + } + } + ``` + +- [#11991](https://github.com/withastro/astro/pull/11991) [`d7a396c`](https://github.com/withastro/astro/commit/d7a396ca3eedc1b32b4ea113cbacb4ccb08384c9) Thanks [@matthewp](https://github.com/matthewp)! - Update error link to on-demand rendering guide + +- [#12127](https://github.com/withastro/astro/pull/12127) [`55e9cd8`](https://github.com/withastro/astro/commit/55e9cd88551ac56ec4cab9a9f3fd9ba49b8934b9) Thanks [@ascorbic](https://github.com/ascorbic)! - Prevents Vite emitting an error when restarting itself + +- [#12516](https://github.com/withastro/astro/pull/12516) [`cb9322c`](https://github.com/withastro/astro/commit/cb9322c763b5cd8e43afe77d30e86a0b7d72f894) Thanks [@stramel](https://github.com/stramel)! - Handle multiple root nodes on SVG files + +- [#11974](https://github.com/withastro/astro/pull/11974) [`60211de`](https://github.com/withastro/astro/commit/60211defbfb2992ba17d1369e71c146d8928b09a) Thanks [@ascorbic](https://github.com/ascorbic)! - Exports the `RenderResult` type + +- [#12578](https://github.com/withastro/astro/pull/12578) [`07b9ca8`](https://github.com/withastro/astro/commit/07b9ca802eb4bbfc14c4e421f8a047fef3a7b439) Thanks [@WesSouza](https://github.com/WesSouza)! - Explicitly import index.ts to fix types when moduleResolution is NodeNext + +- [#11791](https://github.com/withastro/astro/pull/11791) [`9393243`](https://github.com/withastro/astro/commit/93932432e7239a1d31c68ea916945302286268e9) Thanks [@bluwy](https://github.com/bluwy)! - Updates Astro's default `