Update astro monorepo to v7 #25

Open
renovate wants to merge 1 commit from renovate/major-astro-monorepo into main
Owner

This PR contains the following updates:

Package Change Age Confidence
@astrojs/markdown-remark (source) ^6.3.2^7.0.0 age confidence
@astrojs/mdx (source) ^4.3.0^7.0.0 age confidence
astro (source) ^5.11.1^7.0.0 age confidence

Release Notes

withastro/astro (@​astrojs/markdown-remark)

v7.2.2

Compare Source

Patch Changes

v7.2.1

Compare Source

Patch Changes

v7.2.0

Compare Source

Minor Changes
  • #​16848 f732f3c Thanks @​Princesseuh! - Adds a new markdown.processor configuration option, allowing you to choose an alternative Markdown processor.

    Websites with many Markdown/MDX files tend to be slow to build because the unified ecosystem (e.g., remark, rehype) is slow to process. This feature introduces the ability to replace this part of the build pipeline with another processor.

    The default processor is unified(). This means that existing configurations remain unchanged and your remark/rehype plugins continue to work.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { unified } from '@astrojs/markdown-remark';
    import remarkToc from 'remark-toc';
    
    export default defineConfig({
      markdown: {
        processor: unified({
          remarkPlugins: [remarkToc],
        }),
      },
    });
    

    In addition to this new configuration option, Astro provides a new alternative processor based on Rust: Sätteri. You can choose to use it now by installing @astrojs/markdown-satteri, importing the satteri() processor, and adapting your existing configuration:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { satteri } from '@astrojs/markdown-satteri';
    
    export default defineConfig({
      markdown: {
        processor: satteri({
          features: { directive: true },
        }),
      },
    });
    

    This processor does not support the remark and rehype plugins. This means you may need to convert them to MDAST or HAST plugins to retain your current functionality.

    The existing top-level markdown.remarkPlugins, markdown.rehypePlugins, markdown.remarkRehype, markdown.gfm, and markdown.smartypants options still work, but are now deprecated and will be removed in a future major update. The matching remarkPlugins, rehypePlugins, and remarkRehype options on the MDX integration are also deprecated for the same reason. To anticipate their removal, move them onto unified({...}) (or your preferred plugin processor) :

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import remarkToc from 'remark-toc';
    import rehypeSlug from 'rehype-slug';
    + import { unified } from '@astrojs/markdown-remark';
    
    export default defineConfig({
      markdown: {
    +    processor: unified({
    +      remarkPlugins: [remarkToc],
    +      rehypePlugins: [rehypeSlug],
    +      remarkRehype: true,
    +      gfm: true,
    +      smartypants: true,
    +    }),
    -    remarkPlugins: [remarkToc],
    -    rehypePlugins: [rehypeSlug],
    -    remarkRehype: true,
    -    gfm: true,
    -    smartypants: true,
      },
    });
    

    For more information on enabling and using this feature in your project, see our Markdown guide. To give feedback on this new Rust processor, see the Native Markdown / MDX parsing and processing RFC.

Patch Changes

v7.1.2

Compare Source

Patch Changes

v7.1.1

Compare Source

Patch Changes

v7.1.0

Compare Source

Minor Changes
  • #​15340 10a1a5a Thanks @​trueberryless! - Updates createMarkdownProcessor to support advanced SmartyPants options.

    The smartypants property in AstroMarkdownOptions now accepts Smartypants options, allowing fine-grained control over typography transformations (backticks, dashes, ellipses, and quotes).

    import { createMarkdownProcessor } from '@astrojs/markdown-remark';
    
    const processor = await createMarkdownProcessor({
      smartypants: {
        backticks: 'all',
        dashes: 'oldschool',
        ellipses: 'unspaced',
        openingQuotes: { double: '«', single: '‹' },
        closingQuotes: { double: '»', single: '›' },
        quotes: false,
      },
    });
    

    For the up-to-date supported properties, check out the retext-smartypants options.

v7.0.1

Compare Source

Patch Changes

v7.0.0

Compare Source

Major Changes
Minor Changes
  • #​15277 cb99214 Thanks @​ematipico! - Fixes an issue where the function createShikiHighlighter would always create a new Shiki highlighter instance. Now the function returns a cached version of the highlighter based on the Shiki options. This should improve the performance for sites that heavily rely on Shiki and code in their pages.

  • #​15332 7c55f80 Thanks @​matthewp! - Exposes the fileURL option in MarkdownProcessorRenderOptions, allowing callers to specify the file URL for resolving relative image paths.

Patch Changes

v6.3.11

Compare Source

Patch Changes

v6.3.10

Compare Source

Patch Changes

v6.3.9

Compare Source

Patch Changes

v6.3.8

Compare Source

Patch Changes

v6.3.7

Compare Source

Patch Changes

v6.3.6

Compare Source

Patch Changes

v6.3.5

Compare Source

Patch Changes

v6.3.4

Compare Source

Patch Changes

v6.3.3

Compare Source

Patch Changes
  • #​13941 6bd5f75 Thanks @​aditsachde! - Adds support for TOML files to Astro's built-in glob() and file() content loaders.

    In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.

    Astro 5.12 now directly supports loading data from TOML files in content collections in both the glob() and the file() loaders.

    If you had added your own TOML content parser for the file() loader, you can now remove it as this functionality is now included:

    // src/content.config.ts
    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) }),
    + loader: file("src/data/dogs.toml")
      schema: /* ... */
    })
    

    Note that TOML does not support top-level arrays. Instead, the file() loader considers each top-level table to be an independent entry. The table header is populated in the id field of the entry object.

    See Astro's content collections guide for more information on using the built-in content loaders.

withastro/astro (@​astrojs/mdx)

v7.0.5

Compare Source

Patch Changes

v7.0.4

Compare Source

Patch Changes

v7.0.3

Compare Source

Patch Changes
  • #​17341 64b0d66 Thanks @​Princesseuh! - Fixes custom pre components not applying to syntax-highlighted code blocks when using the Sätteri Markdown processor with MDX.

v7.0.2

Compare Source

Patch Changes

v7.0.1

Compare Source

Patch Changes

v7.0.0

Compare Source

Major Changes
Minor Changes
  • #​17093 4585fe5 Thanks @​Princesseuh! - Replaces the import entrypoint of getContainerRenderer()

    A new container-renderer entrypoint exporting getContainerRenderer() has been added to the following integrations: React, Preact, Svelte, SolidJS, Vue, and MDX. This prevents bundlers from trying to bundle unrelated exports from the package root when only the Container API is used.

    If you are using the Container API, update your import statements to use the new entrypoint. The following example updates the getContainerRenderer() import for React:

    - import { getContainerRenderer } from '@astrojs/react';
    + import { getContainerRenderer } from '@astrojs/react/container-renderer';
    

    Importing getContainerRenderer() from the package root still works, but is now deprecated and logs a warning.

  • #​17129 ff7b718 Thanks @​Princesseuh! - Adds support for modifying frontmatter programmatically with the default Markdown processor.

    A Sätteri plugin can now read and mutate ctx.data.astro.frontmatter, and Astro uses the result as the page's frontmatter, in both Markdown and MDX.

Patch Changes

v6.0.3

Compare Source

Patch Changes
  • #​16969 4a31f90 Thanks @​Princesseuh! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting markdown.syntaxHighlight to 'prism' now highlights your code blocks with Prism.

    // astro.config.mjs
    import { satteri } from '@astrojs/markdown-satteri';
    
    export default defineConfig({
      markdown: {
        processor: satteri(),
        syntaxHighlight: 'prism',
      },
    });
    

v6.0.2

Patch Changes

v6.0.1

Patch Changes

v6.0.0

Compare Source

Patch Changes
  • #​16969 4a31f90 Thanks @​Princesseuh! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting markdown.syntaxHighlight to 'prism' now highlights your code blocks with Prism.

    // astro.config.mjs
    import { satteri } from '@astrojs/markdown-satteri';
    
    export default defineConfig({
      markdown: {
        processor: satteri(),
        syntaxHighlight: 'prism',
      },
    });
    
  • Updated dependencies [4a31f90]:

v5.0.6

Compare Source

Patch Changes

v5.0.5

Compare Source

Patch Changes

v5.0.4

Compare Source

Patch Changes

v5.0.3

Compare Source

Patch Changes

v5.0.2

Compare Source

Patch Changes

v5.0.1

Compare Source

Patch Changes

v5.0.0

Compare Source

Major Changes
Patch Changes

v4.3.14

Compare Source

Patch Changes

v4.3.13

Compare Source

Patch Changes

v4.3.12

Compare Source

Patch Changes

v4.3.11

Compare Source

Patch Changes

v4.3.10

Compare Source

Patch Changes
  • #​14715 3d55c5d Thanks @​ascorbic! - Adds support for client hydration in getContainerRenderer()

    The getContainerRenderer() function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually call container.addClientRenderer() with the appropriate client renderer entrypoint.

    See the container-with-vitest demo for a usage example, and the Container API documentation for more information on using framework components with the experimental Container API.

v4.3.9

Patch Changes

v4.3.8

Patch Changes
  • #​14591 3e887ec Thanks @​matthewp! - Adds TypeScript support for the components prop on MDX Content component when using await render(). Developers now get proper IntelliSense and type checking when passing custom components to override default MDX element rendering.

  • #​14598 7b45c65 Thanks @​delucis! - Reduces terminal text styling dependency size by switching from kleur to picocolors

v4.3.7

Compare Source

Patch Changes

v4.3.6

Compare Source

Patch Changes

v4.3.5

Compare Source

Patch Changes

v4.3.4

Compare Source

Patch Changes

v4.3.3

Compare Source

Patch Changes

v4.3.2

Compare Source

Patch Changes

v4.3.1

Compare Source

Patch Changes
withastro/astro (astro)

v7.2.2

Compare Source

Patch Changes
  • #​17611 9bc3207 Thanks @​thelazylamaGit! - Fixes component styles rendered from content entries remaining stale until a second save when an adapter uses Astro's fallback development environment

  • #​17634 2267eee Thanks @​astrobot-houston! - Fixes incremental builds dropping optimized images for cached pages when using a collectStaticImages prerenderer (e.g. @astrojs/cloudflare with compile-time image optimization)

  • #​17650 4cdf128 Thanks @​astrobot-houston! - Fixes intermittent ImageNotFound errors during build on projects with many images. The build now limits concurrent image file reads to avoid exhausting OS file descriptors (EMFILE) and retries transient I/O errors with backoff. Non-transient errors are no longer silently swallowed.

  • #​17683 2378221 Thanks @​astrobot-houston! - Fixes prerenderConflictBehavior not applying to content collection duplicate ID warnings in the glob() and file() loaders. Setting it to 'error' now throws during content sync, and 'ignore' suppresses the warning.

  • #​17659 90c6ea4 Thanks @​astrobot-houston! - Fixes the Fonts API breaking experimental.incrementalBuild caching by embedding a build-local, randomly-assigned server port in generated code used for the dependency hash

  • #​17630 fd1d9ee Thanks @​ericclemmons! - Fixes incremental builds becoming prohibitively slow for sites with many pages or content entries that share a large dependency graph.

  • #​17690 93beecc Thanks @​NgoQuocViet2001! - Prevents files in directories whose names start with pages from being treated as page routes

  • #​17671 09f0dc7 Thanks @​tarikermis! - Fixes astro dev refusing to start after a Docker container restart when an unrelated process reuses the PID from a persisted lock file. Astro now checks the process command across platforms, so stale lock files are cleaned up and --force does not signal the unrelated process.

v7.2.1

Compare Source

Patch Changes
  • #​17612 7133730 Thanks @​thelazylamaGit! - Fixes CSS hot module replacement after navigating between pages with ClientRouter

  • #​17628 4ada248 Thanks @​astrobot-houston! - Fixes a CSP violation when using both security.csp and experimental.clientPrerender with data-astro-prefetch links. The dynamically injected <script type="speculationrules"> now uses a static "source": "document" approach with a CSS selector, producing a deterministic payload that is hashed and included in the CSP script-src directive at build time.

  • #​17605 89e4647 Thanks @​ashleigh-yeoman! - Fixes middleware HMR not responding to changes in imported modules. Previously, only direct edits to the middleware file would trigger a reload.

  • #​17582 bd2c1a5 Thanks @​astrobot-houston! - Fixes a regression where content collection reference() fields silently accepted entry IDs that don't exist, such as an ID that doesn't match a loader's slugified version of it. Astro now logs an error for references that point to a missing entry after all loaders finish syncing.

  • #​17661 97b0cc7 Thanks @​ArmandPhilippot! - Improves Markdown options documentation with links to the Markdown guide and official processors.

  • #​17349 4328c73 Thanks @​astrobot-houston! - Fixes an issue where requests handled by the dev prerender environment (e.g. /_image with @astrojs/cloudflare's prerenderEnvironment: 'node') returned a 500 when a prerendered catch-all route existed, because non-prerendered route modules were imported in an environment where their runtime-specific APIs are unavailable

  • #​17603 722eed6 Thanks @​astrobot-houston! - Fixes <video> and <audio> elements being non-functional after navigating via view transitions (<ClientRouter />)

  • #​17616 3a890d2 Thanks @​lazerg! - Fixes experimental.incrementalBuild re-rendering unchanged routes that import more than one asset. The route's dependency hash depended on the order the assets finished building, so two builds of identical sources could produce different hashes. The hash is now based on the file name each asset resolves to.

  • #​17547 fba468c Thanks @​dmgawel! - Improves getCollection() and getEntry() performance for entries without local image references

  • #​17602 16e0d9d Thanks @​astrobot-houston! - Fixes a build error caused by hash collisions in generated content collection image import identifiers

v7.2.0

Compare Source

Minor Changes
  • #​17174 0224a3a Thanks @​matthewp! - Adds the astro preview --background flag to start preview servers as background processes.

    This makes preview servers easier to manage from scripts and AI coding agents because the command returns after the server is ready instead of keeping the terminal attached to the long-running process.

    astro preview --background
    

    When a preview server is running in the background, you can inspect or stop it with new astro preview subcommands:

    astro preview status
    astro preview logs
    astro preview logs --follow
    astro preview stop
    

    If Astro detects that astro preview is being run by an AI coding agent, background mode is enabled automatically. This matches the existing behavior for astro dev, allowing agents to continue working after the preview server starts while still receiving the server URL and process ID.

    To opt out of automatic background mode for preview servers, set ASTRO_PREVIEW_BACKGROUND=0 before running astro preview.

  • #​17532 7f94895 Thanks @​florian-lefebvre! - Adds support for paths relative to your project root in logger.entrypoint

    Previously, pointing logger.entrypoint at a custom log handler living in your own project required building an absolute URL. You can now write the path directly:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      logger: {
    -    entrypoint: new URL('./src/logger.js', import.meta.url),
    +    entrypoint: './src/logger.js',
      },
    });
    

    Paths starting with ./ or ../ are resolved against your project root. Package specifiers such as @org/astro-logger, absolute paths, and URL entrypoints keep working as before.

  • #​17084 961bbe5 Thanks @​matthewp! - Widens the AstroPrerenderer render() return type so prerenderers can report incremental-build metadata

    A prerenderer's render() may now resolve to either a Response (as before) or a PrerenderResult object that pairs the response with the content entries and optimized-image transforms the page resolved. This lets prerenderers that render out of process (for example, in an adapter's runtime like workerd) report those dependencies back to the build, so incremental static builds can track and replay them for skipped pages.

    import type { AstroPrerenderer, PrerenderResult } from 'astro';
    
    const prerenderer: AstroPrerenderer = {
      name: 'my-adapter:prerenderer',
      getStaticPaths,
      async render(request, { routeData }): Promise<PrerenderResult> {
        const { response, metadata } = await renderInRuntime(request, routeData);
        return { response, metadata };
      },
    };
    

    This is a non-breaking widening: prerenderers that return a bare Response continue to work unchanged, and in-process prerenderers can keep returning a Response since the build collects their metadata directly.

  • #​16871 90c98ae Thanks @​adamchal! - Adds session: false in astro.config to opt out of session support. Projects that do not set session: false see no behavior change.

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      session: false,
    });
    

    The session runtime and dependencies (unstorage) are now tree-shaken out of the SSR bundle for any project where no session driver is wired via:

    • session: false
    • no session config at all
    • a session config without a driver

    Useful for serverless/edge runtimes where cold-start parse time is sensitive.

  • #​17084 961bbe5 Thanks @​matthewp! - Adds experimental support for incremental static builds with experimental.incrementalBuild.

    When enabled, Astro can skip regenerating static pages from dynamic routes when both the page's module dependencies and its data cache key are unchanged from the previous build. This currently applies to pages returned from getStaticPaths() that include a cacheKey.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        incrementalBuild: true,
      },
    });
    

    Return a cacheKey for each generated page from getStaticPaths():

    ---
    export async function getStaticPaths() {
      const posts = await fetchPosts();
    
      return posts.map((post) => ({
        params: { slug: post.slug },
        props: { post },
        cacheKey: post.digest,
      }));
    }
    ---
    

    For incremental builds to skip rendering in CI, Astro's cache directory must be preserved between builds. Astro empties the output directory on each build and restores skipped pages from the cache directory, so only that directory needs to persist. For the default config, cache and restore node_modules/.astro/ before running astro build.

    See the experimental incremental static builds documentation for more information.

  • #​17084 961bbe5 Thanks @​matthewp! - Adds the optional digest property to content collection entries.

    Loaders can provide an opaque digest value that changes when an entry changes. This is now reflected in the CollectionEntry type returned by getCollection() and getEntry(), making it easier to detect content changes without re-hashing large entry bodies.

    ---
    import { getCollection } from 'astro:content';
    
    const posts = await getCollection('blog');
    
    for (const post of posts) {
      console.log(post.digest);
    }
    ---
    

    The property is optional because not every loader provides a digest. See incremental static builds for how digest can be used as a cacheKey.

Patch Changes
  • #​17534 5a5337e Thanks @​florian-lefebvre! - Improves logger.entrypoint reference docs

  • #​17529 d52a787 Thanks @​QVinto! - Fixes astro dev crashing with Invalid URL when --host is set to a specific non-loopback address

    Vite only reports a local URL for loopback hosts. When the dev server was started with --host <custom-address> bound to a specific non-loopback address (a LAN or Tailscale IP, for example), the URL was reported under network and local was empty, so writing the dev lock file threw Invalid URL and killed a server that had already started successfully.

    The lock file URL now falls back to the network URL, and a server that exposes no URL at all is left untracked rather than being taken down by lock file bookkeeping.

  • #​17566 296248c Thanks @​astrobot-houston! - Fixes fontProviders.googleicons() returning the full icon font (~3.9MB) instead of only the requested glyphs when multiple experimental.glyphs are specified

  • #​17560 ef45de1 Thanks @​astrobot-houston! - Fixes Astro.url.pathname for non-index pages when using build.format: 'preserve'. Previously, a page like src/pages/about-me.astro would output to dist/about-me.html but Astro.url.pathname would incorrectly return /about-me/ instead of /about-me.html.

  • #​17573 0089f83 Thanks @​astrobot-houston! - Fixes a Content Layer build crash that could occur when another dependency causes an older version of neotraverse to be hoisted to the project root

  • #​17571 116f700 Thanks @​astrobot-houston! - Fixes cookies set via Astro.cookies.set() inside a custom 404.astro or 500.astro error page being silently dropped from the final response

  • #​17579 3ea55ce Thanks @​bluwy! - Supports the devEngines field in package.json when detecting the package manager for install commands

  • #​17422 e4e2037 Thanks @​jiwonyoon-dev! - Fixes popover being rendered as popover="true"/popover="false" on custom elements (tag names containing a hyphen). Per the Popover API, the attribute only accepts "auto", "manual", or being absent, so boolean values are now always rendered as a bare popover attribute (or omitted), regardless of the tag name.

v7.1.6

Compare Source

Patch Changes
  • #​17536 ff97b86 Thanks @​dmgawel! - Fixes concurrent static builds failing to generate i18n rewrite fallbacks for dynamic routes

  • #​17383 296e1b0 Thanks @​thelazylamaGit! - Fixes stale dev CSS after editing component style blocks and CSS files in dev

  • #​17543 bbc1ec9 Thanks @​ematipico! - Adds a feature to experimental.collectionStorage that allows to change the size of chunks.

    For example, you can reduce the size of chunks to 1MB:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        collectionStorage: {
          type: 'chunked',
          chunkSize: 1024 * 1024,
        },
      },
    });
    
  • #​17545 5214663 Thanks @​ematipico! - Bumps the Astro compiler to the latest version. Changelog.

v7.1.5

Compare Source

Patch Changes

v7.1.4

Compare Source

Patch Changes
  • #​17488 d4f266d Thanks @​emerson-d-lopes! - Fixes duplicate CSS files being emitted in server output when a prerendered page and a server-rendered page share the same styles (e.g. a shared layout importing Tailwind). The prerender and SSR environments each emitted their own copy of the same stylesheet (index.X.css and _..Y.css); the SSR build now reuses the CSS asset filename from the prerender build when the stylesheet is backed by the same CSS source modules, so only a single file is emitted.

  • #​17472 4dc590c Thanks @​astrobot-houston! - Adds the missing background prop to the <Image /> and <Picture /> component types. The prop already worked at runtime, but was absent from the types, causing astro check to report that background does not exist on the component props

  • #​17292 0fc519d Thanks @​astrobot-houston! - Fixes missing scoped styles for child components inside client:only islands in production builds

  • #​17421 f1448de Thanks @​iamkaleemsajjad-hue! - Fixes session runtime errors being silently swallowed by console.error instead of routing through Astro's logger

  • #​17421 f1448de Thanks @​iamkaleemsajjad-hue! - Fixes a session being left in a partial state after a storage failure during session.regenerate(), preventing unnecessary storage reads on subsequent operations

  • #​17517 82bf7e2 Thanks @​Hashim1999164! - Prevents a visible terminal window from popping up on Windows when the dev server runs in background mode. The detached child process is now spawned with windowsHide: true, so console-subsystem grandchildren (such as workerd.exe) no longer get a new focus-stealing window allocated by Windows Terminal.

  • #​17510 eaa1fb0 Thanks @​astrobot-houston! - Fixes the glob() loader watcher so negation patterns like !docs/drafts/** correctly exclude files during development, matching the behavior of the initial scan. Previously, negations were treated as independent matchers, causing unrelated files (including .astro/data-store.json) to be ingested as collection entries

  • #​17511 704e570 Thanks @​astrobot-houston! - Fixes TypeScript path aliases from tsconfig.json not resolving in astro.config.ts

v7.1.3

Compare Source

Patch Changes
  • #​17427 630b382 Thanks @​astrobot-houston! - Fixes image optimization during astro build using too many parallel processes in CPU-limited containers. Builds now respect the container's CPU limit, reducing peak memory usage and avoiding out-of-memory crashes.

v7.1.2

Compare Source

Patch Changes
  • #​17445 a5f7230 Thanks @​ocavue! - Updates dependency cookie to v2. Cookie values made entirely of URL-safe characters are no longer percent-encoded in Set-Cookie headers; encoded values round-trip exactly as before.

  • #​17402 a89c137 Thanks @​farrosfr! - Fixes a bug where mutated Astro.locals during the request lifecycle are lost and not passed to custom error pages (404.astro/500.astro)

  • #​17405 91992ef Thanks @​Araluma! - Prevents an unhandled promise rejection from the prefetch fetch fallback. In WebKit (Safari), <link rel="prefetch"> is unsupported, so prefetch uses the fetch() fallback; on a flaky connection that fetch rejects with TypeError: Load failed, and because the promise was not awaited or caught, it surfaced as an unhandled rejection to the page's global error handlers. The best-effort prefetch now swallows the failure with .catch().

v7.1.1

Compare Source

Patch Changes

v7.1.0

Compare Source

Minor Changes
  • #​17302 5f4dc03 Thanks @​astrobot-houston! - Adds a new deferRender option to the glob() content loader

    When set to true, renderable entries (such as Markdown) are not rendered during content sync. Instead, rendering is deferred until the entry is actually rendered in a page, using the same on-demand path that .mdx files already use.

    This reduces memory usage during astro build for large collections whose rendered output is much larger than the source — for example, Markdown that uses heavy rehype plugins like rehype-katex. Such builds could previously run out of memory while storing the eagerly-rendered HTML for every entry.

    // src/content.config.ts
    import { defineCollection } from 'astro:content';
    import { glob } from 'astro/loaders';
    
    const docs = defineCollection({
      loader: glob({ pattern: '**/*.md', base: 'src/content/docs', deferRender: true }),
    });
    

    By default deferRender is false, preserving the existing behavior of rendering entries eagerly during sync so their rendered HTML can be cached across builds.

  • #​17296 30698a2 Thanks @​ematipico! - Adds a new experimental collectionStorage option for controlling how the content layer persists its data store

    By default, Astro serializes the entire content layer data store to a single file (.astro/data-store.json). For very large content collections, this file can grow large enough to hit platform file-size limits.

    Set experimental.collectionStorage: 'chunked' to instead split the data store across many smaller, content-addressed files inside a .astro/data-store/ directory, described by a manifest:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        collectionStorage: 'chunked',
      },
    });
    

    Because each part file is named by a hash of its contents, unchanged parts keep the same name across builds and are not rewritten, and identical parts are deduplicated. The default value is 'single-file', which preserves the current behavior.

  • #​17214 44c4989 Thanks @​ematipico! - Adds support for the more specific CSP directives script-src-elem, script-src-attr, style-src-elem, and style-src-attr through a new kind option.

    Previously, CSP was only scoped to generic script-src/style-src directives. Now each source or hash can be scoped to a narrower directive — for example, to allow inline style attributes (such as those from define:vars or Shiki) without loosening the policy for your <style> and <link> elements.

Scoping sources and hashes in your config

Each entry in resources and hashes can be an object with a kind property. Depending on whether you use scriptDirective or styleDirective, "element" targets script-src-elem or style-src-elem, "attribute" targets script-src-attr or style-src-attr, and "default" (the same as a bare string or hash) targets script-src or style-src.

// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  security: {
    csp: {
      scriptDirective: {
        resources: [{ resource: 'https://cdn.example.com', kind: 'element' }],
      },
      styleDirective: {
        resources: [{ resource: "'unsafe-inline'", kind: 'attribute' }],
      },
    },
  },
});
Scoping at runtime

The same kind option is available on the runtime CSP API, where the existing methods now also accept an object:

ctx.csp.insertScriptResource({ resource: 'https://cdn.example.com', kind: 'element' });
ctx.csp.insertStyleResource({ resource: "'unsafe-inline'", kind: 'attribute' });
  • #​17258 84814d4 Thanks @​astrobot-houston! - Adds a new format() option to the paginate utility. The format() option is a function that accepts the current URL of the page, and returns a new URL.

    For example, when your host only supports URLs using the .html extension, you can use format() to add it to the generated URLs:

    ---
    export async function getStaticPaths({ paginate }) {
      // Load your data with fetch(), getCollection(), etc.
      const response = await fetch(`https://pokeapi.co/api/v2/pokemon?limit=150`);
      const result = await response.json();
      const allPokemon = result.results;
    
      // Return a paginated collection of paths for all items
      return paginate(allPokemon, {
        pageSize: 10,
        format: (url) => `${url}.html`,
      });
    }
    
    const { page } = Astro.props;
    ---
    
  • #​17331 7db6420 Thanks @​matthewp! - Adds a --ignore-lock flag to astro dev for starting a dev server without checking or writing the lock file, so it can run alongside an already-running dev server for the same project.

    The new instance is not tracked by astro dev stop, astro dev status, or astro dev logs. --ignore-lock cannot be combined with --background (or an auto-detected AI agent environment, which runs dev servers in the background automatically) or --force, since those rely on the lock file.

    astro dev --ignore-lock
    
  • #​17389 16de021 Thanks @​florian-lefebvre! - Allows passing URL entrypoints when configuring the logger

    Matching other APIs like session drivers or font providers, the logger entrypoint can now be a URL:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      logger: {
        entrypoint: new URL('./logger.js', import.meta.url),
      },
    });
    
Patch Changes
  • #​17332 4407483 Thanks @​astrobot-houston! - Fixes the JSON logger crashing with process is not defined in non-Node runtimes like Cloudflare's workerd. The JSON logger now uses console.log/console.error instead of process.stdout/process.stderr, matching the pattern already used by the console logger.

  • #​17391 186a1e7 Thanks @​florian-lefebvre! - Fixes a case where an integration could not update the logger with updateConfig()

  • #​17394 d9f99e1 Thanks @​matthewp! - Fixes element-specific CSP directives to preserve the existing behavior of configured script and style resources

  • #​17374 b2d1b3e Thanks @​astrobot-houston! - Fixes dev server returning 404 for ?url imported assets when accessed via browser navigation

  • #​17390 ed71eaf Thanks @​florian-lefebvre! - Removes an unused and undocumented generic from the AstroLoggerDestination type

  • #​17393 092da56 Thanks @​matthewp! - Hardens generated transition styles, development metadata, and server island URLs when embedding dynamic values

v7.0.9

Compare Source

Patch Changes
  • #​17286 a249317 Thanks @​astrobot-houston! - Fixes the first browser visit after astro dev starts triggering an immediate full page reload

  • #​17369 a94d4a5 Thanks @​adamchal! - Fixes an issue where a client island could permanently fail to hydrate if the first attempt to load its component failed. Islands now reliably recover from transient import failures, which previously did not work for React components during astro dev.

v7.0.8

Compare Source

Patch Changes

v7.0.7

Compare Source

Patch Changes
  • #​17318 23a4120 Thanks @​astrobot-houston! - Fixes CSS module scoped-name hash mismatch in astro dev when using vite.css.transformer: 'lightningcss' with content collections. Previously, a component importing a CSS module and rendered via content collection render() would get different class name hashes in the element and the injected <style> tag, causing styles not to apply.

  • #​17323 4298883 Thanks @​ematipico! - Fixes a dev server memory leak which caused Node.js to emit warnings in the console.

  • #​17323 4298883 Thanks @​ematipico! - Fixes a dev server crash when a .html or /index.html suffixed request (such as those netlify dev probes as pretty-URL fallbacks) matched a dynamic endpoint route, causing a TypeError: Missing parameter error

  • #​17325 cebc404 Thanks @​astrobot-houston! - Fixes a bug where CSS @import rules could end up mid-stylesheet after inline CSS chunks were merged during build, causing browsers to silently ignore them

  • #​17323 4298883 Thanks @​ematipico! - Fixes a build regression that could leave unresolved preload markers in inlined scripts with external dynamic imports

  • Updated dependencies [4298883, 4298883]:

v7.0.6

Compare Source

Patch Changes
  • #​17261 79aa99c Thanks @​astrobot-houston! - Fixes a false deprecation warning for markdown.gfm and markdown.smartypants when using the Container API

  • #​17247 f94280d Thanks @​chatman-media! - Fixes route generation throwing "Missing parameter" (or silently dropping the segment) when a dynamic param's value is 0. The generator used truthy checks instead of checking for undefined, so paginate(posts, { params: { categoryId: 0 } }) would crash even though 0 is a perfectly valid param value.

  • #​17278 6f11739 Thanks @​astrobot-houston! - Fixes missing CSS for virtual style modules (e.g., responsive image layout styles) in dev mode when JavaScript is disabled

  • #​17250 0b30b35 Thanks @​matthewp! - Fixes the security.checkOrigin check so it is applied consistently to Astro Actions and on-demand endpoints, regardless of how the request pipeline is composed. Previously, the origin check could be skipped in the composable astro/hono pipeline depending on the order of the middleware() primitive (or when it was omitted).

  • #​17274 8c3579b Thanks @​astrobot-houston! - Fixes missing render() type overload for live collection entries. Previously, calling render() on a LiveDataEntry produced a TypeScript error when using only live.config.ts without a content.config.ts.

  • #​17257 4208297 Thanks @​astrobot-houston! - Fixes astro check failing to find @astrojs/check and typescript when astro is installed in a directory outside the project tree (e.g. pnpm virtual store)

  • #​17272 b428648 Thanks @​matthewp! - Fixes island component paths so that extensionless imports (e.g. import { Counter } from '../components/Counter') resolve to the real file on disk, matching Vite's extension order and directory index resolution. This makes the include/exclude options of JSX renderer integrations (React, Preact, Solid) match components imported without a file extension, and removes the spurious React 19 "Invalid hook call" warning logged on every request in dev when include was set alongside another JSX renderer

  • #​17279 2aeaa44 Thanks @​astrobot-houston! - Fixes a bug where <Picture inferSize> with a remote image could fail with FailedToFetchRemoteImageDimensions when the image server rate-limits requests (e.g. HTTP 429). Remote dimensions are now resolved once per render instead of once per output format.

  • #​17251 5240e26 Thanks @​matthewp! - Hardens the handling of attribute rendering when using with custom elements.

  • #​17248 429bd62 Thanks @​astrobot-houston! - Fixes a crash when using Astro's getViteConfig with Vitest browser mode (e.g., Storybook vitest runner). Astro now skips dev server setup inside Vitest, preventing errors.

  • #​17260 14524c0 Thanks @​matthewp! - Fixes a regression where a <script> inside a component rendered through Astro.slots.render() was hoisted out of its original position instead of staying next to its component content

  • Updated dependencies [eb6f97e]:

v7.0.5

Compare Source

Patch Changes
  • #​17242 9c05ba4 Thanks @​matthewp! - Fixes an error that could occur after the dev server restarts when using an adapter such as @astrojs/cloudflare, where a request would fail with a 500 referencing a missing pre-bundled dependency:

    The file does not exist at "node_modules/.vite/deps_ssr/astro_compiler-runtime.js?v=6419660d" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`.
    
  • #​17202 c6d254d Thanks @​matthewp! - Refactors path alias resolution to use Vite's native tsconfigPaths option

    This is an internal change with no expected impact on user projects. Astro now defers tsconfig and jsconfig paths alias resolution to Vite, keeping a small fallback for a few CSS cases Vite does not yet handle.

  • #​17123 72e29bd Thanks @​martrapp! - Fixes an issue where the ClientRouter wipes head elements after page transitions if the <head> contains a server:defer component.

  • #​17232 257505e Thanks @​matthewp! - Fixes a bug where <style> tags from components such as a content collection's Content could be silently dropped from the output when an await appeared before the component in an .astro file's markup.

  • #​17193 a7352fd Thanks @​jan-kubica! - Fixes the background dev server failing to start when astro is hoisted outside the project's node_modules (for example bun workspaces). The background process is now spawned from Astro's own resolved location instead of a path assumed under the project root.

  • #​17255 581d171 Thanks @​astrobot-houston! - Fixes prefetch not working for links inside server:defer components

v7.0.4

Compare Source

Patch Changes
  • #​17212 7ba0bb1 Thanks @​matthewp! - Ensures transition directive values are HTML-escaped when rendered on hydrated islands

  • #​17224 dc5e52f Thanks @​astrobot-houston! - Fixes trailing slash handling for dynamic file endpoints in dev mode. Dynamic file endpoints (e.g., src/pages/api/[name].json.ts) with trailingSlash: "always" incorrectly required a trailing slash in dev mode, returning 404 for /api/bar.json and 200 for /api/bar.json/.

  • #​17067 23f9446 Thanks @​fkatsuhiro! - Fixed a bug where the development toolbar did not output a warning even though the implicit ARIA role and the manually specified role were duplicated.

  • #​17234 d5fbee8 Thanks @​ocavue! - Adds support for sharp v0.35. pnpm users no longer need to approve sharp's build script (see allowBuilds) when on v0.35.

  • #​17223 5970ef4 Thanks @​astrobot-houston! - Fixes getCollection() returning empty in dev mode for large content collections (500k+ entries)

  • #​17184 799e5cd Thanks @​Princesseuh! - Upgrades the Rust compiler to the latest, which fixes some bugs. Refer to its changelog for more information.

  • #​17208 da8b573 Thanks @​matthewp! - Hardens forwarded header handling so the internal request helper validates X-Forwarded-Host against security.allowedDomains before trusting X-Forwarded-For for clientAddress. Previously it only checked that the header was present, which was inconsistent with the public createRequest helper. This aligns both code paths; behavior is unchanged for correctly configured proxies.

v7.0.3

Compare Source

Patch Changes
  • #​17189 24d2c9e Thanks @​astrobot-houston! - Fixes a bug where an error thrown inside one route's getStaticPaths() would prevent other valid routes from being matched in dev mode

  • #​16932 8f4a3db Thanks @​fkatsuhiro! - Fixes HMR for action files during development. Editing files in src/actions/ now takes effect on the next request without requiring a dev server restart.

  • #​17087 fb0ab02 Thanks @​jp-knj! - Fixes localized custom error pages in i18n projects so routes like /pt/404 are used for missing localized pages and return the correct status code

v7.0.2

Compare Source

Patch Changes

v7.0.1

Compare Source

Patch Changes
  • #​17151 ccceda3 Thanks @​matthewp! - Fixes astro dev incorrectly starting in background mode for Warp terminal users. Hybrid environments like Warp are no longer treated as AI agents for auto-background detection.

  • #​17158 164df87 Thanks @​ematipico! - Fixes astro dev --background --host not listing the network addresses. The background server start output and astro dev status now show every exposed network URL, matching the foreground dev server.

  • #​17141 d785b9d Thanks @​astrobot-houston! - Fixes responsive image CSS overriding user styles defined inside CSS @layer blocks. The generated image styles are now wrapped in @layer astro.images, ensuring they have lower cascade priority than user-defined layers.

  • #​17150 1a61386 Thanks @​matthewp! - Fixes astro dev --background failing on Windows with "Failed to spawn background dev server process"

v7.0.0

Compare Source

Major Changes
  • #​15819 cafec4e Thanks @​delucis! - Upgrade to Vite v8

  • #​16965 57ead0d Thanks @​Princesseuh! - Makes 'jsx' the default value for compressHTML

    Astro now strips whitespace from your HTML using JSX rules by default, the same way frameworks like React do. Whitespace and line breaks around elements are removed, but meaningful whitespace within a single line — like a space between two inline elements — is preserved. To keep a space that would otherwise be removed, write it explicitly in your source, for example with {" "}.

    This can change rendered output where whitespace between inline elements was previously meaningful. To keep Astro's earlier behavior, set compressHTML: true for HTML-aware compression, or compressHTML: false to preserve all whitespace.

  • #​16610 c63e7e4 Thanks @​matthewp! - Adds background dev server management for AI coding agents.

    When an AI coding agent is detected, astro dev now automatically starts the dev server as a detached background process. This prevents the dev server from blocking the agent's terminal and allows it to continue working while the server runs.

    A lock file (.astro/dev.json) is written when the dev server starts, recording the server's URL, port, and PID. This prevents duplicate servers from being started for the same project.

New flag and subcommands
  • astro dev --background — Start the dev server as a background process (this is what runs automatically when an agent is detected).
  • astro dev stop — Stop a running background dev server.
  • astro dev status — Check if a dev server is running and display its URL, PID, and uptime.
  • astro dev logs — View logs from a background dev server. Use --follow (-f) to stream new output as it's written.

These allow you to start and manage dev servers programmatically and were designed with AI coding agents in mind.

What should I do?

No action is required. If you are not using an AI coding agent, astro dev behaves exactly as before. If you are using an agent, background mode is enabled automatically — the agent will receive the server URL and PID, and can use astro dev stop to shut it down.

To opt out of automatic background mode when an agent is detected, set the environment variable ASTRO_DEV_BACKGROUND=0 before running astro dev.

  • #​17010 0606073 Thanks @​ocavue! - Removes the @astrojs/db package as it is no longer maintained.

    The @astrojs/db package were deprecated in v6.4.5 and is now removed. This means the astro db, astro login, astro logout, astro link, and astro init CLI commands have also been removed.

    If you were using Astro DB in your project, remove @astrojs/db from your project's dependencies and replace it with one of the following alternatives:

    • Node.js built-in SQLite: Node.js now includes a built-in node:sqlite module (available since Node.js v22.5.0). This is a good option if you are using the Node.js adapter and were using @astrojs/db for local SQLite storage.
    • Drizzle ORM: If you were using @astrojs/db for its Drizzle-based schema and query API, you can use Drizzle directly with any supported database.
    • Other database libraries: Use any database library that suits your deployment platform (e.g. Turso, PlanetScale, Neon).
  • #​16462 c30a778 Thanks @​Princesseuh! - Replaces the Go compiler with a Rust-based version.

    The Rust-based Astro compiler (@astrojs/compiler-rs) is now the default compiler. This new compiler is faster and more reliable, leading to faster build times and iteration cycles during development.

    This new compiler is more strict regarding invalid syntax. For example, unclosed HTML tags will now throw an error instead of being ignored. It also does not attempt to correct semantically invalid HTML anymore, instead leaving it to the browser to handle, similar to other tools or document.write() in JavaScript.

    The previous Go-based compiler has been removed, along with the experimental.rustCompiler flag used to opt into the Rust compiler. If you were setting experimental.rustCompiler in your astro.config.mjs, you can now remove it. No other action is required.

  • #​16966 6650ec2 Thanks @​Princesseuh! - Makes Sätteri the default Markdown processor

    Astro now renders .md files with satteri() from @astrojs/markdown-satteri, its native Markdown pipeline, instead of the remark/rehype pipeline. @astrojs/markdown-remark is no longer installed by default.

    To keep using the remark/rehype pipeline, install @astrojs/markdown-remark and set it as your processor:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { unified } from '@astrojs/markdown-remark';
    
    export default defineConfig({
      markdown: {
        processor: unified(),
      },
    });
    

    The deprecated markdown.remarkPlugins, markdown.rehypePlugins, and markdown.remarkRehype options still work, but now require @astrojs/markdown-remark to be used.

  • #​16877 3b7d76e Thanks @​matthewp! - Enables advanced routing by default.

    The advanced routing feature introduced behind a flag in v6.3.0 is no longer experimental and is now enabled by default.

    This gives full control over how requests flow through your application, with first-class support for frameworks like Hono.

    Advanced routing now uses src/fetch.ts as default entrypoint instead of src/app.ts.

    If you were previously using this feature without a custom entrypoint, please configure fetchFile or rename your entrypoint to src/fetch.ts, and then remove the experimental flag from your Astro config:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental {
    -    advancedRouting: true,
      },
    +  fetchFile: 'app.ts' // optional, you only need this if you cannot rename your entrypoint.
    });
    

    fetchFile is now a top-level config option instead of being nested under experimental.advancedRouting. If you were using a custom entrypoint, please update your Astro config to move its configuration:

    // astro.config.mjs
    export default defineConfig({
    -  experimental: {
    -    advancedRouting: {
    -      fetchFile: 'my-custom-entrypoint.ts',
    -    },
    -  },
    +  fetchFile: 'my-custom-entrypoint.ts',
    })
    

    You can also set fetchFile: null to disable the entrypoint if you are using src/fetch.ts for another purpose, or don’t need advanced routing features.

    If you have been waiting for stabilization before using advanced routing, you can now do so.

    Please see the advanced routing guide in docs for more about this feature.

  • #​16725 10229f7 Thanks @​ArmandPhilippot! - Removes deprecated APIs exported from astro:transitions.

    In Astro 6.x, some helpers available in astro:transitions and astro:transitions/client were deprecated.

    In Astro 7.0, the following APIs can no longer be used in your project:

    • TRANSITION_BEFORE_PREPARATION
    • TRANSITION_AFTER_PREPARATION
    • TRANSITION_BEFORE_SWAP
    • TRANSITION_AFTER_SWAP
    • TRANSITION_PAGE_LOAD
    • isTransitionBeforePreparationEvent()
    • isTransitionBeforeSwapEvent()
    • createAnimationScope()
What should I do?

Remove any occurrence of createAnimationScope():

-import { createAnimationScope } from 'astro:transitions';

Replace any occurrence of the other APIs using the lifecycle event names directly:

-import {
-	TRANSITION_AFTER_SWAP,
-	isTransitionBeforePreparationEvent,
-} from 'astro:transitions/client';

-console.log(isTransitionBeforePreparationEvent(event));
+console.log(event.type === 'astro:before-preparation');

-console.log(TRANSITION_AFTER_SWAP);
+console.log('astro:after-swap');

Learn more about all utilities available in the View Transitions Router API Reference.

Minor Changes
  • #​16998 57dcc31 Thanks @​matthewp! - Exposes getFetchState() from astro/hono as a public API

    The getFetchState() function retrieves or lazily creates a FetchState from a Hono context object. This allows third-party packages to build Hono middleware that interacts with Astro's per-request state, giving the astro/hono API the same extensibility as astro/fetch.

    import { Hono } from 'hono';
    import { getFetchState, pages } from 'astro/hono';
    
    const app = new Hono();
    
    app.use(async (context, next) => {
      const state = getFetchState(context);
      state.locals.message = 'Hello from custom middleware';
      await next();
    });
    
    app.use(pages());
    
    export default app;
    
  • #​16996 300641e Thanks @​florian-lefebvre! - Adds a subset field to the FontData type exposed via fontData from astro:assets. When using multiple font subsets (e.g., subsets: ["latin", "korean"]), each font data entry now includes the subset name, making it possible to distinguish between font entries for different subsets that share the same weight and style.

  • #​16745 f864a80 Thanks @​ematipico! - The custom logger feature introduced behind a flag in v6.2.0 is no longer experimental and is available for general use.

    This feature provides better control over Astro's logging infrastructure by allowing you to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for on-demand rendering when connecting to log aggregation services such as Kibana, Logstash, CloudWatch, Grafana, or Loki.

    Astro provides three built-in log handlers (json, node, and console), and you can also create your own.

JSON logging
import { defineConfig, logHandlers } from 'astro/config';

export default defineConfig({
  logger: logHandlers.json({
    pretty: true,
    level: 'warn',
  }),
});
Custom logger
import { defineConfig } from 'astro/config';

export default defineConfig({
  logger: {
    entrypoint: '@org/custom-logger',
  },
});

Additionally, context.logger is now always available in API routes and middleware, even without a custom logger configured.

If you were previously using this feature, please remove the experimental flag from your Astro config:

import { defineConfig } from 'astro/config';

export default defineConfig({
-  experimental: {
-    logger: {
-      entrypoint: '@org/custom-logger',
-    },
-  },
+  logger: {
+    entrypoint: '@org/custom-logger',
+  },
});

If you have been waiting for stabilization before using custom loggers, you can now do so.

Please see the Logger docs for more about this feature.

  • #​16981 0d6d644 Thanks @​ematipico! - Removes the setting experimental.queuedRendering. The new rendering engine is now stable and replaces the old one.

    As part of the stabilization, the queued rendering has been improved, and some features have been removed:

    • The construction of the queue has been removed, instead now Astro uses a streaming approach where components are rendered and flushed as they are encountered.
    • The node polling feature has been removed because it doesn't yield concrete savings.
    • The content cache has been descoped, and how only tag names are cached.
      If you were previously using this experimental feature, you must remove this experimental flag from your configuration as it no longer exists:
    // astro.config.mjs
    import { defineConfig } from "astro/config";
    
    export default defineConfig({
      experimental: {
    -    queuedRendering: {}
      }
    });
    
  • #​17116 f95e58e Thanks @​ascorbic! - Stabilizes route caching, removing the experimental.cache and experimental.routeRules flags and replacing them with the top-level cache and routeRules configuration options.

    Route caching, introduced experimentally in v6.0.0, is now stable. It gives you a platform-agnostic way to cache responses from on-demand rendered pages and endpoints, based on standard HTTP caching semantics.

    Update your config to move cache and routeRules out of the experimental block:

    // astro.config.mjs
    import { defineConfig, memoryCache } from 'astro/config';
    
    export default defineConfig({
    -  experimental: {
    -    cache: {
    -      provider: memoryCache(),
    -    },
    -    routeRules: {
    -      '/blog/[...path]': { maxAge: 300, swr: 60 },
    -    },
    -  },
    +  cache: {
    +    provider: memoryCache(),
    +  },
    +  routeRules: {
    +    '/blog/[...path]': { maxAge: 300, swr: 60 },
    +  },
    });
    

    Set caching directives in your routes with Astro.cache (in .astro pages) or context.cache (in API routes and middleware), and Astro translates them into the appropriate headers or runtime behavior depending on your configured cache provider. You can also define cache rules for routes declaratively in your config using routeRules, without modifying route code.

    See the route caching guide for more information.

Patch Changes
  • #​16980 1f07343 Thanks @​matthewp! - Removes state.provide(), state.resolve(), state.finalizeAll(), and App.Providers from the public advanced routing API. These context provider extension points are now internal-only. If you were using them in an integration, use locals to share per-request state instead.

  • #​17111 c0f33ed Thanks @​ematipico! - Harden the limits on the number of decoding on the URL.

  • #​16982 1e000e2 Thanks @​matthewp! - Improves the warning when accessing Astro.session without session storage configured. The session property is now always defined on the context object, and accessing it without configuration logs a helpful message instead of silently returning undefined.

  • #​16335 9a53f77 Thanks @​ascorbic! - Adds shared helper utilities for CDN cache provider authors for route caching

    Exports astro/cache/provider-utils with helpers for building platform-specific cache-control headers, generating path-based invalidation tags, and normalizing invalidation options. These are used internally by the first-party Netlify, Vercel, and Cloudflare cache providers.

  • #​17095 e84ebc0 Thanks @​matthewp! - Improves build performance by removing an unfiltered transform hook from the astro:head-metadata-build plugin. Head propagation modules are now identified by their module ID (?astroPropagatedAssets) instead of scanning every module's source code.

  • #​17041 4c4a91c Thanks @​iseraph-dev! - Fixes a bug where the advanced routing astro/hono / astro/fetch pages() handler returned the host framework's default Internal Server Error response instead of rendering the custom 500.astro page when a page threw during render. Unmatched requests with a prerendered (or absent) custom 404 page now render the 404 error page instead of failing the same way.

  • #​17097 5e340d7 Thanks @​iseraph-dev! - Fixes a bug where the advanced routing astro/hono / astro/fetch middleware() handler returned the host framework's default Internal Server Error response instead of rendering the custom 500.astro page when middleware threw. Unmatched requests with a prerendered (or absent) custom 404 page now render the 404 error page instead of failing the same way. Errors surfaced through next (the host framework's downstream chain) still propagate to the host's own error handler.

  • #​15819 cafec4e Thanks @​delucis! - Fixes --port flag being ignored after a Vite-triggered server restart (e.g. when a .env file changes)

  • #​17104 b074a37 Thanks @​iseraph-dev! - Fixes the custom 500.astro page receiving an empty error prop when the error originated in middleware.

  • #​17078 04547ec Thanks @​astrobot-houston! - Fixes a spurious Astro.request.headers warning on prerendered pages when security.allowedDomains is configured. The internal allowedDomains header validation now skips prerendered routes, since they use synthetic requests with no real headers.

  • #​16603 deaaf3f Thanks @​alexanderniebuhr! - Removes the warning that Astro does not support vite v8, since Astro v7 does support vite v8

  • #​16335 9a53f77 Thanks @​ascorbic! - Passes the Request object to CacheProvider.setHeaders() for route caching

    Cache providers now receive the incoming Request as a second argument to setHeaders(options, request). This allows CDN providers to read the request URL, headers, and other properties when generating cache response headers, for example to auto-tag responses with their pathname for path-based invalidation.

  • #​17098 637a1b6 Thanks @​matthewp! - Fixes internal Astro headers leaking from direct pages() handler responses

  • #​17090 3cf76c0 Thanks @​matthewp! - Fixes Vite and Rolldown build warnings

  • #​16434 ee079d4 Thanks @​ematipico! - Fixes an issue where i18n domains would return 404 when trailingSlash is set to never.

  • Updated dependencies [7e7ab87, ff7b718, 241250b]:

v6.4.8

Compare Source

Patch Changes

v6.4.7

Compare Source

Patch Changes
  • #​17035 197e50e Thanks @​astrobot-houston! - Fixes getRelativeLocaleUrl, getAbsoluteLocaleUrl, and getAbsoluteLocaleUrlList to strip trailing slashes when trailingSlash: 'never' is configured

  • #​16967 3719765 Thanks @​astrobot-houston! - Fixes double URL-encoded paths returning 400 Bad Request on on-demand routes

    Previously, any URL containing a double-encoded character (like %255B, which is [ encoded twice) was unconditionally rejected with a 400 Bad Request before middleware or route handlers could run. This broke embedded tools like Sanity Studio whose client-side router legitimately produces double-encoded URLs.

    The fix replaces the rejection approach with iterative decoding — multi-level percent-encoding is now fully resolved to its canonical form before being passed to middleware and route matching. This preserves the security fix for CVE-2025-66202 (middleware authorization bypass via double encoding) because middleware now always sees the fully decoded path, making bypass impossible. For example, /api/%2561dmin is decoded to /api/admin, which middleware can correctly block.

  • #​17066 2f4d92a Thanks @​matthewp! - Fixes prerendered redirect targets being incorrectly bundled into the SSR function in hybrid mode, causing massive bundle size inflation

  • #​16882 621beb7 Thanks @​jettwayio! - fix(render): honour compressHTML when joining head elements

  • #​16892 8d753b0 Thanks @​astrobot-houston! - Fixes custom elements in MDX having their children's slot attribute stripped by the JSX runtime

    When custom elements (tags with hyphens like <my-element>) are used in MDX files, the slot HTML attribute on their children is now correctly preserved. Previously, the shared JSX runtime would treat slot as an Astro slot assignment and remove it from the output, breaking Shadow DOM named slot distribution for web components.

  • #​16957 544ee76 Thanks @​thelazylamaGit! - Fixes stale inline CSS in server-rendered HTML after CSS file edits during dev

    When editing a CSS file (.css, .scss, etc.) during development, the inline <style> tags in server-rendered HTML would retain old CSS content instead of updating. This caused a brief flash of old CSS (FOUC) on fresh page loads before Vite's client-side HMR corrected the styles.

    The fix ensures that Astro's per-route dev CSS virtual modules are invalidated in both the SSR module graph and the module runner's evaluation cache when a style file changes, so the next page render picks up the fresh CSS.

  • #​17044 2220d22 Thanks @​astrobot-houston! - Fixes CSS from client:only islands leaking to unrelated pages when Rollup bundles non-CSS-importing modules into the same chunk as CSS-importing modules

  • #​17040 7c4763d Thanks @​astrobot-houston! - Fixes HMR not triggering for files inside the src/middleware/ directory during dev

  • #​16672 52fc862 Thanks @​martinheidegger! - Fixes support for numeric IDs in YAML frontmatter when using content collection references

  • #​16762 9de80ae Thanks @​alexanderdombroski! - Adds a JSON schema to the Wrangler configuration file generated when running astro add cloudflare

  • #​17046 ef771ec Thanks @​ematipico! - Improves the diagnostics emitted when Astro parses incorrect .astro files.

v6.4.6

Compare Source

Patch Changes
  • #​16765 b10e86e Thanks @​fkatsuhiro! - Fixes an issue where renaming an image file while the dev server is running triggers a build error. Now Astro correctly hot-reloads the image without crashing.

  • #​17026 add3df1 Thanks @​matthewp! - Hardens addAttribute to drop attribute names containing characters that are invalid per the HTML spec (", ', >, /, =, whitespace)

  • #​17033 ffda27b Thanks @​matthewp! - Validates the request origin against allowedDomains before fetching prerendered error pages. When allowedDomains is configured and the Host header matches, the original origin is used. Otherwise, the fetch falls back to localhost.

v6.4.5

Compare Source

Patch Changes
  • #​16985 4ecff32 Thanks @​maximslo! - Fixes the experimental.logger destination not being used for the "Server listening on..." startup message. The logger is now resolved before the server starts listening, and adapterLogger re-creates itself when the underlying logger changes so the startup message uses the correct destination.

  • #​16947 e0703a6 Thanks @​ematipico! - Fixes Astro.request.url not reflecting validated X-Forwarded-Proto/X-Forwarded-Host headers when security.allowedDomains is configured. Previously, only Astro.url was updated with the forwarded origin while Astro.request.url retained the socket-derived URL, causing the two to diverge behind TLS-terminating proxies.

  • #​16997 dc45246 Thanks @​matthewp! - Reverts a change to isNode runtime detection that caused a significant build time regression for Cloudflare adapter users with large prerendered sites

v6.4.4

Compare Source

Patch Changes
  • #​16926 1b39ae8 Thanks @​narendraio! - Prevents App.match() from throwing on request paths that contain an invalid percent-sequence.

  • #​16924 2c0bc94 Thanks @​astrobot-houston! - Fixes an issue where editing a client-side component (e.g. with client:idle, client:load, etc.) caused an unnecessary full program reload of the backend during development.

  • #​16958 2c1d50f Thanks @​fkatsuhiro! - Fixes a bug where static file endpoints using getStaticPaths with .html in dynamic param values (e.g. { path: 'file.html' }) would fail with a NoMatchingStaticPathFound error during build. The .html suffix is no longer incorrectly stripped from endpoint route pathnames.

  • #​16855 c610cda Thanks @​astrobot-houston! - Fixes dynamic routes returning 500 "TypeError: Missing parameter" when using domain-based i18n routing in SSR.

  • #​16946 606c37b Thanks @​ematipico! - Fixes Astro.routePattern to preserve original casing of dynamic parameter names from filenames. Previously, a file at src/pages/blog/[postId].astro would return /blog/[postid] for Astro.routePattern due to an internal .toLowerCase() call. It now correctly returns /blog/[postId].

  • #​16720 16d49b6 Thanks @​thomas-callahan-collibra! - Fix an issue where dynamic routes would return the string [object Object] instead of the expected content, in certain runtimes.

  • #​16703 17390a6 Thanks @​henrybrewer00-dotcom! - Fixes styles being stripped when the project root is started with a path whose case differs from the actual filesystem case (e.g. running astro dev from d:\dev\app while the folder on disk is D:\dev\app).

  • #​16855 c610cda Thanks @​astrobot-houston! - Fixes Astro.currentLocale returning the default locale instead of the domain's locale on dynamic routes served from a mapped domain.

v6.4.3

Compare Source

Patch Changes
  • #​16900 17a0fbd Thanks @​ocavue! - Bumps devalue dependency to v5.8.1

  • #​16016 0d85e1b Thanks @​felmonon! - Fix a false positive in the dev toolbar accessibility audit for anchors with text inside closed <details> elements.

  • #​16911 79c6c46 Thanks @​astrobot-houston! - Fixes a bug where experimental.advancedRouting with astro/hono handlers threw TypeError: Cannot read properties of undefined (reading 'route') for unmatched routes instead of rendering the custom 404 page.

  • #​16899 239c469 Thanks @​matthewp! - Fixes a false "does not call the middleware() handler" warning when using astro() in a custom src/app.ts and the first request is a redirect route.

  • #​16887 493acdb Thanks @​astrobot-houston! - Fixes redirectToDefaultLocale not working after the Advanced Routing refactoring.

  • #​16908 ef53ab9 Thanks @​florian-lefebvre! - Improves optimized fallbacks generation when using the Fonts API by using better metrics for bold variants

v6.4.2

Patch Changes
  • #​16889 b94bcfd Thanks @​Princesseuh! - Fixes a plugins is not iterable crash when using a pre-6.0 @astrojs/mdx alongside integrations (e.g. Starlight) that set markdown.remarkPlugins, markdown.rehypePlugins, or markdown.remarkRehype.

  • #​16878 b9f6bb9 Thanks @​fkatsuhiro! - Fixes an issue where on-demand (SSR) dynamic routes would return 404 when a prerendered dynamic route with the same URL pattern was sorted first alphabetically. In production builds with @astrojs/node adapter, if [a_prebuild].astro (prerender=true) came before [b_ssr].astro alphabetically, requests to URLs not in the prerendered route's static paths would 404 instead of falling through to the SSR route. The fix adds fallthrough logic so that when a prerendered dynamic route matches but can't serve the request, Astro tries subsequent matching routes.

v6.4.1

Patch Changes
  • #​16883 eeb064c Thanks @​Princesseuh! - Restores the astro/jsx/rehype.js entry point so that older versions of @astrojs/mdx continue to work when used with Astro 6.x. This entry point will be removed in Astro 7.0.

v6.4.0

Compare Source

Minor Changes
  • #​16468 4cff3a1 Thanks @​matthewp! - Adds a new preserveBuildServerDir adapter feature

    Adapters can now set preserveBuildServerDir: true in their adapter features to keep the dist/server/ directory structure for static builds, mirroring the existing preserveBuildClientDir option. This is useful for adapters that require a consistent dist/client/ and dist/server/ layout regardless of build output type.

    setAdapter({
      name: 'my-adapter',
      adapterFeatures: {
        buildOutput,
        preserveBuildClientDir: true,
        preserveBuildServerDir: true,
      },
    });
    
  • #​16848 f732f3c Thanks @​Princesseuh! - Adds a new markdown.processor configuration option, allowing you to choose an alternative Markdown processor.

    Websites with many Markdown/MDX files tend to be slow to build because the unified ecosystem (e.g., remark, rehype) is slow to process. This feature introduces the ability to replace this part of the build pipeline with another processor.

    The default processor is unified(). This means that existing configurations remain unchanged and your remark/rehype plugins continue to work.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { unified } from '@astrojs/markdown-remark';
    import remarkToc from 'remark-toc';
    
    export default defineConfig({
      markdown: {
        processor: unified({
          remarkPlugins: [remarkToc],
        }),
      },
    });
    

    In addition to this new configuration option, Astro provides a new alternative processor based on Rust: Sätteri. You can choose to use it now by installing @astrojs/markdown-satteri, importing the satteri() processor, and adapting your existing configuration:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { satteri } from '@astrojs/markdown-satteri';
    
    export default defineConfig({
      markdown: {
        processor: satteri({
          features: { directive: true },
        }),
      },
    });
    

    This processor does not support the remark and rehype plugins. This means you may need to convert them to MDAST or HAST plugins to retain your current functionality.

    The existing top-level markdown.remarkPlugins, markdown.rehypePlugins, markdown.remarkRehype, markdown.gfm, and markdown.smartypants options still work, but are now deprecated and will be removed in a future major update. The matching remarkPlugins, rehypePlugins, and remarkRehype options on the MDX integration are also deprecated for the same reason. To anticipate their removal, move them onto unified({...}) (or your preferred plugin processor) :

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import remarkToc from 'remark-toc';
    import rehypeSlug from 'rehype-slug';
    + import { unified } from '@astrojs/markdown-remark';
    
    export default defineConfig({
      markdown: {
    +    processor: unified({
    +      remarkPlugins: [remarkToc],
    +      rehypePlugins: [rehypeSlug],
    +      remarkRehype: true,
    +      gfm: true,
    +      smartypants: true,
    +    }),
    -    remarkPlugins: [remarkToc],
    -    rehypePlugins: [rehypeSlug],
    -    remarkRehype: true,
    -    gfm: true,
    -    smartypants: true,
      },
    });
    

    For more information on enabling and using this feature in your project, see our Markdown guide. To give feedback on this new Rust processor, see the Native Markdown / MDX parsing and processing RFC.

Patch Changes
  • #​16468 4cff3a1 Thanks @​matthewp! - Skips the static preview server when an adapter provides its own previewEntrypoint, allowing the adapter to handle both static and dynamic routes

  • #​16811 e0e26db Thanks @​matthewp! - Fixes X-Forwarded-Host and X-Forwarded-Proto headers being ignored when set in a custom src/app.ts fetch handler before creating FetchState

  • #​16468 4cff3a1 Thanks @​matthewp! - Fixes the static preview server to respect preserveBuildClientDir, serving files from build.client instead of outDir when the adapter requires it

  • #​16770 1e2aa11 Thanks @​matthewp! - Fixes a race condition where the Vite dep optimizer could lose React dependencies in dev mode when using Astro Actions

  • #​16468 4cff3a1 Thanks @​matthewp! - Exempts internal routes (e.g. server islands) from getStaticPaths() validation, fixing server island rendering on static sites

  • #​16468 4cff3a1 Thanks @​matthewp! - Fixes preview for static sites that contain non-prerendered routes. Previously, the preview command ignored SSR routes discovered during route scanning and always used the static preview server.

  • Updated dependencies [f732f3c, f732f3c]:

v6.3.8

Compare Source

Patch Changes
  • #​16830 f2bf3cb Thanks @​matthewp! - Fixes 404s for dynamically imported JS chunks when using an adapter with assetQueryParams (e.g. Vercel skew protection)

  • #​16831 ace96ba Thanks @​astrobot-houston! - Fixes a misleading GetStaticPathsRequired error when a redirect is configured from a dynamic route to a static (or less-dynamic) destination. For example, '/project/[slug]': '/' previously produced a confusing error pointing at index.astro. Astro now detects the parameter mismatch at config validation time and throws a clear InvalidRedirectDestination error naming the missing parameters.

  • #​16702 b7d1758 Thanks @​matthewp! - Fixes scoped styles from .astro components being dropped when rendered inside MDX content (<Content /> from render(entry)) passed through a named slot using <Fragment slot="X">. The Fragment component now eagerly evaluates its slot contents to ensure propagating components register their styles before head content is flushed.

  • #​16823 3df6a45 Thanks @​astrobot-houston! - Fixes missing CSS for conditionally rendered Svelte components in production builds

  • #​16836 3d7adfa Thanks @​LongYC! - Document compressHTML: "jsx" config is only available since Astro v6.2.0

  • #​16864 334ce13 Thanks @​cheets! - Fixes a false-positive Internal Warning: route cache overwritten logged on every SSR request for dynamic routes

v6.3.7

Compare Source

Patch Changes
  • #​16821 9c76b12 Thanks @​astrobot-houston! - Fixes request body handling in the Node adapter when req.body is a Buffer, Uint8Array, or ArrayBuffer. Previously, binary body data was incorrectly JSON-stringified (producing {"type":"Buffer","data":[...]}) instead of being passed through directly. This affected libraries like serverless-http that set req.body to a Buffer.

  • #​16785 de96360 Thanks @​astrobot-houston! - Fixes vite.build.minify, vite.build.sourcemap, and vite.build.rollupOptions.output (e.g. compact) being ignored for client-side builds. These top-level Vite build options are now properly forwarded to the client environment, with environment-specific overrides (vite.environments.client.build.*) taking priority when set.

  • #​16819 b5dd8f1 Thanks @​astrobot-houston! - Fixes custom elements in MDX files bypassing the renderer pipeline. Custom elements (tags containing hyphens like <my-element>) in .mdx files are now routed through registered renderers for SSR, matching the behavior of .astro files. If no renderer claims the element, it falls back to rendering as raw HTML.

  • #​16808 765896c Thanks @​ematipico! - Fixes dynamic routes returning 400 Bad Request when the URL contains a literal % character, such as paths built with encodeURIComponent('%?.pdf')

  • #​16804 90d2aca Thanks @​jp-knj! - Fixes a v6 regression where astro:i18n could not be imported from client <script> blocks.

v6.3.6

Compare Source

Patch Changes
  • #​16774 8f77583 Thanks @​astrobot-houston! - Fixes markdown images with empty alt text (![](image.jpg)) in content collections dropping the alt attribute entirely. The alt="" attribute is now correctly preserved in the rendered HTML output, which is important for accessibility (indicating decorative images).

  • #​16776 3d10b5e Thanks @​matthewp! - Fixes HMR serving stale content when components are passed as props via getStaticPaths()

  • #​16784 7453860 Thanks @​ematipico! - Improved the printing of the build time if it goes over the 60 seconds.

  • #​16665 3dbbcee Thanks @​Princesseuh! - Fixes remote SVG sources erroring with dangerouslyProcessSVG after the v6.3 SVG-processing gate. The default Sharp service now resolves the output format from the source up-front when it can (URL extension, data: MIME, ESM metadata), and from the actual buffer at request time when it can't, so SVG sources pass through untouched without needing to set image.dangerouslyProcessSVG: true or an explicit format="svg".

    The error message has also been updated to point at format="svg" as the simpler workaround when an SVG source is encountered without dangerouslyProcessSVG enabled.

  • #​16777 1754b91 Thanks @​matthewp! - Fixes HMR serving stale content for dynamically imported components through barrel files

  • #​16730 068d924 Thanks @​harshagarwalnyu! - Fixes an issue where the file() content loader did not generate a valid JSON Schema for collections whose JSON or YAML data is a top-level array instead of an object.

v6.3.5

Compare Source

Patch Changes
  • #​16771 07c8805 Thanks @​ematipico! - Fixes position prop on <Image> and <Picture> components breaking Content Security Policy (CSP).

  • #​16593 50924ce Thanks @​yanthomasdev! - Improves error messages with more consistent and correct writing.

  • #​16757 5d661cd Thanks @​astrobot-houston! - Fixes dev server serving stale content when SSR-only modules change (e.g. .astro files outside the project root in a monorepo, or dynamically imported components).

    Previously, the astro:hmr-reload plugin returned an empty array after detecting SSR-only module changes, which prevented Vite's updateModules from propagating the invalidation to the SSR module runner. The runner's evaluated module cache stayed stale, so subsequent requests continued returning old content.

    Now the plugin returns the SSR-only modules so Vite can process them through updateModules, which properly invalidates the module runner's cache and ensures fresh content on the next request.

v6.3.4

Compare Source

Patch Changes
  • #​16723 0f10bfe Thanks @​matthewp! - Adds fetchFile option to experimental.advancedRouting to customize or disable the entrypoint file

    export default defineConfig({
      experimental: {
        advancedRouting: {
          fetchFile: 'fetch.ts',
        },
      },
    });
    
  • #​16723 0f10bfe Thanks @​matthewp! - Fixes Hono cache() middleware to follow the standard wrapper pattern

  • #​16723 0f10bfe Thanks @​matthewp! - Adds App.Providers interface for typing custom context providers on Astro and ctx

    declare namespace App {
      interface Providers {
        oauth: import('./lib/oauth').OAuthSession;
      }
    }
    
  • #​16723 0f10bfe Thanks @​matthewp! - Adds FetchState.response property, set automatically after pages() or middleware() completes

    const response = await middleware(state, (s) => pages(s));
    console.log(state.response === response); // true
    
  • #​16723 0f10bfe Thanks @​matthewp! - Adds Fetchable type export for typing the advanced routing entrypoint

    import type { Fetchable } from 'astro';
    
    export default {
      async fetch(request) {
        return new Response('ok');
      },
    } satisfies Fetchable;
    
  • #​16572 4a5a077 Thanks @​DORI2001! - Suppresses [WARN] Vite warning: unused imports from "@astrojs/internal-helpers/remote" during prerender builds. The package is now bundled alongside astro in the prerender environment, matching how it is handled in the SSR environment.

  • #​16756 b6ee23d Thanks @​astrobot-houston! - Fixes styles from Markdoc/MDX custom components not being extracted to <head> in the dev server when using the Cloudflare adapter with prerenderEnvironment: 'node' and rendering content through a wrapper component.

  • #​16747 904d19a Thanks @​astrobot-houston! - Fixes Astro action requests failing in astro dev when using the Cloudflare adapter with prerenderEnvironment: 'node' alongside a prerendered catch-all route such as [...page].astro.

    Actions and other SSR POST endpoints now continue to work in dev instead of returning an HTTP 500 error.

  • #​16701 3495ce4 Thanks @​demaisj! - Fix Map and Set instances saved in a content collection being broken when retrieving entries.

  • #​16614 fca1c32 Thanks @​Eptagone! - Fixes entry.data type inference when a live collection is configured without a schema.

  • #​16661 03b8f7f Thanks @​ocavue! - Updates typescript to v6. No changes are needed from users.

  • #​16681 c22770a Thanks @​dotnetCarpenter! - Fixes an issue where SVG images with width="0" or height="0" incorrectly threw a NoImageMetadata error instead of being treated as valid dimensions.

v6.3.3

Compare Source

Patch Changes
  • #​16737 bd84f33 Thanks @​matthewp! - Fixes a reflected XSS vulnerability where slot names on hydrated components were not HTML-escaped in SSR output

v6.3.2

Compare Source

Patch Changes
  • #​16675 11d4592 Thanks @​ascorbic! - Fixes a regression where Astro.cache was undefined when experimental.cache was not configured.

    The previous documented behavior is for Astro.cache to always be defined as a no-op shim: cache.set() warns once, cache.invalidate() throws and cache.enabled can be used to gate. This allows library and user code can call cache methods without conditional checks. The cache provider registration was being gated at the call site on experimental.cache being configured, which meant the disabled shim branch inside the provider was unreachable and the Astro.cache getter was never attached to the context.

  • #​16691 0f0a4ce Thanks @​matthewp! - Fixes HTMLElement is not defined error during HMR when using components with client-side scripts (e.g. Starlight <Tabs>) and the Cloudflare adapter

  • #​16562 07529ec Thanks @​matthewp! - Fixes non-prerendered routes failing when a dynamic prerendered route exists in the same project with prerenderEnvironment: 'node'

  • #​16638 272185b Thanks @​ematipico! - Fixes a bug where the Astro compiler wasn't freed at the end of the build. After the fix, the memory used by the compiler is now correctly freed at the end of the build.

  • #​16544 d365c97 Thanks @​matthewp! - Tightens isRemotePath() to reject control characters after a leading slash and fixes the dev image endpoint origin check

  • #​16685 889e748 Thanks @​farrosfr! - Improve validation messages for security.csp.directives when script-src or style-src are incorrectly placed in the directives array.

  • #​16605 772f13a Thanks @​rururux! - Fixes assetsPrefix not being available on build from astro:config/server.

  • #​16556 f38dec7 Thanks @​matthewp! - Rejects double-encoded URL paths with a 400 response instead of silently falling back to partial decoding

  • #​16659 38bcb25 Thanks @​jsparkdev! - Fixes & characters appearing as raw entity strings (e.g. &#&#8203;38;) in <meta> tags when viewed in link previews or raw HTML.

  • Updated dependencies [d365c97, 9256345]:

v6.3.1

Compare Source

Patch Changes

v6.3.0

Compare Source

Minor Changes
  • #​16366 d69f858 Thanks @​matthewp! - Adds a new experimental.advancedRouting option that lets you take full control of Astro's request handling pipeline by creating a src/app.ts file in your project.

    Today, Astro handles every incoming request through a fixed internal pipeline: trailing slash normalization, redirects, actions, middleware, page rendering, i18n, and so on. That pipeline works great for most sites, but as projects grow you often want to run your own logic between those steps — an auth check before rendering, a rate limiter before actions, custom logging around the whole stack. Advanced routing gives you that control.

    When enabled, Astro looks for a src/app.ts file in your project. If it finds one, that file becomes the entrypoint for all server-rendered requests. You compose the pipeline yourself using the handlers Astro provides, and you can slot your own logic anywhere in the chain.

Enabling advanced routing
// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  experimental: {
    advancedRouting: true,
  },
});
Two ways to build your pipeline

Astro ships two entrypoints for advanced routing: astro/fetch and astro/hono.

astro/fetch is a low-level, framework-free API built on the Web Fetch standard. You create a FetchState from the incoming request, then call handler functions in sequence. Each handler takes the state, does its work, and returns a Response (or undefined to pass through). This is the core primitive that everything else is built on:

// src/app.ts
import {
  FetchState,
  trailingSlash,
  redirects,
  actions,
  middleware,
  pages,
  i18n,
} from 'astro/fetch';

export default {
  async fetch(request: Request) {
    const state = new FetchState(request);

    // Early exits — these return a Response only when they apply.
    const slash = trailingSlash(state);
    if (slash) return slash;

    const redirect = redirects(state);
    if (redirect) return redirect;

    const action = await actions(state);
    if (action) return action;

    // Middleware wraps page rendering; i18n post-processes the response.
    const response = await middleware(state, () => pages(state));
    return i18n(state, response);
  },
};

astro/hono wraps the same handlers as Hono middleware, so you can mix Astro's pipeline with Hono's ecosystem of middleware (logger, CORS, JWT, rate limiting, etc.) using the app.use() pattern you already know:

// src/app.ts
import { Hono } from 'hono';
import { getCookie } from 'hono/cookie';
import { logger } from 'hono/logger';
import { actions, middleware, pages, i18n } from 'astro/hono';

const app = new Hono();

app.use(logger());

// Auth gate — only runs for /dashboard routes.
app.use('/dashboard/*', async (c, next) => {
  const session = getCookie(c, 'session');
  if (!session) return c.redirect('/login');
  return next();
});

app.use(actions());
app.use(middleware());
app.use(pages());
app.use(i18n());

export default app;

Both approaches give you the same power — pick whichever fits your project. If you don't need a framework, astro/fetch keeps things minimal. If you want a rich middleware ecosystem, astro/hono gets you there with one import.

For more information on enabling and using this feature in your project, see the experimental advanced routing docs. To give feedback, or to keep up with its development, see the advanced routing RFC for more information and discussion.

  • #​16366 d69f858 Thanks @​matthewp! - Adds a consume() instance method to AstroCookies. This method marks the cookies as consumed and returns the Set-Cookie header values. After consumption, any subsequent set() calls will log a warning, since the headers have already been sent.

    Previously this was only available as a static method AstroCookies.consume(cookies). The static method is now deprecated but kept for backward compatibility with existing adapters.

  • #​16412 ba2d2e3 Thanks @​0xbejaxer! - Add retry and error event handling for astro-island hydration import failures to reduce unrecoverable hydration errors on transient network failures.

  • #​16582 885cd31 Thanks @​Princesseuh! - Adds a new image.dangerouslyProcessSVG flag to optionally enable processing SVG inputs. For security reasons, Astro will no longer rasterizes SVG image sources by default in its default image service and endpoint.

    Set image.dangerouslyProcessSVG: true to opt back into processing SVG inputs.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      // ...
      image: {
        dangerouslyProcessSVG: true,
      },
    });
    

    Note that this is a breaking change for users who were previously relying on Astro's default image service to rasterize SVG inputs, but it is a necessary change to improve security and prevent potential vulnerabilities.

  • #​16519 1b1c218 Thanks @​louisescher! - Adds support for redirecting URLs in remote image optimization.

    Previously, when a remote image URL meant to be optimized by Astro led to a redirect, Astro would fail silently and ignore the redirect. Now, Astro tracks up to 10 redirects for these images. If any of the redirects are not covered by a pattern in image.remotePatterns or a domain in image.domains, Astro will fail with a helpful error message.

    In the following example, the first image would be loaded successfully, while the second would lead to Astro throwing an error:

    export default defineConfig({
      image: {
        domains: ['example.com', 'cdn.example.com'],
      },
    });
    
    {
      /* Redirects to https://cdn.example.com/assets/image.png: */
    }
    <Image
      src="https://example.com/assets/image.png"
      width="1920"
      height="1080"
      alt="An example image."
    />;
    
    {
      /* Redirects to https://malicious.com/image.png: */
    }
    <Image
      src="https://example.com/bad-image.png"
      width="1920"
      height="1080"
      alt="An example image."
    />;
    

    In cases where all redirects to HTTPS hosts should be trusted, the following configuration for image.remotePatterns can be used:

    export default defineConfig({
      image: {
        remotePatterns: [
          {
            protocol: 'https',
          },
        ],
      },
    });
    
Patch Changes
  • #​16592 9c6efc5 Thanks @​matthewp! - Escapes interpolated values in the dev server redirect HTML template, consistent with how the 404 template already handles them

  • #​16585 78f305e Thanks @​web-dev0521! - Fixes z.array(z.boolean()) in form actions incorrectly coercing the string "false" to true. Boolean array elements now use the same 'true'/'false' string comparison as single z.boolean() fields, so submitting ["false", "true", "false"] correctly parses as [false, true, false].

  • #​16567 12a03f2 Thanks @​matthewp! - Fixes deleted content collection entries persisting in getCollection() results during dev

  • #​16595 ce9b25c Thanks @​web-dev0521! - Fixes pushDirective in the CSP runtime duplicating the new directive once per existing non-matching directive. Calling insertDirective() (or otherwise pushing a directive whose name is not yet in the list) now appends it exactly once, and a directive that merges with a later existing entry no longer leaves an unmerged copy behind.

  • #​16600 94e4b7c Thanks @​web-dev0521! - Fixes Astro.preferredLocale returning the wrong value when i18n.locales mixes object-form entries ({ path, codes }) with string entries that normalize to the same locale. The first matching code in the configured locales order is now selected, matching the documented behavior.

  • #​16591 cce20f7 Thanks @​matthewp! - Uses a consistent generic error message in the image endpoint across all adapters

  • #​16629 f54be80 Thanks @​g-taki! - Fixes a bug where SSR responses in astro dev could crash with TypeError: this.logger.flush is not a function.

  • #​16589 3740b24 Thanks @​ArmandPhilippot! - Fixes an outdated code snippet in the documentation for session storage configuration.

  • Updated dependencies [354e231]:

v6.2.2

Compare Source

Patch Changes
  • #​16292 00f48ee Thanks @​p-linnane! - Fixes head metadata propagation in dev for adapters that load modules in the prerender Vite environment, such as @astrojs/cloudflare. The astro:head-metadata plugin previously only tracked the ssr environment, so maybeRenderHead() could fire inside an unrelated component's <template> element, trapping subsequent hoisted <style> blocks.

  • #​16451 778865f Thanks @​maximslo! - Fixes build crash when processing animated AVIF images. Sharp now gracefully passes through unsupported image formats instead of crashing during the build.

  • #​16548 7214d3e Thanks @​senutpal! - Fixes scoped styles applying to the wrong element when vite.css.transformer is set to 'lightningcss' and a selector uses a nested & inside :where(...), such as Tailwind v4's space-x-*, space-y-*, and divide-* utilities.

  • #​16566 9ac96b4 Thanks @​web-dev0521! - Fixes data-astro-prefetch="tap" not triggering when clicking nested elements (e.g. <span>, <img>, <svg>) inside an anchor tag.

  • #​15994 1e70d18 Thanks @​ossaidqadri! - Fix <style> compilation failure when importing Astro components via tsconfig path aliases

  • #​16144 1cd6650 Thanks @​fkatsuhiro! - Fixed a regression where .html was unexpectedly stripped from dynamic route parameters on non-page routes (.ts endpoints and redirects). This caused endpoints like /some/[...id].ts returning id: 'file.html' on getStaticPaths to not serve that file because the generated route (/some/file.html) would get matched as id: file that is not part of the list returned by getStaticPaths.

  • #​16415 559c0fd Thanks @​0xbejaxer! - Fix CSS traversal boundaries so pages with export const partial = true still contribute styles when imported as components by other pages.

  • #​16516 17f1867 Thanks @​fkatsuhiro! - Fixes an issue where the index route would return a 404 error when using a custom base path combined with trailingSlash: 'never'. This ensures that the home page and internal rewrites are correctly matched under these configurations.

  • #​16515 280ec88 Thanks @​jp-knj! - Fixes an issue where i18n.fallback pages with fallbackType: 'rewrite' were emitted with empty bodies during astro build.

  • #​16565 7959798 Thanks @​enjoyandlove! - Fixes session persistence when session.delete() is the first mutation in a request (no prior get, set, has, or keys). The session was marked dirty in memory, but persistence skipped the save because #data stayed undefined, so the backing store could still return the deleted key on the next request.

  • #​16527 86fd80d Thanks @​enjoyandlove! - Prevents script deduplication state from being consumed while rendering inert <template> contexts.

  • #​16540 e59c637 Thanks @​ascorbic! - Skips session storage reads when no session cookie is present. Previously, calling session.get() on a request without a session cookie would initialize the storage driver and make a read that was guaranteed to miss. On network-backed drivers this added latency and resource usage to every anonymous request.

  • #​16517 6ab0b3c Thanks @​adamchal! - Removes inline CSS for prerendered routes from the SSR manifest. The static HTML on disk already inlines those styles, and the SSR worker never renders prerendered routes, so the data was dead weight. Builds with many prerendered routes and build.inlineStylesheets: "always" (or "auto" with small stylesheets) will see a smaller SSR entry chunk, which reduces cold-start parse time on platforms like Cloudflare Workers.

  • #​16509 d3d3557 Thanks @​cyphercodes! - Fix conditional named slot callbacks receiving arguments from Astro.slots.render().

  • #​16236 c6b068e Thanks @​fkatsuhiro! - Fixes the position prop on <Image /> and <Picture /> components to correctly apply object-position styles

  • #​16018 d14f47c Thanks @​felmonon! - Fix defineLiveCollection() so LiveLoader data types declared as interfaces are accepted.

v6.2.1

Compare Source

Patch Changes
  • #​16531 76db01d Thanks @​rodrigosdev! - Fixes config validation for omitted integrations fields with newer Zod versions.

  • #​16535 7df0fe4 Thanks @​rururux! - Fixed an issue where a warning was displayed when the server property was missing during config validation, even though it is not required.

  • #​16534 5cf6c51 Thanks @​matthewp! - Fixes compatibility with Zod 4.4.0 for the server config property and error formatting

v6.2.0

Compare Source

Minor Changes
  • #​16187 fe58071 Thanks @​gllmt! - Adds a waitUntil option to the RenderOptions so that adapters can forward runtime background-task hooks to Astro.

    When provided by an adapter, runtime cache providers receive context.waitUntil in
    CacheProvider.onRequest(), which allows background cache work such as stale-while-revalidate
    without blocking the response. The Cloudflare adapter now forwards
    ExecutionContext.waitUntil to this API.

  • #​16290 a49637a Thanks @​ViVaLaDaniel! - Ensures that server.allowedHosts (and vite.preview.allowedHosts) configuration is respected when using astro preview with the @astrojs/cloudflare adapter. This improves security by preventing DNS rebinding attacks when previewing Cloudflare builds locally.

  • #​15725 4108ec1 Thanks @​meyer! - Adds support for a new 'jsx' value for the compressHTML option. When set, whitespace is stripped using JSX whitespace rules instead of the default HTML compression strategy.

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      compressHTML: 'jsx',
    });
    

    In JSX, whitespaces never matter, as such, no amount of indentation, or newlines will not affect the rendered output. For instance, the following code:

    <div>
      <span>foo</span>
      <span>bar</span>
    </div>
    

    will be rendered as foobar, whereas with HTML whitespace rules, a space would be present between the words due to the newline and indentation between the tags.

  • #​16477 28fb3e1 Thanks @​ematipico! - Adds experimental support for configurable log handlers.

    This experimental feature provides better control over Astro's logging infrastructure by allowing users to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for users using on-demand rendering and wishing to connect their log aggregation services, such as Kibana, Logstash, CloudWatch, Grafana, or Loki.

    By default, Astro provides three built-in log handlers (json, node, and console), but you can also create your own.

JSON logging

JSON logging can be enabled via the CLI for the build, dev, and sync commands using the experimentalJson flag:

// astro.config.mjs
import { defineConfig, logHandlers } from 'astro/config';

export default defineConfig({
  experimental: {
    logger: logHandlers.json({
      pretty: true,
      level: 'warn',
    }),
  },
});
Custom logger

You can also create your own custom logger by implementing the correct interface:

// astro.config.mjs
import { defineConfig } from 'astro/config';

export default defineConfig({
  experimental: {
    logger: {
      entrypoint: '@org/custom-logger',
    },
  },
});
// @org/custom-logger.js
import type { AstroLoggerDestination, AstroLoggerMessage } from 'astro';
import { matchesLevel } from 'astor/logger';

function customLogger(level = 'info'): AstroLoggerDestination {
  return {
    write(message: AstroLoggerMessage) {
      if (matchesLevel(message.level, level)) {
        // write message somewhere
      }
    },
  };
}

export default customLogger;

For more information on enabling and using this feature in your project, see the Experimental Logger docs.

For a complete overview and to give feedback on this experimental API, see the Custom logger RFC.

  • #​16333 0f7c3c8 Thanks @​florian-lefebvre! - Adds an experimental flag svgOptimizer that enables automatic optimization of your SVG components using the provided optimizer. This supersedes the svgo experimental flag, which is now removed.

    When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code.

    Astro ships with a SVGO based optimizer, but any can be used.

    To enable this feature, add the experimental flag in your Astro config and remove svgo if it was enabled:

    // astro.config.mjs
    -import { defineConfig } from "astro/config";
    +import { defineConfig, svgoOptimizer } from "astro/config";
    
    export default defineConfig({
    +  experimental: {
    +    svgOptimizer: svgoOptimizer()
    -    svgo: true
    +  }
    });
    

    For more information on enabling and using this feature in your project, see the experimental SVG optimization docs.

  • #​16302 f6f8e80 Thanks @​florian-lefebvre! - Adds a new experimental_getFontFileURL() method to resolve font file URLs when using the Fonts API

    The fontData object exported from astro:assets was introduced to provide low-level access to font family data for advanced usage. One of the goals of this API was to be able to resolve buffers using URLs. However, it turned out to be impractical, especially during prerendering.

    Astro now exports a new experimental_getFontFileURL() helper function from astro:assets to resolve font file URLs from fontData. For example, when using satori to generate Open Graph images:

    // src/pages/og.png.ts
    
    import type { APIRoute } from "astro";
    -import { fontData } from "astro:assets";
    +import { fontData, experimental_getFontFileURL } from "astro:assets";
    -import { outDir } from "astro:config/server";
    -import { readFile } from "node:fs/promises";
    import satori from "satori";
    import { html } from "satori-html";
    import sharp from "sharp";
    
    export const GET: APIRoute = async (context) => {
      const fontPath = fontData["--font-roboto"][0]?.src[0]?.url;
    
      if (fontPath === undefined) {
        throw new Error("Cannot find the font path.");
      }
    
    -  const data = import.meta.env.DEV
    -    ? await fetch(new URL(fontPath, context.url.origin)).then(async (res) => res.arrayBuffer())
    -    : await readFile(new URL(`.${fontPath}`, outDir));
    +  const url = experimental_getFontFileURL(fontPath, context.url);
    +  const data = await fetch(url).then((res) => res.arrayBuffer());
    
      const svg = await satori(
        html`<div style="color: black;">hello, world</div>`,
        {
          width: 600,
          height: 400,
          fonts: [
            {
              name: "Roboto",
              data,
              weight: 400,
              style: "normal",
            },
          ],
        },
      );
    
      const pngBuffer = await sharp(Buffer.from(svg))
        .resize(600, 400)
        .png()
        .toBuffer();
    
      return new Response(new Uint8Array(pngBuffer), {
        headers: {
          "Content-Type": "image/png",
        },
      });
    };
    

    See the Fonts API documentation for more information.

Patch Changes

v6.1.10

Compare Source

Patch Changes
  • #​16479 1058428 Thanks @​matthewp! - Fixes a spurious [WARN] [content] Content config not loaded warning during astro dev for projects that don't use content collections

  • #​16457 3d82220 Thanks @​matthewp! - Hardens server island encryption to prevent encrypted data from one island component being replayed against a different one

  • #​16481 152700e Thanks @​matthewp! - Fixes a spurious 404 request for a dev toolbar sourcemap during astro dev caused by the browser mis-resolving a relative sourceMappingURL from the /@id/ URL prefix

  • #​16480 1bcb43b Thanks @​matthewp! - Fixes an unnecessary full page reload on first navigation during dev

v6.1.9

Compare Source

Patch Changes

v6.1.8

Compare Source

Patch Changes
  • #​16367 a6866a7 Thanks @​ematipico! - Fixes an issue where build output files could contain special characters (!, ~, {, }) in their names, causing deploy failures on platforms like Netlify.

  • #​16381 217c5b3 Thanks @​ematipico! - Slightly improved the performance of the dev server by caching the internal crawling of the dependencies of a project.

  • #​16348 7d26cd7 Thanks @​ocavue! - Fixes a bug where emitted assets during a client build would contain always fresh, new hashes in their name. Now the build should be more stable.

  • #​16317 d012bfe Thanks @​das-peter! - Fixes a bug where allowedDomains weren't correctly propagated when using the development server.

  • #​16379 5a84551 Thanks @​martrapp! - Improves Vue scoped style handling in DEV mode during client router navigation.

  • #​16317 d012bfe Thanks @​das-peter! - Adds tests to verify settings are properly propagated when using the development server.

  • #​16282 5b0fdaa Thanks @​jmurty! - Fixes build errors on platforms with skew protection enabled (e.g. Vercel, Netlify) for inter-chunk Javascript using dynamic imports

  • Updated dependencies [e0b240e]:

v6.1.7

Compare Source

Patch Changes
  • #​16027 c62516b Thanks @​fkatsuhiro! - Fixes a bug where remote image dimensions were not validated during static builds on Netlify.

  • #​16311 94048f2 Thanks @​Arecsu! - Fixes --port flag being ignored after a Vite-triggered server restart (e.g. when a .env file changes)

  • #​16316 0fcd04c Thanks @​ematipico! - Fixes the /_image endpoint accepting an arbitrary f=svg query parameter and serving non-SVG content as image/svg+xml. The endpoint now validates that the source is actually SVG before honoring f=svg, matching the same guard already enforced on the <Image> component path.

v6.1.6

Compare Source

Patch Changes
  • #​16202 b5c2fba Thanks @​matthewp! - Fixes Actions failing with ActionsWithoutServerOutputError when using output: 'static' with an adapter

  • #​16303 b06eabf Thanks @​matthewp! - Improves handling of special characters in inline <script> content

  • #​14924 bb4586a Thanks @​aralroca! - Fixes SCSS and CSS module file changes triggering a full page reload instead of hot-updating styles in place during development

v6.1.5

Compare Source

Patch Changes
  • #​16171 5bcd03c Thanks @​Desel72! - Fixes a build error that occurred when a pre-rendered page used the <Picture> component and another page called render() on content collection entries.

  • #​16239 7c65c04 Thanks @​dataCenter430! - Fixes sync content inside <Fragment> not streaming to the browser until all async sibling expressions have resolved.

  • #​16242 686c312 Thanks @​martrapp! - Revives UnoCSS in dev mode when used with the client router.

    This change partly reverts #​16089, which in hindsight turned out to be too general. Instead of automatically persisting all style sheets, we now do this only for styles from Vue components.

  • #​16192 79d86b8 Thanks @​alexanderniebuhr! - Uses today’s date for Cloudflare compatibility_date in astro add cloudflare

    When creating new projects, astro add cloudflare now sets compatibility_date to the current date. Previously, this date was resolved from locally installed packages, which could be unreliable in some package manager environments. Using today’s date is simpler and more reliable across environments, and is supported by workerd.

  • #​16259 34df955 Thanks @​gameroman! - Removed dlv dependency

v6.1.4

Compare Source

Patch Changes
  • #​16197 21f9fe2 Thanks @​SchahinRohani! - Remove unused re-exports from assets/utils barrel file to fix Vite build warning

  • #​16059 6d5469e Thanks @​matthewp! - Fixes Expected 'miniflare' to be defined errors and 404 responses in dev mode when using the Cloudflare adapter and the config file changes. Instead of creating a brand new Vite server on config changes, Astro now performs a Vite in-place restart, allowing the Cloudflare adapter to reuse its existing miniflare instance across restarts.

  • #​16154 7610ba4 Thanks @​Desel72! - Fixes pages with dots in their filenames (e.g. hello.world.astro) returning 404 when accessed with a trailing slash in the dev server. The trailingSlashForPath function now only forces trailingSlash: 'never' for endpoints with file extensions, allowing pages to correctly respect the user's trailingSlash config.

  • #​16193 23425e2 Thanks @​matthewp! - Fixes trailingSlash: "always" producing redirect HTML instead of the actual response for extensionless endpoints during static builds

v6.1.3

Compare Source

Patch Changes
  • #​16161 b51f297 Thanks @​matthewp! - Fixes a dev rendering issue with the Cloudflare adapter where head metadata could be missing and dev CSS/scripts could be injected in the wrong place

  • #​16110 de669f0 Thanks @​tmimmanuel! - Fixes skew protection query parameters not being appended to inter-chunk JavaScript imports in client bundles, which could cause version mismatches during rolling deployments on Vercel

  • #​16162 a0a49e9 Thanks @​rururux! - Fixes an issue where HMR would not trigger when modifying files while using @​astrojs/cloudflare with prerenderEnvironment: 'node' enabled.

  • #​16142 7454854 Thanks @​rururux! - Fixes HTML content being incorrectly escaped as plain text when rendering a MDX component using the AstroContainer APIs.

  • #​16116 12602a9 Thanks @​riderx! - Fixes a bug where page-level CSS could leak between unrelated pages when traversing style parents across top-level route boundaries

  • #​16178 a7e7567 Thanks @​matthewp! - Fixes SSR builds failing with "No matching renderer found" when a project only has injected routes and no src/pages/ directory

v6.1.2

Compare Source

Patch Changes
  • #​16104 47a394d Thanks @​matthewp! - Fixes astro preview ignoring vite.preview.allowedHosts set in astro.config.mjs

  • #​16047 711f837 Thanks @​matthewp! - Fixes catch-all routes incorrectly intercepting requests for static assets when using the @astrojs/node adapter in middleware mode.

  • #​15981 a60cbb6 Thanks @​moktamd! - Fix Zod v4 validation error formatting to show human-readable messages instead of raw JSON

v6.1.1

Compare Source

Patch Changes
  • #​16479 1058428 Thanks @​matthewp! - Fixes a spurious [WARN] [content] Content config not loaded warning during astro dev for projects that don't use content collections

  • #​16457 3d82220 Thanks @​matthewp! - Hardens server island encryption to prevent encrypted data from one island component being replayed against a different one

  • #​16481 152700e Thanks @​matthewp! - Fixes a spurious 404 request for a dev toolbar sourcemap during astro dev caused by the browser mis-resolving a relative sourceMappingURL from the /@id/ URL prefix

  • #​16480 1bcb43b Thanks @​matthewp! - Fixes an unnecessary full page reload on first navigation during dev

v6.1.0

Compare Source

Minor Changes
  • #​15804 a5e7232 Thanks @​merlinnot! - Allows setting codec-specific defaults for Astro's built-in Sharp image service via image.service.config.

    You can now configure encoder-level options such as jpeg.mozjpeg, webp.effort, webp.alphaQuality, avif.effort, avif.chromaSubsampling, and png.compressionLevel when using astro/assets/services/sharp for compile-time image generation.

    These settings apply as defaults for the built-in Sharp pipeline, while per-image quality still takes precedence when set on <Image />, <Picture />, or getImage().

  • #​15455 babf57f Thanks @​AhmadYasser1! - Adds fallbackRoutes to the IntegrationResolvedRoute type, exposing i18n fallback routes to integrations via the astro:routes:resolved hook for projects using fallbackType: 'rewrite'.

    This allows integrations such as the sitemap integration to properly include generated fallback routes in their output.

    {
      'astro:routes:resolved': ({ routes }) => {
        for (const route of routes) {
          for (const fallback of route.fallbackRoutes) {
            console.log(fallback.pathname) // e.g. /fr/about/
          }
        }
      }
    }
    
  • #​15340 10a1a5a Thanks @​trueberryless! - Adds support for advanced configuration of SmartyPants in Markdown.

    You can now pass an options object to markdown.smartypants in your Astro configuration to fine-tune how punctuation, dashes, and quotes are transformed.

    This is helpful for projects that require specific typographic standards, such as "oldschool" dash handling or localized quotation marks.

    // astro.config.mjs
    export default defineConfig({
      markdown: {
        smartypants: {
          backticks: 'all',
          dashes: 'oldschool',
          ellipses: 'unspaced',
          openingQuotes: { double: '«', single: '‹' },
          closingQuotes: { double: '»', single: '›' },
          quotes: false,
        },
      },
    });
    

    See the retext-smartypants options for more information.

Patch Changes
  • #​16025 a09f319 Thanks @​koji-1009! - Instructs the client router to skip view transition animations when the browser is already providing its own visual transition, such as a swipe gesture.

  • #​16055 ccecb8f Thanks @​Gautam-Bharadwaj! - Fixes an issue where client:only components could have duplicate client:component-path attributes added in MDX in rare cases

  • #​16081 44fc340 Thanks @​crazylogic03! - Fixes the emitFile() is not supported in serve mode warning that appears during astro dev when using integrations that inject before-hydration scripts (e.g. @astrojs/react)

  • #​16068 31d733b Thanks @​Karthikeya1500! - Fixes the dev toolbar a11y audit incorrectly classifying menuitemradio as a non-interactive ARIA role.

  • #​16080 e80ac73 Thanks @​ematipico! - Fixes experimental.queuedRendering incorrectly escaping the HTML output of .html page files, causing the page content to render as plain text instead of HTML in the browser.

  • #​16048 13b9d56 Thanks @​matthewp! - Fixes a dev server crash (serverIslandNameMap.get is not a function) that occurred when navigating to a page with server:defer after first visiting a page without one, when using @astrojs/cloudflare

  • #​16093 336e086 Thanks @​Snugug! - Fixes Zod meta not correctly being rendered on top-level schema when converted into JSON Schema

  • #​16043 d402485 Thanks @​ematipico! - Fixes checkOrigin CSRF protection in astro dev behind a TLS-terminating reverse proxy. The dev server now reads X-Forwarded-Proto (gated on security.allowedDomains, matching production behaviour) so the constructed request origin matches the https:// origin the browser sends. Also ensures security.allowedDomains and security.checkOrigin are respected in dev.

  • #​16064 ba58e0d Thanks @​ematipico! - Updates the dependency svgo to the latest, to fix a security issue.

  • #​16007 2dcd8d5 Thanks @​florian-lefebvre! - Fixes a case where fonts files would unecessarily be copied several times during the build

  • #​16017 b089b90 Thanks @​felmonon! - Fix the astro sync error message when getImage() is called while loading content collections.

  • #​16014 fa73fbb Thanks @​matthewp! - Fixes a build error where using astro:config/client inside a <script> tag would cause Rollup to fail with "failed to resolve import virtual:astro:routes from virtual:astro:manifest"

  • #​16054 f74465a Thanks @​seroperson! - Fixes an issue with the development server, where changes to the middleware weren't picked, and it required a full restart of the server.

  • #​16033 198d31b Thanks @​adampage! - Fixes a bug where the the role image was incorrectly reported by audit tool bar.

  • #​15935 278828c Thanks @​oliverlynch! - Fixes cached assets failing to revalidate due to redirect check mishandling Not Modified responses.

  • #​16075 2c1ae85 Thanks @​florian-lefebvre! - Fixes a case where invalid URLs would be generated in development when using font families with an oblique style and angles

  • #​16062 87fd6a4 Thanks @​matthewp! - Warns on dev server startup when Vite 8 is detected at the top level of the user's project, and automatically adds a "overrides": { "vite": "^7" } entry to package.json when running astro add cloudflare. This prevents a require_dist is not a function crash caused by a Vite version split between Astro (requires Vite 7) and packages like @tailwindcss/vite that hoist Vite 8.

  • Updated dependencies [10a1a5a]:

v6.0.8

Compare Source

Patch Changes
  • #​15978 6d182fe Thanks @​seroperson! - Fixes a bug where Astro Actions didn't properly support nested object properties, causing problems when users used zod functions such as superRefine or discriminatedUnion.

  • #​16011 e752170 Thanks @​matthewp! - Fixes a dev server hang on the first request when using the Cloudflare adapter

  • #​15997 1fddff7 Thanks @​ematipico! - Fixes Astro.rewrite() failing when the target path contains duplicate slashes (e.g. //about). The duplicate slashes are now collapsed before URL parsing, preventing them from being interpreted as a protocol-relative URL.

v6.0.7

Compare Source

Patch Changes
  • #​15950 acce5e8 Thanks @​matthewp! - Fixes a build regression in projects with multiple frontend integrations where server:defer server islands could fail at runtime when all pages are prerendered.

  • #​15988 c93b4a0 Thanks @​ossaidqadri! - Fix styles from dynamically imported components not being injected on first dev server load.

  • #​15968 3e7a9d5 Thanks @​chasemccoy! - Fixes renderMarkdown in custom content loaders not resolving images in markdown content. Images referenced in markdown processed by renderMarkdown are now correctly optimized, matching the behavior of the built-in glob() loader.

  • #​15990 1e6017f Thanks @​ematipico! - Fixes an issue where Astro.currentLocale would always be the default locale instead of the actual one when using a dynamic route like [locale].astro or [locale]/index.astro. It now resolves to the correct locale from the URL.

  • #​15990 1e6017f Thanks @​ematipico! - Fixes an issue where visiting an invalid locale URL (e.g. /asdf/) would show the content of a dynamic [locale] page with a 404 status code, instead of showing your custom 404 page. Now, the correct 404 page is rendered when the locale in the URL doesn't match any configured locale.

  • #​15960 1d84020 Thanks @​matthewp! - Fixes Cloudflare dev server islands with prerenderEnvironment: 'node' by sharing the serialized manifest encryption key across dev environments and routing server island requests through the SSR runtime.

  • #​15735 9685e2d Thanks @​fa-sharp! - Fixes an EventEmitter memory leak when serving static pages from Node.js middleware.

    When using the middleware handler, requests that were being passed on to Express / Fastify (e.g. static files / pre-rendered pages / etc.) weren't cleaning up socket listeners before calling next(), causing a memory leak warning. This fix makes sure to run the cleanup before calling next().

v6.0.6

Compare Source

Patch Changes
  • #​15965 2dca307 Thanks @​matthewp! - Fixes client hydration for components imported through Node.js subpath imports (package.json#imports, e.g. #components/*), for example when using the Cloudflare adapter in development.

  • #​15770 6102ca2 Thanks @​jpc-ae! - Updates the create astro welcome message to highlight the graceful dev/preview server quit command rather than the kill process shortcut

  • #​15953 7eddf22 Thanks @​Desel72! - fix(hmr): eagerly recompile on style-only change to prevent stale slots render

  • #​15916 5201ed4 Thanks @​trueberryless! - Fixes InferLoaderSchema type inference for content collections defined with a loader that includes a schema

  • #​15864 d3c7de9 Thanks @​florian-lefebvre! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default

  • #​15944 a5e1acd Thanks @​fkatsuhiro! - Fixes SSR dynamic routes with .html extension (e.g. [slug].html.astro) not working

  • #​15937 d236245 Thanks @​ematipico! - Fixes an issue where HMR didn't correctly work on Windows when adding/changing/deleting routes in pages/.

  • #​15931 98dfb61 Thanks @​Strernd! - Fix skew protection query params not being applied to island hydration component-url and renderer-url, and ensure query params are appended safely for asset URLs with existing search/hash parts.

  • Updated dependencies []:

v6.0.5

Compare Source

Patch Changes
  • #​15891 b889231 Thanks @​matthewp! - Fix dev routing for server:defer islands when adapters opt into handling prerendered routes in Astro core. Server island requests are now treated as prerender-handler eligible so prerendered pages using prerenderEnvironment: 'node' can load island content without 400 errors.

  • #​15890 765a887 Thanks @​matthewp! - Fixes astro:actions validation to check resolved routes, so projects using default static output with at least one prerender = false page or endpoint no longer fail during startup.

  • #​15884 dcd2c8e Thanks @​matthewp! - Avoid a MaxListenersExceededWarning during astro dev startup by increasing the shared Vite watcher listener limit when attaching content server listeners.

  • #​15904 23d5244 Thanks @​jlukic! - Emit the before-hydration script chunk for the client Vite environment. The chunk was only emitted for prerender and ssr environments, causing a 404 when browsers tried to load it. This broke hydration for any integration using injectScript('before-hydration', ...), including Lit SSR.

  • #​15933 325901e Thanks @​ematipico! - Fixes an issue where <style> tags inside SVG components weren't correctly tracked when enabling CSP.

  • #​15875 c43ef8a Thanks @​matthewp! - Ensure custom prerenderers are always torn down during build, even when getStaticPaths() throws.

  • #​15887 1861fed Thanks @​ematipico! - Fixes an issue where the build incorrectly leaked server entrypoint into the client environment, causing adapters to emit warnings during the build.

  • #​15888 925252e Thanks @​matthewp! - Fix a bug where server:defer could fail at runtime in prerendered pages for some adapters (including Cloudflare), causing errors like serverIslandMap?.get is not a function.

  • #​15901 07c1002 Thanks @​delucis! - Fixes JSON schema generation for content collection schemas that have differences between their input and output shapes.

  • #​15882 759f946 Thanks @​matthewp! - Fix Astro.url.pathname for the root page when using build.format: "file" so it resolves to /index.html instead of /.html during builds.

v6.0.4

Compare Source

Patch Changes
  • #​15870 920f10b Thanks @​matthewp! - Prebundle astro/toolbar in dev when custom dev toolbar apps are registered, preventing re-optimization reloads that can hide or break the toolbar.

  • #​15876 f47ac53 Thanks @​ematipico! - Fixes redirectToDefaultLocale producing a protocol-relative URL (//locale) instead of an absolute path (/locale) when base is '/'.

  • #​15767 e0042f7 Thanks @​matthewp! - Fixes server islands (server:defer) not working when only used in prerendered pages with output: 'server'.

  • #​15873 35841ed Thanks @​matthewp! - Fix a dev server bug where newly created pages could miss layout-imported CSS until restart.

  • #​15874 ce0669d Thanks @​ematipico! - Fixes a warning when using prefetchAll

  • #​15754 58f1d63 Thanks @​rururux! - Fixes a bug where a directory at the project root sharing the same name as a page route would cause the dev server to return a 404 instead of serving the page.

  • #​15869 76b3a5e Thanks @​matthewp! - Update the unknown file extension error hint to recommend vite.resolve.noExternal, which is the correct Vite 7 config key.

v6.0.3

Compare Source

Patch Changes
  • #​15711 b2bd27b Thanks @​OliverSpeir! - Improves Astro core's dev environment handling for prerendered routes by ensuring route/CSS updates and prerender middleware behavior work correctly across both SSR and prerender environments.

    This enables integrations that use Astro's prerender dev environment (such as Cloudflare with prerenderEnvironment: 'node') to get consistent route matching and HMR behavior during development.

  • #​15852 1cdaf9f Thanks @​ematipico! - Fixes a regression where the the routes emitted by the astro:build:done hook didn't have the distURL array correctly populated.

  • #​15765 ca76ff1 Thanks @​matthewp! - Hardens server island POST endpoint validation to use own-property checks for improved consistency

v6.0.2

Compare Source

Patch Changes

v6.0.1

Compare Source

Patch Changes

v6.0.0

Compare Source

Major Changes
What should I do?

If you were using experimental CSP runtime utilities, you must now access methods conditionally:

-Astro.csp.insertDirective("default-src 'self'");
+Astro.csp?.insertDirective("default-src 'self'");
Minor Changes
  • #​14306 141c4a2 Thanks @​ematipico! - Adds new optional properties to setAdapter() for adapter entrypoint handling in the Adapter API

    Changes:

    • New optional properties:
      • entryType?: 'self' | 'legacy-dynamic' - determines if the adapter provides its own entrypoint ('self') or if Astro constructs one ('legacy-dynamic', default)

    Migration: Adapter authors can optionally add these properties to support custom dev entrypoints. If not specified, adapters will use the legacy behavior.

  • #​15700 4e7f3e8 Thanks @​ocavue! - Updates the internal logic during SSR by providing additional metadata for UI framework integrations.

  • #​15231 3928b87 Thanks @​rururux! - Adds a new optional getRemoteSize() method to the Image Service API.

    Previously, inferRemoteSize() had a fixed implementation that fetched the entire image to determine its dimensions.
    With this new helper function that extends inferRemoteSize(), you can now override or extend how remote image metadata is retrieved.

    This enables use cases such as:

    • Caching: Storing image dimensions in a database or local cache to avoid redundant network requests.
    • Provider APIs: Using a specific image provider's API (like Cloudinary or Vercel) to get dimensions without downloading the file.

    For example, you can add a simple cache layer to your existing image service:

    const cache = new Map();
    
    const myService = {
      ...baseService,
      async getRemoteSize(url, imageConfig) {
        if (cache.has(url)) return cache.get(url);
    
        const result = await baseService.getRemoteSize(url, imageConfig);
        cache.set(url, result);
        return result;
      },
    };
    

    See the Image Services API reference documentation for more information.

  • #​15077 a164c77 Thanks @​matthewp! - Updates the Integration API to add setPrerenderer() to the astro:build:start hook, allowing adapters to provide custom prerendering logic.

    The new API accepts either an AstroPrerenderer object directly, or a factory function that receives the default prerenderer:

    'astro:build:start': ({ setPrerenderer }) => {
      setPrerenderer((defaultPrerenderer) => ({
        name: 'my-prerenderer',
        async setup() {
          // Optional: called once before prerendering starts
        },
        async getStaticPaths() {
          // Returns array of { pathname: string, route: RouteData }
          return defaultPrerenderer.getStaticPaths();
        },
        async render(request, { routeData }) {
          // request: Request
          // routeData: RouteData
          // Returns: Response
        },
        async teardown() {
          // Optional: called after all pages are prerendered
        }
      }));
    }
    

    Also adds the astro:static-paths virtual module, which exports a StaticPaths class for adapters to collect all prerenderable paths from within their target runtime. This is useful when implementing a custom prerenderer that runs in a non-Node environment:

    // In your adapter's request handler (running in target runtime)
    import { App } from 'astro/app';
    import { StaticPaths } from 'astro:static-paths';
    
    export function createApp(manifest) {
      const app = new App(manifest);
    
      return {
        async fetch(request) {
          const { pathname } = new URL(request.url);
    
          // Expose endpoint for prerenderer to get static paths
          if (pathname === '/__astro_static_paths') {
            const staticPaths = new StaticPaths(app);
            const paths = await staticPaths.getAll();
            return new Response(JSON.stringify({ paths }));
          }
    
          // Normal request handling
          return app.render(request);
        },
      };
    }
    

    See the adapter reference for more details on implementing a custom prerenderer.

  • #​15345 840fbf9 Thanks @​matthewp! - Adds a new emitClientAsset function to astro/assets/utils for integration authors. This function allows emitting assets that will be moved to the client directory during SSR builds, useful for assets referenced in server-rendered content that need to be available on the client.

    import { emitClientAsset } from 'astro/assets/utils';
    
    // Inside a Vite plugin's transform or load hook
    const handle = emitClientAsset(this, {
      type: 'asset',
      name: 'my-image.png',
      source: imageBuffer,
    });
    
  • #​15460 ee7e53f Thanks @​florian-lefebvre! - Updates the Adapter API to allow providing a serverEntrypoint when using entryType: 'self'

    Astro 6 introduced a new powerful yet simple Adapter API for defining custom server entrypoints. You can now call setAdapter() with the entryType: 'self' option and specify your custom serverEntrypoint:

    export function myAdapter() {
      return {
        name: 'my-adapter',
        hooks: {
          'astro:config:done': ({ setAdapter }) => {
            setAdapter({
              name: 'my-adapter',
              entryType: 'self',
              serverEntrypoint: 'my-adapter/server.js',
              supportedAstroFeatures: {
                // ...
              },
            });
          },
        },
      };
    }
    

    If you need further customization at the Vite level, you can omit serverEntrypoint and instead specify your custom server entrypoint with vite.build.rollupOptions.input.

  • #​15781 2de969d Thanks @​ematipico! - Adds a new clientAddress option to the createContext() function

    Providing this value gives adapter and middleware authors explicit control over the client IP address. When not provided, accessing clientAddress throws an error consistent with other contexts where it is not set by the adapter.

    Additionally, both of the official Netlify and Vercel adapters have been updated to provide this information in their edge middleware.

    import { createContext } from 'astro/middleware';
    
    createContext({
      clientAddress: context.headers.get('x-real-ip'),
    });
    
  • #​15258 d339a18 Thanks @​ematipico! - Stabilizes the adapter feature experimentalStatiHeaders. If you were using this feature in any of the supported adapters, you'll need to change the name of the flag:

    export default defineConfig({
      adapter: netlify({
    -    experimentalStaticHeaders: true
    +    staticHeaders: true
      })
    })
    
  • #​15535 dfe2e22 Thanks @​florian-lefebvre! - Exports new createRequest() and writeResponse() utilities from astro/app/node

    To replace the deprecated NodeApp.createRequest() and NodeApp.writeResponse() methods, the astro/app/node module now exposes new createRequest() and writeResponse() utilities. These can be used to convert a NodeJS IncomingMessage into a web-standard Request and stream a web-standard Response into a NodeJS ServerResponse:

    import { createApp } from 'astro/app/entrypoint';
    import { createRequest, writeResponse } from 'astro/app/node';
    import { createServer } from 'node:http';
    
    const app = createApp();
    
    const server = createServer(async (req, res) => {
      const request = createRequest(req);
      const response = await app.render(request);
      await writeResponse(response, res);
    });
    
  • #​15755 f9ee868 Thanks @​matthewp! - Adds a new security.serverIslandBodySizeLimit configuration option

    Server island POST endpoints now enforce a body size limit, similar to the existing security.actionBodySizeLimit for Actions. The new option defaults to 1048576 (1 MB) and can be configured independently.

    Requests exceeding the limit are rejected with a 413 response. You can customize the limit in your Astro config:

    export default defineConfig({
      security: {
        serverIslandBodySizeLimit: 2097152, // 2 MB
      },
    });
    
  • #​15529 a509941 Thanks @​florian-lefebvre! - Adds a new build-in font provider npm to access fonts installed as NPM packages

    You can now add web fonts specified in your package.json through Astro's type-safe Fonts API. The npm font provider allows you to add fonts either from locally installed packages in node_modules or from a CDN.

    Set fontProviders.npm() as your fonts provider along with the required name and cssVariable values, and add options as needed:

    import { defineConfig, fontProviders } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        fonts: [
          {
            name: 'Roboto',
            provider: fontProviders.npm(),
            cssVariable: '--font-roboto',
          },
        ],
      },
    });
    

    See the NPM font provider reference documentation for more details.

  • #​15471 32b4302 Thanks @​ematipico! - Adds a new experimental flag queuedRendering to enable a queue-based rendering engine

    The new engine is based on a two-pass process, where the first pass
    traverses the tree of components, emits an ordered queue, and then the queue is rendered.

    The new engine does not use recursion, and comes with two customizable options.

    Early benchmarks showed significant speed improvements and memory efficiency in big projects.

Queue-rendered based

The new engine can be enabled in your Astro config with experimental.queuedRendering.enabled set to true, and can be further customized with additional sub-features.

// astro.config.mjs
export default defineConfig({
  experimental: {
    queuedRendering: {
      enabled: true,
    },
  },
});
Pooling

With the new engine enabled, you now have the option to have a pool of nodes that can be saved and reused across page rendering. Node pooling has no effect when rendering pages on demand (SSR) because these rendering requests don't share memory. However, it can be very useful for performance when building static pages.

// astro.config.mjs
export default defineConfig({
  experimental: {
    queuedRendering: {
      enabled: true,
      poolSize: 2000, // store up to 2k nodes to be reused across renderers
    },
  },
});
Content caching

The new engine additionally unlocks a new contentCache option. This allows you to cache values of nodes during the rendering phase. This is currently a boolean feature with no further customization (e.g. size of cache) that uses sensible defaults for most large content collections:

When disabled, the pool engine won't cache strings, but only types.

// astro.config.mjs
export default defineConfig({
  experimental: {
    queuedRendering: {
      enabled: true,
      contentCache: true, // enable re-use of node values
    },
  },
});

For more information on enabling and using this feature in your project, see the experimental queued rendering docs for more details.

  • #​14888 4cd3fe4 Thanks @​OliverSpeir! - Updates astro add cloudflare to better setup types, by adding ./worker-configuration.d.ts to tsconfig includes and a generate-types script to package.json

  • #​15646 0dd9d00 Thanks @​delucis! - Removes redundant fetchpriority attributes from the output of Astro’s <Image> component

    Previously, Astro would always include fetchpriority="auto" on images not using the priority attribute.
    However, this is the default value, so specifying it is redundant. This change omits the attribute by default.

  • #​15291 89b6cdd Thanks @​florian-lefebvre! - Removes the experimental.fonts flag and replaces it with a new configuration option fonts - (v6 upgrade guidance)

  • #​15495 5b99e90 Thanks @​leekeh! - Adds a new middlewareMode adapter feature to replace the previous edgeMiddleware option.

    This feature only impacts adapter authors. If your adapter supports edgeMiddleware, you should upgrade to the new middlewareMode option to specify the middleware mode for your adapter as soon as possible. The edgeMiddleware feature is deprecated and will be removed in a future major release.

    export default function createIntegration() {
      return {
        name: '@example/my-adapter',
        hooks: {
          'astro:config:done': ({ setAdapter }) => {
            setAdapter({
              name: '@example/my-adapter',
              serverEntrypoint: '@example/my-adapter/server.js',
              adapterFeatures: {
    -            edgeMiddleware: true
    +            middlewareMode: 'edge'
              }
            });
          },
        },
      };
    }
    
  • #​15694 66449c9 Thanks @​matthewp! - Adds preserveBuildClientDir option to adapter features

    Adapters can now opt in to preserving the client/server directory structure for static builds by setting preserveBuildClientDir: true in their adapter features. When enabled, static builds will output files to build.client instead of directly to outDir.

    This is useful for adapters that require a consistent directory structure regardless of the build output type, such as deploying to platforms with specific file organization requirements.

    // my-adapter/index.js
    export default function myAdapter() {
      return {
        name: 'my-adapter',
        hooks: {
          'astro:config:done': ({ setAdapter }) => {
            setAdapter({
              name: 'my-adapter',
              adapterFeatures: {
                buildOutput: 'static',
                preserveBuildClientDir: true,
              },
            });
          },
        },
      };
    }
    
  • #​15332 7c55f80 Thanks @​matthewp! - Adds a fileURL option to renderMarkdown in content loaders, enabling resolution of relative image paths. When provided, relative image paths in markdown will be resolved relative to the specified file URL and included in metadata.localImagePaths.

    const loader = {
      name: 'my-loader',
      load: async ({ store, renderMarkdown }) => {
        const content = `
    # My Post
    
    ![Local image](./image.png)
    `;
        // Provide a fileURL to resolve relative image paths
        const fileURL = new URL('./posts/my-post.md', import.meta.url);
        const rendered = await renderMarkdown(content, { fileURL });
        // rendered.metadata.localImagePaths now contains the resolved image path
      },
    };
    
  • #​15407 aedbbd8 Thanks @​ematipico! - Adds support for responsive images when security.csp is enabled, out of the box.

    Astro's implementation of responsive image styles has been updated to be compatible with a configured Content Security Policy.

    Instead of, injecting style elements at runtime, Astro will now generate your styles at build time using a combination of class="" and data-* attributes. This means that your processed styles are loaded and hashed out of the box by Astro.

    If you were previously choosing between Astro's CSP feature and including responsive images on your site, you may now use them together.

  • #​15543 d43841d Thanks @​Princesseuh! - Adds a new experimental.rustCompiler flag to opt into the experimental Rust-based Astro compiler

    This experimental compiler is faster, provides better error messages, and generally has better support for modern JavaScript, TypeScript, and CSS features.

    After enabling in your Astro config, the @astrojs/compiler-rs package must also be installed into your project separately:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        rustCompiler: true,
      },
    });
    

    This new compiler is still in early development and may exhibit some differences compared to the existing Go-based compiler. Notably, this compiler is generally more strict in regard to invalid HTML syntax and may throw errors in cases where the Go-based compiler would have been more lenient. For example, unclosed tags (e.g. <p>My paragraph) will now result in errors.

    For more information about using this experimental feature in your project, especially regarding expected differences and limitations, please see the experimental Rust compiler reference docs. To give feedback on the compiler, or to keep up with its development, see the RFC for a new compiler for Astro for more information and discussion.

  • #​15349 a257c4c Thanks @​ascorbic! - Passes collection name to live content loaders

    Live content collection loaders now receive the collection name as part of their parameters. This is helpful for loaders that manage multiple collections or need to differentiate behavior based on the collection being accessed.

    export function storeLoader({ field, key }) {
      return {
        name: 'store-loader',
        loadCollection: async ({ filter, collection }) => {
          // ...
        },
        loadEntry: async ({ filter, collection }) => {
          // ...
        },
      };
    }
    
  • #​15006 f361730 Thanks @​florian-lefebvre! - Adds new session driver object shape

    For greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object:

    -import { defineConfig } from 'astro/config'
    +import { defineConfig, sessionDrivers } from 'astro/config'
    
    export default defineConfig({
      session: {
    -    driver: 'redis',
    -    options: {
    -      url: process.env.REDIS_URL
    -    },
    +    driver: sessionDrivers.redis({
    +      url: process.env.REDIS_URL
    +    }),
      }
    })
    

    Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.

  • #​15291 89b6cdd Thanks @​florian-lefebvre! - Adds a new Fonts API to provide first-party support for adding custom fonts in Astro.

    This feature allows you to use fonts from both your file system and several built-in supported providers (e.g. Google, Fontsource, Bunny) through a unified API. Keep your site performant thanks to sensible defaults and automatic optimizations including preloading and fallback font generation.

    To enable this feature, configure fonts with one or more fonts:

    import { defineConfig, fontProviders } from 'astro/config';
    
    export default defineConfig({
      fonts: [
        {
          provider: fontProviders.fontsource(),
          name: 'Roboto',
          cssVariable: '--font-roboto',
        },
      ],
    });
    

    Import and include the <Font /> component with the required cssVariable property in the head of your page, usually in a dedicated Head.astro component or in a layout component directly:

    ---
    // src/layouts/Layout.astro
    import { Font } from 'astro:assets';
    ---
    
    <html>
      <head>
        <Font cssVariable="--font-roboto" preload />
      </head>
      <body>
        <slot />
      </body>
    </html>
    

    In any page rendered with that layout, including the layout component itself, you can now define styles with your font's cssVariable to apply your custom font.

    In the following example, the <h1> heading will have the custom font applied, while the paragraph <p> will not.

    ---
    // src/pages/example.astro
    import Layout from '../layouts/Layout.astro';
    ---
    
    <Layout>
      <h1>In a galaxy far, far away...</h1>
    
      <p>Custom fonts make my headings much cooler!</p>
    
      <style>
        h1 {
          font-family: var('--font-roboto');
        }
      </style>
    </Layout>
    

    Visit the updated fonts guide to learn more about adding custom fonts to your project.

  • #​14550 9c282b5 Thanks @​ascorbic! - Adds support for live content collections

    Live content collections are a new type of content collection that fetch their data at runtime rather than build time. This allows you to access frequently updated data from CMSs, APIs, databases, or other sources using a unified API, without needing to rebuild your site when the data changes.

Live collections vs build-time collections

In Astro 5.0, the content layer API added support for adding diverse content sources to content collections. You can create loaders that fetch data from any source at build time, and then access it inside a page via getEntry() and getCollection(). The data is cached between builds, giving fast access and updates.

However, there was no method for updating the data store between builds, meaning any updates to the data needed a full site deploy, even if the pages are rendered on demand. This meant that content collections were not suitable for pages that update frequently. Instead, these pages tended to access the APIs directly in the frontmatter. This worked, but it led to a lot of boilerplate, and meant users didn't benefit from the simple, unified API that content loaders offer. In most cases, users tended to individually create loader libraries shared between pages.

Live content collections (introduced experimentally in Astro 5.10) solve this problem by allowing you to create loaders that fetch data at runtime, rather than build time. This means that the data is always up-to-date, without needing to rebuild the site.

How to use

To use live collections, create a new src/live.config.ts file (alongside your src/content.config.ts if you have one) to define your live collections with a live content loader using the new defineLiveCollection() function from the astro:content module:

import { defineLiveCollection } from 'astro:content';
import { storeLoader } from '@mystore/astro-loader';

const products = defineLiveCollection({
  loader: storeLoader({
    apiKey: process.env.STORE_API_KEY,
    endpoint: 'https://api.mystore.com/v1',
  }),
});

export const collections = { products };

You can then use the getLiveCollection() and getLiveEntry() functions to access your live data, along with error handling (since anything can happen when requesting live data!):

---
import { getLiveCollection, getLiveEntry, render } from 'astro:content';
// Get all products
const { entries: allProducts, error } = await getLiveCollection('products');
if (error) {
  // Handle error appropriately
  console.error(error.message);
}

// Get products with a filter (if supported by your loader)
const { entries: electronics } = await getLiveCollection('products', { category: 'electronics' });

// Get a single product by ID (string syntax)
const { entry: product, error: productError } = await getLiveEntry('products', Astro.params.id);
if (productError) {
  return Astro.redirect('/404');
}

// Get a single product with a custom query (if supported by your loader) using a filter object
const { entry: productBySlug } = await getLiveEntry('products', { slug: Astro.params.slug });
const { Content } = await render(product);
---

<h1>{product.data.title}</h1>
<Content />
Upgrading from experimental live collections

If you were using the experimental feature, you must remove the experimental.liveContentCollections flag from your astro.config.* file:

 export default defineConfig({
   // ...
-  experimental: {
-    liveContentCollections: true,
-  },
 });

No other changes to your project code are required as long as you have been keeping up with Astro 5.x patch releases, which contained breaking changes to this experimental feature. If you experience problems with your live collections after upgrading to Astro v6 and removing this flag, please review the Astro CHANGELOG from 5.10.2 onwards for any potential updates you might have missed, or follow the current v6 documentation for live collections.

  • #​15548 5b8f573 Thanks @​florian-lefebvre! - Adds a new optional embeddedLangs prop to the <Code /> component to support languages beyond the primary lang

    This allows, for example, highlighting .vue files with a <script setup lang="tsx"> block correctly:

    ---
    import { Code } from 'astro:components';
    
    const code = `
    <script setup lang="tsx">
    const Text = ({ text }: { text: string }) => <div>{text}</div>;
    </script>
    
    <template>
      <Text text="hello world" />
    </template>`;
    ---
    
    <Code {code} lang="vue" embeddedLangs={['tsx']} />
    

    See the <Code /> component documentation for more details.

  • #​14826 170f64e Thanks @​florian-lefebvre! - Adds an option prerenderConflictBehavior to configure the behavior of conflicting prerendered routes

    By default, Astro warns you during the build about any conflicts between multiple dynamic routes that can result in the same output path. For example /blog/[slug] and /blog/[...all] both could try to prerender the /blog/post-1 path. In such cases, Astro renders only the highest priority route for the conflicting path. This allows your site to build successfully, although you may discover that some pages are rendered by unexpected routes.

    With the new prerenderConflictBehavior configuration option, you can now configure this further:

    • prerenderConflictBehavior: 'error' fails the build
    • prerenderConflictBehavior: 'warn' (default) logs a warning and the highest-priority route wins
    • prerenderConflictBehavior: 'ignore' silently picks the highest-priority route when conflicts occur
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
    +    prerenderConflictBehavior: 'error',
    });
    
  • #​14946 95c40f7 Thanks @​ematipico! - Removes the experimental.csp flag and replaces it with a new configuration option security.csp - (v6 upgrade guidance)

  • #​15579 08437d5 Thanks @​ascorbic! - Adds two new experimental flags for a Route Caching API and further configuration-level Route Rules for controlling SSR response caching.

    Route caching gives you a platform-agnostic way to cache server-rendered responses, based on web standard cache headers. You set caching directives in your routes using Astro.cache (in .astro pages) or context.cache (in API routes and middleware), and Astro translates them into the appropriate headers or runtime behavior depending on your adapter. You can also define cache rules for routes declaratively in your config using experimental.routeRules, without modifying route code.

    This feature requires on-demand rendering. Prerendered pages are already static and do not use route caching.

Getting started

Enable the feature by configuring experimental.cache with a cache provider in your Astro config:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';
import { memoryCache } from 'astro/config';

export default defineConfig({
  adapter: node({ mode: 'standalone' }),
  experimental: {
    cache: {
      provider: memoryCache(),
    },
  },
});
Using Astro.cache and context.cache

In .astro pages, use Astro.cache.set() to control caching:

---
// src/pages/index.astro
Astro.cache.set({
  maxAge: 120, // Cache for 2 minutes
  swr: 60, // Serve stale for 1 minute while revalidating
  tags: ['home'], // Tag for targeted invalidation
});
---

<html><body>Cached page</body></html>

In API routes and middleware, use context.cache:

// src/pages/api/data.ts
export function GET(context) {
  context.cache.set({
    maxAge: 300,
    tags: ['api', 'data'],
  });
  return Response.json({ ok: true });
}
Cache options

cache.set() accepts the following options:

  • maxAge (number): Time in seconds the response is considered fresh.
  • swr (number): Stale-while-revalidate window in seconds. During this window, stale content is served while a fresh response is generated in the background.
  • tags (string[]): Cache tags for targeted invalidation. Tags accumulate across multiple set() calls within a request.
  • lastModified (Date): When multiple set() calls provide lastModified, the most recent date wins.
  • etag (string): Entity tag for conditional requests.

Call cache.set(false) to explicitly opt out of caching for a request.

Multiple calls to cache.set() within a single request are merged: scalar values use last-write-wins, lastModified uses most-recent-wins, and tags accumulate.

Invalidation

Purge cached entries by tag or path using cache.invalidate():

// Invalidate all entries tagged 'data'
await context.cache.invalidate({ tags: ['data'] });

// Invalidate a specific path
await context.cache.invalidate({ path: '/api/data' });
Config-level route rules

Use experimental.routeRules to set default cache options for routes without modifying route code. Supports Nitro-style shortcuts for ergonomic configuration:

import { memoryCache } from 'astro/config';

export default defineConfig({
  experimental: {
    cache: {
      provider: memoryCache(),
    },
    routeRules: {
      // Shortcut form (Nitro-style)
      '/api/*': { swr: 600 },

      // Full form with nested cache
      '/products/*': { cache: { maxAge: 3600, tags: ['products'] } },
    },
  },
});

Route patterns support static paths, dynamic parameters ([slug]), and rest parameters ([...path]). Per-route cache.set() calls merge with (and can override) the config-level defaults.

You can also read the current cache state via cache.options:

const { maxAge, swr, tags } = context.cache.options;
Cache providers

Cache behavior is determined by the configured cache provider. There are two types:

  • CDN providers set response headers (e.g. CDN-Cache-Control, Cache-Tag) and let the CDN handle caching. Astro strips these headers before sending the response to the client.
  • Runtime providers implement onRequest() to intercept and cache responses in-process, adding an X-Astro-Cache header (HIT/MISS/STALE) for observability.
Built-in memory cache provider

Astro includes a built-in, in-memory LRU runtime cache provider. Import memoryCache from astro/config to configure it.

Features:

  • In-memory LRU cache with configurable max entries (default: 1000)
  • Stale-while-revalidate support
  • Tag-based and path-based invalidation
  • X-Astro-Cache response header: HIT, MISS, or STALE
  • Query parameter sorting for better hit rates (?b=2&a=1 and ?a=1&b=2 hit the same entry)
  • Common tracking parameters (utm_*, fbclid, gclid, etc.) excluded from cache keys by default
  • Vary header support — responses that set Vary automatically get separate cache entries per variant
  • Configurable query parameter filtering via query.exclude (glob patterns) and query.include (allowlist)

For more information on enabling and using this feature in your project, see the Experimental Route Caching docs.
For a complete overview and to give feedback on this experimental API, see the Route Caching RFC.

  • #​15483 7be3308 Thanks @​florian-lefebvre! - Adds streaming option to the createApp() function in the Adapter API, mirroring the same functionality available when creating a new App instance

    An adapter's createApp() function now accepts streaming (defaults to true) as an option. HTML streaming breaks a document into chunks to send over the network and render on the page in order. This normally results in visitors seeing your HTML as fast as possible but factors such as network conditions and waiting for data fetches can block page rendering.

    HTML streaming helps with performance and generally provides a better visitor experience. In most cases, disabling streaming is not recommended.

    However, when you need to disable HTML streaming (e.g. your host only supports non-streamed HTML caching at the CDN level), you can opt out of the default behavior by passing streaming: false to createApp():

    import { createApp } from 'astro/app/entrypoint';
    
    const app = createApp({ streaming: false });
    

    See more about the createApp() function in the Adapter API reference.

Patch Changes
  • #​15423 c5ea720 Thanks @​matthewp! - Improves error message when a dynamic redirect destination does not match any existing route.

    Previously, configuring a redirect like /categories/[category]/categories/[category]/1 in static output mode would fail with a misleading "getStaticPaths required" error. Now, Astro detects this early and provides a clear error explaining that the destination does not match any existing route.

  • #​15167 4fca170 Thanks @​HiDeoo! - Fixes an issue where CSS from unused components, when using content collections, could be incorrectly included between page navigations in development mode.

  • #​15565 30cd6db Thanks @​ematipico! - Fixes an issue where the use of the Astro internal logger couldn't work with Cloudflare Vite plugin.

  • #​15508 2c6484a Thanks @​KTibow! - Fixes behavior when shortcuts are used before server is ready

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - Improves JSDoc annotations for AstroGlobal, AstroSharedContext and APIContext types

  • #​15712 7ac43c7 Thanks @​florian-lefebvre! - Improves astro info by supporting more operating systems when copying the information to the clipboard.

  • #​15054 22db567 Thanks @​matthewp! - Improves zod union type error messages to show expected vs received types instead of generic "Invalid input"

  • #​15064 caf5621 Thanks @​ascorbic! - Fixes a bug that caused incorrect warnings of duplicate entries to be logged by the glob loader when editing a file

  • #​15801 01db4f3 Thanks @​ascorbic! - Improves the experience of working with experimental route caching in dev mode by replacing some errors with silent no-ops, avoiding the need to write conditional logic to handle different modes

    Adds a cache.enabled property to CacheLike so libraries can check whether caching is active without try/catch.

  • #​15562 e14a51d Thanks @​florian-lefebvre! - Removes types for the astro:ssr-manifest module, which was removed

  • #​15542 9760404 Thanks @​rururux! - Improves rendering by preserving hidden="until-found" value in attributes

  • #​15044 7cac71b Thanks @​florian-lefebvre! - Removes an exposed internal API of the preview server

  • #​15573 d789452 Thanks @​matthewp! - Clear the route cache on content changes so slug pages reflect updated data during dev.

  • #​15308 89cbcfa Thanks @​matthewp! - Fixes styles missing in dev for prerendered pages when using Cloudflare adapter

  • #​15435 957b9fe Thanks @​rururux! - Improves compatibility of the built-in image endpoint with runtimes that don't support CJS dependencies correctly

  • #​15640 4c1a801 Thanks @​ematipico! - Reverts the support of Shiki with CSP. Unfortunately, after exhaustive tests, the highlighter can't be supported to cover all cases.

    Adds a warning when both Content Security Policy (CSP) and Shiki syntax highlighting are enabled, as they are incompatible due to Shiki's use of inline styles

  • #​15415 cc3c46c Thanks @​ematipico! - Fixes an issue where CSP headers were incorrectly injected in the development server.

  • #​15412 c546563 Thanks @​florian-lefebvre! - Improves the AstroAdapter type and how legacy adapters are handled

  • #​15322 18e0980 Thanks @​matthewp! - Prevents missing CSS when using both SSR and prerendered routes

  • #​15760 f49a27f Thanks @​ematipico! - Fixed an issue where queued rendering wasn't correctly re-using the saved nodes.

  • #​15277 cb99214 Thanks @​ematipico! - Fixes an issue where the function createShikiHighlighter would always create a new Shiki highlighter instance. Now the function returns a cached version of the highlighter based on the Shiki options. This should improve the performance for sites that heavily rely on Shiki and code in their pages.

  • #​15394 5520f89 Thanks @​florian-lefebvre! - Fixes a case where using the Fonts API with netlify dev wouldn't work because of query parameters

  • #​15605 f6473fd Thanks @​ascorbic! - Improves .astro component SSR rendering performance by up to 2x.

    This includes several optimizations to the way that Astro generates and renders components on the server. These are mostly micro-optimizations, but they add up to a significant improvement in performance. Most pages will benefit, but pages with many components will see the biggest improvement, as will pages with lots of strings (e.g. text-heavy pages with lots of HTML elements).

  • #​15721 e6e146c Thanks @​matthewp! - Fixes action route handling to return 404 for requests to prototype method names like constructor or toString used as action paths

  • #​15497 a93c81d Thanks @​matthewp! - Fix dev reloads for content collection Markdown updates under Vite 7.

  • #​15780 e0ac125 Thanks @​ematipico! - Prevents vite.envPrefix misconfiguration from exposing access: "secret" environment variables in client-side bundles. Astro now throws a clear error at startup if any vite.envPrefix entry matches a variable declared with access: "secret" in env.schema.

    For example, the following configuration will throw an error for API_SECRET because it's defined as secret its name matches ['PUBLIC_', 'API_'] defined in env.schema:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      env: {
        schema: {
          API_SECRET: envField.string({ context: 'server', access: 'secret', optional: true }),
          API_URL: envField.string({ context: 'server', access: 'public', optional: true }),
        },
      },
      vite: {
        envPrefix: ['PUBLIC_', 'API_'],
      },
    });
    
  • #​15514 999a7dd Thanks @​veeceey! - Fixes font flash (FOUT) during ClientRouter navigation by preserving inline <style> elements and font preload links in the head during page transitions.

    Previously, @font-face declarations from the <Font> component were removed and re-inserted on every client-side navigation, causing the browser to re-evaluate them.

  • #​15560 170ed89 Thanks @​z0mt3c! - Fix X-Forwarded-Proto validation when allowedDomains includes both protocol and hostname fields. The protocol check no longer fails due to hostname mismatch against the hardcoded test URL.

  • #​15704 862d77b Thanks @​umutkeltek! - Fixes i18n fallback middleware intercepting non-404 responses

    The fallback middleware was triggering for all responses with status >= 300, including legitimate 3xx redirects, 403 forbidden, and 5xx server errors. This broke auth flows and form submissions on localized server routes. The fallback now correctly only triggers for 404 (page not found) responses.

  • #​15661 7150a2e Thanks @​ematipico! - Fixes a build error when generating projects with 100k+ static routes.

  • #​15580 a92333c Thanks @​ematipico! - Fixes a build error when generating projects with a large number of static routes

  • #​15176 9265546 Thanks @​matthewp! - Fixes hydration for framework components inside MDX when using Astro.slots.render()

    Previously, when multiple framework components with client:* directives were passed as named slots to an Astro component in MDX, only the first slot would hydrate correctly. Subsequent slots would render their HTML but fail to include the necessary hydration scripts.

  • #​15506 074901f Thanks @​ascorbic! - Fixes a race condition where concurrent requests to dynamic routes in the dev server could produce incorrect params.

  • #​15444 10b0422 Thanks @​AhmadYasser1! - Fixes Astro.rewrite returning 404 when rewriting to a URL with non-ASCII characters

    When rewriting to a path containing non-ASCII characters (e.g., /redirected/héllo), the route lookup compared encoded distURL hrefs against decoded pathnames, causing the comparison to always fail and resulting in a 404. This fix compares against the encoded pathname instead.

  • #​15728 12ca621 Thanks @​SvetimFM! - Improves internal state retention for persisted elements during view transitions, especially avoiding WebGL context loss in Safari and resets of CSS transitions and iframes in modern Chromium and Firefox browsers

  • #​15279 8983f17 Thanks @​ematipico! - Fixes an issue where the dev server would serve files like /README.md from the project root when they shouldn't be accessible. A new route guard middleware now blocks direct URL access to files that exist outside of srcDir and publicDir, returning a 404 instead.

  • #​15703 829182b Thanks @​matthewp! - Fixes server islands returning a 500 error in dev mode for adapters that do not set adapterFeatures.buildOutput (e.g. @astrojs/netlify)

  • #​15749 573d188 Thanks @​ascorbic! - Fixes a bug that caused session.regenerate() to silently lose session data

    Previously, regenerated session data was not saved under the new session ID unless set() was also called.

  • #​15549 be1c87e Thanks @​0xRozier! - Fixes an issue where original (unoptimized) images from prerendered pages could be kept in the build output during SSR builds.

  • #​15454 b47a4e1 Thanks @​Fryuni! - Fixes a race condition in the content layer which could result in dropped content collection entries.

  • #​15685 1a323e5 Thanks @​jcayzac! - Fix regression where SVG images in content collection image() fields could not be rendered as inline components. This behavior is now restored while preserving the TLA deadlock fix.

  • #​15603 5bc2b2c Thanks @​0xRozier! - Fixes a deadlock that occurred when using SVG images in content collections

  • #​15385 9e16d63 Thanks @​matthewp! - Fixes content layer loaders that use dynamic imports

    Content collection loaders can now use await import() and import.meta.glob() to dynamically import modules during build. Previously, these would fail with "Vite module runner has been closed."

  • #​15565 30cd6db Thanks @​ematipico! - Fixes an issue where the use of the Code component would result in an unexpected error.

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - Fixes remote images Etag header handling by disabling internal cache

  • #​15317 7e1e35a Thanks @​matthewp! - Fixes ?raw imports failing when used in both SSR and prerendered routes

  • #​15809 94b4a46 Thanks @​Princesseuh! - Fixes fit defaults not being applied unless layout was also specified

  • #​15563 e959698 Thanks @​ematipico! - Fixes an issue where warnings would be logged during the build using one of the official adapters

  • #​15121 06261e0 Thanks @​ematipico! - Fixes a bug where the Astro, with the Cloudflare integration, couldn't correctly serve certain routes in the development server.

  • #​15585 98ea30c Thanks @​matthewp! - Add a default body size limit for server actions to prevent oversized requests from exhausting memory.

  • #​15264 11efb05 Thanks @​florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22

  • #​15778 4ebc1e3 Thanks @​ematipico! - Fixes an issue where the computed clientAddress was incorrect in cases of a Request header with multiple values. The clientAddress is now also validated to contain only characters valid in IP addresses, rejecting injection payloads.

  • #​15565 30cd6db Thanks @​ematipico! - Fixes an issue where the new Astro v6 development server didn't log anything when navigating the pages.

  • #​15024 22c48ba Thanks @​florian-lefebvre! - Fixes a case where JSON schema generation would fail for unrepresentable types

  • #​15669 d5a888b Thanks @​florian-lefebvre! - Removes the cssesc dependency

    This CommonJS dependency could sometimes cause errors because Astro is ESM-only. It is now replaced with a built-in ESM-friendly implementation.

  • #​15740 c5016fc Thanks @​matthewp! - Removes an escape hatch that skipped attribute escaping for URL values containing &, ensuring all dynamic attribute values are consistently escaped

  • #​15756 b6c64d1 Thanks @​matthewp! - Hardens the dev server by validating Sec-Fetch metadata headers to restrict cross-origin subresource requests

  • #​15744 fabb710 Thanks @​matthewp! - Fixes cookie handling during error page rendering to ensure cookies set by middleware are consistently included in the response

  • #​15776 e9a9cc6 Thanks @​matthewp! - Hardens error page response merging to ensure framing headers from the original response are not carried over to the rendered error page

  • #​15759 39ff2a5 Thanks @​matthewp! - Adds a new bodySizeLimit option to the @astrojs/node adapter

    You can now configure a maximum allowed request body size for your Node.js standalone server. The default limit is 1 GB. Set the value in bytes, or pass 0 to disable the limit entirely:

    import node from '@astrojs/node';
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      adapter: node({
        mode: 'standalone',
        bodySizeLimit: 1024 * 1024 * 100, // 100 MB
      }),
    });
    
  • #​15777 02e24d9 Thanks @​matthewp! - Fixes CSRF origin check mismatch by passing the actual server listening port to createRequest, ensuring the constructed URL origin includes the correct port (e.g., http://localhost:4321 instead of http://localhost). Also restricts X-Forwarded-Proto to only be trusted when allowedDomains is configured.

  • #​15742 9d9699c Thanks @​matthewp! - Hardens clientAddress resolution to respect security.allowedDomains for X-Forwarded-For, consistent with the existing handling of X-Forwarded-Host, X-Forwarded-Proto, and X-Forwarded-Port. The X-Forwarded-For header is now only used to determine Astro.clientAddress when the request's host has been validated against an allowedDomains entry. Without a matching domain, clientAddress falls back to the socket's remote address.

  • #​15768 6328f1a Thanks @​matthewp! - Hardens internal cookie parsing to use a null-prototype object consistently for the fallback path, aligning with how the cookie library handles parsed values

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - Fixes images not working in development when using setups with port forwarding

  • #​15811 2ba0db5 Thanks @​ematipico! - Fixes integration-injected scripts (e.g. Alpine.js via injectScript()) not being loaded in the dev server when using non-runnable environment adapters like @astrojs/cloudflare.

  • #​15208 8dbdd8e Thanks @​matthewp! - Makes session.driver optional in config schema, allowing adapters to provide default drivers

    Adapters like Cloudflare, Netlify, and Node provide default session drivers, so users can now configure session options (like ttl) without explicitly specifying a driver.

  • #​15260 abca1eb Thanks @​ematipico! - Fixes an issue where adding new pages weren't correctly shown when using the development server.

  • #​15591 1ed07bf Thanks @​renovate! - Upgrades devalue to v5.6.3

  • #​15137 2f70bf1 Thanks @​matthewp! - Adds legacy.collectionsBackwardsCompat flag that restores v5 backwards compatibility behavior for legacy content collections - (v6 upgrade guidance)

    When enabled, this flag allows:

    • Collections defined without loaders (automatically get glob loader)
    • Collections with type: 'content' or type: 'data'
    • Config files located at src/content/config.ts (legacy location)
    • Legacy entry API: entry.slug and entry.render() methods
    • Path-based entry IDs instead of slug-based IDs
    // astro.config.mjs
    export default defineConfig({
      legacy: {
        collectionsBackwardsCompat: true,
      },
    });
    

    This is a temporary migration helper for v6 upgrades. Migrate collections to the Content Layer API, then disable this flag.

  • #​15550 58df907 Thanks @​florian-lefebvre! - Improves the JSDoc annotations for the AstroAdapter type

  • #​15696 a9fd221 Thanks @​Princesseuh! - Fixes images not working in MDX when using the Cloudflare adapter in certain cases

  • #​15386 a0234a3 Thanks @​OliverSpeir! - Updates astro add cloudflare to use the latest valid compatibility_date in the wrangler config, if available

  • #​15036 f125a73 Thanks @​florian-lefebvre! - Fixes certain aliases not working when using images in JSON files with the content layer

  • #​15693 4db2089 Thanks @​ArmandPhilippot! - Fixes the links to Astro Docs to match the v6 structure.

  • #​15093 8d5f783 Thanks @​matthewp! - Reduces build memory by filtering routes per environment so each only builds the pages it needs

  • #​15268 54e5cc4 Thanks @​rururux! - fix: avoid creating unused images during build in Picture component

  • #​15757 631aaed Thanks @​matthewp! - Hardens URL pathname normalization to consistently handle backslash characters after decoding, ensuring middleware and router see the same canonical pathname

  • #​15337 7ff7b11 Thanks @​ematipico! - Fixes a bug where the development server couldn't serve newly created new pages while the development server is running.

  • #​15535 dfe2e22 Thanks @​florian-lefebvre! - Fixes the types of createApp() exported from astro/app/entrypoint

  • #​15073 2a39c32 Thanks @​ascorbic! - Don't log an error when there is no content config

  • #​15717 4000aaa Thanks @​matthewp! - Ensures that URLs with multiple leading slashes (e.g. //admin) are normalized to a single slash before reaching middleware, so that pathname checks like context.url.pathname.startsWith('/admin') work consistently regardless of the request URL format

  • #​15450 50c9129 Thanks @​florian-lefebvre! - Fixes a case where build.serverEntry would not be respected when using the new Adapter API

  • #​15331 4592be5 Thanks @​matthewp! - Fixes an issue where API routes would overwrite public files during build. Public files now correctly take priority over generated routes in both dev and build modes.

  • #​15414 faedcc4 Thanks @​sapphi-red! - Fixes a bug where some requests to the dev server didn't start with the leading /.

  • #​15419 a18d727 Thanks @​ematipico! - Fixes an issue where the add command could accept any arbitrary value, leading the possible command injections. Now add and --add accepts
    values that are only acceptable npmjs.org names.

  • #​15507 07f6610 Thanks @​matthewp! - Avoid bundling SSR renderers when only API endpoints are dynamic

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - Reduces Astro’s install size by around 8 MB

  • #​15752 918d394 Thanks @​ascorbic! - Fixes an issue where a session ID from a cookie with no matching server-side data was accepted as-is. The session now generates a new ID when the cookie value has no corresponding storage entry.

  • #​15743 3b4252a Thanks @​matthewp! - Hardens config-based redirects with catch-all parameters to prevent producing protocol-relative URLs (e.g. //example.com) in the Location header

  • #​15761 8939751 Thanks @​ematipico! - Fixes an issue where it wasn't possible to set experimental.queuedRendering.poolSize to 0.

  • #​15633 9d293c2 Thanks @​jwoyo! - Fixes a case where <script> tags from components passed as slots to server islands were not included in the response

  • #​15491 6c60b05 Thanks @​matthewp! - Fixes a case where setting vite.server.allowedHosts: true was turned into an invalid array

  • #​15459 a4406b4 Thanks @​florian-lefebvre! - Fixes a case where context.csp was logging warnings in development that should be logged in production only

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - Enables the ClientRouter to preserve the original hash part of the target URL during server side redirects.

  • #​15133 53b125b Thanks @​HiDeoo! - Fixes an issue where adding or removing <style> tags in Astro components would not visually update styles during development without restarting the development server.

  • #​15362 dbf71c0 Thanks @​jcayzac! - Fixes inferSize being kept in the HTML attributes of the emitted <img> when that option is used with an image that is not remote.

  • #​15421 bf62b6f Thanks @​Princesseuh! - Removes unintended logging

  • #​15732 2ce9e74 Thanks @​florian-lefebvre! - Updates docs links to point to the stable release

  • #​15718 14f37b8 Thanks @​florian-lefebvre! - Fixes a case where internal headers may leak when rendering error pages

  • #​15214 6bab8c9 Thanks @​ematipico! - Fixes an issue where the internal performance timers weren't correctly updated to reflect new build pipeline.

  • #​15112 5751d2b Thanks @​HiDeoo! - Fixes a Windows-specific build issue when importing an Astro component with a <script> tag using an import alias.

  • #​15345 840fbf9 Thanks @​matthewp! - Fixes an issue where .sql files (and other non-asset module types) were incorrectly moved to the client assets folder during SSR builds, causing "no such module" errors at runtime.

    The ssrMoveAssets function now reads the Vite manifest to determine which files are actual client assets (CSS and static assets like images) and only moves those, leaving server-side module files in place.

  • #​15259 8670a69 Thanks @​ematipico! - Fixes an issue where styles weren't correctly reloaded when using the @astrojs/cloudflare adapter.

  • #​15473 d653b86 Thanks @​matthewp! - Improves Host header handling for SSR deployments behind proxies

  • #​15047 5580372 Thanks @​matthewp! - Fixes wrangler config template in astro add cloudflare to use correct entrypoint and compatibility date

  • #​14589 7038f07 Thanks @​43081j! - Improves CLI styling

  • #​15586 35bc814 Thanks @​matthewp! - Fixes an issue where allowlists were not being enforced when handling remote images

  • #​15422 68770ef Thanks @​matthewp! - Upgrade to @​astrojs/compiler@​3.0.0-beta

  • #​15205 12adc55 Thanks @​martrapp! - Fixes an issue where the astro:page-load event did not fire on initial page loads.

  • #​15125 6feb0d7 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Changes the font format downloaded by default when using the experimental Fonts API. Additionally, adds a new formats configuration option to specify which font formats to download.

    Previously, Astro was opinionated about which font sources would be kept for usage, mainly keeping woff2 and woff files.

    You can now specify what font formats should be downloaded (if available). Only woff2 files are downloaded by default.

What should I do?

If you were previously relying on Astro downloading the woff format, you will now need to specify this explicitly with the new formats configuration option. Additionally, you may also specify any additional file formats to download if available:

// astro.config.mjs
import { defineConfig, fontProviders } from 'astro/config'

export default defineConfig({
    experimental: {
        fonts: [{
            name: 'Roboto',
            cssVariable: '--font-roboto',
            provider: fontProviders.google(),
+            formats: ['woff2', 'woff', 'otf']
        }]
    }
})

v5.18.2

Compare Source

Patch Changes
  • #​16813 8f7d8c4 Thanks @​matthewp! - Populates styles in the SSR manifest for prerendered routes. Previously, prerendered routes had styles: [] in the manifest, making it impossible for workers or middleware to discover which CSS files a prerendered page uses.

v5.18.1

Compare Source

Patch Changes

v5.18.0

Compare Source

Minor Changes
  • #​15589 b7dd447 Thanks @​qzio! - Adds a new security.actionBodySizeLimit option to configure the maximum size of Astro Actions request bodies.

    This lets you increase the default 1 MB limit when your actions need to accept larger payloads. For example, actions that handle file uploads or large JSON payloads can now opt in to a higher limit.

    If you do not set this option, Astro continues to enforce the 1 MB default to help prevent abuse.

    // astro.config.mjs
    export default defineConfig({
      security: {
        actionBodySizeLimit: 10 * 1024 * 1024, // set to 10 MB
      },
    });
    
Patch Changes
  • #​15594 efae11c Thanks @​qzio! - Fix X-Forwarded-Proto validation when allowedDomains includes both protocol and hostname fields. The protocol check no longer fails due to hostname mismatch against the hardcoded test URL.

v5.17.3

Compare Source

Patch Changes

v5.17.2

Compare Source

Patch Changes
  • c13b536 Thanks @​matthewp! - Improves Host header handling for SSR deployments behind proxies

v5.17.1

Compare Source

Patch Changes
  • #​15334 d715f1f Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Removes the getFontBuffer() helper function exported from astro:assets when using the experimental Fonts API

    This experimental feature introduced in v15.6.13 ended up causing significant memory usage during build. This feature has been removed and will be reintroduced after further exploration and testing.

    If you were relying on this function, you can replicate the previous behavior manually:

    • On prerendered routes, read the file using node:fs
    • On server rendered routes, fetch files using URLs from fontData and context.url

v5.17.0

Compare Source

Minor Changes
  • #​14932 b19d816 Thanks @​patrickarlt! - Adds support for returning a Promise from the parser() option of the file() loader

    This enables you to run asynchronous code such as fetching remote data or using async parsers when loading files with the Content Layer API.

    For example:

    import { defineCollection } from 'astro:content';
    import { file } from 'astro/loaders';
    
    const blog = defineCollection({
      loader: file('src/data/blog.json', {
        parser: async (text) => {
          const data = JSON.parse(text);
    
          // Perform async operations like fetching additional data
          const enrichedData = await fetch(`https://api.example.com/enrich`, {
            method: 'POST',
            body: JSON.stringify(data),
          }).then((res) => res.json());
    
          return enrichedData;
        },
      }),
    });
    
    export const collections = { blog };
    

    See the parser() reference documentation for more information.

  • #​15171 f220726 Thanks @​mark-ignacio! - Adds a new, optional kernel configuration option to select a resize algorithm in the Sharp image service

    By default, Sharp resizes images with the lanczos3 kernel. This new config option allows you to set the default resizing algorithm to any resizing option supported by Sharp (e.g. linear, mks2021).

    Kernel selection can produce quite noticeable differences depending on various characteristics of the source image - especially drawn art - so changing the kernel gives you more control over the appearance of images on your site:

    export default defineConfig({
      image: {
        service: {
          entrypoint: 'astro/assets/services/sharp',
          config: {
            kernel: "mks2021"
          }
      }
    })
    

    This selection will apply to all images on your site, and is not yet configurable on a per-image basis. For more information, see Sharps documentation on resizing images.

  • #​15063 08e0fd7 Thanks @​jmortlock! - Adds a new partitioned option when setting a cookie to allow creating partitioned cookies.

    Partitioned cookies can only be read within the context of the top-level site on which they were set. This allows cross-site tracking to be blocked, while still enabling legitimate uses of third-party cookies.

    You can create a partitioned cookie by passing partitioned: true when setting a cookie. Note that partitioned cookies must also be set with secure: true:

    Astro.cookies.set('my-cookie', 'value', {
      partitioned: true,
      secure: true,
    });
    

    For more information, see the AstroCookieSetOptions API reference.

  • #​15022 f1fce0e Thanks @​ascorbic! - Adds a new retainBody option to the glob() loader to allow reducing the size of the data store.

    Currently, the glob() loader stores the raw body of each content file in the entry, in addition to the rendered HTML.

    The retainBody option defaults to true, but you can set it to false to prevent the raw body of content files from being stored in the data store. This significantly reduces the deployed size of the data store and helps avoid hitting size limits for sites with very large collections.

    The rendered body will still be available in the entry.rendered.html property for markdown files, and the entry.filePath property will still point to the original file.

    import { defineCollection } from 'astro:content';
    import { glob } from 'astro/loaders';
    
    const blog = defineCollection({
      loader: glob({
        pattern: '**/*.md',
        base: './src/content/blog',
        retainBody: false,
      }),
    });
    

    When retainBody is false, entry.body will be undefined instead of containing the raw file contents.

  • #​15153 928529f Thanks @​jcayzac! - Adds a new background property to the <Image /> component.

    This optional property lets you pass a background color to flatten the image with. By default, Sharp uses a black background when flattening an image that is being converted to a format that does not support transparency (e.g. jpeg). Providing a value for background on an <Image /> component, or passing it to the getImage() helper, will flatten images using that color instead.

    This is especially useful when the requested output format doesn't support an alpha channel (e.g. jpeg) and can't support transparent backgrounds.

    ---
    import { Image } from 'astro:assets';
    ---
    
    <Image
      src="/transparent.png"
      alt="A JPEG with a white background!"
      format="jpeg"
      background="#ffffff"
    />
    

    See more about this new property in the image reference docs

  • #​15015 54f6006 Thanks @​tony! - Adds optional placement config option for the dev toolbar.

    You can now configure the default toolbar position ('bottom-left', 'bottom-center', or 'bottom-right') via devToolbar.placement in your Astro config. This option is helpful for sites with UI elements (chat widgets, cookie banners) that are consistently obscured by the toolbar in the dev environment.

    You can set a project default that is consistent across environments (e.g. dev machines, browser instances, team members):

    // astro.config.mjs
    export default defineConfig({
      devToolbar: {
        placement: 'bottom-left',
      },
    });
    

    User preferences from the toolbar UI (stored in localStorage) still take priority, so this setting can be overridden in individual situations as necessary.

v5.16.16

Compare Source

Patch Changes

v5.16.15

Compare Source

Patch Changes
  • #​15286 0aafc83 Thanks @​florian-lefebvre! - Fixes a case where font providers provided as class instances may not work when using the experimental Fonts API. It affected the local provider

v5.16.14

Compare Source

Patch Changes
  • #​15213 c775fce Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Updates how the local provider must be used when using the experimental Fonts API

    Previously, there were 2 kinds of font providers: remote and local.

    Font providers are now unified. If you are using the local provider, the process for configuring local fonts must be updated:

    -import { defineConfig } from "astro/config";
    +import { defineConfig, fontProviders } from "astro/config";
    
    export default defineConfig({
        experimental: {
            fonts: [{
                name: "Custom",
                cssVariable: "--font-custom",
    -            provider: "local",
    +            provider: fontProviders.local(),
    +            options: {
                variants: [
                    {
                        weight: 400,
                        style: "normal",
                        src: ["./src/assets/fonts/custom-400.woff2"]
                    },
                    {
                        weight: 700,
                        style: "normal",
                        src: ["./src/assets/fonts/custom-700.woff2"]
                    }
                    // ...
                ]
    +            }
            }]
        }
    });
    

    Once configured, there is no change to using local fonts in your project. However, you should inspect your deployed site to confirm that your new font configuration is being applied.

    See the experimental Fonts API docs for more information.

  • #​15213 c775fce Thanks @​florian-lefebvre! - Exposes root on FontProvider init() context

    When building a custom FontProvider for the experimental Fonts API, the init() method receives a context. This context now exposes a root URL, useful for resolving local files:

    import type { FontProvider } from "astro";
    
    export function registryFontProvider(): FontProvider {
      return {
        // ...
    -    init: async ({ storage }) => {
    +    init: async ({ storage, root }) => {
            // ...
        },
      };
    }
    
  • #​15185 edabeaa Thanks @​EricGrill! - Add .vercel to .gitignore when adding the Vercel adapter via astro add vercel

v5.16.13

Compare Source

Patch Changes
  • #​15182 cb60ee1 Thanks @​florian-lefebvre! - Adds a new getFontBuffer() method to retrieve font file buffers when using the experimental Fonts API

    The getFontData() helper function from astro:assets was introduced in 5.14.0 to provide access to font family data for use outside of Astro. One of the goals of this API was to be able to retrieve buffers using URLs.

    However, it turned out to be impractical and even impossible during prerendering.

    Astro now exports a new getFontBuffer() helper function from astro:assets to retrieve font file buffers from URL returned by getFontData(). For example, when using satori to generate Open Graph images:

    // src/pages/og.png.ts
    
    import type{ APIRoute } from "astro"
    -import { getFontData } from "astro:assets"
    +import { getFontData, getFontBuffer } from "astro:assets"
    import satori from "satori"
    
    export const GET: APIRoute = (context) => {
      const data = getFontData("--font-roboto")
    
      const svg = await satori(
        <div style={{ color: "black" }}>hello, world</div>,
        {
          width: 600,
          height: 400,
          fonts: [
            {
              name: "Roboto",
    -          data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then(res => res.arrayBuffer()),
    +          data: await getFontBuffer(data[0].src[0].url),
              weight: 400,
              style: "normal",
            },
          ],
        },
      )
    
      // ...
    }
    

    See the experimental Fonts API documentation for more information.

v5.16.12

Compare Source

Patch Changes
  • #​15175 47ae148 Thanks @​florian-lefebvre! - Allows experimental Font providers to specify family options

    Previously, an Astro FontProvider could only accept options at the provider level when called. That could result in weird data structures for family-specific options.

    Astro FontProviders can now declare family-specific options, by specifying a generic:

    // font-provider.ts
    import type { FontProvider } from "astro";
    import { retrieveFonts, type Fonts } from "./utils.js",
    
    interface Config {
      token: string;
    }
    
    +interface FamilyOptions {
    +    minimal?: boolean;
    +}
    
    -export function registryFontProvider(config: Config): FontProvider {
    +export function registryFontProvider(config: Config): FontProvider<FamilyOptions> {
      let data: Fonts = {}
    
      return {
        name: "registry",
        config,
        init: async () => {
          data = await retrieveFonts(token);
        },
        listFonts: () => {
          return Object.keys(data);
        },
    -    resolveFont: ({ familyName, ...rest }) => {
    +    // options is typed as FamilyOptions
    +    resolveFont: ({ familyName, options, ...rest }) => {
          const fonts = data[familyName];
          if (fonts) {
            return { fonts };
          }
          return undefined;
        },
      };
    }
    

    Once the font provider is registered in the Astro config, types are automatically inferred:

    // astro.config.ts
    import { defineConfig } from "astro/config";
    import { registryFontProvider } from "./font-provider";
    
    export default defineConfig({
        experimental: {
            fonts: [{
                provider: registryFontProvider({
                  token: "..."
                }),
                name: "Custom",
                cssVariable: "--font-custom",
    +            options: {
    +                minimal: true
    +            }
            }]
        }
    });
    
  • #​15175 47ae148 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Updates how options are passed to the Google and Google Icons font providers when using the experimental Fonts API

    Previously, the Google and Google Icons font providers accepted options that were specific to given font families.

    These options must now be set using the options property instead. For example using the Google provider:

    import { defineConfig, fontProviders } from "astro/config";
    
    export default defineConfig({
        experimental: {
            fonts: [{
                name: 'Inter',
                cssVariable: '--astro-font-inter',
                weights: ['300 900'],
    -            provider: fontProviders.google({
    -                experimental: {
    -                    variableAxis: {
    -                        Inter: { opsz: ['14..32'] }
    -                    }
    -                }
    -            }),
    +            provider: fontProviders.google(),
    +            options: {
    +                experimental: {
    +                    variableAxis: { opsz: ['14..32'] }
    +                }
    +            }
            }]
        }
    })
    
  • #​15200 c0595b3 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Removes getFontData() exported from astro:assets with fontData when using the experimental Fonts API

    Accessing font data can be useful for advanced use cases, such as generating meta tags or Open Graph images. Before, we exposed a getFontData() helper function to retrieve the font data for a given cssVariable. That was however limiting for programmatic usages that need to access all font data.

    The getFontData() helper function is removed and replaced by a new fontData object:

    -import { getFontData } from "astro:assets";
    -const data = getFontData("--font-roboto")
    
    +import { fontData } from "astro:assets";
    +const data = fontData["--font-roboto"]
    

    We may reintroduce getFontData() later on for a more friendly DX, based on your feedback.

  • #​15254 8d84b30 Thanks @​lamalex! - Fixes CSS assetsPrefix with remote URLs incorrectly prepending a forward slash

    When using build.assetsPrefix with a remote URL (e.g., https://cdn.example.com) for CSS assets, the generated <link> elements were incorrectly getting a / prepended to the full URL, resulting in invalid URLs like /https://cdn.example.com/assets/style.css.

    This fix checks if the stylesheet link is a remote URL before prepending the forward slash.

  • #​15178 731f52d Thanks @​kedarvartak! - Fixes an issue where stopping the dev server with q+enter incorrectly created a dist folder and copied font files when using the experimental Fonts API

  • #​15230 3da6272 Thanks @​rahuld109! - Fixes greedy regex in error message markdown rendering that caused link syntax examples to capture extra characters

  • #​15253 2a6315a Thanks @​matthewp! - Fixes hydration for React components nested inside HTML elements in MDX files

  • #​15227 9a609f4 Thanks @​matthewp! - Fixes styles not being included for conditionally rendered Svelte 5 components in production builds

  • #​14607 ee52160 Thanks @​simensfo! - Reintroduces css deduplication for hydrated client components. Ensures assets already added to a client chunk are not flagged as orphaned

v5.16.11

Compare Source

Patch Changes

v5.16.10

Compare Source

Patch Changes
  • 2fa19c4 - Improved error handling in the rendering phase

    Added defensive validation in App.render() and #renderError() to provide a descriptive error message when a route module doesn't have a valid page function.

  • #​15199 d8e64ef Thanks @​ArmandPhilippot! - Fixes the links to Astro Docs so that they match the current docs structure.

  • #​15169 b803d8b Thanks @​rururux! - fix: fix image 500 error when moving dist directory in standalone Node

  • #​14622 9b35c62 Thanks @​aprici7y! - Fixes CSS url() references to public assets returning 404 in dev mode when base path is configured

  • #​15219 43df4ce Thanks @​matthewp! - Upgrades the diff package to v8

v5.16.9

Compare Source

Patch Changes
  • #​15174 37ab65a Thanks @​florian-lefebvre! - Adds Google Icons to built-in font providers

    To start using it, access it on fontProviders:

    import { defineConfig, fontProviders } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        fonts: [
          {
            name: 'Material Symbols Outlined',
            provider: fontProviders.googleicons(),
            cssVariable: '--font-material',
          },
        ],
      },
    });
    
  • #​15150 a77c4f4 Thanks @​matthewp! - Fixes hydration for framework components inside MDX when using Astro.slots.render()

    Previously, when multiple framework components with client:* directives were passed as named slots to an Astro component in MDX, only the first slot would hydrate correctly. Subsequent slots would render their HTML but fail to include the necessary hydration scripts.

  • #​15130 9b726c4 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Changes how font providers are implemented with updates to the FontProvider type

    This is an implementation detail that changes how font providers are created. This process allows Astro to take more control rather than relying directly on unifont types. All of Astro's built-in font providers have been updated to reflect this new type, and can be configured as before. However, using third-party unifont providers that rely on unifont types will require an update to your project code.

    Previously, an Astro FontProvider was made of a config and a runtime part. It relied directly on unifont types, which allowed a simple configuration for third-party unifont providers, but also coupled Astro's implementation to unifont, which was limiting.

    Astro's font provider implementation is now only made of a config part with dedicated hooks. This allows for the separation of config and runtime, but requires you to create a font provider object in order to use custom font providers (e.g. third-party unifont providers, or private font registries).

What should I do?

If you were using a 3rd-party unifont font provider, you will now need to write an Astro FontProvider using it under the hood. For example:

// astro.config.ts
import { defineConfig } from "astro/config";
import { acmeProvider, type AcmeOptions } from '@acme/unifont-provider'
+import type { FontProvider } from "astro";
+import type { InitializedProvider } from 'unifont';

+function acme(config?: AcmeOptions): FontProvider {
+	const provider = acmeProvider(config);
+	let initializedProvider: InitializedProvider | undefined;
+	return {
+		name: provider._name,
+		config,
+		async init(context) {
+			initializedProvider = await provider(context);
+		},
+		async resolveFont({ familyName, ...rest }) {
+			return await initializedProvider?.resolveFont(familyName, rest);
+		},
+		async listFonts() {
+			return await initializedProvider?.listFonts?.();
+		},
+	};
+}

export default defineConfig({
    experimental: {
        fonts: [{
-            provider: acmeProvider({ /* ... */ }),
+            provider: acme({ /* ... */ }),
            name: "Material Symbols Outlined",
            cssVariable: "--font-material"
        }]
    }
});
  • #​15147 9cd5b87 Thanks @​matthewp! - Fixes scripts in components not rendering when a sibling <Fragment slot="..."> exists but is unused

v5.16.8

Compare Source

Patch Changes

v5.16.7

Compare Source

Patch Changes
  • #​15122 b137946 Thanks @​florian-lefebvre! - Improves JSDoc annotations for AstroGlobal, AstroSharedContext and APIContext types

  • #​15123 3f58fa2 Thanks @​43081j! - Improves rendering performance by grouping render chunks when emitting from async iterables to avoid encoding costs

  • #​14954 7bec4bd Thanks @​volpeon! - Fixes remote images Etag header handling by disabling internal cache

  • #​15052 b2bcd5a Thanks @​Princesseuh! - Fixes images not working in development when using setups with port forwarding

  • #​15028 87b19b8 Thanks @​Princesseuh! - Fixes certain aliases not working when using images in JSON files with the content layer

  • #​15118 cfa382b Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Removes the defineAstroFontProvider() type helper.

    If you are building a custom font provider, remove any occurrence of defineAstroFontProvider() and use the FontProvider type instead:

    -import { defineAstroFontProvider } from 'astro/config';
    
    -export function myProvider() {
    -    return defineAstroFontProvider({
    -        entrypoint: new URL('./implementation.js', import.meta.url)
    -    });
    -};
    
    +import type { FontProvider } from 'astro';
    
    +export function myProvider(): FontProvider {
    +    return {
    +        entrypoint: new URL('./implementation.js', import.meta.url)
    +    },
    +}
    
  • #​15055 4e28db8 Thanks @​delucis! - Reduces Astro’s install size by around 8 MB

  • #​15088 a19140f Thanks @​martrapp! - Enables the ClientRouter to preserve the original hash part of the target URL during server side redirects.

  • #​15117 b1e8e32 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Changes the font format downloaded by default when using the experimental Fonts API. Additionally, adds a new formats configuration option to specify which font formats to download.

    Previously, Astro was opinionated about which font sources would be kept for usage, mainly keeping woff2 and woff files.

    You can now specify what font formats should be downloaded (if available). Only woff2 files are downloaded by default.

What should I do?

If you were previously relying on Astro downloading the woff format, you will now need to specify this explicitly with the new formats configuration option. Additionally, you may also specify any additional file formats to download if available:

// astro.config.mjs
import { defineConfig, fontProviders } from 'astro/config'

export default defineConfig({
    experimental: {
        fonts: [{
            name: 'Roboto',
            cssVariable: '--font-roboto',
            provider: fontProviders.google(),
+            formats: ['woff2', 'woff', 'otf']
        }]
    }
})

v5.16.6

Compare Source

Patch Changes

v5.16.5

Compare Source

Patch Changes
  • #​14985 c016f10 Thanks @​florian-lefebvre! - Fixes a case where JSDoc annotations wouldn't show for fonts related APIs in the Astro config

  • #​14973 ed7cc2f Thanks @​amankumarpandeyin! - Fixes performance regression and OOM errors when building medium-sized blogs with many content entries. Replaced O(n²) object spread pattern with direct mutation in generateLookupMap.

  • #​14958 70eb542 Thanks @​ascorbic! - Gives a helpful error message if a user sets output: "hybrid" in their Astro config.

    The option was removed in Astro 5, but lots of content online still references it, and LLMs often suggest it. It's not always clear that the replacement is output: "static", rather than output: "server". This change adds a helpful error message to guide humans and robots.

  • #​14901 ef53716 Thanks @​Darknab! - Updates the glob() loader to log a warning when duplicated IDs are detected

  • Updated dependencies [d8305f8]:

v5.16.4

Compare Source

Patch Changes
  • #​14940 2cf79c2 Thanks @​ematipico! - Fixes a bug where Astro didn't properly combine CSP resources from the csp configuration with those added using the runtime API (Astro.csp.insertDirective()) to form grammatically correct CSP headers

    Now Astro correctly deduplicate CSP resources. For example, if you have a global resource in the configuration file, and then you add a
    a new one using the runtime APIs.

v5.16.3

Compare Source

Patch Changes
  • #​14889 4bceeb0 Thanks @​florian-lefebvre! - Fixes actions types when using specific TypeScript configurations

  • #​14929 e0f277d Thanks @​matthewp! - Fixes authentication bypass via double URL encoding in middleware

    Prevents attackers from bypassing path-based authentication checks using multi-level URL encoding (e.g., /%2561dmin instead of /%61dmin). Pathnames are now validated after decoding to ensure no additional encoding remains.

v5.16.2

Compare Source

Patch Changes

v5.16.1

Compare Source

Patch Changes

v5.16.0

Compare Source

Minor Changes
  • #​13880 1a2ed01 Thanks @​azat-io! - Adds experimental SVGO optimization support for SVG assets

    Astro now supports automatic SVG optimization using SVGO during build time. This experimental feature helps reduce SVG file sizes while maintaining visual quality, improving your site's performance.

    To enable SVG optimization with default settings, add the following to your astro.config.mjs:

    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        svgo: true,
      },
    });
    

    To customize optimization, pass a SVGO configuration object:

    export default defineConfig({
      experimental: {
        svgo: {
          plugins: [
            'preset-default',
            {
              name: 'removeViewBox',
              active: false,
            },
          ],
        },
      },
    });
    

    For more information on enabling and using this feature in your project, see the experimental SVG optimization docs.

  • #​14810 2e845fe Thanks @​ascorbic! - Adds a hint for code agents to use the --yes flag to skip prompts when running astro add

  • #​14698 f42ff9b Thanks @​mauriciabad! - Adds the ActionInputSchema utility type to automatically infer the TypeScript type of an action's input based on its Zod schema

    For example, this type can be used to retrieve the input type of a form action:

    import { type ActionInputSchema, defineAction } from 'astro:actions';
    import { z } from 'astro/zod';
    
    const action = defineAction({
      accept: 'form',
      input: z.object({ name: z.string() }),
      handler: ({ name }) => ({ message: `Welcome, ${name}!` }),
    });
    
    type Schema = ActionInputSchema<typeof action>;
    // typeof z.object({ name: z.string() })
    
    type Input = z.input<Schema>;
    // { name: string }
    
  • #​14574 4356485 Thanks @​jacobdalamb! - Adds new CLI shortcuts available when running astro preview:

    • o + enter: open the site in your browser
    • q + enter: quit the preview
    • h + enter: print all available shortcuts
Patch Changes
  • #​14813 e1dd377 Thanks @​ematipico! - Removes picocolors as dependency in favor of the fork piccolore.

  • #​14609 d774306 Thanks @​florian-lefebvre! - Improves astro info

  • #​14796 c29a785 Thanks @​florian-lefebvre! - BREAKING CHANGE to the experimental Fonts API only

    Updates the default subsets to ["latin"]

    Subsets have been a common source of confusion: they caused a lot of files to be downloaded by default. You now have to manually pick extra subsets.

    Review your Astro config and update subsets if you need, for example if you need greek characters:

    import { defineConfig, fontProviders } from "astro/config"
    
    export default defineConfig({
        experimental: {
            fonts: [{
                name: "Roboto",
                cssVariable: "--font-roboto",
                provider: fontProviders.google(),
    +            subsets: ["latin", "greek"]
            }]
        }
    })
    

v5.15.9

Compare Source

Patch Changes
  • #​14786 758a891 Thanks @​mef! - Add handling of invalid encrypted props and slots in server islands.

  • #​14783 504958f Thanks @​florian-lefebvre! - Improves the experimental Fonts API build log to show the number of downloaded files. This can help spotting excessive downloading because of misconfiguration

  • #​14791 9e9c528 Thanks @​Princesseuh! - Changes the remote protocol checks for images to require explicit authorization in order to use data URIs.

    In order to allow data URIs for remote images, you will need to update your astro.config.mjs file to include the following configuration:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      images: {
        remotePatterns: [
          {
            protocol: 'data',
          },
        ],
      },
    });
    
  • #​14787 0f75f6b Thanks @​matthewp! - Fixes wildcard hostname pattern matching to correctly reject hostnames without dots

    Previously, hostnames like localhost or other single-part names would incorrectly match patterns like *.example.com. The wildcard matching logic has been corrected to ensure that only valid subdomains matching the pattern are accepted.

  • #​14776 3537876 Thanks @​ktym4a! - Fixes the behavior of passthroughImageService so it does not generate webp.

  • Updated dependencies [9e9c528, 0f75f6b]:

v5.15.8

Compare Source

Patch Changes
  • #​14772 00c579a Thanks @​matthewp! - Improves the security of Server Islands slots by encrypting them before transmission to the browser, matching the security model used for props. This improves the integrity of slot content and prevents injection attacks, even when component templates don't explicitly support slots.

    Slots continue to work as expected for normal usage—this change has no breaking changes for legitimate requests.

  • #​14771 6f80081 Thanks @​matthewp! - Fix middleware pathname matching by normalizing URL-encoded paths

    Middleware now receives normalized pathname values, ensuring that encoded paths like /%61dmin are properly decoded to /admin before middleware checks. This prevents potential security issues where middleware checks might be bypassed through URL encoding.

v5.15.7

Compare Source

Patch Changes

v5.15.6

Compare Source

Patch Changes
  • #​14751 18c55e1 Thanks @​delucis! - Fixes hydration of client components when running the dev server and using a barrel file that re-exports both Astro and UI framework components.

  • #​14750 35122c2 Thanks @​florian-lefebvre! - Updates the experimental Fonts API to log a warning if families with a conflicting cssVariable are provided

  • #​14737 74c8852 Thanks @​Arecsu! - Fixes an error when using transition:persist with components that use declarative Shadow DOM. Astro now avoids re-attaching a shadow root if one already exists, preventing "Unable to re-attach to existing ShadowDOM" navigation errors.

  • #​14750 35122c2 Thanks @​florian-lefebvre! - Updates the experimental Fonts API to allow for more granular configuration of remote font families

    A font family is defined by a combination of properties such as weights and styles (e.g. weights: [500, 600] and styles: ["normal", "bold"]), but you may want to download only certain combinations of these.

    For greater control over which font files are downloaded, you can specify the same font (ie. with the same cssVariable, name, and provider properties) multiple times with different combinations. Astro will merge the results and download only the required files. For example, it is possible to download normal 500 and 600 while downloading only italic 500:

    // astro.config.mjs
    import { defineConfig, fontProviders } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        fonts: [
          {
            name: 'Roboto',
            cssVariable: '--roboto',
            provider: fontProviders.google(),
            weights: [500, 600],
            styles: ['normal'],
          },
          {
            name: 'Roboto',
            cssVariable: '--roboto',
            provider: fontProviders.google(),
            weights: [500],
            styles: ['italic'],
          },
        ],
      },
    });
    

v5.15.5

Compare Source

Patch Changes
  • #​14712 91780cf Thanks @​florian-lefebvre! - Fixes a case where build's process.env would be inlined in the server output

  • #​14713 666d5a7 Thanks @​florian-lefebvre! - Improves fallbacks generation when using the experimental Fonts API

  • #​14743 dafbb1b Thanks @​matthewp! - Improves X-Forwarded header validation to prevent cache poisoning and header injection attacks. Now properly validates X-Forwarded-Proto, X-Forwarded-Host, and X-Forwarded-Port headers against configured allowedDomains patterns, rejecting malformed or suspicious values. This is especially important when running behind a reverse proxy or load balancer.

v5.15.4

Compare Source

Patch Changes
  • #​14703 970ac0f Thanks @​ArmandPhilippot! - Adds missing documentation for some public utilities exported from astro:i18n.

  • #​14715 3d55c5d Thanks @​ascorbic! - Adds support for client hydration in getContainerRenderer()

    The getContainerRenderer() function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually call container.addClientRenderer() with the appropriate client renderer entrypoint.

    See the container-with-vitest demo for a usage example, and the Container API documentation for more information on using framework components with the experimental Container API.

  • #​14711 a4d284d Thanks @​deining! - Fixes typos in documenting our error messages and public APIs.

  • #​14701 9be54c7 Thanks @​florian-lefebvre! - Fixes a case where the experimental Fonts API would filter available font files too aggressively, which could prevent the download of woff files when using the google provider

v5.15.3

Compare Source

Patch Changes
  • #​14627 b368de0 Thanks @​matthewp! - Fixes skew protection support for images and font URLs

    Adapter-level query parameters (assetQueryParams) are now applied to all image and font asset URLs, including:

    • Dynamic optimized images via /_image endpoint
    • Static optimized image files
    • Font preload tags and font requests when using the experimental Fonts API
  • #​14631 3ad33f9 Thanks @​KurtGokhan! - Adds the astro/jsx-dev-runtime export as an alias for astro/jsx-runtime

v5.15.2

Compare Source

Patch Changes
  • #​14623 c5fe295 Thanks @​delucis! - Fixes a leak of server runtime code when importing SVGs in client-side code. Previously, when importing an SVG file in client code, Astro could end up adding code for rendering SVGs on the server to the client bundle.

  • #​14621 e3175d9 Thanks @​GameRoMan! - Updates vite version to fix CVE

v5.15.1

Compare Source

Patch Changes

v5.15.0

Compare Source

Minor Changes
  • #​14543 9b3241d Thanks @​matthewp! - Adds two new adapter configuration options assetQueryParams and internalFetchHeaders to the Adapter API.

    Official and community-built adapters can now use client.assetQueryParams to specify query parameters that should be appended to asset URLs (CSS, JavaScript, images, fonts, etc.). The query parameters are automatically appended to all generated asset URLs during the build process.

    Adapters can also use client.internalFetchHeaders to specify headers that should be included in Astro's internal fetch calls (Actions, View Transitions, Server Islands, Prefetch).

    This enables features like Netlify's skew protection, which requires the deploy ID to be sent with both internal requests and asset URLs to ensure client and server versions match during deployments.

  • #​14489 add4277 Thanks @​dev-shetty! - Adds a new Copy to Clipboard button to the error overlay stack trace.

    When an error occurs in dev mode, you can now copy the stack trace with a single click to more easily share it in a bug report, a support thread, or with your favorite LLM.

  • #​14564 5e7cebb Thanks @​florian-lefebvre! - Updates astro add cloudflare to scaffold more configuration files

    Running astro add cloudflare will now emit wrangler.jsonc and public/.assetsignore, allowing your Astro project to work out of the box as a worker.

Patch Changes
  • #​14591 3e887ec Thanks @​matthewp! - Adds TypeScript support for the components prop on MDX Content component when using await render(). Developers now get proper IntelliSense and type checking when passing custom components to override default MDX element rendering.

  • #​14598 7b45c65 Thanks @​delucis! - Reduces terminal text styling dependency size by switching from kleur to picocolors

  • #​13826 8079482 Thanks @​florian-lefebvre! - Adds the option to specify in the preload directive which weights, styles, or subsets to preload for a given font family when using the experimental Fonts API:

    ---
    import { Font } from 'astro:assets';
    ---
    
    <Font
      cssVariable="--font-roboto"
      preload={[{ subset: 'latin', style: 'normal' }, { weight: '400' }]}
    />
    

    Variable weight font files will be preloaded if any weight within its range is requested. For example, a font file for font weight 100 900 will be included when 400 is specified in a preload object.

v5.14.8

Compare Source

Patch Changes
  • #​14590 577d051 Thanks @​matthewp! - Fixes image path resolution in content layer collections to support bare filenames. The image() helper now normalizes bare filenames like "cover.jpg" to relative paths "./cover.jpg" for consistent resolution behavior between markdown frontmatter and JSON content collections.

v5.14.7

Compare Source

Patch Changes
  • #​14582 7958c6b Thanks @​florian-lefebvre! - Fixes a regression that caused Actions to throw errors while loading

  • #​14567 94500bb Thanks @​matthewp! - Fixes the actions endpoint to return 404 for nonexistent actions instead of throwing an unhandled error

  • #​14566 946fe68 Thanks @​matthewp! - Fixes handling malformed cookies gracefully by returning the unparsed value instead of throwing

    When a cookie with an invalid value is present (e.g., containing invalid URI sequences), Astro.cookies.get() now returns the raw cookie value instead of throwing a URIError. This aligns with the behavior of the underlying cookie package and prevents crashes when manually-set or corrupted cookies are encountered.

  • #​14142 73c5de9 Thanks @​P4tt4te! - Updates handling of CSS for hydrated client components to prevent duplicates

  • #​14576 2af62c6 Thanks @​aprici7y! - Fixes a regression that caused Astro.site to always be undefined in getStaticPaths()

v5.14.6

Compare Source

Patch Changes
⚠️ Breaking change for experimental live content collections only

Feedback showed that this did not make sense to set at the loader level, since the loader does not know how long each individual entry should be cached for.

If your live loader returns cache hints with maxAge, you need to remove this property:

return {
  entries: [...],
  cacheHint: {
    tags: ['my-tag'],
-   maxAge: 60,
    lastModified: new Date(),
  },
};

The cacheHint object now only supports tags and lastModified properties. If you want to set the max age for a page, you can set the headers manually:

---
Astro.headers.set('cdn-cache-control', 'max-age=3600');
---
  • #​14548 6cdade4 Thanks @​ascorbic! - Adds missing rendered property to experimental live collections entry type

    Live collections support a rendered property that allows you to provide pre-rendered HTML for each entry. While this property was documented and implemented, it was missing from the TypeScript types. This could lead to type errors when trying to use it in a TypeScript project.

    No changes to your project code are necessary. You can continue to use the rendered property as before, and it will no longer produce TypeScript errors.

v5.14.5

Compare Source

Patch Changes
  • #​14525 4f55781 Thanks @​penx! - Fixes defineLiveCollection() types

  • #​14441 62ec8ea Thanks @​upsuper! - Updates redirect handling to be consistent across static and server output, aligning with the behavior of other adapters.

    Previously, the Node.js adapter used default HTML files with meta refresh tags when in static output. This often resulted in an extra flash of the page on redirect, while also not applying the proper status code for redirections. It's also likely less friendly to search engines.

    This update ensures that configured redirects are always handled as HTTP redirects regardless of output mode, and the default HTML files for the redirects are no longer generated in static output. It makes the Node.js adapter more consistent with the other official adapters.

    No change to your project is required to take advantage of this new adapter functionality. It is not expected to cause any breaking changes. However, if you relied on the previous redirecting behavior, you may need to handle your redirects differently now. Otherwise, you should notice smoother redirects, with more accurate HTTP status codes, and may potentially see some SEO gains.

  • #​14506 ec3cbe1 Thanks @​abdo-spices! - Updates the <Font /> component so that preload links are generated after the style tag, as recommended by capo.js

v5.14.4

Compare Source

Patch Changes

v5.14.3

Compare Source

Patch Changes
  • #​14505 28b2a1d Thanks @​matthewp! - Fixes Cannot set property manifest error in test utilities by adding a protected setter for the manifest property

  • #​14235 c4d84bb Thanks @​toxeeec! - Fixes a bug where the "tap" prefetch strategy worked only on the first clicked link with view transitions enabled

v5.14.1

Compare Source

Patch Changes

v5.14.0

Compare Source

Minor Changes
  • #​13520 a31edb8 Thanks @​openscript! - Adds a new property routePattern available to GetStaticPathsOptions

    This provides the original, dynamic segment definition in a routing file path (e.g. /[...locale]/[files]/[slug]) from the Astro render context that would not otherwise be available within the scope of getStaticPaths(). This can be useful to calculate the params and props for each page route.

    For example, you can now localize your route segments and return an array of static paths by passing routePattern to a custom getLocalizedData() helper function. The params object will be set with explicit values for each route segment (e.g. locale, files, and slug). Then, these values will be used to generate the routes and can be used in your page template via Astro.params.

    ---
    // src/pages/[...locale]/[files]/[slug].astro
    import { getLocalizedData } from '../../../utils/i18n';
    
    export async function getStaticPaths({ routePattern }) {
      const response = await fetch('...');
      const data = await response.json();
    
      console.log(routePattern); // [...locale]/[files]/[slug]
    
      // Call your custom helper with `routePattern` to generate the static paths
      return data.flatMap((file) => getLocalizedData(file, routePattern));
    }
    
    const { locale, files, slug } = Astro.params;
    ---
    

    For more information about this advanced routing pattern, see Astro's routing reference.

  • #​13651 dcfbd8c Thanks @​ADTC! - Adds a new SvgComponent type

    You can now more easily enforce type safety for your .svg assets by directly importing SVGComponent from astro/types:

    ---
    // src/components/Logo.astro
    import type { SvgComponent } from 'astro/types';
    import HomeIcon from './Home.svg';
    interface Link {
      url: string;
      text: string;
      icon: SvgComponent;
    }
    const links: Link[] = [
      {
        url: '/',
        text: 'Home',
        icon: HomeIcon,
      },
    ];
    ---
    
  • #​14206 16a23e2 Thanks @​Fryuni! - Warn on prerendered routes collision.

    Previously, when two dynamic routes /[foo] and /[bar] returned values on their getStaticPaths that resulted in the same final path, only one of the routes would be rendered while the other would be silently ignored. Now, when this happens, a warning will be displayed explaining which routes collided and on which path.

    Additionally, a new experimental flag failOnPrerenderConflict can be used to fail the build when such a collision occurs.

Patch Changes
  • #​13811 69572c0 Thanks @​florian-lefebvre! - Adds a new getFontData() method to retrieve lower-level font family data programmatically when using the experimental Fonts API

    The getFontData() helper function from astro:assets provides access to font family data for use outside of Astro. This can then be used in an API Route or to generate your own meta tags.

    import { getFontData } from 'astro:assets';
    
    const data = getFontData('--font-roboto');
    

    For example, getFontData() can get the font buffer from the URL when using satori to generate Open Graph images:

    // src/pages/og.png.ts
    
    import type { APIRoute } from 'astro';
    import { getFontData } from 'astro:assets';
    import satori from 'satori';
    
    export const GET: APIRoute = (context) => {
      const data = getFontData('--font-roboto');
    
      const svg = await satori(<div style={{ color: 'black' }}>hello, world</div>, {
        width: 600,
        height: 400,
        fonts: [
          {
            name: 'Roboto',
            data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then((res) =>
              res.arrayBuffer(),
            ),
            weight: 400,
            style: 'normal',
          },
        ],
      });
    
      // ...
    };
    

    See the experimental Fonts API documentation for more information.

v5.13.11

Compare Source

Patch Changes
  • #​14409 250a595 Thanks @​louisescher! - Fixes an issue where astro info would log errors to console in certain cases.

  • #​14398 a7df80d Thanks @​idawnlight! - Fixes an unsatisfiable type definition when calling addServerRenderer on an experimental container instance

  • #​13747 120866f Thanks @​jp-knj! - Adds automatic request signal abortion when the underlying socket closes in the Node.js adapter

    The Node.js adapter now automatically aborts the request.signal when the client connection is terminated. This enables better resource management and allows applications to properly handle client disconnections through the standard AbortSignal API.

  • #​14428 32a8acb Thanks @​drfuzzyness! - Force sharpService to return a Uint8Array if Sharp returns a SharedArrayBuffer

  • #​14411 a601186 Thanks @​GameRoMan! - Fixes relative links to docs that could not be opened in the editor.

v5.13.10

Compare Source

Patch Changes

v5.13.9

Compare Source

Patch Changes

v5.13.8

Compare Source

Patch Changes
  • #​14300 bd4a70b Thanks @​louisescher! - Adds Vite version & integration versions to output of astro info

  • #​14341 f75fd99 Thanks @​delucis! - Fixes support for declarative Shadow DOM when using the <ClientRouter> component

  • #​14350 f59581f Thanks @​ascorbic! - Improves error reporting for content collections by adding logging for configuration errors that had previously been silently ignored. Also adds a new error that is thrown if a live collection is used in content.config.ts rather than live.config.ts.

  • #​14343 13f7d36 Thanks @​florian-lefebvre! - Fixes a regression in non node runtimes

v5.13.7

Compare Source

Patch Changes

v5.13.6

Compare Source

Patch Changes

v5.13.5

Compare Source

Patch Changes
  • #​14286 09c5db3 Thanks @​ematipico! - BREAKING CHANGES only to the experimental CSP feature

    The following runtime APIs of the Astro global have been renamed:

    • Astro.insertDirective to Astro.csp.insertDirective
    • Astro.insertStyleResource to Astro.csp.insertStyleResource
    • Astro.insertStyleHash to Astro.csp.insertStyleHash
    • Astro.insertScriptResource to Astro.csp.insertScriptResource
    • Astro.insertScriptHash to Astro.csp.insertScriptHash

    The following runtime APIs of the APIContext have been renamed:

    • ctx.insertDirective to ctx.csp.insertDirective
    • ctx.insertStyleResource to ctx.csp.insertStyleResource
    • ctx.insertStyleHash to ctx.csp.insertStyleHash
    • ctx.insertScriptResource to ctx.csp.insertScriptResource
    • ctx.insertScriptHash to ctx.csp.insertScriptHash
  • #​14283 3224637 Thanks @​ematipico! - Fixes an issue where CSP headers were incorrectly injected in the development server.

  • #​14275 3e2f20d Thanks @​florian-lefebvre! - Adds support for experimental CSP when using experimental fonts

    Experimental fonts now integrate well with experimental CSP by injecting hashes for the styles it generates, as well as font-src directives.

    No action is required to benefit from it.

  • #​14280 4b9fb73 Thanks @​ascorbic! - Fixes a bug that caused cookies to not be correctly set when using middleware sequences

  • #​14276 77281c4 Thanks @​ArmandPhilippot! - Adds a missing export for resolveSrc, a documented image services utility.

v5.13.4

Compare Source

Patch Changes
  • #​14260 86a1e40 Thanks @​jp-knj! - Fixes Astro.url.pathname to respect trailingSlash: 'never' configuration when using a base path. Previously, the root path with a base would incorrectly return /base/ instead of /base when trailingSlash was set to 'never'.

  • #​14248 e81c4bd Thanks @​julesyoungberg! - Fixes a bug where actions named 'apply' do not work due to being a function prototype method.

v5.13.3

Compare Source

Patch Changes
  • #​14239 d7d93e1 Thanks @​wtchnm! - Fixes a bug where the types for the live content collections were not being generated correctly in dev mode

  • #​14221 eadc9dd Thanks @​delucis! - Fixes JSON schema support for content collections using the file() loader

  • #​14229 1a9107a Thanks @​jonmichaeldarby! - Ensures Astro.currentLocale returns the correct locale during SSG for pages that use a locale param (such as [locale].astro or [locale]/index.astro, which produce [locale].html)

v5.13.2

Compare Source

Patch Changes

v5.13.1

Compare Source

Patch Changes
  • #​14409 250a595 Thanks @​louisescher! - Fixes an issue where astro info would log errors to console in certain cases.

  • #​14398 a7df80d Thanks @​idawnlight! - Fixes an unsatisfiable type definition when calling addServerRenderer on an experimental container instance

  • #​13747 120866f Thanks @​jp-knj! - Adds automatic request signal abortion when the underlying socket closes in the Node.js adapter

    The Node.js adapter now automatically aborts the request.signal when the client connection is terminated. This enables better resource management and allows applications to properly handle client disconnections through the standard AbortSignal API.

  • #​14428 32a8acb Thanks @​drfuzzyness! - Force sharpService to return a Uint8Array if Sharp returns a SharedArrayBuffer

  • #​14411 a601186 Thanks @​GameRoMan! - Fixes relative links to docs that could not be opened in the editor.

v5.13.0

Compare Source

Minor Changes
  • #​14173 39911b8 Thanks @​florian-lefebvre! - Adds an experimental flag staticImportMetaEnv to disable the replacement of import.meta.env values with process.env calls and their coercion of environment variable values. This supersedes the rawEnvValues experimental flag, which is now removed.

    Astro allows you to configure a type-safe schema for your environment variables, and converts variables imported via astro:env into the expected type. This is the recommended way to use environment variables in Astro, as it allows you to easily see and manage whether your variables are public or secret, available on the client or only on the server at build time, and the data type of your values.

    However, you can still access environment variables through process.env and import.meta.env directly when needed. This was the only way to use environment variables in Astro before astro:env was added in Astro 5.0, and Astro's default handling of import.meta.env includes some logic that was only needed for earlier versions of Astro.

    The experimental.staticImportMetaEnv flag updates the behavior of import.meta.env to align with Vite's handling of environment variables and for better ease of use with Astro's current implementations and features. This will become the default behavior in Astro 6.0, and this early preview is introduced as an experimental feature.

    Currently, non-public import.meta.env environment variables are replaced by a reference to process.env. Additionally, Astro may also convert the value type of your environment variables used through import.meta.env, which can prevent access to some values such as the strings "true" (which is converted to a boolean value), and "1" (which is converted to a number).

    The experimental.staticImportMetaEnv flag simplifies Astro's default behavior, making it easier to understand and use. Astro will no longer replace any import.meta.env environment variables with a process.env call, nor will it coerce values.

    To enable this feature, add the experimental flag in your Astro config and remove rawEnvValues if it was enabled:

    // astro.config.mjs
    import { defineConfig } from "astro/config";
    
    export default defineConfig({
    +  experimental: {
    +    staticImportMetaEnv: true
    -    rawEnvValues: false
    +  }
    });
    
Updating your project

If you were relying on Astro's default coercion, you may need to update your project code to apply it manually:

// src/components/MyComponent.astro
- const enabled: boolean = import.meta.env.ENABLED;
+ const enabled: boolean = import.meta.env.ENABLED === "true";

If you were relying on the transformation into process.env calls, you may need to update your project code to apply it manually:

// src/components/MyComponent.astro
- const enabled: boolean = import.meta.env.DB_PASSWORD;
+ const enabled: boolean = process.env.DB_PASSWORD;

You may also need to update types:

// src/env.d.ts
interface ImportMetaEnv {
  readonly PUBLIC_POKEAPI: string;
-  readonly DB_PASSWORD: string;
-  readonly ENABLED: boolean;
+  readonly ENABLED: string;
}

interface ImportMeta {
  readonly env: ImportMetaEnv;
}

+ namespace NodeJS {
+  interface ProcessEnv {
+    DB_PASSWORD: string;
+  }
+ }

See the experimental static import.meta.env documentation for more information about this feature. You can learn more about using environment variables in Astro, including astro:env, in the environment variables documentation.

  • #​14122 41ed3ac Thanks @​ascorbic! - Adds experimental support for automatic Chrome DevTools workspace folders

    This feature allows you to edit files directly in the browser and have those changes reflected in your local file system via a connected workspace folder. This allows you to apply edits such as CSS tweaks without leaving your browser tab!

    With this feature enabled, the Astro dev server will automatically configure a Chrome DevTools workspace for your project. Your project will then appear as a workspace source, ready to connect. Then, changes that you make in the "Sources" panel are automatically saved to your project source code.

    To enable this feature, add the experimental flag chromeDevtoolsWorkspace to your Astro config:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        chromeDevtoolsWorkspace: true,
      },
    });
    

    See the experimental Chrome DevTools workspace feature documentation for more information.

v5.12.9

Compare Source

Patch Changes
  • #​14020 9518975 Thanks @​jp-knj and @​asieradzk! - Prevent double-prefixed redirect paths when using fallback and redirectToDefaultLocale together

    Fixes an issue where i18n fallback routes would generate double-prefixed paths (e.g., /es/es/test/item1/) when fallback and redirectToDefaultLocale configurations were used together. The fix adds proper checks to prevent double prefixing in route generation.

  • #​14199 3e4cb8e Thanks @​ascorbic! - Fixes a bug that prevented HMR from working with inline styles

v5.12.8

Compare Source

Patch Changes

v5.12.7

Compare Source

Patch Changes

v5.12.6

Compare Source

Patch Changes

v5.12.5

Compare Source

Patch Changes
  • #​14059 19f53eb Thanks @​benosmac! - Fixes a bug in i18n implementation, where Astro didn't emit the correct pages when fallback is enabled, and a locale uses a catch-all route, e.g. src/pages/es/[...catchAll].astro

  • #​14155 31822c3 Thanks @​ascorbic! - Fixes a bug that caused an error "serverEntrypointModule[_start] is not a function" in some adapters

v5.12.4

Compare Source

Patch Changes

v5.12.3

Compare Source

Patch Changes
  • #​14119 14807a4 Thanks @​ascorbic! - Fixes a bug that caused builds to fail if a client directive was mistakenly added to an Astro component

  • #​14001 4b03d9c Thanks @​dnek! - Fixes an issue where getImage() assigned the resized base URL to the srcset URL of ImageTransform, which matched the width, height, and format of the original image.

v5.12.2

Compare Source

Patch Changes

v5.12.1

Compare Source

Patch Changes

v5.12.0

Compare Source

Minor Changes
  • #​13971 fe35ee2 Thanks @​adamhl8! - Adds an experimental flag rawEnvValues to disable coercion of import.meta.env values (e.g. converting strings to other data types) that are populated from process.env

    Astro allows you to configure a type-safe schema for your environment variables, and converts variables imported via astro:env into the expected type.

    However, Astro also converts your environment variables used through import.meta.env in some cases, and this can prevent access to some values such as the strings "true" (which is converted to a boolean value), and "1" (which is converted to a number).

    The experimental.rawEnvValues flag disables coercion of import.meta.env values that are populated from process.env, allowing you to use the raw value.

    To enable this feature, add the experimental flag in your Astro config:

    import { defineConfig } from "astro/config"
    
    export default defineConfig({
    +  experimental: {
    +    rawEnvValues: true,
    +  }
    })
    

    If you were relying on this coercion, you may need to update your project code to apply it manually:

    - const enabled: boolean = import.meta.env.ENABLED
    + const enabled: boolean = import.meta.env.ENABLED === "true"
    

    See the experimental raw environment variables reference docs for more information.

  • #​13941 6bd5f75 Thanks @​aditsachde! - Adds support for TOML files to Astro's built-in glob() and file() content loaders.

    In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.

    Astro 5.12 now directly supports loading data from TOML files in content collections in both the glob() and the file() loaders.

    If you had added your own TOML content parser for the file() loader, you can now remove it as this functionality is now included:

    // src/content.config.ts
    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) }),
    + loader: file("src/data/dogs.toml")
      schema: /* ... */
    })
    

    Note that TOML does not support top-level arrays. Instead, the file() loader considers each top-level table to be an independent entry. The table header is populated in the id field of the entry object.

    See Astro's content collections guide for more information on using the built-in content loaders.

Patch Changes

v5.11.2

Compare Source

Patch Changes

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@astrojs/markdown-remark](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark)) | [`^6.3.2` → `^7.0.0`](https://renovatebot.com/diffs/npm/@astrojs%2fmarkdown-remark/6.3.2/7.2.2) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fmarkdown-remark/7.2.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fmarkdown-remark/6.3.2/7.2.2?slim=true) | | [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) ([source](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx)) | [`^4.3.0` → `^7.0.0`](https://renovatebot.com/diffs/npm/@astrojs%2fmdx/4.3.0/7.0.5) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fmdx/7.0.5?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fmdx/4.3.0/7.0.5?slim=true) | | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`^5.11.1` → `^7.0.0`](https://renovatebot.com/diffs/npm/astro/5.11.1/7.2.2) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/7.2.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/5.11.1/7.2.2?slim=true) | --- ### Release Notes <details> <summary>withastro/astro (@&#8203;astrojs/markdown-remark)</summary> ### [`v7.2.2`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#722) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.2.1...@astrojs/markdown-remark@7.2.2) ##### Patch Changes - Updated dependencies \[[`c895b12`](https://github.com/withastro/astro/commit/c895b12b99a73f5a9f98d6699452d12c138f8a18)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.2 ### [`v7.2.1`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#721) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.2.0...@astrojs/markdown-remark@7.2.1) ##### Patch Changes - Updated dependencies \[[`eb6f97e`](https://github.com/withastro/astro/commit/eb6f97e391ee587747e37609c255c7cd4b9cce3c)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.1 ### [`v7.2.0`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#720) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.1.2...@astrojs/markdown-remark@7.2.0) ##### Minor Changes - [#&#8203;16848](https://github.com/withastro/astro/pull/16848) [`f732f3c`](https://github.com/withastro/astro/commit/f732f3cc716342a63e5b03815243ba10964b89dc) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds a new `markdown.processor` configuration option, allowing you to choose an alternative Markdown processor. Websites with many Markdown/MDX files tend to be slow to build because the unified ecosystem (e.g., remark, rehype) is slow to process. This feature introduces the ability to replace this part of the build pipeline with another processor. The default processor is `unified()`. This means that existing configurations remain unchanged and your remark/rehype plugins continue to work. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import { unified } from '@astrojs/markdown-remark'; import remarkToc from 'remark-toc'; export default defineConfig({ markdown: { processor: unified({ remarkPlugins: [remarkToc], }), }, }); ``` In addition to this new configuration option, Astro provides a new alternative processor based on Rust: [Sätteri](https://satteri.bruits.org/). You can choose to use it now by installing `@astrojs/markdown-satteri`, importing the `satteri()` processor, and adapting your existing configuration: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri({ features: { directive: true }, }), }, }); ``` This processor does not support the remark and rehype plugins. This means you may need to convert them to [MDAST or HAST plugins](https://satteri.bruits.org/docs/plugins/) to retain your current functionality. The existing top-level `markdown.remarkPlugins`, `markdown.rehypePlugins`, `markdown.remarkRehype`, `markdown.gfm`, and `markdown.smartypants` options still work, but are now deprecated and will be removed in a future major update. The matching `remarkPlugins`, `rehypePlugins`, and `remarkRehype` options on the MDX integration are also deprecated for the same reason. To anticipate their removal, move them onto `unified({...})` (or your preferred plugin processor) : ```diff // astro.config.mjs import { defineConfig } from 'astro/config'; import remarkToc from 'remark-toc'; import rehypeSlug from 'rehype-slug'; + import { unified } from '@astrojs/markdown-remark'; export default defineConfig({ markdown: { + processor: unified({ + remarkPlugins: [remarkToc], + rehypePlugins: [rehypeSlug], + remarkRehype: true, + gfm: true, + smartypants: true, + }), - remarkPlugins: [remarkToc], - rehypePlugins: [rehypeSlug], - remarkRehype: true, - gfm: true, - smartypants: true, }, }); ``` For more information on enabling and using this feature in your project, see our [Markdown guide](https://docs.astro.build/en/guides/markdown-content/). To give feedback on this new Rust processor, see the [Native Markdown / MDX parsing and processing RFC](https://github.com/withastro/roadmap/pull/1364). ##### Patch Changes - Updated dependencies \[[`f732f3c`](https://github.com/withastro/astro/commit/f732f3cc716342a63e5b03815243ba10964b89dc)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.0 ### [`v7.1.2`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#712) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.1.1...@astrojs/markdown-remark@7.1.2) ##### Patch Changes - [#&#8203;15723](https://github.com/withastro/astro/pull/15723) [`9256345`](https://github.com/withastro/astro/commit/92563452ce866d9f9b950ad4b2adc808d10e8014) Thanks [@&#8203;rururux](https://github.com/rururux)! - Updates internal type usage from `@astrojs/prism`. - Updated dependencies \[[`d365c97`](https://github.com/withastro/astro/commit/d365c975ba2d88fc1dbdfe698df2bf9e2eafadce), [`9256345`](https://github.com/withastro/astro/commit/92563452ce866d9f9b950ad4b2adc808d10e8014)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.9.1 - [@&#8203;astrojs/prism](https://github.com/astrojs/prism)@&#8203;4.0.2 ### [`v7.1.1`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#711) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.1.0...@astrojs/markdown-remark@7.1.1) ##### Patch Changes - [#&#8203;16419](https://github.com/withastro/astro/pull/16419) [`f3485c3`](https://github.com/withastro/astro/commit/f3485c3458bc8bf70c152126e418c24f489ded9d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens nested object and package metadata lookups to ignore prototype keys in content handling and project scaffolding - Updated dependencies \[[`99464ed`](https://github.com/withastro/astro/commit/99464edb5fc0968f6497328e106f26ab393668bd), [`f3485c3`](https://github.com/withastro/astro/commit/f3485c3458bc8bf70c152126e418c24f489ded9d)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.9.0 ### [`v7.1.0`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#710) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.0.1...@astrojs/markdown-remark@7.1.0) ##### Minor Changes - [#&#8203;15340](https://github.com/withastro/astro/pull/15340) [`10a1a5a`](https://github.com/withastro/astro/commit/10a1a5a5232fa401ca814b396cf79aeccdfdf8a9) Thanks [@&#8203;trueberryless](https://github.com/trueberryless)! - Updates `createMarkdownProcessor` to support advanced SmartyPants options. The `smartypants` property in `AstroMarkdownOptions` now accepts `Smartypants` options, allowing fine-grained control over typography transformations (backticks, dashes, ellipses, and quotes). ```ts import { createMarkdownProcessor } from '@astrojs/markdown-remark'; const processor = await createMarkdownProcessor({ smartypants: { backticks: 'all', dashes: 'oldschool', ellipses: 'unspaced', openingQuotes: { double: '«', single: '‹' }, closingQuotes: { double: '»', single: '›' }, quotes: false, }, }); ``` For the up-to-date supported properties, check out [the `retext-smartypants` options](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields). ### [`v7.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#701) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.0.0...@astrojs/markdown-remark@7.0.1) ##### Patch Changes - Updated dependencies \[[`d3c7de9`](https://github.com/withastro/astro/commit/d3c7de9253e9cb31fa5c4bf9f4bdf59dd1ada7b0)]: - [@&#8203;astrojs/prism](https://github.com/astrojs/prism)@&#8203;4.0.1 ### [`v7.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#700) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.11...@astrojs/markdown-remark@7.0.0) ##### Major Changes - [#&#8203;14494](https://github.com/withastro/astro/pull/14494) [`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates Markdown heading ID generation - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-markdown-heading-id-generation)) - [#&#8203;15726](https://github.com/withastro/astro/pull/15726) [`6f19ecc`](https://github.com/withastro/astro/commit/6f19ecc35adfb2ddaabbba2269630f95c13f5a57) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates dependency `shiki` to v4 Check [Shiki's upgrade guide](https://shiki.style/blog/v4). ##### Minor Changes - [#&#8203;15277](https://github.com/withastro/astro/pull/15277) [`cb99214`](https://github.com/withastro/astro/commit/cb99214ebb991d1b929978f46e1b3ae68b561366) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the function `createShikiHighlighter` would always create a new Shiki highlighter instance. Now the function returns a cached version of the highlighter based on the Shiki options. This should improve the performance for sites that heavily rely on Shiki and code in their pages. - [#&#8203;15332](https://github.com/withastro/astro/pull/15332) [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Exposes the `fileURL` option in `MarkdownProcessorRenderOptions`, allowing callers to specify the file URL for resolving relative image paths. ##### Patch Changes - [#&#8203;15187](https://github.com/withastro/astro/pull/15187) [`bbb5811`](https://github.com/withastro/astro/commit/bbb5811eb801a42dc091bb09ea19d6cde3033795) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Update to Astro 6 beta - [#&#8203;15297](https://github.com/withastro/astro/pull/15297) [`80f0225`](https://github.com/withastro/astro/commit/80f022559e81b5609a69ba31c7f0d93dcb0bf74d) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes a case where code blocks generated by prism would include the `is:raw` attribute in the final output - [#&#8203;15676](https://github.com/withastro/astro/pull/15676) [`1fa4177`](https://github.com/withastro/astro/commit/1fa41779c458123f707940a5253dbe6e540dbf7d) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes an issue where the use of the `Code` component would result in an unexpected error. - [#&#8203;15651](https://github.com/withastro/astro/pull/15651) [`f94d3c5`](https://github.com/withastro/astro/commit/f94d3c5313e5a7576cf2cb316a85d68d335a188f) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Reuses cached Shiki highlighter instances across languages. - Updated dependencies \[[`bbb5811`](https://github.com/withastro/astro/commit/bbb5811eb801a42dc091bb09ea19d6cde3033795), [`4ebc1e3`](https://github.com/withastro/astro/commit/4ebc1e328ac40e892078031ed9dfecf60691fd56), [`11efb05`](https://github.com/withastro/astro/commit/11efb058e85cda68f9a8e8f15a2c7edafe5a4789), [`4e7f3e8`](https://github.com/withastro/astro/commit/4e7f3e8e6849c314a0ab031ebd7f23fb982f0529), [`a164c77`](https://github.com/withastro/astro/commit/a164c77336059f2dc3e7f7fe992aa754ed145ef3), [`cf6ea6b`](https://github.com/withastro/astro/commit/cf6ea6b36b67c7712395ed3f9ca19cb14ba1a013), [`e131261`](https://github.com/withastro/astro/commit/e1312615b39c59ebc05d5bb905ee0960b50ad3cf), [`a18d727`](https://github.com/withastro/astro/commit/a18d727fc717054df85177c8e0c3d38a5252f2da), [`240c317`](https://github.com/withastro/astro/commit/240c317faab52d7f22494e9181f5d2c2c404b0bd), [`745e632`](https://github.com/withastro/astro/commit/745e632fc590e41a5701509e9cc4ed971bdddf74)]: - [@&#8203;astrojs/prism](https://github.com/astrojs/prism)@&#8203;4.0.0 - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.8.0 ### [`v6.3.11`](https://github.com/withastro/astro/releases/tag/%40astrojs/markdown-remark%406.3.11) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.10...@astrojs/markdown-remark@6.3.11) ##### Patch Changes - Updated dependencies \[[`c2cd371`](https://github.com/withastro/astro/commit/c2cd371f9f2003ab8c9ce70a24fc0af40c5de531)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.6 ### [`v6.3.10`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#6310) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.9...@astrojs/markdown-remark@6.3.10) ##### Patch Changes - [#&#8203;14902](https://github.com/withastro/astro/pull/14902) [`d8305f8`](https://github.com/withastro/astro/commit/d8305f8abdf92db6fa505ee9c1774553ba90b7bd) Thanks [@&#8203;tuyuritio](https://github.com/tuyuritio)! - Prevents HAST-only props from being directly converted into HTML attributes ### [`v6.3.9`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#639) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.8...@astrojs/markdown-remark@6.3.9) ##### Patch Changes - Updated dependencies \[[`9e9c528`](https://github.com/withastro/astro/commit/9e9c528191b6f5e06db9daf6ad26b8f68016e533), [`0f75f6b`](https://github.com/withastro/astro/commit/0f75f6bc637d547e07324e956db21d9f245a3e8e)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.5 ### [`v6.3.8`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#638) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.7...@astrojs/markdown-remark@6.3.8) ##### Patch Changes - Updated dependencies \[[`b8ca69b`](https://github.com/withastro/astro/commit/b8ca69b97149becefaf89bf21853de9c905cdbb7)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.4 ### [`v6.3.7`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#637) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.6...@astrojs/markdown-remark@6.3.7) ##### Patch Changes - Updated dependencies \[[`1e2499e`](https://github.com/withastro/astro/commit/1e2499e8ea83ebfa233a18a7499e1ccf169e56f4)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.3 ### [`v6.3.6`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#636) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.5...@astrojs/markdown-remark@6.3.6) ##### Patch Changes - Updated dependencies \[[`4d16de7`](https://github.com/withastro/astro/commit/4d16de7f95db5d1ec1ce88610d2a95e606e83820)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.2 ### [`v6.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#635) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.4...@astrojs/markdown-remark@6.3.5) ##### Patch Changes - Updated dependencies \[[`0567fb7`](https://github.com/withastro/astro/commit/0567fb7b50c0c452be387dd7c7264b96bedab48f)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.1 ### [`v6.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#634) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.3...@astrojs/markdown-remark@6.3.4) ##### Patch Changes - Updated dependencies \[[`f4e8889`](https://github.com/withastro/astro/commit/f4e8889c10c25aeb7650b389c35a70780d5ed172)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.0 ### [`v6.3.3`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#633) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@6.3.2...@astrojs/markdown-remark@6.3.3) ##### Patch Changes - [#&#8203;13941](https://github.com/withastro/astro/pull/13941) [`6bd5f75`](https://github.com/withastro/astro/commit/6bd5f75806cb4df39d9e4e9b1f2225dcfdd724b0) Thanks [@&#8203;aditsachde](https://github.com/aditsachde)! - Adds support for TOML files to Astro's built-in `glob()` and `file()` content loaders. In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader. Astro 5.12 now directly supports loading data from TOML files in content collections in both the `glob()` and the `file()` loaders. If you had added your own TOML content parser for the `file()` loader, you can now remove it as this functionality is now included: ```diff // src/content.config.ts 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) }), + loader: file("src/data/dogs.toml") schema: /* ... */ }) ``` Note that TOML does not support top-level arrays. Instead, the `file()` loader considers each top-level table to be an independent entry. The table header is populated in the `id` field of the entry object. See Astro's [content collections guide](https://docs.astro.build/en/guides/content-collections/#built-in-loaders) for more information on using the built-in content loaders. </details> <details> <summary>withastro/astro (@&#8203;astrojs/mdx)</summary> ### [`v7.0.5`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#705) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@7.0.4...@astrojs/mdx@7.0.5) ##### Patch Changes - Updated dependencies \[[`c895b12`](https://github.com/withastro/astro/commit/c895b12b99a73f5a9f98d6699452d12c138f8a18)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.2 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.2.2 ### [`v7.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#704) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@7.0.3...@astrojs/mdx@7.0.4) ##### Patch Changes - [#&#8203;17514](https://github.com/withastro/astro/pull/17514) [`41a00dd`](https://github.com/withastro/astro/commit/41a00dd86fc848763fa9dc6e501d6e85188c1306) Thanks [@&#8203;gtritchie](https://github.com/gtritchie)! - Fixes a bug where the integration was emitting React-cased attribute names. ### [`v7.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#703) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@7.0.2...@astrojs/mdx@7.0.3) ##### Patch Changes - [#&#8203;17341](https://github.com/withastro/astro/pull/17341) [`64b0d66`](https://github.com/withastro/astro/commit/64b0d6667eabd8fe51643dfdab7004670e319810) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes custom `pre` components not applying to syntax-highlighted code blocks when using the Sätteri Markdown processor with MDX. ### [`v7.0.2`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#702) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@7.0.1...@astrojs/mdx@7.0.2) ##### Patch Changes - Updated dependencies \[[`eb6f97e`](https://github.com/withastro/astro/commit/eb6f97e391ee587747e37609c255c7cd4b9cce3c)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.1 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.2.1 ### [`v7.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#701) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@7.0.0...@astrojs/mdx@7.0.1) ##### Patch Changes - [#&#8203;17249](https://github.com/withastro/astro/pull/17249) [`02b73b0`](https://github.com/withastro/astro/commit/02b73b0fc2e32102e788fd9031ce061337490a73) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the `peerDependencies` field used incorrect dependencies. ### [`v7.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#700) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@6.0.3...@astrojs/mdx@7.0.0) ##### Major Changes - [#&#8203;15819](https://github.com/withastro/astro/pull/15819) [`cafec4e`](https://github.com/withastro/astro/commit/cafec4e23365061491103dfce2e889a15cf86f27) Thanks [@&#8203;delucis](https://github.com/delucis)! - Upgrade to Vite v8 ##### Minor Changes - [#&#8203;17093](https://github.com/withastro/astro/pull/17093) [`4585fe5`](https://github.com/withastro/astro/commit/4585fe57dda06226058118f90a809f9e33d4b2af) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Replaces the import entrypoint of `getContainerRenderer()` A new `container-renderer` entrypoint exporting `getContainerRenderer()` has been added to the following integrations: React, Preact, Svelte, SolidJS, Vue, and MDX. This prevents bundlers from trying to bundle unrelated exports from the package root when only the Container API is used. If you are using the Container API, update your import statements to use the new entrypoint. The following example updates the `getContainerRenderer()` import for React: ```diff - import { getContainerRenderer } from '@astrojs/react'; + import { getContainerRenderer } from '@astrojs/react/container-renderer'; ``` Importing `getContainerRenderer()` from the package root still works, but is now deprecated and logs a warning. - [#&#8203;17129](https://github.com/withastro/astro/pull/17129) [`ff7b718`](https://github.com/withastro/astro/commit/ff7b718a301b8edc7d7db6626f65e69ce35823a7) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds support for [modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically) with the default Markdown processor. A Sätteri plugin can now read and mutate `ctx.data.astro.frontmatter`, and Astro uses the result as the page's frontmatter, in both Markdown and MDX. ##### Patch Changes - [#&#8203;17124](https://github.com/withastro/astro/pull/17124) [`7e7ab87`](https://github.com/withastro/astro/commit/7e7ab8775f1c70e00e30db9d3c4796246eaf1c5f) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Updates `satteri` to `0.9.0`. See the [Sätteri changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md) for details. - [#&#8203;17027](https://github.com/withastro/astro/pull/17027) [`241250b`](https://github.com/withastro/astro/commit/241250bf126f39c86a8aedd38df106e533301752) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Triggers beta prereleases for packages that are still on alpha ### [`v6.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#603) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@6.0.2...@astrojs/mdx@6.0.3) ##### Patch Changes - [#&#8203;16969](https://github.com/withastro/astro/pull/16969) [`4a31f90`](https://github.com/withastro/astro/commit/4a31f90c765bcd1c4af8b85160b74a0da338cfe7) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting `markdown.syntaxHighlight` to `'prism'` now highlights your code blocks with Prism. ```js // astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, }); ``` ### [`v6.0.2`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#602) ##### Patch Changes - [#&#8203;16955](https://github.com/withastro/astro/pull/16955) [`9a93d68`](https://github.com/withastro/astro/commit/9a93d68429aa15e76f07268863badfbda7b59d23) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.8.0. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#080--2026-06-03) for details on bugs fixed and features added. - Updated dependencies \[[`9a93d68`](https://github.com/withastro/astro/commit/9a93d68429aa15e76f07268863badfbda7b59d23)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.2.2 ### [`v6.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#601) ##### Patch Changes - Updated dependencies \[[`eeb064c`](https://github.com/withastro/astro/commit/eeb064ca9452fd9d0ad9b7557059a646a90a3e57)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.2.1 ### [`v6.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#600-alpha1) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.6...@astrojs/mdx@6.0.0) ##### Patch Changes - [#&#8203;16969](https://github.com/withastro/astro/pull/16969) [`4a31f90`](https://github.com/withastro/astro/commit/4a31f90c765bcd1c4af8b85160b74a0da338cfe7) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting `markdown.syntaxHighlight` to `'prism'` now highlights your code blocks with Prism. ```js // astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, }); ``` - Updated dependencies \[[`4a31f90`](https://github.com/withastro/astro/commit/4a31f90c765bcd1c4af8b85160b74a0da338cfe7)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.0-alpha.0 ### [`v5.0.6`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#506) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.5...@astrojs/mdx@5.0.6) ##### Patch Changes - [#&#8203;16579](https://github.com/withastro/astro/pull/16579) [`49e10e3`](https://github.com/withastro/astro/commit/49e10e3b97a49d805802b8972a2f848ea7847b91) Thanks [@&#8203;igor-koop](https://github.com/igor-koop)! - Fixes an issue where the `smartypants` option was ignored. ### [`v5.0.5`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#505) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.4...@astrojs/mdx@5.0.5) ##### Patch Changes - Updated dependencies \[[`9256345`](https://github.com/withastro/astro/commit/92563452ce866d9f9b950ad4b2adc808d10e8014)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.2 ### [`v5.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#504) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.3...@astrojs/mdx@5.0.4) ##### Patch Changes - Updated dependencies \[[`f3485c3`](https://github.com/withastro/astro/commit/f3485c3458bc8bf70c152126e418c24f489ded9d)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.1 ### [`v5.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#503) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.2...@astrojs/mdx@5.0.3) ##### Patch Changes - Updated dependencies \[[`10a1a5a`](https://github.com/withastro/astro/commit/10a1a5a5232fa401ca814b396cf79aeccdfdf8a9)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.0 ### [`v5.0.2`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#502) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.1...@astrojs/mdx@5.0.2) ##### Patch Changes - [#&#8203;15864](https://github.com/withastro/astro/pull/15864) [`d3c7de9`](https://github.com/withastro/astro/commit/d3c7de9253e9cb31fa5c4bf9f4bdf59dd1ada7b0) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.0.1 ### [`v5.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#501) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@5.0.0...@astrojs/mdx@5.0.1) ##### Patch Changes - [#&#8203;15934](https://github.com/withastro/astro/pull/15934) [`6f8f0bc`](https://github.com/withastro/astro/commit/6f8f0bc4e22e958ccc2164acb1aa8cce21c43148) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Updates the Astro `peerDependencies#astro` to be `6.0.0`. ### [`v5.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#500) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.14...@astrojs/mdx@5.0.0) ##### Major Changes - [#&#8203;14494](https://github.com/withastro/astro/pull/14494) [`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates Markdown heading ID generation - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-markdown-heading-id-generation)) - [#&#8203;14427](https://github.com/withastro/astro/pull/14427) [`e131261`](https://github.com/withastro/astro/commit/e1312615b39c59ebc05d5bb905ee0960b50ad3cf) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Increases minimum Node.js version to 22.12.0 - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#node-22)) - [#&#8203;14445](https://github.com/withastro/astro/pull/14445) [`ecb0b98`](https://github.com/withastro/astro/commit/ecb0b98396f639d830a99ddb5895ab9223e4dc87) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#vite-70)) ##### Patch Changes - [#&#8203;15187](https://github.com/withastro/astro/pull/15187) [`bbb5811`](https://github.com/withastro/astro/commit/bbb5811eb801a42dc091bb09ea19d6cde3033795) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Update to Astro 6 beta - [#&#8203;15475](https://github.com/withastro/astro/pull/15475) [`36fc0e0`](https://github.com/withastro/astro/commit/36fc0e0c9e75b4cf830b15afd1a6a1f769095e6f) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes edge cases where an `export const components = {...}` declaration would fail to be detected with the `optimize` option enabled - [#&#8203;15264](https://github.com/withastro/astro/pull/15264) [`11efb05`](https://github.com/withastro/astro/commit/11efb058e85cda68f9a8e8f15a2c7edafe5a4789) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Lower the Node version requirement to allow running on Stackblitz until it supports v22 - Updated dependencies \[[`bbb5811`](https://github.com/withastro/astro/commit/bbb5811eb801a42dc091bb09ea19d6cde3033795), [`cb99214`](https://github.com/withastro/astro/commit/cb99214ebb991d1b929978f46e1b3ae68b561366), [`80f0225`](https://github.com/withastro/astro/commit/80f022559e81b5609a69ba31c7f0d93dcb0bf74d), [`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f), [`1fa4177`](https://github.com/withastro/astro/commit/1fa41779c458123f707940a5253dbe6e540dbf7d), [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d), [`6f19ecc`](https://github.com/withastro/astro/commit/6f19ecc35adfb2ddaabbba2269630f95c13f5a57), [`f94d3c5`](https://github.com/withastro/astro/commit/f94d3c5313e5a7576cf2cb316a85d68d335a188f)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.0.0 ### [`v4.3.14`](https://github.com/withastro/astro/releases/tag/%40astrojs/mdx%404.3.14) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.13...@astrojs/mdx@4.3.14) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.11 ### [`v4.3.13`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#4313) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.12...@astrojs/mdx@4.3.13) ##### Patch Changes - Updated dependencies \[[`d8305f8`](https://github.com/withastro/astro/commit/d8305f8abdf92db6fa505ee9c1774553ba90b7bd)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.10 ### [`v4.3.12`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#4312) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.11...@astrojs/mdx@4.3.12) ##### Patch Changes - [#&#8203;14813](https://github.com/withastro/astro/pull/14813) [`e1dd377`](https://github.com/withastro/astro/commit/e1dd377398a3dcf6ba0697dc8d4bde6d77a45700) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes `picocolors` as dependency in favor of the fork `piccolore`. ### [`v4.3.11`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#4311) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.10...@astrojs/mdx@4.3.11) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.9 ### [`v4.3.10`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#4310) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.9...@astrojs/mdx@4.3.10) ##### Patch Changes - [#&#8203;14715](https://github.com/withastro/astro/pull/14715) [`3d55c5d`](https://github.com/withastro/astro/commit/3d55c5d0fb520d470b33d391e5b68861f5b51271) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds support for client hydration in `getContainerRenderer()` The `getContainerRenderer()` function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually call `container.addClientRenderer()` with the appropriate client renderer entrypoint. See [the `container-with-vitest` demo](https://github.com/withastro/astro/blob/main/examples/container-with-vitest/test/ReactWrapper.test.ts) for a usage example, and [the Container API documentation](https://docs.astro.build/en/reference/container-reference/#renderers-option) for more information on using framework components with the experimental Container API. ### [`v4.3.9`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#439) ##### Patch Changes - [#&#8203;14621](https://github.com/withastro/astro/pull/14621) [`e3175d9`](https://github.com/withastro/astro/commit/e3175d9ccbf070150ab2229b2564ca0b12a86c30) Thanks [@&#8203;GameRoMan](https://github.com/GameRoMan)! - Updates `vite` version to fix CVE ### [`v4.3.8`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#438) ##### Patch Changes - [#&#8203;14591](https://github.com/withastro/astro/pull/14591) [`3e887ec`](https://github.com/withastro/astro/commit/3e887ec523b8e4ec4d01978f0fedf246dfdfbc81) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds TypeScript support for the `components` prop on MDX `Content` component when using `await render()`. Developers now get proper IntelliSense and type checking when passing custom components to override default MDX element rendering. - [#&#8203;14598](https://github.com/withastro/astro/pull/14598) [`7b45c65`](https://github.com/withastro/astro/commit/7b45c65c62e37d4225fb14ea378e2301de31cbea) Thanks [@&#8203;delucis](https://github.com/delucis)! - Reduces terminal text styling dependency size by switching from `kleur` to `picocolors` ### [`v4.3.7`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#437) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.6...@astrojs/mdx@4.3.7) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.8 ### [`v4.3.6`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#436) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.5...@astrojs/mdx@4.3.6) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.7 ### [`v4.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#435) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.4...@astrojs/mdx@4.3.5) ##### Patch Changes - [#&#8203;14326](https://github.com/withastro/astro/pull/14326) [`c24a8f4`](https://github.com/withastro/astro/commit/c24a8f42a17410ea78fc2d68ff0105b931a381eb) Thanks [@&#8203;jsparkdev](https://github.com/jsparkdev)! - Updates `vite` version to fix CVE ### [`v4.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#434) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.3...@astrojs/mdx@4.3.4) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.6 ### [`v4.3.3`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#433) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.2...@astrojs/mdx@4.3.3) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.5 ### [`v4.3.2`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#432) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.1...@astrojs/mdx@4.3.2) ##### Patch Changes - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.4 ### [`v4.3.1`](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#4313) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/mdx@4.3.0...@astrojs/mdx@4.3.1) ##### Patch Changes - Updated dependencies \[[`d8305f8`](https://github.com/withastro/astro/commit/d8305f8abdf92db6fa505ee9c1774553ba90b7bd)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.10 </details> <details> <summary>withastro/astro (astro)</summary> ### [`v7.2.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#722) [Compare Source](https://github.com/withastro/astro/compare/astro@7.2.1...astro@7.2.2) ##### Patch Changes - [#&#8203;17611](https://github.com/withastro/astro/pull/17611) [`9bc3207`](https://github.com/withastro/astro/commit/9bc3207fdbcdf8991596d0caeb66b707405aad07) Thanks [@&#8203;thelazylamaGit](https://github.com/thelazylamaGit)! - Fixes component styles rendered from content entries remaining stale until a second save when an adapter uses Astro's fallback development environment - [#&#8203;17634](https://github.com/withastro/astro/pull/17634) [`2267eee`](https://github.com/withastro/astro/commit/2267eeec7e88a47013465682d5278d7ea9253e5b) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes incremental builds dropping optimized images for cached pages when using a `collectStaticImages` prerenderer (e.g. `@astrojs/cloudflare` with compile-time image optimization) - [#&#8203;17650](https://github.com/withastro/astro/pull/17650) [`4cdf128`](https://github.com/withastro/astro/commit/4cdf12873970dc542a18188fca1a9289ca1b0368) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes intermittent `ImageNotFound` errors during build on projects with many images. The build now limits concurrent image file reads to avoid exhausting OS file descriptors (EMFILE) and retries transient I/O errors with backoff. Non-transient errors are no longer silently swallowed. - [#&#8203;17683](https://github.com/withastro/astro/pull/17683) [`2378221`](https://github.com/withastro/astro/commit/23782215a3f49d205b3576280e788d7c714c6d0f) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `prerenderConflictBehavior` not applying to content collection duplicate ID warnings in the `glob()` and `file()` loaders. Setting it to `'error'` now throws during content sync, and `'ignore'` suppresses the warning. - [#&#8203;17659](https://github.com/withastro/astro/pull/17659) [`90c6ea4`](https://github.com/withastro/astro/commit/90c6ea4641e2ca9362c4ab0ea7a8590d07bd1868) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes the Fonts API breaking `experimental.incrementalBuild` caching by embedding a build-local, randomly-assigned server port in generated code used for the dependency hash - [#&#8203;17630](https://github.com/withastro/astro/pull/17630) [`fd1d9ee`](https://github.com/withastro/astro/commit/fd1d9ee3f4a9c196153090d0523668febb1b6024) Thanks [@&#8203;ericclemmons](https://github.com/ericclemmons)! - Fixes incremental builds becoming prohibitively slow for sites with many pages or content entries that share a large dependency graph. - [#&#8203;17690](https://github.com/withastro/astro/pull/17690) [`93beecc`](https://github.com/withastro/astro/commit/93beeccc518d19caee01b0fa72f7e6244cb9288c) Thanks [@&#8203;NgoQuocViet2001](https://github.com/NgoQuocViet2001)! - Prevents files in directories whose names start with `pages` from being treated as page routes - [#&#8203;17671](https://github.com/withastro/astro/pull/17671) [`09f0dc7`](https://github.com/withastro/astro/commit/09f0dc7f90ef92f8520e13b7ba130e4b8aad31bd) Thanks [@&#8203;tarikermis](https://github.com/tarikermis)! - Fixes `astro dev` refusing to start after a Docker container restart when an unrelated process reuses the PID from a persisted lock file. Astro now checks the process command across platforms, so stale lock files are cleaned up and `--force` does not signal the unrelated process. ### [`v7.2.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#721) [Compare Source](https://github.com/withastro/astro/compare/astro@7.2.0...astro@7.2.1) ##### Patch Changes - [#&#8203;17612](https://github.com/withastro/astro/pull/17612) [`7133730`](https://github.com/withastro/astro/commit/71337304965425820e81cc27d54b95d23033c017) Thanks [@&#8203;thelazylamaGit](https://github.com/thelazylamaGit)! - Fixes CSS hot module replacement after navigating between pages with `ClientRouter` - [#&#8203;17628](https://github.com/withastro/astro/pull/17628) [`4ada248`](https://github.com/withastro/astro/commit/4ada24889fc1bcc1ee89f3f8e5c6bc4cbe87cce6) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a CSP violation when using both `security.csp` and `experimental.clientPrerender` with `data-astro-prefetch` links. The dynamically injected `<script type="speculationrules">` now uses a static `"source": "document"` approach with a CSS selector, producing a deterministic payload that is hashed and included in the CSP `script-src` directive at build time. - [#&#8203;17605](https://github.com/withastro/astro/pull/17605) [`89e4647`](https://github.com/withastro/astro/commit/89e4647bed74e65a2fc1c60ccb5a7fc6b7bf3bc4) Thanks [@&#8203;ashleigh-yeoman](https://github.com/ashleigh-yeoman)! - Fixes middleware HMR not responding to changes in imported modules. Previously, only direct edits to the middleware file would trigger a reload. - [#&#8203;17582](https://github.com/withastro/astro/pull/17582) [`bd2c1a5`](https://github.com/withastro/astro/commit/bd2c1a5a70666cc140c73a77edb41882fc88b277) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a regression where content collection `reference()` fields silently accepted entry IDs that don't exist, such as an ID that doesn't match a loader's slugified version of it. Astro now logs an error for references that point to a missing entry after all loaders finish syncing. - [#&#8203;17661](https://github.com/withastro/astro/pull/17661) [`97b0cc7`](https://github.com/withastro/astro/commit/97b0cc79c586bb1fc2ce2ffe4c420f3cf2db769e) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Improves Markdown options documentation with links to the Markdown guide and official processors. - [#&#8203;17349](https://github.com/withastro/astro/pull/17349) [`4328c73`](https://github.com/withastro/astro/commit/4328c736b18d36576429186445c8c89e8cd0d4b6) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes an issue where requests handled by the dev prerender environment (e.g. `/_image` with `@astrojs/cloudflare`'s `prerenderEnvironment: 'node'`) returned a 500 when a prerendered catch-all route existed, because non-prerendered route modules were imported in an environment where their runtime-specific APIs are unavailable - [#&#8203;17603](https://github.com/withastro/astro/pull/17603) [`722eed6`](https://github.com/withastro/astro/commit/722eed64c4ec878a4778ab312599733b325b21ca) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `<video>` and `<audio>` elements being non-functional after navigating via view transitions (`<ClientRouter />`) - [#&#8203;17616](https://github.com/withastro/astro/pull/17616) [`3a890d2`](https://github.com/withastro/astro/commit/3a890d226482e98c41650fb66c0c14d45eba2717) Thanks [@&#8203;lazerg](https://github.com/lazerg)! - Fixes `experimental.incrementalBuild` re-rendering unchanged routes that import more than one asset. The route's dependency hash depended on the order the assets finished building, so two builds of identical sources could produce different hashes. The hash is now based on the file name each asset resolves to. - [#&#8203;17547](https://github.com/withastro/astro/pull/17547) [`fba468c`](https://github.com/withastro/astro/commit/fba468c228d8661d2383a80c74206075201a187b) Thanks [@&#8203;dmgawel](https://github.com/dmgawel)! - Improves `getCollection()` and `getEntry()` performance for entries without local image references - [#&#8203;17602](https://github.com/withastro/astro/pull/17602) [`16e0d9d`](https://github.com/withastro/astro/commit/16e0d9d5c1b289242d317887e8334506627f2233) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a build error caused by hash collisions in generated content collection image import identifiers ### [`v7.2.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#720) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.6...astro@7.2.0) ##### Minor Changes - [#&#8203;17174](https://github.com/withastro/astro/pull/17174) [`0224a3a`](https://github.com/withastro/astro/commit/0224a3a356c1f2956075b77c3667bc67cf027d8c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds the `astro preview --background` flag to start preview servers as background processes. This makes preview servers easier to manage from scripts and AI coding agents because the command returns after the server is ready instead of keeping the terminal attached to the long-running process. ```sh astro preview --background ``` When a preview server is running in the background, you can inspect or stop it with new `astro preview` subcommands: ```sh astro preview status astro preview logs astro preview logs --follow astro preview stop ``` If Astro detects that `astro preview` is being run by an AI coding agent, background mode is enabled automatically. This matches the existing behavior for `astro dev`, allowing agents to continue working after the preview server starts while still receiving the server URL and process ID. To opt out of automatic background mode for preview servers, set `ASTRO_PREVIEW_BACKGROUND=0` before running `astro preview`. - [#&#8203;17532](https://github.com/withastro/astro/pull/17532) [`7f94895`](https://github.com/withastro/astro/commit/7f94895f8c28fc4d6977c9bfb1f90e80a9cfaa08) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds support for paths relative to your project root in `logger.entrypoint` Previously, pointing `logger.entrypoint` at a custom log handler living in your own project required building an absolute `URL`. You can now write the path directly: ```diff // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ logger: { - entrypoint: new URL('./src/logger.js', import.meta.url), + entrypoint: './src/logger.js', }, }); ``` Paths starting with `./` or `../` are resolved against your project root. Package specifiers such as `@org/astro-logger`, absolute paths, and `URL` entrypoints keep working as before. - [#&#8203;17084](https://github.com/withastro/astro/pull/17084) [`961bbe5`](https://github.com/withastro/astro/commit/961bbe5fdf4a761adb479595dfb94dc2e80f2957) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Widens the `AstroPrerenderer` `render()` return type so prerenderers can report incremental-build metadata A prerenderer's `render()` may now resolve to either a `Response` (as before) or a `PrerenderResult` object that pairs the response with the content entries and optimized-image transforms the page resolved. This lets prerenderers that render out of process (for example, in an adapter's runtime like workerd) report those dependencies back to the build, so [incremental static builds](https://docs.astro.build/en/reference/experimental-flags/incremental-build/) can track and replay them for skipped pages. ```ts import type { AstroPrerenderer, PrerenderResult } from 'astro'; const prerenderer: AstroPrerenderer = { name: 'my-adapter:prerenderer', getStaticPaths, async render(request, { routeData }): Promise<PrerenderResult> { const { response, metadata } = await renderInRuntime(request, routeData); return { response, metadata }; }, }; ``` This is a non-breaking widening: prerenderers that return a bare `Response` continue to work unchanged, and in-process prerenderers can keep returning a `Response` since the build collects their metadata directly. - [#&#8203;16871](https://github.com/withastro/astro/pull/16871) [`90c98ae`](https://github.com/withastro/astro/commit/90c98ae21ef0444a4088b7081676b0f97915001f) Thanks [@&#8203;adamchal](https://github.com/adamchal)! - Adds `session: false` in `astro.config` to opt out of session support. Projects that do not set `session: false` see no behavior change. ```js title="astro.config.mjs" import { defineConfig } from 'astro/config'; export default defineConfig({ session: false, }); ``` The session runtime and dependencies (`unstorage`) are now tree-shaken out of the SSR bundle for any project where no session driver is wired via: - `session: false` - no `session` config at all - a `session` config without a driver Useful for serverless/edge runtimes where cold-start parse time is sensitive. - [#&#8203;17084](https://github.com/withastro/astro/pull/17084) [`961bbe5`](https://github.com/withastro/astro/commit/961bbe5fdf4a761adb479595dfb94dc2e80f2957) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds experimental support for incremental static builds with `experimental.incrementalBuild`. When enabled, Astro can skip regenerating static pages from dynamic routes when both the page's module dependencies and its data cache key are unchanged from the previous build. This currently applies to pages returned from `getStaticPaths()` that include a `cacheKey`. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { incrementalBuild: true, }, }); ``` Return a `cacheKey` for each generated page from `getStaticPaths()`: ```astro --- export async function getStaticPaths() { const posts = await fetchPosts(); return posts.map((post) => ({ params: { slug: post.slug }, props: { post }, cacheKey: post.digest, })); } --- ``` For incremental builds to skip rendering in CI, Astro's cache directory must be preserved between builds. Astro empties the output directory on each build and restores skipped pages from the cache directory, so only that directory needs to persist. For the default config, cache and restore `node_modules/.astro/` before running `astro build`. See the [experimental incremental static builds](https://docs.astro.build/en/reference/experimental-flags/incremental-build/) documentation for more information. - [#&#8203;17084](https://github.com/withastro/astro/pull/17084) [`961bbe5`](https://github.com/withastro/astro/commit/961bbe5fdf4a761adb479595dfb94dc2e80f2957) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds the optional `digest` property to content collection entries. Loaders can provide an opaque digest value that changes when an entry changes. This is now reflected in the `CollectionEntry` type returned by `getCollection()` and `getEntry()`, making it easier to detect content changes without re-hashing large entry bodies. ```astro --- import { getCollection } from 'astro:content'; const posts = await getCollection('blog'); for (const post of posts) { console.log(post.digest); } --- ``` The property is optional because not every loader provides a digest. See [incremental static builds](https://docs.astro.build/en/reference/experimental-flags/incremental-build/) for how `digest` can be used as a `cacheKey`. ##### Patch Changes - [#&#8203;17534](https://github.com/withastro/astro/pull/17534) [`5a5337e`](https://github.com/withastro/astro/commit/5a5337ea718ab32401a37cdddc52e944289e8b66) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves `logger.entrypoint` reference docs - [#&#8203;17529](https://github.com/withastro/astro/pull/17529) [`d52a787`](https://github.com/withastro/astro/commit/d52a787b321b67a0491f33d87e670b59ba16f9fe) Thanks [@&#8203;QVinto](https://github.com/QVinto)! - Fixes `astro dev` crashing with `Invalid URL` when `--host` is set to a specific non-loopback address Vite only reports a `local` URL for loopback hosts. When the dev server was started with `--host <custom-address>` bound to a specific non-loopback address (a LAN or Tailscale IP, for example), the URL was reported under `network` and `local` was empty, so writing the dev lock file threw `Invalid URL` and killed a server that had already started successfully. The lock file URL now falls back to the network URL, and a server that exposes no URL at all is left untracked rather than being taken down by lock file bookkeeping. - [#&#8203;17566](https://github.com/withastro/astro/pull/17566) [`296248c`](https://github.com/withastro/astro/commit/296248cb39e9e2cc3c0896441df75edb2d3b3959) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `fontProviders.googleicons()` returning the full icon font (\~3.9MB) instead of only the requested glyphs when multiple `experimental.glyphs` are specified - [#&#8203;17560](https://github.com/withastro/astro/pull/17560) [`ef45de1`](https://github.com/withastro/astro/commit/ef45de17d21a0303fe50d7ca50fc8deef15856a7) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `Astro.url.pathname` for non-index pages when using `build.format: 'preserve'`. Previously, a page like `src/pages/about-me.astro` would output to `dist/about-me.html` but `Astro.url.pathname` would incorrectly return `/about-me/` instead of `/about-me.html`. - [#&#8203;17573](https://github.com/withastro/astro/pull/17573) [`0089f83`](https://github.com/withastro/astro/commit/0089f836320ec2aefdb6c448af31e56754115c5c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a Content Layer build crash that could occur when another dependency causes an older version of `neotraverse` to be hoisted to the project root - [#&#8203;17571](https://github.com/withastro/astro/pull/17571) [`116f700`](https://github.com/withastro/astro/commit/116f700d63b314467256d1913d544415d109f3bc) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes cookies set via `Astro.cookies.set()` inside a custom `404.astro` or `500.astro` error page being silently dropped from the final response - [#&#8203;17579](https://github.com/withastro/astro/pull/17579) [`3ea55ce`](https://github.com/withastro/astro/commit/3ea55ce24024af7dc6ec3dcdde2f8af6ab5707d8) Thanks [@&#8203;bluwy](https://github.com/bluwy)! - Supports the `devEngines` field in package.json when detecting the package manager for install commands - [#&#8203;17422](https://github.com/withastro/astro/pull/17422) [`e4e2037`](https://github.com/withastro/astro/commit/e4e20374f55c3338e4bd22275a8ad265f1c24cbf) Thanks [@&#8203;jiwonyoon-dev](https://github.com/jiwonyoon-dev)! - Fixes `popover` being rendered as `popover="true"`/`popover="false"` on custom elements (tag names containing a hyphen). Per the Popover API, the attribute only accepts `"auto"`, `"manual"`, or being absent, so boolean values are now always rendered as a bare `popover` attribute (or omitted), regardless of the tag name. ### [`v7.1.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#716) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.5...astro@7.1.6) ##### Patch Changes - [#&#8203;17536](https://github.com/withastro/astro/pull/17536) [`ff97b86`](https://github.com/withastro/astro/commit/ff97b86ab02d199af5fe0f6e9984e9919c8276bf) Thanks [@&#8203;dmgawel](https://github.com/dmgawel)! - Fixes concurrent static builds failing to generate i18n rewrite fallbacks for dynamic routes - [#&#8203;17383](https://github.com/withastro/astro/pull/17383) [`296e1b0`](https://github.com/withastro/astro/commit/296e1b03770e55fe969130300c3c55674ae59b1a) Thanks [@&#8203;thelazylamaGit](https://github.com/thelazylamaGit)! - Fixes stale dev CSS after editing component style blocks and CSS files in dev - [#&#8203;17543](https://github.com/withastro/astro/pull/17543) [`bbc1ec9`](https://github.com/withastro/astro/commit/bbc1ec9715160e25eb6a6fee2e133386414c0c00) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds a feature to `experimental.collectionStorage` that allows to change the size of chunks. For example, you can reduce the size of chunks to 1MB: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { collectionStorage: { type: 'chunked', chunkSize: 1024 * 1024, }, }, }); ``` - [#&#8203;17545](https://github.com/withastro/astro/pull/17545) [`5214663`](https://github.com/withastro/astro/commit/5214663aa5aca47e6cd0e049cfa40844b87bbb6f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Bumps the Astro compiler to the latest version. [Changelog](https://github.com/withastro/compiler-rs/releases/tag/%40astrojs%2Fcompiler-rs%400.3.2). ### [`v7.1.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#715) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.4...astro@7.1.5) ##### Patch Changes - [#&#8203;17524](https://github.com/withastro/astro/pull/17524) [`7613030`](https://github.com/withastro/astro/commit/761303051021764c5b8bc43ae4e32629c15b61a8) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a bug where an error while finalizing a request could prevent a response from being sent - [#&#8203;17480](https://github.com/withastro/astro/pull/17480) [`f61ba9c`](https://github.com/withastro/astro/commit/f61ba9cfb028d9f7448eda3fea2726e179d66391) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where a custom `logger.entrypoint` failed to load at runtime in a built server bundle. - [#&#8203;17525](https://github.com/withastro/astro/pull/17525) [`e614b7b`](https://github.com/withastro/astro/commit/e614b7bd8a0dae403b1f9c219250847d326cbff2) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes action path resolution so that properties of a resolved action function are not treated as routable path segments - [#&#8203;17284](https://github.com/withastro/astro/pull/17284) [`c775c1f`](https://github.com/withastro/astro/commit/c775c1f984d1c176bf26a0f9c435bf6c0d585443) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a bug where the custom 404 (or 500) page was not rendered when a middleware rewrite targeted a route that returned an empty 404/500 response, and a blank page was returned instead - [#&#8203;17474](https://github.com/withastro/astro/pull/17474) [`c895b12`](https://github.com/withastro/astro/commit/c895b12b99a73f5a9f98d6699452d12c138f8a18) Thanks [@&#8203;nicksnyder](https://github.com/nicksnyder)! - Updates dependency `js-yaml` to v4.3.0 - Updated dependencies \[[`c895b12`](https://github.com/withastro/astro/commit/c895b12b99a73f5a9f98d6699452d12c138f8a18)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.2 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.2.2 - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.5 ### [`v7.1.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#714) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.3...astro@7.1.4) ##### Patch Changes - [#&#8203;17488](https://github.com/withastro/astro/pull/17488) [`d4f266d`](https://github.com/withastro/astro/commit/d4f266de4af009876baa554708705e5ac36572bb) Thanks [@&#8203;emerson-d-lopes](https://github.com/emerson-d-lopes)! - Fixes duplicate CSS files being emitted in server output when a prerendered page and a server-rendered page share the same styles (e.g. a shared layout importing Tailwind). The prerender and SSR environments each emitted their own copy of the same stylesheet (`index.X.css` and `_..Y.css`); the SSR build now reuses the CSS asset filename from the prerender build when the stylesheet is backed by the same CSS source modules, so only a single file is emitted. - [#&#8203;17472](https://github.com/withastro/astro/pull/17472) [`4dc590c`](https://github.com/withastro/astro/commit/4dc590c8fcdd9207492914dddb8e861c532ed904) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Adds the missing `background` prop to the `<Image />` and `<Picture />` component types. The prop already worked at runtime, but was absent from the types, causing `astro check` to report that `background` does not exist on the component props - [#&#8203;17292](https://github.com/withastro/astro/pull/17292) [`0fc519d`](https://github.com/withastro/astro/commit/0fc519de12d69088052b76e096a4adfdc789c30c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes missing scoped styles for child components inside `client:only` islands in production builds - [#&#8203;17421](https://github.com/withastro/astro/pull/17421) [`f1448de`](https://github.com/withastro/astro/commit/f1448de83726a7ab21c89d45e2e26ed8f6ef6531) Thanks [@&#8203;iamkaleemsajjad-hue](https://github.com/iamkaleemsajjad-hue)! - Fixes session runtime errors being silently swallowed by `console.error` instead of routing through Astro's logger - [#&#8203;17421](https://github.com/withastro/astro/pull/17421) [`f1448de`](https://github.com/withastro/astro/commit/f1448de83726a7ab21c89d45e2e26ed8f6ef6531) Thanks [@&#8203;iamkaleemsajjad-hue](https://github.com/iamkaleemsajjad-hue)! - Fixes a session being left in a partial state after a storage failure during `session.regenerate()`, preventing unnecessary storage reads on subsequent operations - [#&#8203;17517](https://github.com/withastro/astro/pull/17517) [`82bf7e2`](https://github.com/withastro/astro/commit/82bf7e2008e3062cb8b32e9500804e71e4bfd30a) Thanks [@&#8203;Hashim1999164](https://github.com/Hashim1999164)! - Prevents a visible terminal window from popping up on Windows when the dev server runs in background mode. The detached child process is now spawned with `windowsHide: true`, so console-subsystem grandchildren (such as `workerd.exe`) no longer get a new focus-stealing window allocated by Windows Terminal. - [#&#8203;17510](https://github.com/withastro/astro/pull/17510) [`eaa1fb0`](https://github.com/withastro/astro/commit/eaa1fb0067406a58490d55686f9f617e4c834905) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes the `glob()` loader watcher so negation patterns like `!docs/drafts/**` correctly exclude files during development, matching the behavior of the initial scan. Previously, negations were treated as independent matchers, causing unrelated files (including `.astro/data-store.json`) to be ingested as collection entries - [#&#8203;17511](https://github.com/withastro/astro/pull/17511) [`704e570`](https://github.com/withastro/astro/commit/704e570a43de11450372eb68ec467c154acc2e2e) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes TypeScript path aliases from `tsconfig.json` not resolving in `astro.config.ts` ### [`v7.1.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#713) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.2...astro@7.1.3) ##### Patch Changes - [#&#8203;17427](https://github.com/withastro/astro/pull/17427) [`630b382`](https://github.com/withastro/astro/commit/630b382ce3303c350154338e59cb5444c5316764) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes image optimization during `astro build` using too many parallel processes in CPU-limited containers. Builds now respect the container's CPU limit, reducing peak memory usage and avoiding out-of-memory crashes. </content> </invoke> ### [`v7.1.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#712) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.1...astro@7.1.2) ##### Patch Changes - [#&#8203;17445](https://github.com/withastro/astro/pull/17445) [`a5f7230`](https://github.com/withastro/astro/commit/a5f7230d1caf41ef1e94f9a6b9f6ee01d332455c) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates dependency `cookie` to v2. Cookie values made entirely of URL-safe characters are no longer percent-encoded in `Set-Cookie` headers; encoded values round-trip exactly as before. - [#&#8203;17402](https://github.com/withastro/astro/pull/17402) [`a89c137`](https://github.com/withastro/astro/commit/a89c137a424b4d7bf97df067bba023eccc2317eb) Thanks [@&#8203;farrosfr](https://github.com/farrosfr)! - Fixes a bug where mutated `Astro.locals` during the request lifecycle are lost and not passed to custom error pages (`404.astro`/`500.astro`) - [#&#8203;17405](https://github.com/withastro/astro/pull/17405) [`91992ef`](https://github.com/withastro/astro/commit/91992ef2ccd9a90fa4270633eb4f5d3b811bf315) Thanks [@&#8203;Araluma](https://github.com/Araluma)! - Prevents an unhandled promise rejection from the prefetch `fetch` fallback. In WebKit (Safari), `<link rel="prefetch">` is unsupported, so prefetch uses the `fetch()` fallback; on a flaky connection that fetch rejects with `TypeError: Load failed`, and because the promise was not awaited or caught, it surfaced as an unhandled rejection to the page's global error handlers. The best-effort prefetch now swallows the failure with `.catch()`. ### [`v7.1.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#711) [Compare Source](https://github.com/withastro/astro/compare/astro@7.1.0...astro@7.1.1) ##### Patch Changes - [#&#8203;17399](https://github.com/withastro/astro/pull/17399) [`4b03702`](https://github.com/withastro/astro/commit/4b0370262ce94a1f426944e659ef7a9c8773f451) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes encoded request paths being routed incorrectly when using domain-based i18n ### [`v7.1.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#710) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.9...astro@7.1.0) ##### Minor Changes - [#&#8203;17302](https://github.com/withastro/astro/pull/17302) [`5f4dc03`](https://github.com/withastro/astro/commit/5f4dc0356f2c2ecf98fa88a257908c9226fac9f1) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Adds a new `deferRender` option to the `glob()` content loader When set to `true`, renderable entries (such as Markdown) are not rendered during content sync. Instead, rendering is deferred until the entry is actually rendered in a page, using the same on-demand path that `.mdx` files already use. This reduces memory usage during `astro build` for large collections whose rendered output is much larger than the source — for example, Markdown that uses heavy rehype plugins like `rehype-katex`. Such builds could previously run out of memory while storing the eagerly-rendered HTML for every entry. ```js // src/content.config.ts import { defineCollection } from 'astro:content'; import { glob } from 'astro/loaders'; const docs = defineCollection({ loader: glob({ pattern: '**/*.md', base: 'src/content/docs', deferRender: true }), }); ``` By default `deferRender` is `false`, preserving the existing behavior of rendering entries eagerly during sync so their rendered HTML can be cached across builds. - [#&#8203;17296](https://github.com/withastro/astro/pull/17296) [`30698a2`](https://github.com/withastro/astro/commit/30698a2ed525497cdc0fce16d25d1cde0c21473c) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds a new experimental `collectionStorage` option for controlling how the content layer persists its data store By default, Astro serializes the entire content layer data store to a single file (`.astro/data-store.json`). For very large content collections, this file can grow large enough to hit platform file-size limits. Set `experimental.collectionStorage: 'chunked'` to instead split the data store across many smaller, content-addressed files inside a `.astro/data-store/` directory, described by a manifest: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { collectionStorage: 'chunked', }, }); ``` Because each part file is named by a hash of its contents, unchanged parts keep the same name across builds and are not rewritten, and identical parts are deduplicated. The default value is `'single-file'`, which preserves the current behavior. - [#&#8203;17214](https://github.com/withastro/astro/pull/17214) [`44c4989`](https://github.com/withastro/astro/commit/44c4989139e84951c6579db9975a659765cf2b6c) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds support for the more specific CSP directives `script-src-elem`, `script-src-attr`, `style-src-elem`, and `style-src-attr` through a new `kind` option. Previously, [`CSP`](https://docs.astro.build/en/reference/configuration-reference/#securitycsp) was only scoped to generic `script-src`/`style-src` directives. Now each source or hash can be scoped to a narrower directive — for example, to allow inline `style` attributes (such as those from `define:vars` or Shiki) without loosening the policy for your `<style>` and `<link>` elements. ##### Scoping sources and hashes in your config Each entry in `resources` and `hashes` can be an object with a `kind` property. Depending on whether you use `scriptDirective` or `styleDirective`, `"element"` targets `script-src-elem` or `style-src-elem`, `"attribute"` targets `script-src-attr` or `style-src-attr`, and `"default"` (the same as a bare string or hash) targets `script-src` or `style-src`. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ security: { csp: { scriptDirective: { resources: [{ resource: 'https://cdn.example.com', kind: 'element' }], }, styleDirective: { resources: [{ resource: "'unsafe-inline'", kind: 'attribute' }], }, }, }, }); ``` ##### Scoping at runtime The same `kind` option is available on the runtime CSP API, where the existing methods now also accept an object: ```js ctx.csp.insertScriptResource({ resource: 'https://cdn.example.com', kind: 'element' }); ctx.csp.insertStyleResource({ resource: "'unsafe-inline'", kind: 'attribute' }); ``` - [#&#8203;17258](https://github.com/withastro/astro/pull/17258) [`84814d4`](https://github.com/withastro/astro/commit/84814d40bc43eb5827148305656050f26338df5a) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Adds a new `format()` option to the [`paginate`](https://docs.astro.build/en/reference/routing-reference/#paginate) utility. The `format()` option is a function that accepts the current URL of the page, and returns a new URL. For example, when your host only supports URLs using the `.html` extension, you can use `format()` to add it to the generated URLs: ```astro --- export async function getStaticPaths({ paginate }) { // Load your data with fetch(), getCollection(), etc. const response = await fetch(`https://pokeapi.co/api/v2/pokemon?limit=150`); const result = await response.json(); const allPokemon = result.results; // Return a paginated collection of paths for all items return paginate(allPokemon, { pageSize: 10, format: (url) => `${url}.html`, }); } const { page } = Astro.props; --- ``` - [#&#8203;17331](https://github.com/withastro/astro/pull/17331) [`7db6420`](https://github.com/withastro/astro/commit/7db6420d482fc649886148acaf13e5fbf809db87) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a `--ignore-lock` flag to `astro dev` for starting a dev server without checking or writing the lock file, so it can run alongside an already-running dev server for the same project. The new instance is not tracked by `astro dev stop`, `astro dev status`, or `astro dev logs`. `--ignore-lock` cannot be combined with `--background` (or an auto-detected AI agent environment, which runs dev servers in the background automatically) or `--force`, since those rely on the lock file. ```shell astro dev --ignore-lock ``` - [#&#8203;17389](https://github.com/withastro/astro/pull/17389) [`16de021`](https://github.com/withastro/astro/commit/16de02130575c61eb294b382e09bc863cf935ec3) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Allows passing URL entrypoints when configuring the logger Matching other APIs like session drivers or font providers, the logger entrypoint can now be a URL: ```js import { defineConfig } from 'astro/config'; export default defineConfig({ logger: { entrypoint: new URL('./logger.js', import.meta.url), }, }); ``` ##### Patch Changes - [#&#8203;17332](https://github.com/withastro/astro/pull/17332) [`4407483`](https://github.com/withastro/astro/commit/4407483e6f9e159164fec83c36d66259baa87e1f) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes the JSON logger crashing with `process is not defined` in non-Node runtimes like Cloudflare's workerd. The JSON logger now uses `console.log`/`console.error` instead of `process.stdout`/`process.stderr`, matching the pattern already used by the console logger. - [#&#8203;17391](https://github.com/withastro/astro/pull/17391) [`186a1e7`](https://github.com/withastro/astro/commit/186a1e74c2eb342ea35a73fc2c0b1930b3c08921) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where an integration could not update the logger with `updateConfig()` - [#&#8203;17394](https://github.com/withastro/astro/pull/17394) [`d9f99e1`](https://github.com/withastro/astro/commit/d9f99e19e4045da75c7f38650a0f2eeb5c79892b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes element-specific CSP directives to preserve the existing behavior of configured script and style resources - [#&#8203;17374](https://github.com/withastro/astro/pull/17374) [`b2d1b3e`](https://github.com/withastro/astro/commit/b2d1b3e485c37fd9e1825310a71acb1e3d011094) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes dev server returning 404 for `?url` imported assets when accessed via browser navigation - [#&#8203;17390](https://github.com/withastro/astro/pull/17390) [`ed71eaf`](https://github.com/withastro/astro/commit/ed71eaf2b5eaa837de438eb252e8651a2aa086f6) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes an unused and undocumented generic from the `AstroLoggerDestination` type - [#&#8203;17393](https://github.com/withastro/astro/pull/17393) [`092da56`](https://github.com/withastro/astro/commit/092da560eea77ee63a3e2c583c80d8238544e42b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens generated transition styles, development metadata, and server island URLs when embedding dynamic values ### [`v7.0.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#709) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.8...astro@7.0.9) ##### Patch Changes - [#&#8203;17286](https://github.com/withastro/astro/pull/17286) [`a249317`](https://github.com/withastro/astro/commit/a249317e4d03ead215838a5f6f0e6fe70444d5d4) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes the first browser visit after `astro dev` starts triggering an immediate full page reload - [#&#8203;17369](https://github.com/withastro/astro/pull/17369) [`a94d4a5`](https://github.com/withastro/astro/commit/a94d4a5afde1fd6de76cb2904703df7eb984b3f0) Thanks [@&#8203;adamchal](https://github.com/adamchal)! - Fixes an issue where a client island could permanently fail to hydrate if the first attempt to load its component failed. Islands now reliably recover from transient import failures, which previously did not work for React components during `astro dev`. ### [`v7.0.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#708) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.7...astro@7.0.8) ##### Patch Changes - [#&#8203;17363](https://github.com/withastro/astro/pull/17363) [`3f4efc5`](https://github.com/withastro/astro/commit/3f4efc5d2f4cf2e38f983bf5842bbd953b5bf923) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `astro preview --open` not opening a browser when using an adapter with a custom preview entrypoint, such as `@astrojs/cloudflare` - [#&#8203;17313](https://github.com/withastro/astro/pull/17313) [`e2e319d`](https://github.com/withastro/astro/commit/e2e319d4a61bf6b9eff5224c51d8433dfeb9153b) Thanks [@&#8203;ronits2407](https://github.com/ronits2407)! - Exposes the `AstroRuntimeLogger` interface to allow users to properly type the logger functions at runtime. - [#&#8203;17328](https://github.com/withastro/astro/pull/17328) [`025cc74`](https://github.com/withastro/astro/commit/025cc747d3eac4241cb4015a8789963970b0480a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro dev --force` not replacing an already-running dev server - [#&#8203;17353](https://github.com/withastro/astro/pull/17353) [`2bba277`](https://github.com/withastro/astro/commit/2bba2775e12285b5d7ed0710c6579d808817704d) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Updates the Astro compiler to the latest version, which fixes many regressions. Refer to the [changelog](https://github.com/withastro/compiler-rs/releases/tag/%40astrojs/compiler-rs%400.3.1) for more details. - [#&#8203;17344](https://github.com/withastro/astro/pull/17344) [`79a41e0`](https://github.com/withastro/astro/commit/79a41e06add3cbb144809f88a0b5ac88d2f8e7d1) Thanks [@&#8203;adamchal](https://github.com/adamchal)! - Improves rendering performance for pages with many component instances, such as repeated MDX `<Content />` components. - Updated dependencies \[[`64b0d66`](https://github.com/withastro/astro/commit/64b0d6667eabd8fe51643dfdab7004670e319810)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.4 ### [`v7.0.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#707) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.6...astro@7.0.7) ##### Patch Changes - [#&#8203;17318](https://github.com/withastro/astro/pull/17318) [`23a4120`](https://github.com/withastro/astro/commit/23a4120b1ba546521ed66c09cb39e346aee6b75a) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes CSS module scoped-name hash mismatch in `astro dev` when using `vite.css.transformer: 'lightningcss'` with content collections. Previously, a component importing a CSS module and rendered via content collection `render()` would get different class name hashes in the element and the injected `<style>` tag, causing styles not to apply. - [#&#8203;17323](https://github.com/withastro/astro/pull/17323) [`4298883`](https://github.com/withastro/astro/commit/4298883399550cae5d5e089d73cb9adadbc2d69b) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a dev server memory leak which caused Node.js to emit warnings in the console. - [#&#8203;17323](https://github.com/withastro/astro/pull/17323) [`4298883`](https://github.com/withastro/astro/commit/4298883399550cae5d5e089d73cb9adadbc2d69b) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a dev server crash when a `.html` or `/index.html` suffixed request (such as those `netlify dev` probes as pretty-URL fallbacks) matched a dynamic endpoint route, causing a `TypeError: Missing parameter` error - [#&#8203;17325](https://github.com/withastro/astro/pull/17325) [`cebc404`](https://github.com/withastro/astro/commit/cebc40495cd09e8036af34c2f668fc2965e089b0) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where CSS `@import` rules could end up mid-stylesheet after inline CSS chunks were merged during build, causing browsers to silently ignore them - [#&#8203;17323](https://github.com/withastro/astro/pull/17323) [`4298883`](https://github.com/withastro/astro/commit/4298883399550cae5d5e089d73cb9adadbc2d69b) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a build regression that could leave unresolved preload markers in inlined scripts with external dynamic imports - Updated dependencies \[[`4298883`](https://github.com/withastro/astro/commit/4298883399550cae5d5e089d73cb9adadbc2d69b), [`4298883`](https://github.com/withastro/astro/commit/4298883399550cae5d5e089d73cb9adadbc2d69b)]: - [@&#8203;astrojs/telemetry](https://github.com/astrojs/telemetry)@&#8203;3.3.3 ### [`v7.0.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#706) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.5...astro@7.0.6) ##### Patch Changes - [#&#8203;17261](https://github.com/withastro/astro/pull/17261) [`79aa99c`](https://github.com/withastro/astro/commit/79aa99c648b4b40b95a31d4a961b77074cf7963c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a false deprecation warning for `markdown.gfm` and `markdown.smartypants` when using the Container API - [#&#8203;17247](https://github.com/withastro/astro/pull/17247) [`f94280d`](https://github.com/withastro/astro/commit/f94280d61496de38f97a818975bd38529569f3e8) Thanks [@&#8203;chatman-media](https://github.com/chatman-media)! - Fixes route generation throwing "Missing parameter" (or silently dropping the segment) when a dynamic param's value is `0`. The generator used truthy checks instead of checking for `undefined`, so `paginate(posts, { params: { categoryId: 0 } })` would crash even though `0` is a perfectly valid param value. - [#&#8203;17278](https://github.com/withastro/astro/pull/17278) [`6f11739`](https://github.com/withastro/astro/commit/6f11739f2c7b28b108c2d8d0a2012f0711775a8c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes missing CSS for virtual style modules (e.g., responsive image layout styles) in dev mode when JavaScript is disabled - [#&#8203;17250](https://github.com/withastro/astro/pull/17250) [`0b30b35`](https://github.com/withastro/astro/commit/0b30b35f864310bee8485c952d1877e82e2b9b1a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes the `security.checkOrigin` check so it is applied consistently to Astro Actions and on-demand endpoints, regardless of how the request pipeline is composed. Previously, the origin check could be skipped in the composable `astro/hono` pipeline depending on the order of the `middleware()` primitive (or when it was omitted). - [#&#8203;17274](https://github.com/withastro/astro/pull/17274) [`8c3579b`](https://github.com/withastro/astro/commit/8c3579b2707703037bd439992a9a4e5efceeda3b) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes missing `render()` type overload for live collection entries. Previously, calling `render()` on a `LiveDataEntry` produced a TypeScript error when using only `live.config.ts` without a `content.config.ts`. - [#&#8203;17257](https://github.com/withastro/astro/pull/17257) [`4208297`](https://github.com/withastro/astro/commit/4208297b37d1781bfe54254c0b981eb146e08691) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `astro check` failing to find `@astrojs/check` and `typescript` when astro is installed in a directory outside the project tree (e.g. pnpm virtual store) - [#&#8203;17272](https://github.com/withastro/astro/pull/17272) [`b428648`](https://github.com/withastro/astro/commit/b428648a3ce0efe7367933096949d1d18bea0168) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes island component paths so that extensionless imports (e.g. `import { Counter } from '../components/Counter'`) resolve to the real file on disk, matching Vite's extension order and directory `index` resolution. This makes the `include`/`exclude` options of JSX renderer integrations (React, Preact, Solid) match components imported without a file extension, and removes the spurious React 19 "Invalid hook call" warning logged on every request in dev when `include` was set alongside another JSX renderer - [#&#8203;17279](https://github.com/withastro/astro/pull/17279) [`2aeaa44`](https://github.com/withastro/astro/commit/2aeaa44a23e42426619e680c37bea5b79fb9bc9d) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where `<Picture inferSize>` with a remote image could fail with `FailedToFetchRemoteImageDimensions` when the image server rate-limits requests (e.g. HTTP 429). Remote dimensions are now resolved once per render instead of once per output format. - [#&#8203;17251](https://github.com/withastro/astro/pull/17251) [`5240e26`](https://github.com/withastro/astro/commit/5240e26c9dd91f9bc7140dcfacdb48d5a132830d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens the handling of attribute rendering when using with custom elements. - [#&#8203;17248](https://github.com/withastro/astro/pull/17248) [`429bd62`](https://github.com/withastro/astro/commit/429bd6287a24770461321696f87edf34758b90fd) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a crash when using Astro's `getViteConfig` with Vitest browser mode (e.g., Storybook vitest runner). Astro now skips dev server setup inside Vitest, preventing errors. - [#&#8203;17260](https://github.com/withastro/astro/pull/17260) [`14524c0`](https://github.com/withastro/astro/commit/14524c03f3d7ea84224d4e708488f30902a9f275) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a regression where a `<script>` inside a component rendered through `Astro.slots.render()` was hoisted out of its original position instead of staying next to its component content - Updated dependencies \[[`eb6f97e`](https://github.com/withastro/astro/commit/eb6f97e391ee587747e37609c255c7cd4b9cce3c)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.1 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.2.1 - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.3 ### [`v7.0.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#705) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.4...astro@7.0.5) ##### Patch Changes - [#&#8203;17242](https://github.com/withastro/astro/pull/17242) [`9c05ba4`](https://github.com/withastro/astro/commit/9c05ba474cee5e3ef5142d88e7e08d53acfbe431) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an error that could occur after the dev server restarts when using an adapter such as `@astrojs/cloudflare`, where a request would fail with a `500` referencing a missing pre-bundled dependency: ``` The file does not exist at "node_modules/.vite/deps_ssr/astro_compiler-runtime.js?v=6419660d" which is in the optimize deps directory. The dependency might be incompatible with the dep optimizer. Try adding it to `optimizeDeps.exclude`. ``` - [#&#8203;17202](https://github.com/withastro/astro/pull/17202) [`c6d254d`](https://github.com/withastro/astro/commit/c6d254dab889f9b15ec79eab84d8dbf7f7cd0007) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Refactors path alias resolution to use Vite's native `tsconfigPaths` option This is an internal change with no expected impact on user projects. Astro now defers tsconfig and jsconfig `paths` alias resolution to Vite, keeping a small fallback for a few CSS cases Vite does not yet handle. - [#&#8203;17123](https://github.com/withastro/astro/pull/17123) [`72e29bd`](https://github.com/withastro/astro/commit/72e29bd7f9d6c9f86febf5c9b97417bc90de5bb1) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Fixes an issue where the ClientRouter wipes head elements after page transitions if the `<head>` contains a `server:defer` component. - [#&#8203;17232](https://github.com/withastro/astro/pull/17232) [`257505e`](https://github.com/withastro/astro/commit/257505ebfd8be87e6b11fd369340245edd0c937a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a bug where `<style>` tags from components such as a content collection's `Content` could be silently dropped from the output when an `await` appeared before the component in an `.astro` file's markup. - [#&#8203;17193](https://github.com/withastro/astro/pull/17193) [`a7352fd`](https://github.com/withastro/astro/commit/a7352fda1218bf48d8483a9893c6f7ed9bdf2060) Thanks [@&#8203;jan-kubica](https://github.com/jan-kubica)! - Fixes the background dev server failing to start when `astro` is hoisted outside the project's `node_modules` (for example bun workspaces). The background process is now spawned from Astro's own resolved location instead of a path assumed under the project root. - [#&#8203;17255](https://github.com/withastro/astro/pull/17255) [`581d171`](https://github.com/withastro/astro/commit/581d17113cb192e8b34aa3ad9965fe733e3ca210) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes prefetch not working for links inside `server:defer` components ### [`v7.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#704) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.3...astro@7.0.4) ##### Patch Changes - [#&#8203;17212](https://github.com/withastro/astro/pull/17212) [`7ba0bb1`](https://github.com/withastro/astro/commit/7ba0bb1dc7516e88caff9abd7767322af44b0294) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Ensures transition directive values are HTML-escaped when rendered on hydrated islands - [#&#8203;17224](https://github.com/withastro/astro/pull/17224) [`dc5e52f`](https://github.com/withastro/astro/commit/dc5e52f96c44a0dbf59edaf0503b53524e4e2da0) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes trailing slash handling for dynamic file endpoints in dev mode. Dynamic file endpoints (e.g., `src/pages/api/[name].json.ts`) with `trailingSlash: "always"` incorrectly required a trailing slash in dev mode, returning 404 for `/api/bar.json` and 200 for `/api/bar.json/`. - [#&#8203;17067](https://github.com/withastro/astro/pull/17067) [`23f9446`](https://github.com/withastro/astro/commit/23f9446a5666f249066c18cb9f6a7a4e261eb090) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixed a bug where the development toolbar did not output a warning even though the implicit ARIA role and the manually specified role were duplicated. - [#&#8203;17234](https://github.com/withastro/astro/pull/17234) [`d5fbee8`](https://github.com/withastro/astro/commit/d5fbee8ec341049dc5ddc7b6c251b7a859abf437) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Adds support for [`sharp` v0.35](https://github.com/lovell/sharp/releases/tag/v0.35.0). pnpm users no longer need to approve `sharp`'s build script (see [`allowBuilds`](https://pnpm.io/settings#allowbuilds)) when on v0.35. - [#&#8203;17223](https://github.com/withastro/astro/pull/17223) [`5970ef4`](https://github.com/withastro/astro/commit/5970ef4f7d99b692a54df019e7b3c161ce2f842c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `getCollection()` returning empty in dev mode for large content collections (500k+ entries) - [#&#8203;17184](https://github.com/withastro/astro/pull/17184) [`799e5cd`](https://github.com/withastro/astro/commit/799e5cd860f85a0d2eb5f77951f7593f474f3ad8) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Upgrades the Rust compiler to the latest, which fixes some bugs. Refer to its [changelog](https://github.com/withastro/compiler-rs/releases/tag/%40astrojs%2Fcompiler-rs%400.3.0) for more information. - [#&#8203;17208](https://github.com/withastro/astro/pull/17208) [`da8b573`](https://github.com/withastro/astro/commit/da8b57354b25e2776324848f7e08530ae828e62f) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens forwarded header handling so the internal request helper validates `X-Forwarded-Host` against `security.allowedDomains` before trusting `X-Forwarded-For` for `clientAddress`. Previously it only checked that the header was present, which was inconsistent with the public `createRequest` helper. This aligns both code paths; behavior is unchanged for correctly configured proxies. ### [`v7.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#703) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.2...astro@7.0.3) ##### Patch Changes - [#&#8203;17189](https://github.com/withastro/astro/pull/17189) [`24d2c9e`](https://github.com/withastro/astro/commit/24d2c9ec71ffcceb853762bb1295e1d893bdd4d6) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where an error thrown inside one route's `getStaticPaths()` would prevent other valid routes from being matched in dev mode - [#&#8203;16932](https://github.com/withastro/astro/pull/16932) [`8f4a3db`](https://github.com/withastro/astro/commit/8f4a3db415f227b5c742c16ad18f764e952f91bd) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes HMR for action files during development. Editing files in `src/actions/` now takes effect on the next request without requiring a dev server restart. - [#&#8203;17087](https://github.com/withastro/astro/pull/17087) [`fb0ab02`](https://github.com/withastro/astro/commit/fb0ab02f019efd222e6976d72bcd618fd915bc1d) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Fixes localized custom error pages in i18n projects so routes like `/pt/404` are used for missing localized pages and return the correct status code ### [`v7.0.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#702) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.1...astro@7.0.2) ##### Patch Changes - Updated dependencies \[[`3b5e994`](https://github.com/withastro/astro/commit/3b5e994738cf58c9eed0774ce779b685c31a3a5c)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.2 ### [`v7.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#701) [Compare Source](https://github.com/withastro/astro/compare/astro@7.0.0...astro@7.0.1) ##### Patch Changes - [#&#8203;17151](https://github.com/withastro/astro/pull/17151) [`ccceda3`](https://github.com/withastro/astro/commit/ccceda31550668dc8422e027475a3d0729c18d33) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro dev` incorrectly starting in background mode for Warp terminal users. Hybrid environments like Warp are no longer treated as AI agents for auto-background detection. - [#&#8203;17158](https://github.com/withastro/astro/pull/17158) [`164df87`](https://github.com/withastro/astro/commit/164df87aee81c1ca5cd38514301673a40e9975c7) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `astro dev --background --host` not listing the network addresses. The background server start output and `astro dev status` now show every exposed network URL, matching the foreground dev server. - [#&#8203;17141](https://github.com/withastro/astro/pull/17141) [`d785b9d`](https://github.com/withastro/astro/commit/d785b9d6d2f014995ec8cb09ed5b50c49d9054d3) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes responsive image CSS overriding user styles defined inside CSS `@layer` blocks. The generated image styles are now wrapped in `@layer astro.images`, ensuring they have lower cascade priority than user-defined layers. - [#&#8203;17150](https://github.com/withastro/astro/pull/17150) [`1a61386`](https://github.com/withastro/astro/commit/1a613868c2dca8d8dd8cef99fd8e4b5cde0ba1e7) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro dev --background` failing on Windows with "Failed to spawn background dev server process" ### [`v7.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#700) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.8...astro@7.0.0) ##### Major Changes - [#&#8203;15819](https://github.com/withastro/astro/pull/15819) [`cafec4e`](https://github.com/withastro/astro/commit/cafec4e23365061491103dfce2e889a15cf86f27) Thanks [@&#8203;delucis](https://github.com/delucis)! - Upgrade to Vite v8 - [#&#8203;16965](https://github.com/withastro/astro/pull/16965) [`57ead0d`](https://github.com/withastro/astro/commit/57ead0d5938e5988e3f896f3d6f8ef4516c4923f) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Makes `'jsx'` the default value for `compressHTML` Astro now strips whitespace from your HTML using JSX rules by default, the same way frameworks like React do. Whitespace and line breaks around elements are removed, but meaningful whitespace within a single line — like a space between two inline elements — is preserved. To keep a space that would otherwise be removed, write it explicitly in your source, for example with `{" "}`. This can change rendered output where whitespace between inline elements was previously meaningful. To keep Astro's earlier behavior, set `compressHTML: true` for HTML-aware compression, or `compressHTML: false` to preserve all whitespace. - [#&#8203;16610](https://github.com/withastro/astro/pull/16610) [`c63e7e4`](https://github.com/withastro/astro/commit/c63e7e4411db8fc652c84ce82b45f53e951eb6fa) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds background dev server management for AI coding agents. When an AI coding agent is detected, `astro dev` now automatically starts the dev server as a detached background process. This prevents the dev server from blocking the agent's terminal and allows it to continue working while the server runs. A lock file (`.astro/dev.json`) is written when the dev server starts, recording the server's URL, port, and PID. This prevents duplicate servers from being started for the same project. ##### New flag and subcommands - `astro dev --background` — Start the dev server as a background process (this is what runs automatically when an agent is detected). - `astro dev stop` — Stop a running background dev server. - `astro dev status` — Check if a dev server is running and display its URL, PID, and uptime. - `astro dev logs` — View logs from a background dev server. Use `--follow` (`-f`) to stream new output as it's written. These allow you to start and manage dev servers programmatically and were designed with AI coding agents in mind. ##### What should I do? No action is required. If you are not using an AI coding agent, `astro dev` behaves exactly as before. If you are using an agent, background mode is enabled automatically — the agent will receive the server URL and PID, and can use `astro dev stop` to shut it down. To opt out of automatic background mode when an agent is detected, set the environment variable `ASTRO_DEV_BACKGROUND=0` before running `astro dev`. - [#&#8203;17010](https://github.com/withastro/astro/pull/17010) [`0606073`](https://github.com/withastro/astro/commit/0606073794ddda42cac1f3e1ca56bbfc7cb178eb) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Removes the `@astrojs/db` package as it is no longer maintained. The `@astrojs/db` package were deprecated in v6.4.5 and is now removed. This means the `astro db`, `astro login`, `astro logout`, `astro link`, and `astro init` CLI commands have also been removed. If you were using Astro DB in your project, remove `@astrojs/db` from your project's dependencies and replace it with one of the following alternatives: - **Node.js built-in SQLite**: Node.js now includes a built-in [`node:sqlite`](https://nodejs.org/api/sqlite.html) module (available since Node.js v22.5.0). This is a good option if you are using the Node.js adapter and were using `@astrojs/db` for local SQLite storage. - **[Drizzle ORM](https://orm.drizzle.team/)**: If you were using `@astrojs/db` for its Drizzle-based schema and query API, you can use Drizzle directly with any supported database. - **Other database libraries**: Use any database library that suits your deployment platform (e.g. [Turso](https://turso.tech/), [PlanetScale](https://planetscale.com/), [Neon](https://neon.tech/)). - [#&#8203;16462](https://github.com/withastro/astro/pull/16462) [`c30a778`](https://github.com/withastro/astro/commit/c30a7789a477e44826c54c8560587d09dc46a229) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Replaces the Go compiler with a Rust-based version. The Rust-based Astro compiler (`@astrojs/compiler-rs`) is now the default compiler. This new compiler is faster and more reliable, leading to faster build times and iteration cycles during development. This new compiler is more strict regarding invalid syntax. For example, unclosed HTML tags will now throw an error instead of being ignored. It also does not attempt to correct semantically invalid HTML anymore, instead leaving it to the browser to handle, similar to other tools or `document.write()` in JavaScript. The previous Go-based compiler has been removed, along with the `experimental.rustCompiler` flag used to opt into the Rust compiler. If you were setting `experimental.rustCompiler` in your `astro.config.mjs`, you can now remove it. No other action is required. - [#&#8203;16966](https://github.com/withastro/astro/pull/16966) [`6650ec2`](https://github.com/withastro/astro/commit/6650ec24e81bb9fdf2fcec3dc07154b94d41cb61) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Makes Sätteri the default Markdown processor Astro now renders `.md` files with `satteri()` from `@astrojs/markdown-satteri`, its native Markdown pipeline, instead of the remark/rehype pipeline. `@astrojs/markdown-remark` is no longer installed by default. To keep using the remark/rehype pipeline, install `@astrojs/markdown-remark` and set it as your processor: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import { unified } from '@astrojs/markdown-remark'; export default defineConfig({ markdown: { processor: unified(), }, }); ``` The deprecated `markdown.remarkPlugins`, `markdown.rehypePlugins`, and `markdown.remarkRehype` options still work, but now require `@astrojs/markdown-remark` to be used. - [#&#8203;16877](https://github.com/withastro/astro/pull/16877) [`3b7d76e`](https://github.com/withastro/astro/commit/3b7d76e6decff6b236d1b30d901b4fa339edb960) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Enables advanced routing by default. The advanced routing feature introduced behind a flag in [v6.3.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#630) is no longer experimental and is now enabled by default. This gives full control over how requests flow through your application, with first-class support for frameworks like Hono. Advanced routing now uses `src/fetch.ts` as default entrypoint instead of `src/app.ts`. If you were previously using this feature without a custom entrypoint, please configure `fetchFile` or rename your entrypoint to `src/fetch.ts`, and then remove the experimental flag from your Astro config: ```diff import { defineConfig } from 'astro/config'; export default defineConfig({ experimental { - advancedRouting: true, }, + fetchFile: 'app.ts' // optional, you only need this if you cannot rename your entrypoint. }); ``` `fetchFile` is now a top-level config option instead of being nested under `experimental.advancedRouting`. If you were using a custom entrypoint, please update your Astro config to move its configuration: ```diff // astro.config.mjs export default defineConfig({ - experimental: { - advancedRouting: { - fetchFile: 'my-custom-entrypoint.ts', - }, - }, + fetchFile: 'my-custom-entrypoint.ts', }) ``` You can also set `fetchFile: null` to disable the entrypoint if you are using `src/fetch.ts` for another purpose, or don’t need advanced routing features. If you have been waiting for stabilization before using advanced routing, you can now do so. Please see [the advanced routing guide in docs](https://docs.astro.build/en/guides/routing/#advanced-routing) for more about this feature. - [#&#8203;16725](https://github.com/withastro/astro/pull/16725) [`10229f7`](https://github.com/withastro/astro/commit/10229f73dbf0f19b9936e9a23f0abc774a4c579e) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Removes deprecated APIs exported from `astro:transitions`. In Astro 6.x, some helpers available in `astro:transitions` and `astro:transitions/client` were deprecated. In Astro 7.0, the following APIs can no longer be used in your project: - `TRANSITION_BEFORE_PREPARATION` - `TRANSITION_AFTER_PREPARATION` - `TRANSITION_BEFORE_SWAP` - `TRANSITION_AFTER_SWAP` - `TRANSITION_PAGE_LOAD` - `isTransitionBeforePreparationEvent()` - `isTransitionBeforeSwapEvent()` - `createAnimationScope()` ##### What should I do? Remove any occurrence of `createAnimationScope()`: ```diff -import { createAnimationScope } from 'astro:transitions'; ``` Replace any occurrence of the other APIs using the lifecycle event names directly: ```diff -import { - TRANSITION_AFTER_SWAP, - isTransitionBeforePreparationEvent, -} from 'astro:transitions/client'; -console.log(isTransitionBeforePreparationEvent(event)); +console.log(event.type === 'astro:before-preparation'); -console.log(TRANSITION_AFTER_SWAP); +console.log('astro:after-swap'); ``` Learn more about all utilities available in the [View Transitions Router API Reference](https://docs.astro.build/en/reference/modules/astro-transitions/). ##### Minor Changes - [#&#8203;16998](https://github.com/withastro/astro/pull/16998) [`57dcc31`](https://github.com/withastro/astro/commit/57dcc31bb78575a89304ab5310f2f5911a83f3af) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Exposes `getFetchState()` from `astro/hono` as a public API The `getFetchState()` function retrieves or lazily creates a `FetchState` from a Hono context object. This allows third-party packages to build Hono middleware that interacts with Astro's per-request state, giving the `astro/hono` API the same extensibility as `astro/fetch`. ```ts import { Hono } from 'hono'; import { getFetchState, pages } from 'astro/hono'; const app = new Hono(); app.use(async (context, next) => { const state = getFetchState(context); state.locals.message = 'Hello from custom middleware'; await next(); }); app.use(pages()); export default app; ``` - [#&#8203;16996](https://github.com/withastro/astro/pull/16996) [`300641e`](https://github.com/withastro/astro/commit/300641e588ac74968197bd87e0a97f71d132946e) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a `subset` field to the `FontData` type exposed via `fontData` from `astro:assets`. When using multiple font subsets (e.g., `subsets: ["latin", "korean"]`), each font data entry now includes the subset name, making it possible to distinguish between font entries for different subsets that share the same weight and style. - [#&#8203;16745](https://github.com/withastro/astro/pull/16745) [`f864a80`](https://github.com/withastro/astro/commit/f864a808c5dd83e19be66bb5227edffbe506a697) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - The custom logger feature introduced behind a flag in [v6.2.0](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#620) is no longer experimental and is available for general use. This feature provides better control over Astro's logging infrastructure by allowing you to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for on-demand rendering when connecting to log aggregation services such as Kibana, Logstash, CloudWatch, Grafana, or Loki. Astro provides three built-in log handlers (`json`, `node`, and `console`), and you can also create your own. ##### JSON logging ```js import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ logger: logHandlers.json({ pretty: true, level: 'warn', }), }); ``` ##### Custom logger ```js import { defineConfig } from 'astro/config'; export default defineConfig({ logger: { entrypoint: '@org/custom-logger', }, }); ``` Additionally, `context.logger` is now always available in API routes and middleware, even without a custom logger configured. 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: { - logger: { - entrypoint: '@org/custom-logger', - }, - }, + logger: { + entrypoint: '@org/custom-logger', + }, }); ``` If you have been waiting for stabilization before using custom loggers, you can now do so. Please see the [Logger docs](https://docs.astro.build/en/reference/configuration-reference/#logger) for more about this feature. - [#&#8203;16981](https://github.com/withastro/astro/pull/16981) [`0d6d644`](https://github.com/withastro/astro/commit/0d6d64433fa31762b6fd593da902f63f3204e02a) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes the setting `experimental.queuedRendering`. The new rendering engine is now stable and replaces the old one. As part of the stabilization, the queued rendering has been improved, and some features have been removed: - The construction of the queue has been removed, instead now Astro uses a streaming approach where components are rendered and flushed as they are encountered. - The node polling feature has been removed because it doesn't yield concrete savings. - The content cache has been descoped, and how only tag names are cached. If you were previously using this experimental feature, you must remove this experimental flag from your configuration as it no longer exists: ```diff // astro.config.mjs import { defineConfig } from "astro/config"; export default defineConfig({ experimental: { - queuedRendering: {} } }); ``` - [#&#8203;17116](https://github.com/withastro/astro/pull/17116) [`f95e58e`](https://github.com/withastro/astro/commit/f95e58eaa6a6d7ac02f84193b485471f0cd14de6) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Stabilizes route caching, removing the `experimental.cache` and `experimental.routeRules` flags and replacing them with the top-level `cache` and `routeRules` configuration options. Route caching, introduced experimentally in v6.0.0, is now stable. It gives you a platform-agnostic way to cache responses from [on-demand rendered](https://docs.astro.build/en/guides/on-demand-rendering/) pages and endpoints, based on standard HTTP caching semantics. Update your config to move `cache` and `routeRules` out of the `experimental` block: ```diff // astro.config.mjs import { defineConfig, memoryCache } from 'astro/config'; export default defineConfig({ - experimental: { - cache: { - provider: memoryCache(), - }, - routeRules: { - '/blog/[...path]': { maxAge: 300, swr: 60 }, - }, - }, + cache: { + provider: memoryCache(), + }, + routeRules: { + '/blog/[...path]': { maxAge: 300, swr: 60 }, + }, }); ``` Set caching directives in your routes with `Astro.cache` (in `.astro` pages) or `context.cache` (in API routes and middleware), and Astro translates them into the appropriate headers or runtime behavior depending on your configured cache provider. You can also define cache rules for routes declaratively in your config using `routeRules`, without modifying route code. See the [route caching guide](https://docs.astro.build/en/guides/caching/) for more information. ##### Patch Changes - [#&#8203;16980](https://github.com/withastro/astro/pull/16980) [`1f07343`](https://github.com/withastro/astro/commit/1f07343ffc69b9c982f43cd0369069fe8d1a07fa) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Removes `state.provide()`, `state.resolve()`, `state.finalizeAll()`, and `App.Providers` from the public advanced routing API. These context provider extension points are now internal-only. If you were using them in an integration, use `locals` to share per-request state instead. - [#&#8203;17111](https://github.com/withastro/astro/pull/17111) [`c0f33ed`](https://github.com/withastro/astro/commit/c0f33eda8adf6f8f2588688f6205b76a96a42466) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Harden the limits on the number of decoding on the URL. - [#&#8203;16982](https://github.com/withastro/astro/pull/16982) [`1e000e2`](https://github.com/withastro/astro/commit/1e000e2454fbbade0a5ed978a9dccf8307780305) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves the warning when accessing `Astro.session` without session storage configured. The `session` property is now always defined on the context object, and accessing it without configuration logs a helpful message instead of silently returning `undefined`. - [#&#8203;16335](https://github.com/withastro/astro/pull/16335) [`9a53f77`](https://github.com/withastro/astro/commit/9a53f77d35e76bcb0165b44cbd2b7e48d48c9f59) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds shared helper utilities for CDN cache provider authors for [route caching](https://docs.astro.build/en/guides/caching/) Exports `astro/cache/provider-utils` with helpers for building platform-specific cache-control headers, generating path-based invalidation tags, and normalizing invalidation options. These are used internally by the first-party Netlify, Vercel, and Cloudflare cache providers. - [#&#8203;17095](https://github.com/withastro/astro/pull/17095) [`e84ebc0`](https://github.com/withastro/astro/commit/e84ebc0af84a13a26ea412460cbc491f81135ae5) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves build performance by removing an unfiltered transform hook from the `astro:head-metadata-build` plugin. Head propagation modules are now identified by their module ID (`?astroPropagatedAssets`) instead of scanning every module's source code. - [#&#8203;17041](https://github.com/withastro/astro/pull/17041) [`4c4a91c`](https://github.com/withastro/astro/commit/4c4a91c3ef3e3316cb9faa32e37c69d69902b956) Thanks [@&#8203;iseraph-dev](https://github.com/iseraph-dev)! - Fixes a bug where the advanced routing `astro/hono` / `astro/fetch` `pages()` handler returned the host framework's default `Internal Server Error` response instead of rendering the custom `500.astro` page when a page threw during render. Unmatched requests with a prerendered (or absent) custom 404 page now render the 404 error page instead of failing the same way. - [#&#8203;17097](https://github.com/withastro/astro/pull/17097) [`5e340d7`](https://github.com/withastro/astro/commit/5e340d7d81aae72215d56b8c598d350b79ad94a3) Thanks [@&#8203;iseraph-dev](https://github.com/iseraph-dev)! - Fixes a bug where the advanced routing `astro/hono` / `astro/fetch` `middleware()` handler returned the host framework's default `Internal Server Error` response instead of rendering the custom `500.astro` page when middleware threw. Unmatched requests with a prerendered (or absent) custom 404 page now render the 404 error page instead of failing the same way. Errors surfaced through `next` (the host framework's downstream chain) still propagate to the host's own error handler. - [#&#8203;15819](https://github.com/withastro/astro/pull/15819) [`cafec4e`](https://github.com/withastro/astro/commit/cafec4e23365061491103dfce2e889a15cf86f27) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes `--port` flag being ignored after a Vite-triggered server restart (e.g. when a `.env` file changes) - [#&#8203;17104](https://github.com/withastro/astro/pull/17104) [`b074a37`](https://github.com/withastro/astro/commit/b074a37c5ab9364529080b3283cf9be8a6350e34) Thanks [@&#8203;iseraph-dev](https://github.com/iseraph-dev)! - Fixes the custom `500.astro` page receiving an empty `error` prop when the error originated in middleware. - [#&#8203;17078](https://github.com/withastro/astro/pull/17078) [`04547ec`](https://github.com/withastro/astro/commit/04547eca5bc6b8c1b3b95398ccc49c870a68c34c) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a spurious `Astro.request.headers` warning on prerendered pages when `security.allowedDomains` is configured. The internal `allowedDomains` header validation now skips prerendered routes, since they use synthetic requests with no real headers. - [#&#8203;16603](https://github.com/withastro/astro/pull/16603) [`deaaf3f`](https://github.com/withastro/astro/commit/deaaf3f734bb2f2c8df20559ac83634f418bea18) Thanks [@&#8203;alexanderniebuhr](https://github.com/alexanderniebuhr)! - Removes the warning that Astro does not support vite v8, since Astro v7 does support vite v8 - [#&#8203;16335](https://github.com/withastro/astro/pull/16335) [`9a53f77`](https://github.com/withastro/astro/commit/9a53f77d35e76bcb0165b44cbd2b7e48d48c9f59) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Passes the `Request` object to `CacheProvider.setHeaders()` for [route caching](https://docs.astro.build/en/guides/caching/) Cache providers now receive the incoming `Request` as a second argument to `setHeaders(options, request)`. This allows CDN providers to read the request URL, headers, and other properties when generating cache response headers, for example to auto-tag responses with their pathname for path-based invalidation. - [#&#8203;17098](https://github.com/withastro/astro/pull/17098) [`637a1b6`](https://github.com/withastro/astro/commit/637a1b6c6fe58fd271faf4ee7555787e4f4a0b9a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes internal Astro headers leaking from direct `pages()` handler responses - [#&#8203;17090](https://github.com/withastro/astro/pull/17090) [`3cf76c0`](https://github.com/withastro/astro/commit/3cf76c035eef5954637e78015be9c20d0129599a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes Vite and Rolldown build warnings - [#&#8203;16434](https://github.com/withastro/astro/pull/16434) [`ee079d4`](https://github.com/withastro/astro/commit/ee079d4c7f143076b84d663c832911009a077c7f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where i18n domains would return 404 when `trailingSlash` is set to `never`. - Updated dependencies \[[`7e7ab87`](https://github.com/withastro/astro/commit/7e7ab8775f1c70e00e30db9d3c4796246eaf1c5f), [`ff7b718`](https://github.com/withastro/astro/commit/ff7b718a301b8edc7d7db6626f65e69ce35823a7), [`241250b`](https://github.com/withastro/astro/commit/241250bf126f39c86a8aedd38df106e533301752)]: - [@&#8203;astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@&#8203;0.3.1 ### [`v6.4.8`](https://github.com/withastro/astro/releases/tag/astro%406.4.8) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.7...astro@6.4.8) ##### Patch Changes - [#&#8203;17109](https://github.com/withastro/astro/pull/17109) [`27c80ea`](https://github.com/withastro/astro/commit/27c80ea92248993e5fce94b2c26d87d611ab6785) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Harden the limits on the number of decoding on the URL. ### [`v6.4.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#647) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.6...astro@6.4.7) ##### Patch Changes - [#&#8203;17035](https://github.com/withastro/astro/pull/17035) [`197e50e`](https://github.com/withastro/astro/commit/197e50e2e37168a9b9e8a014c13d1308b2220ca1) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `getRelativeLocaleUrl`, `getAbsoluteLocaleUrl`, and `getAbsoluteLocaleUrlList` to strip trailing slashes when `trailingSlash: 'never'` is configured - [#&#8203;16967](https://github.com/withastro/astro/pull/16967) [`3719765`](https://github.com/withastro/astro/commit/37197652630ffbc11efaaec1865869410b8dfd70) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes double URL-encoded paths returning 400 Bad Request on on-demand routes Previously, any URL containing a double-encoded character (like `%255B`, which is `[` encoded twice) was unconditionally rejected with a `400 Bad Request` before middleware or route handlers could run. This broke embedded tools like Sanity Studio whose client-side router legitimately produces double-encoded URLs. The fix replaces the rejection approach with iterative decoding — multi-level percent-encoding is now fully resolved to its canonical form before being passed to middleware and route matching. This preserves the security fix for CVE-2025-66202 (middleware authorization bypass via double encoding) because middleware now always sees the fully decoded path, making bypass impossible. For example, `/api/%2561dmin` is decoded to `/api/admin`, which middleware can correctly block. - [#&#8203;17066](https://github.com/withastro/astro/pull/17066) [`2f4d92a`](https://github.com/withastro/astro/commit/2f4d92a72b00354114359b5746d573fbfd3b334f) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes prerendered redirect targets being incorrectly bundled into the SSR function in hybrid mode, causing massive bundle size inflation - [#&#8203;16882](https://github.com/withastro/astro/pull/16882) [`621beb7`](https://github.com/withastro/astro/commit/621beb70fe957ecc73c3407c240392507613e0fd) Thanks [@&#8203;jettwayio](https://github.com/jettwayio)! - fix(render): honour compressHTML when joining head elements - [#&#8203;16892](https://github.com/withastro/astro/pull/16892) [`8d753b0`](https://github.com/withastro/astro/commit/8d753b0b671971b78e7064fe38c2b0b518823627) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes custom elements in MDX having their children's `slot` attribute stripped by the JSX runtime When custom elements (tags with hyphens like `<my-element>`) are used in MDX files, the `slot` HTML attribute on their children is now correctly preserved. Previously, the shared JSX runtime would treat `slot` as an Astro slot assignment and remove it from the output, breaking Shadow DOM named slot distribution for web components. - [#&#8203;16957](https://github.com/withastro/astro/pull/16957) [`544ee76`](https://github.com/withastro/astro/commit/544ee763d7f7894e3b588daa14b09ef32a4d794a) Thanks [@&#8203;thelazylamaGit](https://github.com/thelazylamaGit)! - Fixes stale inline CSS in server-rendered HTML after CSS file edits during dev When editing a CSS file (`.css`, `.scss`, etc.) during development, the inline `<style>` tags in server-rendered HTML would retain old CSS content instead of updating. This caused a brief flash of old CSS (FOUC) on fresh page loads before Vite's client-side HMR corrected the styles. The fix ensures that Astro's per-route dev CSS virtual modules are invalidated in both the SSR module graph and the module runner's evaluation cache when a style file changes, so the next page render picks up the fresh CSS. - [#&#8203;17044](https://github.com/withastro/astro/pull/17044) [`2220d22`](https://github.com/withastro/astro/commit/2220d22f8c7278988560d0e4b4f378c9967e9bae) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes CSS from `client:only` islands leaking to unrelated pages when Rollup bundles non-CSS-importing modules into the same chunk as CSS-importing modules - [#&#8203;17040](https://github.com/withastro/astro/pull/17040) [`7c4763d`](https://github.com/withastro/astro/commit/7c4763d31b94ccbdc2339992d73e087912e5b8e3) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes HMR not triggering for files inside the `src/middleware/` directory during dev - [#&#8203;16672](https://github.com/withastro/astro/pull/16672) [`52fc862`](https://github.com/withastro/astro/commit/52fc86213e6412b6f9f3b70a2616d52b5fb783a9) Thanks [@&#8203;martinheidegger](https://github.com/martinheidegger)! - Fixes support for numeric IDs in YAML frontmatter when using content collection references - [#&#8203;16762](https://github.com/withastro/astro/pull/16762) [`9de80ae`](https://github.com/withastro/astro/commit/9de80ae486bc43c8680fda099a125d836e78b552) Thanks [@&#8203;alexanderdombroski](https://github.com/alexanderdombroski)! - Adds a JSON schema to the Wrangler configuration file generated when running `astro add cloudflare` - [#&#8203;17046](https://github.com/withastro/astro/pull/17046) [`ef771ec`](https://github.com/withastro/astro/commit/ef771ece349eedb6e0b3b240b020fb96df208a92) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Improves the diagnostics emitted when Astro parses incorrect `.astro` files. ### [`v6.4.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#646) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.5...astro@6.4.6) ##### Patch Changes - [#&#8203;16765](https://github.com/withastro/astro/pull/16765) [`b10e86e`](https://github.com/withastro/astro/commit/b10e86e6dbaf04678127c86366befc0b78a164f6) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes an issue where renaming an image file while the dev server is running triggers a build error. Now Astro correctly hot-reloads the image without crashing. - [#&#8203;17026](https://github.com/withastro/astro/pull/17026) [`add3df1`](https://github.com/withastro/astro/commit/add3df10fdaff469ae0228f09d99290de170029a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens `addAttribute` to drop attribute names containing characters that are invalid per the HTML spec (`"`, `'`, `>`, `/`, `=`, whitespace) - [#&#8203;17033](https://github.com/withastro/astro/pull/17033) [`ffda27b`](https://github.com/withastro/astro/commit/ffda27b7c8697d4b7ed530e93385a420e1fc4acd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Validates the request origin against `allowedDomains` before fetching prerendered error pages. When `allowedDomains` is configured and the Host header matches, the original origin is used. Otherwise, the fetch falls back to `localhost`. ### [`v6.4.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#645) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.4...astro@6.4.5) ##### Patch Changes - [#&#8203;16985](https://github.com/withastro/astro/pull/16985) [`4ecff32`](https://github.com/withastro/astro/commit/4ecff3268acb6ee3db719c4b38bbaead703ff4de) Thanks [@&#8203;maximslo](https://github.com/maximslo)! - Fixes the `experimental.logger` destination not being used for the "Server listening on..." startup message. The logger is now resolved before the server starts listening, and `adapterLogger` re-creates itself when the underlying logger changes so the startup message uses the correct destination. - [#&#8203;16947](https://github.com/withastro/astro/pull/16947) [`e0703a6`](https://github.com/withastro/astro/commit/e0703a6e815be829759ab7912f7024ee8424c3ac) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `Astro.request.url` not reflecting validated `X-Forwarded-Proto`/`X-Forwarded-Host` headers when `security.allowedDomains` is configured. Previously, only `Astro.url` was updated with the forwarded origin while `Astro.request.url` retained the socket-derived URL, causing the two to diverge behind TLS-terminating proxies. - [#&#8203;16997](https://github.com/withastro/astro/pull/16997) [`dc45246`](https://github.com/withastro/astro/commit/dc45246812afcaab60393e5236d27e95f98f5efa) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Reverts a change to `isNode` runtime detection that caused a significant build time regression for Cloudflare adapter users with large prerendered sites ### [`v6.4.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#644) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.3...astro@6.4.4) ##### Patch Changes - [#&#8203;16926](https://github.com/withastro/astro/pull/16926) [`1b39ae8`](https://github.com/withastro/astro/commit/1b39ae8485406937501d8a734afe2a464d671064) Thanks [@&#8203;narendraio](https://github.com/narendraio)! - Prevents `App.match()` from throwing on request paths that contain an invalid percent-sequence. - [#&#8203;16924](https://github.com/withastro/astro/pull/16924) [`2c0bc94`](https://github.com/withastro/astro/commit/2c0bc943d96d602b429ce3ecbb379d01a46903b5) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes an issue where editing a client-side component (e.g. with `client:idle`, `client:load`, etc.) caused an unnecessary full program reload of the backend during development. - [#&#8203;16958](https://github.com/withastro/astro/pull/16958) [`2c1d50f`](https://github.com/withastro/astro/commit/2c1d50f5f9d557d7cdc17fd75f3a10fd203699c9) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes a bug where static file endpoints using `getStaticPaths` with `.html` in dynamic param values (e.g. `{ path: 'file.html' }`) would fail with a `NoMatchingStaticPathFound` error during build. The `.html` suffix is no longer incorrectly stripped from endpoint route pathnames. - [#&#8203;16855](https://github.com/withastro/astro/pull/16855) [`c610cda`](https://github.com/withastro/astro/commit/c610cda44b273c15a6e7eaa4a84fa194002643e1) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes dynamic routes returning 500 "TypeError: Missing parameter" when using domain-based i18n routing in SSR. - [#&#8203;16946](https://github.com/withastro/astro/pull/16946) [`606c37b`](https://github.com/withastro/astro/commit/606c37b886a9e25170ba82634cc81a8a775e8ac6) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `Astro.routePattern` to preserve original casing of dynamic parameter names from filenames. Previously, a file at `src/pages/blog/[postId].astro` would return `/blog/[postid]` for `Astro.routePattern` due to an internal `.toLowerCase()` call. It now correctly returns `/blog/[postId]`. - [#&#8203;16720](https://github.com/withastro/astro/pull/16720) [`16d49b6`](https://github.com/withastro/astro/commit/16d49b694071be212fb8c5a141ade72e8717a30e) Thanks [@&#8203;thomas-callahan-collibra](https://github.com/thomas-callahan-collibra)! - Fix an issue where dynamic routes would return the string `[object Object]` instead of the expected content, in certain runtimes. - [#&#8203;16703](https://github.com/withastro/astro/pull/16703) [`17390a6`](https://github.com/withastro/astro/commit/17390a6184d5cbd5ff85b7f652a92f5a6a7b0557) Thanks [@&#8203;henrybrewer00-dotcom](https://github.com/henrybrewer00-dotcom)! - Fixes styles being stripped when the project root is started with a path whose case differs from the actual filesystem case (e.g. running `astro dev` from `d:\dev\app` while the folder on disk is `D:\dev\app`). - [#&#8203;16855](https://github.com/withastro/astro/pull/16855) [`c610cda`](https://github.com/withastro/astro/commit/c610cda44b273c15a6e7eaa4a84fa194002643e1) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `Astro.currentLocale` returning the default locale instead of the domain's locale on dynamic routes served from a mapped domain. ### [`v6.4.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#643) [Compare Source](https://github.com/withastro/astro/compare/astro@6.4.2...astro@6.4.3) ##### Patch Changes - [#&#8203;16900](https://github.com/withastro/astro/pull/16900) [`17a0fbd`](https://github.com/withastro/astro/commit/17a0fbd34d11db765e79caf269bfd5f43ef51da8) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Bumps `devalue` dependency to v5.8.1 - [#&#8203;16016](https://github.com/withastro/astro/pull/16016) [`0d85e1b`](https://github.com/withastro/astro/commit/0d85e1b7ea58a243bd1b61bdfb951c4fd87b9db5) Thanks [@&#8203;felmonon](https://github.com/felmonon)! - Fix a false positive in the dev toolbar accessibility audit for anchors with text inside closed `<details>` elements. - [#&#8203;16911](https://github.com/withastro/astro/pull/16911) [`79c6c46`](https://github.com/withastro/astro/commit/79c6c469a735bece8a80200f7b188e15f1abff24) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a bug where `experimental.advancedRouting` with `astro/hono` handlers threw `TypeError: Cannot read properties of undefined (reading 'route')` for unmatched routes instead of rendering the custom 404 page. - [#&#8203;16899](https://github.com/withastro/astro/pull/16899) [`239c469`](https://github.com/withastro/astro/commit/239c469cd2cd66d147a302a2ca14e07a0891f9b8) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a false "does not call the middleware() handler" warning when using `astro()` in a custom `src/app.ts` and the first request is a redirect route. - [#&#8203;16887](https://github.com/withastro/astro/pull/16887) [`493acdb`](https://github.com/withastro/astro/commit/493acdb4abc56534e9efa68af16e3ef273d7d88b) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `redirectToDefaultLocale` not working after the Advanced Routing refactoring. - [#&#8203;16908](https://github.com/withastro/astro/pull/16908) [`ef53ab9`](https://github.com/withastro/astro/commit/ef53ab91e8362b50bb1a3ab73d9350b93ea41de4) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves optimized fallbacks generation when using the Fonts API by using better metrics for bold variants ### [`v6.4.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#642) ##### Patch Changes - [#&#8203;16889](https://github.com/withastro/astro/pull/16889) [`b94bcfd`](https://github.com/withastro/astro/commit/b94bcfd8da64a3f2862a20572e7a9847aebdbc70) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes a `plugins is not iterable` crash when using a pre-6.0 `@astrojs/mdx` alongside integrations (e.g. Starlight) that set `markdown.remarkPlugins`, `markdown.rehypePlugins`, or `markdown.remarkRehype`. - [#&#8203;16878](https://github.com/withastro/astro/pull/16878) [`b9f6bb9`](https://github.com/withastro/astro/commit/b9f6bb9a238b909d491ca4a7a99620908faf58a8) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes an issue where on-demand (SSR) dynamic routes would return 404 when a prerendered dynamic route with the same URL pattern was sorted first alphabetically. In production builds with `@astrojs/node` adapter, if `[a_prebuild].astro` (prerender=true) came before `[b_ssr].astro` alphabetically, requests to URLs not in the prerendered route's static paths would 404 instead of falling through to the SSR route. The fix adds fallthrough logic so that when a prerendered dynamic route matches but can't serve the request, Astro tries subsequent matching routes. ### [`v6.4.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#641) ##### Patch Changes - [#&#8203;16883](https://github.com/withastro/astro/pull/16883) [`eeb064c`](https://github.com/withastro/astro/commit/eeb064ca9452fd9d0ad9b7557059a646a90a3e57) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Restores the `astro/jsx/rehype.js` entry point so that older versions of `@astrojs/mdx` continue to work when used with Astro 6.x. This entry point will be removed in Astro 7.0. ### [`v6.4.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#640) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.8...astro@6.4.0) ##### Minor Changes - [#&#8203;16468](https://github.com/withastro/astro/pull/16468) [`4cff3a1`](https://github.com/withastro/astro/commit/4cff3a107c3750ab5f0878a6b41836705282b771) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a new `preserveBuildServerDir` adapter feature Adapters can now set `preserveBuildServerDir: true` in their adapter features to keep the `dist/server/` directory structure for static builds, mirroring the existing `preserveBuildClientDir` option. This is useful for adapters that require a consistent `dist/client/` and `dist/server/` layout regardless of build output type. ```js setAdapter({ name: 'my-adapter', adapterFeatures: { buildOutput, preserveBuildClientDir: true, preserveBuildServerDir: true, }, }); ``` - [#&#8203;16848](https://github.com/withastro/astro/pull/16848) [`f732f3c`](https://github.com/withastro/astro/commit/f732f3cc716342a63e5b03815243ba10964b89dc) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds a new `markdown.processor` configuration option, allowing you to choose an alternative Markdown processor. Websites with many Markdown/MDX files tend to be slow to build because the unified ecosystem (e.g., remark, rehype) is slow to process. This feature introduces the ability to replace this part of the build pipeline with another processor. The default processor is `unified()`. This means that existing configurations remain unchanged and your remark/rehype plugins continue to work. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import { unified } from '@astrojs/markdown-remark'; import remarkToc from 'remark-toc'; export default defineConfig({ markdown: { processor: unified({ remarkPlugins: [remarkToc], }), }, }); ``` In addition to this new configuration option, Astro provides a new alternative processor based on Rust: [Sätteri](https://satteri.bruits.org/). You can choose to use it now by installing `@astrojs/markdown-satteri`, importing the `satteri()` processor, and adapting your existing configuration: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri({ features: { directive: true }, }), }, }); ``` This processor does not support the remark and rehype plugins. This means you may need to convert them to [MDAST or HAST plugins](https://satteri.bruits.org/docs/plugins/) to retain your current functionality. The existing top-level `markdown.remarkPlugins`, `markdown.rehypePlugins`, `markdown.remarkRehype`, `markdown.gfm`, and `markdown.smartypants` options still work, but are now deprecated and will be removed in a future major update. The matching `remarkPlugins`, `rehypePlugins`, and `remarkRehype` options on the MDX integration are also deprecated for the same reason. To anticipate their removal, move them onto `unified({...})` (or your preferred plugin processor) : ```diff // astro.config.mjs import { defineConfig } from 'astro/config'; import remarkToc from 'remark-toc'; import rehypeSlug from 'rehype-slug'; + import { unified } from '@astrojs/markdown-remark'; export default defineConfig({ markdown: { + processor: unified({ + remarkPlugins: [remarkToc], + rehypePlugins: [rehypeSlug], + remarkRehype: true, + gfm: true, + smartypants: true, + }), - remarkPlugins: [remarkToc], - rehypePlugins: [rehypeSlug], - remarkRehype: true, - gfm: true, - smartypants: true, }, }); ``` For more information on enabling and using this feature in your project, see our [Markdown guide](https://docs.astro.build/en/guides/markdown-content/). To give feedback on this new Rust processor, see the [Native Markdown / MDX parsing and processing RFC](https://github.com/withastro/roadmap/pull/1364). ##### Patch Changes - [#&#8203;16468](https://github.com/withastro/astro/pull/16468) [`4cff3a1`](https://github.com/withastro/astro/commit/4cff3a107c3750ab5f0878a6b41836705282b771) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Skips the static preview server when an adapter provides its own `previewEntrypoint`, allowing the adapter to handle both static and dynamic routes - [#&#8203;16811](https://github.com/withastro/astro/pull/16811) [`e0e26db`](https://github.com/withastro/astro/commit/e0e26dbfe95f9d42f51ad414dbe877e60cbc637d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `X-Forwarded-Host` and `X-Forwarded-Proto` headers being ignored when set in a custom `src/app.ts` fetch handler before creating `FetchState` - [#&#8203;16468](https://github.com/withastro/astro/pull/16468) [`4cff3a1`](https://github.com/withastro/astro/commit/4cff3a107c3750ab5f0878a6b41836705282b771) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes the static preview server to respect `preserveBuildClientDir`, serving files from `build.client` instead of `outDir` when the adapter requires it - [#&#8203;16770](https://github.com/withastro/astro/pull/16770) [`1e2aa11`](https://github.com/withastro/astro/commit/1e2aa11caf8e7a48f37dd614fd2d4c15cc7a8439) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a race condition where the Vite dep optimizer could lose React dependencies in dev mode when using Astro Actions - [#&#8203;16468](https://github.com/withastro/astro/pull/16468) [`4cff3a1`](https://github.com/withastro/astro/commit/4cff3a107c3750ab5f0878a6b41836705282b771) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Exempts internal routes (e.g. server islands) from `getStaticPaths()` validation, fixing server island rendering on static sites - [#&#8203;16468](https://github.com/withastro/astro/pull/16468) [`4cff3a1`](https://github.com/withastro/astro/commit/4cff3a107c3750ab5f0878a6b41836705282b771) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes preview for static sites that contain non-prerendered routes. Previously, the preview command ignored SSR routes discovered during route scanning and always used the static preview server. - Updated dependencies \[[`f732f3c`](https://github.com/withastro/astro/commit/f732f3cc716342a63e5b03815243ba10964b89dc), [`f732f3c`](https://github.com/withastro/astro/commit/f732f3cc716342a63e5b03815243ba10964b89dc)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.10.0 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.2.0 ### [`v6.3.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#638) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.7...astro@6.3.8) ##### Patch Changes - [#&#8203;16830](https://github.com/withastro/astro/pull/16830) [`f2bf3cb`](https://github.com/withastro/astro/commit/f2bf3cb257788ff657ffbe9044fe6225e6662cb7) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes 404s for dynamically imported JS chunks when using an adapter with `assetQueryParams` (e.g. Vercel skew protection) - [#&#8203;16831](https://github.com/withastro/astro/pull/16831) [`ace96ba`](https://github.com/withastro/astro/commit/ace96ba5024129cbeb9d8e75134f4f8bdf42a57a) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes a misleading `GetStaticPathsRequired` error when a redirect is configured from a dynamic route to a static (or less-dynamic) destination. For example, `'/project/[slug]': '/'` previously produced a confusing error pointing at `index.astro`. Astro now detects the parameter mismatch at config validation time and throws a clear `InvalidRedirectDestination` error naming the missing parameters. - [#&#8203;16702](https://github.com/withastro/astro/pull/16702) [`b7d1758`](https://github.com/withastro/astro/commit/b7d1758efbe0544520b4b15577d2e0dd944bf8a1) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes scoped styles from `.astro` components being dropped when rendered inside MDX content (`<Content />` from `render(entry)`) passed through a named slot using `<Fragment slot="X">`. The Fragment component now eagerly evaluates its slot contents to ensure propagating components register their styles before head content is flushed. - [#&#8203;16823](https://github.com/withastro/astro/pull/16823) [`3df6a45`](https://github.com/withastro/astro/commit/3df6a453243ff4d1d983d0fb6d259617f50be211) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes missing CSS for conditionally rendered Svelte components in production builds - [#&#8203;16836](https://github.com/withastro/astro/pull/16836) [`3d7adfa`](https://github.com/withastro/astro/commit/3d7adfae7d063661d85d92061a15f728fa5df2bd) Thanks [@&#8203;LongYC](https://github.com/LongYC)! - Document compressHTML: "jsx" config is only available since Astro v6.2.0 - [#&#8203;16864](https://github.com/withastro/astro/pull/16864) [`334ce13`](https://github.com/withastro/astro/commit/334ce135807666df283dc4cd4d5f6dad1b1b80cc) Thanks [@&#8203;cheets](https://github.com/cheets)! - Fixes a false-positive `Internal Warning: route cache overwritten` logged on every SSR request for dynamic routes ### [`v6.3.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#637) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.6...astro@6.3.7) ##### Patch Changes - [#&#8203;16821](https://github.com/withastro/astro/pull/16821) [`9c76b12`](https://github.com/withastro/astro/commit/9c76b12052c445416df6b034d7b6df66957a0503) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes request body handling in the Node adapter when `req.body` is a `Buffer`, `Uint8Array`, or `ArrayBuffer`. Previously, binary body data was incorrectly JSON-stringified (producing `{"type":"Buffer","data":[...]}`) instead of being passed through directly. This affected libraries like `serverless-http` that set `req.body` to a `Buffer`. - [#&#8203;16785](https://github.com/withastro/astro/pull/16785) [`de96360`](https://github.com/withastro/astro/commit/de963608d82e9bab74896945aa6503ba164ddbb0) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes `vite.build.minify`, `vite.build.sourcemap`, and `vite.build.rollupOptions.output` (e.g. `compact`) being ignored for client-side builds. These top-level Vite build options are now properly forwarded to the client environment, with environment-specific overrides (`vite.environments.client.build.*`) taking priority when set. - [#&#8203;16819](https://github.com/withastro/astro/pull/16819) [`b5dd8f1`](https://github.com/withastro/astro/commit/b5dd8f1e82813a646c4c61510764fc83b2fcafd4) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes custom elements in MDX files bypassing the renderer pipeline. Custom elements (tags containing hyphens like `<my-element>`) in `.mdx` files are now routed through registered renderers for SSR, matching the behavior of `.astro` files. If no renderer claims the element, it falls back to rendering as raw HTML. - [#&#8203;16808](https://github.com/withastro/astro/pull/16808) [`765896c`](https://github.com/withastro/astro/commit/765896cd4d03755093d6c9f47d69285ac910b848) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes dynamic routes returning 400 Bad Request when the URL contains a literal `%` character, such as paths built with `encodeURIComponent('%?.pdf')` - [#&#8203;16804](https://github.com/withastro/astro/pull/16804) [`90d2aca`](https://github.com/withastro/astro/commit/90d2aca7536e600062e6b9d787ef7e60990a23fe) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Fixes a v6 regression where `astro:i18n` could not be imported from client `<script>` blocks. ### [`v6.3.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#636) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.5...astro@6.3.6) ##### Patch Changes - [#&#8203;16774](https://github.com/withastro/astro/pull/16774) [`8f77583`](https://github.com/withastro/astro/commit/8f7758313df4af52e83e039bb64c41006de93c4e) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes markdown images with empty alt text (`![](image.jpg)`) in content collections dropping the `alt` attribute entirely. The `alt=""` attribute is now correctly preserved in the rendered HTML output, which is important for accessibility (indicating decorative images). - [#&#8203;16776](https://github.com/withastro/astro/pull/16776) [`3d10b5e`](https://github.com/withastro/astro/commit/3d10b5e16256ff9999e757f86cf2c4f04c36a311) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes HMR serving stale content when components are passed as props via `getStaticPaths()` - [#&#8203;16784](https://github.com/withastro/astro/pull/16784) [`7453860`](https://github.com/withastro/astro/commit/7453860fb4fb34017365c135678bfd76f1f9aeb5) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Improved the printing of the build time if it goes over the 60 seconds. - [#&#8203;16665](https://github.com/withastro/astro/pull/16665) [`3dbbcee`](https://github.com/withastro/astro/commit/3dbbcee0a7015867cb1b6770440ba51d1eee3445) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes remote SVG sources erroring with `dangerouslyProcessSVG` after the v6.3 SVG-processing gate. The default Sharp service now resolves the output format from the source up-front when it can (URL extension, `data:` MIME, ESM metadata), and from the actual buffer at request time when it can't, so SVG sources pass through untouched without needing to set `image.dangerouslyProcessSVG: true` or an explicit `format="svg"`. The error message has also been updated to point at `format="svg"` as the simpler workaround when an SVG source is encountered without `dangerouslyProcessSVG` enabled. - [#&#8203;16777](https://github.com/withastro/astro/pull/16777) [`1754b91`](https://github.com/withastro/astro/commit/1754b91dec1e5d9839ddfc39fbf2ee1fbb9391a4) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes HMR serving stale content for dynamically imported components through barrel files - [#&#8203;16730](https://github.com/withastro/astro/pull/16730) [`068d924`](https://github.com/withastro/astro/commit/068d924402dced7670530774f36cca301f91e60c) Thanks [@&#8203;harshagarwalnyu](https://github.com/harshagarwalnyu)! - Fixes an issue where the `file()` content loader did not generate a valid JSON Schema for collections whose JSON or YAML data is a top-level array instead of an object. ### [`v6.3.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#635) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.4...astro@6.3.5) ##### Patch Changes - [#&#8203;16771](https://github.com/withastro/astro/pull/16771) [`07c8805`](https://github.com/withastro/astro/commit/07c880500926e3337798ca906d9422c880c6e148) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `position` prop on `<Image>` and `<Picture>` components breaking Content Security Policy (CSP). - [#&#8203;16593](https://github.com/withastro/astro/pull/16593) [`50924ce`](https://github.com/withastro/astro/commit/50924cea1faf32b8c14b031936e93812033b04ca) Thanks [@&#8203;yanthomasdev](https://github.com/yanthomasdev)! - Improves error messages with more consistent and correct writing. - [#&#8203;16757](https://github.com/withastro/astro/pull/16757) [`5d661cd`](https://github.com/withastro/astro/commit/5d661cd226cd9abb4f0f352231f2f68feec52ab4) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes dev server serving stale content when SSR-only modules change (e.g. `.astro` files outside the project root in a monorepo, or dynamically imported components). Previously, the `astro:hmr-reload` plugin returned an empty array after detecting SSR-only module changes, which prevented Vite's `updateModules` from propagating the invalidation to the SSR module runner. The runner's evaluated module cache stayed stale, so subsequent requests continued returning old content. Now the plugin returns the SSR-only modules so Vite can process them through `updateModules`, which properly invalidates the module runner's cache and ensures fresh content on the next request. ### [`v6.3.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#634) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.3...astro@6.3.4) ##### Patch Changes - [#&#8203;16723](https://github.com/withastro/astro/pull/16723) [`0f10bfe`](https://github.com/withastro/astro/commit/0f10bfe70d443ebe5474a72f59c3a3e745831b98) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `fetchFile` option to `experimental.advancedRouting` to customize or disable the entrypoint file ```js export default defineConfig({ experimental: { advancedRouting: { fetchFile: 'fetch.ts', }, }, }); ``` - [#&#8203;16723](https://github.com/withastro/astro/pull/16723) [`0f10bfe`](https://github.com/withastro/astro/commit/0f10bfe70d443ebe5474a72f59c3a3e745831b98) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes Hono `cache()` middleware to follow the standard wrapper pattern - [#&#8203;16723](https://github.com/withastro/astro/pull/16723) [`0f10bfe`](https://github.com/withastro/astro/commit/0f10bfe70d443ebe5474a72f59c3a3e745831b98) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `App.Providers` interface for typing custom context providers on `Astro` and `ctx` ```ts declare namespace App { interface Providers { oauth: import('./lib/oauth').OAuthSession; } } ``` - [#&#8203;16723](https://github.com/withastro/astro/pull/16723) [`0f10bfe`](https://github.com/withastro/astro/commit/0f10bfe70d443ebe5474a72f59c3a3e745831b98) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `FetchState.response` property, set automatically after `pages()` or `middleware()` completes ```ts const response = await middleware(state, (s) => pages(s)); console.log(state.response === response); // true ``` - [#&#8203;16723](https://github.com/withastro/astro/pull/16723) [`0f10bfe`](https://github.com/withastro/astro/commit/0f10bfe70d443ebe5474a72f59c3a3e745831b98) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `Fetchable` type export for typing the advanced routing entrypoint ```ts import type { Fetchable } from 'astro'; export default { async fetch(request) { return new Response('ok'); }, } satisfies Fetchable; ``` - [#&#8203;16572](https://github.com/withastro/astro/pull/16572) [`4a5a077`](https://github.com/withastro/astro/commit/4a5a0779712be11680a9fc729be2ba9dd93f68d2) Thanks [@&#8203;DORI2001](https://github.com/DORI2001)! - Suppresses `[WARN] Vite warning: unused imports from "@astrojs/internal-helpers/remote"` during prerender builds. The package is now bundled alongside `astro` in the prerender environment, matching how it is handled in the SSR environment. - [#&#8203;16756](https://github.com/withastro/astro/pull/16756) [`b6ee23d`](https://github.com/withastro/astro/commit/b6ee23d339311c356ad25781f62454aee289e47b) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes styles from Markdoc/MDX custom components not being extracted to `<head>` in the dev server when using the Cloudflare adapter with `prerenderEnvironment: 'node'` and rendering content through a wrapper component. - [#&#8203;16747](https://github.com/withastro/astro/pull/16747) [`904d19a`](https://github.com/withastro/astro/commit/904d19a73e91dc166c492905ebf6c81705fa7064) Thanks [@&#8203;astrobot-houston](https://github.com/astrobot-houston)! - Fixes Astro action requests failing in `astro dev` when using the Cloudflare adapter with `prerenderEnvironment: 'node'` alongside a prerendered catch-all route such as `[...page].astro`. Actions and other SSR POST endpoints now continue to work in dev instead of returning an HTTP 500 error. - [#&#8203;16701](https://github.com/withastro/astro/pull/16701) [`3495ce4`](https://github.com/withastro/astro/commit/3495ce4f3af103673e32b6fdd452e4108252e1b5) Thanks [@&#8203;demaisj](https://github.com/demaisj)! - Fix `Map` and `Set` instances saved in a content collection being broken when retrieving entries. - [#&#8203;16614](https://github.com/withastro/astro/pull/16614) [`fca1c32`](https://github.com/withastro/astro/commit/fca1c32c329f6044c6833debdb9d683dd2103fc9) Thanks [@&#8203;Eptagone](https://github.com/Eptagone)! - Fixes `entry.data` type inference when a live collection is configured without a schema. - [#&#8203;16661](https://github.com/withastro/astro/pull/16661) [`03b8f7f`](https://github.com/withastro/astro/commit/03b8f7f7644cc1d9e738a8221d6bd377399538c0) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates `typescript` to v6. No changes are needed from users. - [#&#8203;16681](https://github.com/withastro/astro/pull/16681) [`c22770a`](https://github.com/withastro/astro/commit/c22770a58c3b312ad4bba81707be72f551ee02db) Thanks [@&#8203;dotnetCarpenter](https://github.com/dotnetCarpenter)! - Fixes an issue where SVG images with `width="0"` or `height="0"` incorrectly threw a `NoImageMetadata` error instead of being treated as valid dimensions. ### [`v6.3.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#633) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.2...astro@6.3.3) ##### Patch Changes - [#&#8203;16737](https://github.com/withastro/astro/pull/16737) [`bd84f33`](https://github.com/withastro/astro/commit/bd84f33d68cfa7d077e0a638970e28b0a9bd83db) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a reflected XSS vulnerability where slot names on hydrated components were not HTML-escaped in SSR output ### [`v6.3.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#632) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.1...astro@6.3.2) ##### Patch Changes - [#&#8203;16675](https://github.com/withastro/astro/pull/16675) [`11d4592`](https://github.com/withastro/astro/commit/11d4592e9498e900b433ba94abed9cd615a9350b) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a regression where `Astro.cache` was `undefined` when `experimental.cache` was not configured. The previous documented behavior is for `Astro.cache` to always be defined as a no-op shim: `cache.set()` warns once, `cache.invalidate()` throws and `cache.enabled` can be used to gate. This allows library and user code can call cache methods without conditional checks. The cache provider registration was being gated at the call site on `experimental.cache` being configured, which meant the disabled shim branch inside the provider was unreachable and the `Astro.cache` getter was never attached to the context. - [#&#8203;16691](https://github.com/withastro/astro/pull/16691) [`0f0a4ce`](https://github.com/withastro/astro/commit/0f0a4ce1b28a6d6ec1658c7f59e0e68408935135) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `HTMLElement is not defined` error during HMR when using components with client-side scripts (e.g. Starlight `<Tabs>`) and the Cloudflare adapter - [#&#8203;16562](https://github.com/withastro/astro/pull/16562) [`07529ec`](https://github.com/withastro/astro/commit/07529eccdaef8727a375475e6d04071b770114a1) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes non-prerendered routes failing when a dynamic prerendered route exists in the same project with `prerenderEnvironment: 'node'` - [#&#8203;16638](https://github.com/withastro/astro/pull/16638) [`272185b`](https://github.com/withastro/astro/commit/272185bcccf6a4adcd7575f319bf91f2e5306c6d) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where the Astro compiler wasn't freed at the end of the build. After the fix, the memory used by the compiler is now correctly freed at the end of the build. - [#&#8203;16544](https://github.com/withastro/astro/pull/16544) [`d365c97`](https://github.com/withastro/astro/commit/d365c975ba2d88fc1dbdfe698df2bf9e2eafadce) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Tightens `isRemotePath()` to reject control characters after a leading slash and fixes the dev image endpoint origin check - [#&#8203;16685](https://github.com/withastro/astro/pull/16685) [`889e748`](https://github.com/withastro/astro/commit/889e748f1546eabc325d5112f95bc78e402fd4f0) Thanks [@&#8203;farrosfr](https://github.com/farrosfr)! - Improve validation messages for `security.csp.directives` when `script-src` or `style-src` are incorrectly placed in the `directives` array. - [#&#8203;16605](https://github.com/withastro/astro/pull/16605) [`772f13a`](https://github.com/withastro/astro/commit/772f13a153db235a232a86dc533df3b07a1a09a0) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes `assetsPrefix` not being available on `build` from `astro:config/server`. - [#&#8203;16556](https://github.com/withastro/astro/pull/16556) [`f38dec7`](https://github.com/withastro/astro/commit/f38dec76a48234ae6919a118f3d626c6ed3d4e80) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Rejects double-encoded URL paths with a 400 response instead of silently falling back to partial decoding - [#&#8203;16659](https://github.com/withastro/astro/pull/16659) [`38bcb25`](https://github.com/withastro/astro/commit/38bcb25282d1f794b7dff349071b089a2737f0aa) Thanks [@&#8203;jsparkdev](https://github.com/jsparkdev)! - Fixes `&` characters appearing as raw entity strings (e.g. `&#&#8203;38;`) in `<meta>` tags when viewed in link previews or raw HTML. - Updated dependencies \[[`d365c97`](https://github.com/withastro/astro/commit/d365c975ba2d88fc1dbdfe698df2bf9e2eafadce), [`9256345`](https://github.com/withastro/astro/commit/92563452ce866d9f9b950ad4b2adc808d10e8014)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.9.1 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.2 ### [`v6.3.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#631) [Compare Source](https://github.com/withastro/astro/compare/astro@6.3.0...astro@6.3.1) ##### Patch Changes - [#&#8203;16646](https://github.com/withastro/astro/pull/16646) [`15fbc41`](https://github.com/withastro/astro/commit/15fbc41bb2fe64e8aee15acbe01abb4792145e8a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes local images returning 404 on non-prerendered pages when using the generic image endpoint ### [`v6.3.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#630) [Compare Source](https://github.com/withastro/astro/compare/astro@6.2.2...astro@6.3.0) ##### Minor Changes - [#&#8203;16366](https://github.com/withastro/astro/pull/16366) [`d69f858`](https://github.com/withastro/astro/commit/d69f858475bee448d0873df4579e1c635223c248) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a new `experimental.advancedRouting` option that lets you take full control of Astro's request handling pipeline by creating a `src/app.ts` file in your project. Today, Astro handles every incoming request through a fixed internal pipeline: trailing slash normalization, redirects, actions, middleware, page rendering, i18n, and so on. That pipeline works great for most sites, but as projects grow you often want to run your own logic *between* those steps — an auth check before rendering, a rate limiter before actions, custom logging around the whole stack. Advanced routing gives you that control. When enabled, Astro looks for a `src/app.ts` file in your project. If it finds one, that file becomes the entrypoint for all server-rendered requests. You compose the pipeline yourself using the handlers Astro provides, and you can slot your own logic anywhere in the chain. ##### Enabling advanced routing ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { advancedRouting: true, }, }); ``` ##### Two ways to build your pipeline Astro ships two entrypoints for advanced routing: `astro/fetch` and `astro/hono`. **`astro/fetch`** is a low-level, framework-free API built on the Web Fetch standard. You create a `FetchState` from the incoming request, then call handler functions in sequence. Each handler takes the state, does its work, and returns a `Response` (or `undefined` to pass through). This is the core primitive that everything else is built on: ```ts // src/app.ts import { FetchState, trailingSlash, redirects, actions, middleware, pages, i18n, } from 'astro/fetch'; export default { async fetch(request: Request) { const state = new FetchState(request); // Early exits — these return a Response only when they apply. const slash = trailingSlash(state); if (slash) return slash; const redirect = redirects(state); if (redirect) return redirect; const action = await actions(state); if (action) return action; // Middleware wraps page rendering; i18n post-processes the response. const response = await middleware(state, () => pages(state)); return i18n(state, response); }, }; ``` **`astro/hono`** wraps the same handlers as [Hono](https://hono.dev) middleware, so you can mix Astro's pipeline with Hono's ecosystem of middleware (logger, CORS, JWT, rate limiting, etc.) using the `app.use()` pattern you already know: ```ts // src/app.ts import { Hono } from 'hono'; import { getCookie } from 'hono/cookie'; import { logger } from 'hono/logger'; import { actions, middleware, pages, i18n } from 'astro/hono'; const app = new Hono(); app.use(logger()); // Auth gate — only runs for /dashboard routes. app.use('/dashboard/*', async (c, next) => { const session = getCookie(c, 'session'); if (!session) return c.redirect('/login'); return next(); }); app.use(actions()); app.use(middleware()); app.use(pages()); app.use(i18n()); export default app; ``` Both approaches give you the same power — pick whichever fits your project. If you don't need a framework, `astro/fetch` keeps things minimal. If you want a rich middleware ecosystem, `astro/hono` gets you there with one import. For more information on enabling and using this feature in your project, see the [experimental advanced routing docs](https://docs.astro.build/en/reference/experimental-flags/advanced-routing/). To give feedback, or to keep up with its development, see the [advanced routing RFC](https://github.com/withastro/roadmap/blob/advanced-routing-stage-3/proposals/0056-advanced-routing.md) for more information and discussion. - [#&#8203;16366](https://github.com/withastro/astro/pull/16366) [`d69f858`](https://github.com/withastro/astro/commit/d69f858475bee448d0873df4579e1c635223c248) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a `consume()` instance method to `AstroCookies`. This method marks the cookies as consumed and returns the `Set-Cookie` header values. After consumption, any subsequent `set()` calls will log a warning, since the headers have already been sent. Previously this was only available as a static method `AstroCookies.consume(cookies)`. The static method is now deprecated but kept for backward compatibility with existing adapters. - [#&#8203;16412](https://github.com/withastro/astro/pull/16412) [`ba2d2e3`](https://github.com/withastro/astro/commit/ba2d2e3a4647b6ca84af6f06d4136e2824254305) Thanks [@&#8203;0xbejaxer](https://github.com/0xbejaxer)! - Add retry and error event handling for `astro-island` hydration import failures to reduce unrecoverable hydration errors on transient network failures. - [#&#8203;16582](https://github.com/withastro/astro/pull/16582) [`885cd31`](https://github.com/withastro/astro/commit/885cd31051ef848b75a0c0228747d815b24dc7da) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds a new `image.dangerouslyProcessSVG` flag to optionally enable processing SVG inputs. For security reasons, Astro will no longer rasterizes SVG image sources by default in its default image service and endpoint. Set `image.dangerouslyProcessSVG: true` to opt back into processing SVG inputs. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ // ... image: { dangerouslyProcessSVG: true, }, }); ``` Note that this is a breaking change for users who were previously relying on Astro's default image service to rasterize SVG inputs, but it is a necessary change to improve security and prevent potential vulnerabilities. - [#&#8203;16519](https://github.com/withastro/astro/pull/16519) [`1b1c218`](https://github.com/withastro/astro/commit/1b1c218c2cf76806f94afbd1cdc2af27c8abc6d0) Thanks [@&#8203;louisescher](https://github.com/louisescher)! - Adds support for redirecting URLs in remote image optimization. Previously, when a remote image URL meant to be optimized by Astro led to a redirect, Astro would fail silently and ignore the redirect. Now, Astro tracks up to 10 redirects for these images. If any of the redirects are not covered by a pattern in `image.remotePatterns` or a domain in `image.domains`, Astro will fail with a helpful error message. In the following example, the first image would be loaded successfully, while the second would lead to Astro throwing an error: ```mjs export default defineConfig({ image: { domains: ['example.com', 'cdn.example.com'], }, }); ``` ```tsx { /* Redirects to https://cdn.example.com/assets/image.png: */ } <Image src="https://example.com/assets/image.png" width="1920" height="1080" alt="An example image." />; { /* Redirects to https://malicious.com/image.png: */ } <Image src="https://example.com/bad-image.png" width="1920" height="1080" alt="An example image." />; ``` In cases where all redirects to HTTPS hosts should be trusted, the following configuration for `image.remotePatterns` can be used: ```mjs export default defineConfig({ image: { remotePatterns: [ { protocol: 'https', }, ], }, }); ``` ##### Patch Changes - [#&#8203;16592](https://github.com/withastro/astro/pull/16592) [`9c6efc5`](https://github.com/withastro/astro/commit/9c6efc5eb85d76b580ab53da412ca099c32ed825) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Escapes interpolated values in the dev server redirect HTML template, consistent with how the 404 template already handles them - [#&#8203;16585](https://github.com/withastro/astro/pull/16585) [`78f305e`](https://github.com/withastro/astro/commit/78f305e6962b50f7cce69772471ab318b6ef4c8a) Thanks [@&#8203;web-dev0521](https://github.com/web-dev0521)! - Fixes `z.array(z.boolean())` in form actions incorrectly coercing the string `"false"` to `true`. Boolean array elements now use the same `'true'`/`'false'` string comparison as single `z.boolean()` fields, so submitting `["false", "true", "false"]` correctly parses as `[false, true, false]`. - [#&#8203;16567](https://github.com/withastro/astro/pull/16567) [`12a03f2`](https://github.com/withastro/astro/commit/12a03f2492c2f32f0bd39dd85b8bc8bf1fbbc138) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes deleted content collection entries persisting in `getCollection()` results during dev - [#&#8203;16595](https://github.com/withastro/astro/pull/16595) [`ce9b25c`](https://github.com/withastro/astro/commit/ce9b25c3edb92d9de5368dcf86a6af57254f7a31) Thanks [@&#8203;web-dev0521](https://github.com/web-dev0521)! - Fixes `pushDirective` in the CSP runtime duplicating the new directive once per existing non-matching directive. Calling `insertDirective()` (or otherwise pushing a directive whose name is not yet in the list) now appends it exactly once, and a directive that merges with a later existing entry no longer leaves an unmerged copy behind. - [#&#8203;16600](https://github.com/withastro/astro/pull/16600) [`94e4b7c`](https://github.com/withastro/astro/commit/94e4b7cf8566625563a0fa0ea8bc26fe831b2fe1) Thanks [@&#8203;web-dev0521](https://github.com/web-dev0521)! - Fixes `Astro.preferredLocale` returning the wrong value when `i18n.locales` mixes object-form entries (`{ path, codes }`) with string entries that normalize to the same locale. The first matching code in the configured `locales` order is now selected, matching the documented behavior. - [#&#8203;16591](https://github.com/withastro/astro/pull/16591) [`cce20f7`](https://github.com/withastro/astro/commit/cce20f7c3597d555d490abe98ea213753842e35a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Uses a consistent generic error message in the image endpoint across all adapters - [#&#8203;16629](https://github.com/withastro/astro/pull/16629) [`f54be80`](https://github.com/withastro/astro/commit/f54be80069c5b43ad76bd69393afa443e1fe08cf) Thanks [@&#8203;g-taki](https://github.com/g-taki)! - Fixes a bug where SSR responses in `astro dev` could crash with `TypeError: this.logger.flush is not a function`. - [#&#8203;16589](https://github.com/withastro/astro/pull/16589) [`3740b24`](https://github.com/withastro/astro/commit/3740b244431eae848b9a83e473528e583fcac2e7) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes an outdated code snippet in the documentation for session storage configuration. - Updated dependencies \[[`354e231`](https://github.com/withastro/astro/commit/354e23191f6a85fd466b512d378959cc12aebb01)]: - [@&#8203;astrojs/telemetry](https://github.com/astrojs/telemetry)@&#8203;3.3.2 ### [`v6.2.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#622) [Compare Source](https://github.com/withastro/astro/compare/astro@6.2.1...astro@6.2.2) ##### Patch Changes - [#&#8203;16292](https://github.com/withastro/astro/pull/16292) [`00f48ee`](https://github.com/withastro/astro/commit/00f48ee25fdc072df93210fa2d6d24ea649d4ab1) Thanks [@&#8203;p-linnane](https://github.com/p-linnane)! - Fixes head metadata propagation in dev for adapters that load modules in the `prerender` Vite environment, such as `@astrojs/cloudflare`. The `astro:head-metadata` plugin previously only tracked the `ssr` environment, so `maybeRenderHead()` could fire inside an unrelated component's `<template>` element, trapping subsequent hoisted `<style>` blocks. - [#&#8203;16451](https://github.com/withastro/astro/pull/16451) [`778865f`](https://github.com/withastro/astro/commit/778865f4abe29f7dfa4009624f39e350b7735acd) Thanks [@&#8203;maximslo](https://github.com/maximslo)! - Fixes build crash when processing animated AVIF images. Sharp now gracefully passes through unsupported image formats instead of crashing during the build. - [#&#8203;16548](https://github.com/withastro/astro/pull/16548) [`7214d3e`](https://github.com/withastro/astro/commit/7214d3e134766c7324e76a0ec4c91050cf4a2a18) Thanks [@&#8203;senutpal](https://github.com/senutpal)! - Fixes scoped styles applying to the wrong element when `vite.css.transformer` is set to `'lightningcss'` and a selector uses a nested `&` inside `:where(...)`, such as Tailwind v4's `space-x-*`, `space-y-*`, and `divide-*` utilities. - [#&#8203;16566](https://github.com/withastro/astro/pull/16566) [`9ac96b4`](https://github.com/withastro/astro/commit/9ac96b406653d2993d35cd83dc5fa538b7417545) Thanks [@&#8203;web-dev0521](https://github.com/web-dev0521)! - Fixes `data-astro-prefetch="tap"` not triggering when clicking nested elements (e.g. `<span>`, `<img>`, `<svg>`) inside an anchor tag. - [#&#8203;15994](https://github.com/withastro/astro/pull/15994) [`1e70d18`](https://github.com/withastro/astro/commit/1e70d18febca2319487c9acbd9c2e18cb961aef0) Thanks [@&#8203;ossaidqadri](https://github.com/ossaidqadri)! - Fix `<style>` compilation failure when importing Astro components via tsconfig path aliases - [#&#8203;16144](https://github.com/withastro/astro/pull/16144) [`1cd6650`](https://github.com/withastro/astro/commit/1cd66504a63055dcbe54b5d3ec52cc220d3a82e1) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixed a regression where `.html` was unexpectedly stripped from dynamic route parameters on non-page routes (`.ts` endpoints and redirects). This caused endpoints like `/some/[...id].ts` returning `id: 'file.html'` on `getStaticPaths` to not serve that file because the generated route (`/some/file.html`) would get matched as `id: file` that is not part of the list returned by `getStaticPaths`. - [#&#8203;16415](https://github.com/withastro/astro/pull/16415) [`559c0fd`](https://github.com/withastro/astro/commit/559c0fd63ac8c051ee3bb634e06aadf48e8d8495) Thanks [@&#8203;0xbejaxer](https://github.com/0xbejaxer)! - Fix CSS traversal boundaries so pages with `export const partial = true` still contribute styles when imported as components by other pages. - [#&#8203;16516](https://github.com/withastro/astro/pull/16516) [`17f1867`](https://github.com/withastro/astro/commit/17f1867c177d99bc5fff31aa12f6c9ab35ef4581) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes an issue where the index route would return a 404 error when using a custom `base` path combined with `trailingSlash: 'never'`. This ensures that the home page and internal rewrites are correctly matched under these configurations. - [#&#8203;16515](https://github.com/withastro/astro/pull/16515) [`280ec88`](https://github.com/withastro/astro/commit/280ec88c0d9c75755b7616263ce516ff2122fb81) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Fixes an issue where `i18n.fallback` pages with `fallbackType: 'rewrite'` were emitted with empty bodies during `astro build`. - [#&#8203;16565](https://github.com/withastro/astro/pull/16565) [`7959798`](https://github.com/withastro/astro/commit/7959798c33c8c5e70183e1af3ab5d9b9d663e494) Thanks [@&#8203;enjoyandlove](https://github.com/enjoyandlove)! - Fixes session persistence when `session.delete()` is the first mutation in a request (no prior `get`, `set`, `has`, or `keys`). The session was marked dirty in memory, but persistence skipped the save because `#data` stayed `undefined`, so the backing store could still return the deleted key on the next request. - [#&#8203;16527](https://github.com/withastro/astro/pull/16527) [`86fd80d`](https://github.com/withastro/astro/commit/86fd80dd17cf896e5eaa185b70576d839d789978) Thanks [@&#8203;enjoyandlove](https://github.com/enjoyandlove)! - Prevents script deduplication state from being consumed while rendering inert `<template>` contexts. - [#&#8203;16540](https://github.com/withastro/astro/pull/16540) [`e59c637`](https://github.com/withastro/astro/commit/e59c637fb6c589fff5b56b737bab57d7513b0559) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Skips session storage reads when no session cookie is present. Previously, calling `session.get()` on a request without a session cookie would initialize the storage driver and make a read that was guaranteed to miss. On network-backed drivers this added latency and resource usage to every anonymous request. - [#&#8203;16517](https://github.com/withastro/astro/pull/16517) [`6ab0b3c`](https://github.com/withastro/astro/commit/6ab0b3c0266fe9c13638e22d40d46f2603e6031d) Thanks [@&#8203;adamchal](https://github.com/adamchal)! - Removes inline CSS for prerendered routes from the SSR manifest. The static HTML on disk already inlines those styles, and the SSR worker never renders prerendered routes, so the data was dead weight. Builds with many prerendered routes and `build.inlineStylesheets: "always"` (or `"auto"` with small stylesheets) will see a smaller SSR entry chunk, which reduces cold-start parse time on platforms like Cloudflare Workers. - [#&#8203;16509](https://github.com/withastro/astro/pull/16509) [`d3d3557`](https://github.com/withastro/astro/commit/d3d3557c77decc59fca6f0bfbdc36ba65e420564) Thanks [@&#8203;cyphercodes](https://github.com/cyphercodes)! - Fix conditional named slot callbacks receiving arguments from `Astro.slots.render()`. - [#&#8203;16236](https://github.com/withastro/astro/pull/16236) [`c6b068e`](https://github.com/withastro/astro/commit/c6b068e905a1a7b6e6a0b813c2368586b70a2214) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes the `position` prop on `<Image />` and `<Picture />` components to correctly apply `object-position` styles - [#&#8203;16018](https://github.com/withastro/astro/pull/16018) [`d14f47c`](https://github.com/withastro/astro/commit/d14f47c46da2f50f79e9b8cfb87eaca9db8e898b) Thanks [@&#8203;felmonon](https://github.com/felmonon)! - Fix `defineLiveCollection()` so `LiveLoader` data types declared as interfaces are accepted. ### [`v6.2.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#621) [Compare Source](https://github.com/withastro/astro/compare/astro@6.2.0...astro@6.2.1) ##### Patch Changes - [#&#8203;16531](https://github.com/withastro/astro/pull/16531) [`76db01d`](https://github.com/withastro/astro/commit/76db01d332a4029f46f6df7a60fae14278321d2c) Thanks [@&#8203;rodrigosdev](https://github.com/rodrigosdev)! - Fixes config validation for omitted `integrations` fields with newer Zod versions. - [#&#8203;16535](https://github.com/withastro/astro/pull/16535) [`7df0fe4`](https://github.com/withastro/astro/commit/7df0fe40b1f57529ce315a74eb83d527ff2040ec) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixed an issue where a warning was displayed when the `server` property was missing during config validation, even though it is not required. - [#&#8203;16534](https://github.com/withastro/astro/pull/16534) [`5cf6c51`](https://github.com/withastro/astro/commit/5cf6c51188b52d22f133ea9373da0080f74701f9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes compatibility with Zod 4.4.0 for the `server` config property and error formatting ### [`v6.2.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#620) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.10...astro@6.2.0) ##### Minor Changes - [#&#8203;16187](https://github.com/withastro/astro/pull/16187) [`fe58071`](https://github.com/withastro/astro/commit/fe58071817f447f832d9ce4341c0b5991d3c0cda) Thanks [@&#8203;gllmt](https://github.com/gllmt)! - Adds a `waitUntil` option to the `RenderOptions` so that adapters can forward runtime background-task hooks to Astro. When provided by an adapter, runtime cache providers receive `context.waitUntil` in `CacheProvider.onRequest()`, which allows background cache work such as stale-while-revalidate without blocking the response. The Cloudflare adapter now forwards `ExecutionContext.waitUntil` to this API. - [#&#8203;16290](https://github.com/withastro/astro/pull/16290) [`a49637a`](https://github.com/withastro/astro/commit/a49637ab82a6ce8506a7272f331d1101f782b3e0) Thanks [@&#8203;ViVaLaDaniel](https://github.com/ViVaLaDaniel)! - Ensures that `server.allowedHosts` (and `vite.preview.allowedHosts`) configuration is respected when using `astro preview` with the `@astrojs/cloudflare` adapter. This improves security by preventing DNS rebinding attacks when previewing Cloudflare builds locally. - [#&#8203;15725](https://github.com/withastro/astro/pull/15725) [`4108ec1`](https://github.com/withastro/astro/commit/4108ec1e256c5e9d97fb29f1097a5095b73cfb8b) Thanks [@&#8203;meyer](https://github.com/meyer)! - Adds support for a new `'jsx'` value for the `compressHTML` option. When set, whitespace is stripped using JSX whitespace rules instead of the default HTML compression strategy. ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ compressHTML: 'jsx', }); ``` In JSX, whitespaces never matter, as such, no amount of indentation, or newlines will not affect the rendered output. For instance, the following code: ```jsx <div> <span>foo</span> <span>bar</span> </div> ``` will be rendered as `foobar`, whereas with HTML whitespace rules, a space would be present between the words due to the newline and indentation between the tags. - [#&#8203;16477](https://github.com/withastro/astro/pull/16477) [`28fb3e1`](https://github.com/withastro/astro/commit/28fb3e16cdf181d49fbc22fbde41958fe9b9ab9e) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds experimental support for configurable log handlers. This experimental feature provides better control over Astro's logging infrastructure by allowing users to replace the default console output with custom logging implementations (e.g., structured JSON). This is particularly useful for users using on-demand rendering and wishing to connect their log aggregation services, such as Kibana, Logstash, CloudWatch, Grafana, or Loki. By default, Astro provides three built-in log handlers (`json`, `node`, and `console`), but you can also create your own. ##### JSON logging JSON logging can be enabled via the CLI for the `build`, `dev`, and `sync` commands using the `experimentalJson` flag: ```js // astro.config.mjs import { defineConfig, logHandlers } from 'astro/config'; export default defineConfig({ experimental: { logger: logHandlers.json({ pretty: true, level: 'warn', }), }, }); ``` ##### Custom logger You can also create your own custom logger by implementing the correct interface: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { logger: { entrypoint: '@org/custom-logger', }, }, }); ``` ```ts // @org/custom-logger.js import type { AstroLoggerDestination, AstroLoggerMessage } from 'astro'; import { matchesLevel } from 'astor/logger'; function customLogger(level = 'info'): AstroLoggerDestination { return { write(message: AstroLoggerMessage) { if (matchesLevel(message.level, level)) { // write message somewhere } }, }; } export default customLogger; ``` For more information on enabling and using this feature in your project, see the [Experimental Logger docs](https://docs.astro.build/en/reference/experimental-flags/logger/). For a complete overview and to give feedback on this experimental API, see the [Custom logger RFC](https://github.com/withastro/roadmap/blob/logger/proposals/0059-custom-logger.md). - [#&#8203;16333](https://github.com/withastro/astro/pull/16333) [`0f7c3c8`](https://github.com/withastro/astro/commit/0f7c3c8e3dfe0fff58bd6e68c40f6f8fb280144e) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds an experimental flag `svgOptimizer` that enables automatic optimization of your SVG components using the provided optimizer. This supersedes the `svgo` experimental flag, which is now removed. When enabled, your imported SVG files used as components will be optimized for smaller file sizes and better performance while maintaining visual quality. This can significantly reduce the size of your SVG assets by removing unnecessary metadata, comments, and redundant code. Astro ships with a [SVGO](https://svgo.dev/) based optimizer, but any can be used. To enable this feature, add the experimental flag in your Astro config and remove `svgo` if it was enabled: ```diff // astro.config.mjs -import { defineConfig } from "astro/config"; +import { defineConfig, svgoOptimizer } from "astro/config"; export default defineConfig({ + experimental: { + svgOptimizer: svgoOptimizer() - svgo: true + } }); ``` For more information on enabling and using this feature in your project, see the [experimental SVG optimization docs](https://docs.astro.build/en/reference/experimental-flags/svg-optimization/). - [#&#8203;16302](https://github.com/withastro/astro/pull/16302) [`f6f8e80`](https://github.com/withastro/astro/commit/f6f8e8097e93e29d00f419e5594f2c081bb32478) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `experimental_getFontFileURL()` method to resolve font file URLs when using the Fonts API The `fontData` object exported from `astro:assets` was introduced to provide low-level access to font family data for advanced usage. One of the goals of this API was to be able to resolve buffers using URLs. However, it turned out to be impractical, especially during prerendering. Astro now exports a new `experimental_getFontFileURL()` helper function from `astro:assets` to resolve font file URLs from `fontData`. For example, when using [satori](https://github.com/vercel/satori) to generate Open Graph images: ```diff // src/pages/og.png.ts import type { APIRoute } from "astro"; -import { fontData } from "astro:assets"; +import { fontData, experimental_getFontFileURL } from "astro:assets"; -import { outDir } from "astro:config/server"; -import { readFile } from "node:fs/promises"; import satori from "satori"; import { html } from "satori-html"; import sharp from "sharp"; export const GET: APIRoute = async (context) => { const fontPath = fontData["--font-roboto"][0]?.src[0]?.url; if (fontPath === undefined) { throw new Error("Cannot find the font path."); } - const data = import.meta.env.DEV - ? await fetch(new URL(fontPath, context.url.origin)).then(async (res) => res.arrayBuffer()) - : await readFile(new URL(`.${fontPath}`, outDir)); + const url = experimental_getFontFileURL(fontPath, context.url); + const data = await fetch(url).then((res) => res.arrayBuffer()); const svg = await satori( html`<div style="color: black;">hello, world</div>`, { width: 600, height: 400, fonts: [ { name: "Roboto", data, weight: 400, style: "normal", }, ], }, ); const pngBuffer = await sharp(Buffer.from(svg)) .resize(600, 400) .png() .toBuffer(); return new Response(new Uint8Array(pngBuffer), { headers: { "Content-Type": "image/png", }, }); }; ``` See the [Fonts API documentation](https://docs.astro.build/en/guides/fonts/#accessing-font-data-programmatically) for more information. ##### Patch Changes - [#&#8203;15980](https://github.com/withastro/astro/pull/15980) [`8812382`](https://github.com/withastro/astro/commit/88123826690dde1e0019aa801fe7d18085f27271) Thanks [@&#8203;seroperson](https://github.com/seroperson)! - Prevents script deduplication inside `<template>` elements ### [`v6.1.10`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#6110) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.9...astro@6.1.10) ##### Patch Changes - [#&#8203;16479](https://github.com/withastro/astro/pull/16479) [`1058428`](https://github.com/withastro/astro/commit/1058428df2d13878c6130787636dd1778273a934) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a spurious `[WARN] [content] Content config not loaded` warning during `astro dev` for projects that don't use content collections - [#&#8203;16457](https://github.com/withastro/astro/pull/16457) [`3d82220`](https://github.com/withastro/astro/commit/3d82220a1549e699e34ed433f3846a919f4c02bd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens server island encryption to prevent encrypted data from one island component being replayed against a different one - [#&#8203;16481](https://github.com/withastro/astro/pull/16481) [`152700e`](https://github.com/withastro/astro/commit/152700e08178285b240d8ef947cccd47b870ee5f) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a spurious 404 request for a dev toolbar sourcemap during `astro dev` caused by the browser mis-resolving a relative `sourceMappingURL` from the `/@id/` URL prefix - [#&#8203;16480](https://github.com/withastro/astro/pull/16480) [`1bcb43b`](https://github.com/withastro/astro/commit/1bcb43bf04f3fa8f4623897ae2a937250f35216a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an unnecessary full page reload on first navigation during dev ### [`v6.1.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#619) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.8...astro@6.1.9) ##### Patch Changes - [#&#8203;16448](https://github.com/withastro/astro/pull/16448) [`99464ed`](https://github.com/withastro/astro/commit/99464edb5fc0968f6497328e106f26ab393668bd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Updates vite, picomatch, and unstorage to latest patch versions - [#&#8203;16422](https://github.com/withastro/astro/pull/16422) [`a3951d7`](https://github.com/withastro/astro/commit/a3951d7873c7c210fedbaa77702bc33db6410715) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens `astro-island` export resolution and hydration error handling for malformed component metadata - [#&#8203;16420](https://github.com/withastro/astro/pull/16420) [`e21de1d`](https://github.com/withastro/astro/commit/e21de1d03b318d5045dba718291c04fe05c01490) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens Astro's error overlay and server logging paths to avoid unsafe HTML insertion and format-string interpolation - [#&#8203;16419](https://github.com/withastro/astro/pull/16419) [`f3485c3`](https://github.com/withastro/astro/commit/f3485c3458bc8bf70c152126e418c24f489ded9d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens nested object and package metadata lookups to ignore prototype keys in content handling and project scaffolding - [#&#8203;16022](https://github.com/withastro/astro/pull/16022) [`a002540`](https://github.com/withastro/astro/commit/a002540d60d4a840db9971e73c820a8015658ffe) Thanks [@&#8203;mathieumaf](https://github.com/mathieumaf)! - Fixes an issue where i18n domains would return 404 when `trailingSlash` is set to `never`. - Updated dependencies \[[`99464ed`](https://github.com/withastro/astro/commit/99464edb5fc0968f6497328e106f26ab393668bd), [`f3485c3`](https://github.com/withastro/astro/commit/f3485c3458bc8bf70c152126e418c24f489ded9d)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.9.0 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.1 ### [`v6.1.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#618) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.7...astro@6.1.8) ##### Patch Changes - [#&#8203;16367](https://github.com/withastro/astro/pull/16367) [`a6866a7`](https://github.com/withastro/astro/commit/a6866a7ef086627f8f8237274361d8acc2f85121) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where build output files could contain special characters (`!`, `~`, `{`, `}`) in their names, causing deploy failures on platforms like Netlify. - [#&#8203;16381](https://github.com/withastro/astro/pull/16381) [`217c5b3`](https://github.com/withastro/astro/commit/217c5b3b937f0aee7e59280e8a10cf2bd4237605) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Slightly improved the performance of the dev server by caching the internal crawling of the dependencies of a project. - [#&#8203;16348](https://github.com/withastro/astro/pull/16348) [`7d26cd7`](https://github.com/withastro/astro/commit/7d26cd77bc1b33cee81f0e7b408dc2d170be1bdd) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Fixes a bug where emitted assets during a client build would contain always fresh, new hashes in their name. Now the build should be more stable. - [#&#8203;16317](https://github.com/withastro/astro/pull/16317) [`d012bfe`](https://github.com/withastro/astro/commit/d012bfeadb5b33f9ab1175191d59357d629c327e) Thanks [@&#8203;das-peter](https://github.com/das-peter)! - Fixes a bug where `allowedDomains` weren't correctly propagated when using the development server. - [#&#8203;16379](https://github.com/withastro/astro/pull/16379) [`5a84551`](https://github.com/withastro/astro/commit/5a845514114ae21ca9820e98b56cce33c0cf579b) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Improves Vue scoped style handling in DEV mode during client router navigation. - [#&#8203;16317](https://github.com/withastro/astro/pull/16317) [`d012bfe`](https://github.com/withastro/astro/commit/d012bfeadb5b33f9ab1175191d59357d629c327e) Thanks [@&#8203;das-peter](https://github.com/das-peter)! - Adds tests to verify settings are properly propagated when using the development server. - [#&#8203;16282](https://github.com/withastro/astro/pull/16282) [`5b0fdaa`](https://github.com/withastro/astro/commit/5b0fdaa8ba3dc17f4b93d9847c3255150b0aeab2) Thanks [@&#8203;jmurty](https://github.com/jmurty)! - Fixes build errors on platforms with skew protection enabled (e.g. Vercel, Netlify) for inter-chunk Javascript using dynamic imports - Updated dependencies \[[`e0b240e`](https://github.com/withastro/astro/commit/e0b240edea4db632138def3a9003b4b12e12f765)]: - [@&#8203;astrojs/telemetry](https://github.com/astrojs/telemetry)@&#8203;3.3.1 ### [`v6.1.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#617) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.6...astro@6.1.7) ##### Patch Changes - [#&#8203;16027](https://github.com/withastro/astro/pull/16027) [`c62516b`](https://github.com/withastro/astro/commit/c62516bbbf8fdf95d38293440d28221c048c41f0) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes a bug where remote image dimensions were not validated during static builds on Netlify. - [#&#8203;16311](https://github.com/withastro/astro/pull/16311) [`94048f2`](https://github.com/withastro/astro/commit/94048f27c30f47ae0e01f90231e0496ed80595f7) Thanks [@&#8203;Arecsu](https://github.com/Arecsu)! - Fixes `--port` flag being ignored after a Vite-triggered server restart (e.g. when a `.env` file changes) - [#&#8203;16316](https://github.com/withastro/astro/pull/16316) [`0fcd04c`](https://github.com/withastro/astro/commit/0fcd04cc985002b56c9e2d36bcb68da0d3f08d5f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes the `/_image` endpoint accepting an arbitrary `f=svg` query parameter and serving non-SVG content as `image/svg+xml`. The endpoint now validates that the source is actually SVG before honoring `f=svg`, matching the same guard already enforced on the `<Image>` component path. ### [`v6.1.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#616) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.5...astro@6.1.6) ##### Patch Changes - [#&#8203;16202](https://github.com/withastro/astro/pull/16202) [`b5c2fba`](https://github.com/withastro/astro/commit/b5c2fba8bf2bc315db94e525f12f7661dd357822) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes Actions failing with `ActionsWithoutServerOutputError` when using `output: 'static'` with an adapter - [#&#8203;16303](https://github.com/withastro/astro/pull/16303) [`b06eabf`](https://github.com/withastro/astro/commit/b06eabf01afda713066feb803bbc4c89af634aaf) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves handling of special characters in inline `<script>` content - [#&#8203;14924](https://github.com/withastro/astro/pull/14924) [`bb4586a`](https://github.com/withastro/astro/commit/bb4586a73e32659e6cd4f610799799b634cfc658) Thanks [@&#8203;aralroca](https://github.com/aralroca)! - Fixes SCSS and CSS module file changes triggering a full page reload instead of hot-updating styles in place during development ### [`v6.1.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#615) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.4...astro@6.1.5) ##### Patch Changes - [#&#8203;16171](https://github.com/withastro/astro/pull/16171) [`5bcd03c`](https://github.com/withastro/astro/commit/5bcd03c1852cb7a7e165017089cc39c111599530) Thanks [@&#8203;Desel72](https://github.com/Desel72)! - Fixes a build error that occurred when a pre-rendered page used the `<Picture>` component and another page called `render()` on content collection entries. - [#&#8203;16239](https://github.com/withastro/astro/pull/16239) [`7c65c04`](https://github.com/withastro/astro/commit/7c65c0495a12dcb86e6566223e398094566d1435) Thanks [@&#8203;dataCenter430](https://github.com/dataCenter430)! - Fixes sync content inside `<Fragment>` not streaming to the browser until all async sibling expressions have resolved. - [#&#8203;16242](https://github.com/withastro/astro/pull/16242) [`686c312`](https://github.com/withastro/astro/commit/686c3124c1f4078d8395c86047020d92225e71ae) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Revives UnoCSS in dev mode when used with the client router. This change partly reverts [#&#8203;16089](https://github.com/withastro/astro/pull/16089), which in hindsight turned out to be too general. Instead of automatically persisting all style sheets, we now do this only for styles from Vue components. - [#&#8203;16192](https://github.com/withastro/astro/pull/16192) [`79d86b8`](https://github.com/withastro/astro/commit/79d86b88ef199d6a2195584ec53b225c6a9df5f9) Thanks [@&#8203;alexanderniebuhr](https://github.com/alexanderniebuhr)! - Uses today’s date for Cloudflare `compatibility_date` in `astro add cloudflare` When creating new projects, `astro add cloudflare` now sets `compatibility_date` to the current date. Previously, this date was resolved from locally installed packages, which could be unreliable in some package manager environments. Using today’s date is simpler and more reliable across environments, and is supported by [`workerd`](https://github.com/cloudflare/workers-sdk/pull/13051). - [#&#8203;16259](https://github.com/withastro/astro/pull/16259) [`34df955`](https://github.com/withastro/astro/commit/34df95585662d8d00f09e1295cdfe51f2dc78e3f) Thanks [@&#8203;gameroman](https://github.com/gameroman)! - Removed `dlv` dependency ### [`v6.1.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#614) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.3...astro@6.1.4) ##### Patch Changes - [#&#8203;16197](https://github.com/withastro/astro/pull/16197) [`21f9fe2`](https://github.com/withastro/astro/commit/21f9fe29f5de442a3e0672ea36dbe690491f3e8c) Thanks [@&#8203;SchahinRohani](https://github.com/SchahinRohani)! - Remove unused re-exports from assets/utils barrel file to fix Vite build warning - [#&#8203;16059](https://github.com/withastro/astro/pull/16059) [`6d5469e`](https://github.com/withastro/astro/commit/6d5469e2c8ddd5c2a546052ac7e3b0fb801b9069) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `Expected 'miniflare' to be defined` errors and 404 responses in dev mode when using the Cloudflare adapter and the config file changes. Instead of creating a brand new Vite server on config changes, Astro now performs a Vite in-place restart, allowing the Cloudflare adapter to reuse its existing miniflare instance across restarts. - [#&#8203;16154](https://github.com/withastro/astro/pull/16154) [`7610ba4`](https://github.com/withastro/astro/commit/7610ba4552b51a64be59ad16e8450ce6672579f0) Thanks [@&#8203;Desel72](https://github.com/Desel72)! - Fixes pages with dots in their filenames (e.g. `hello.world.astro`) returning 404 when accessed with a trailing slash in the dev server. The `trailingSlashForPath` function now only forces `trailingSlash: 'never'` for endpoints with file extensions, allowing pages to correctly respect the user's `trailingSlash` config. - [#&#8203;16193](https://github.com/withastro/astro/pull/16193) [`23425e2`](https://github.com/withastro/astro/commit/23425e2413b25cd304b64b4711f86f3f889546ff) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `trailingSlash: "always"` producing redirect HTML instead of the actual response for extensionless endpoints during static builds ### [`v6.1.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#613) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.2...astro@6.1.3) ##### Patch Changes - [#&#8203;16161](https://github.com/withastro/astro/pull/16161) [`b51f297`](https://github.com/withastro/astro/commit/b51f2972d4c5d877f9087b86bb2b1d62c8293be5) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a dev rendering issue with the Cloudflare adapter where head metadata could be missing and dev CSS/scripts could be injected in the wrong place - [#&#8203;16110](https://github.com/withastro/astro/pull/16110) [`de669f0`](https://github.com/withastro/astro/commit/de669f0a11c606cc4703762a73c2566d17667453) Thanks [@&#8203;tmimmanuel](https://github.com/tmimmanuel)! - Fixes skew protection query parameters not being appended to inter-chunk JavaScript imports in client bundles, which could cause version mismatches during rolling deployments on Vercel - [#&#8203;16162](https://github.com/withastro/astro/pull/16162) [`a0a49e9`](https://github.com/withastro/astro/commit/a0a49e99fd63419cae8bf143e1a58f532c52ee94) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes an issue where HMR would not trigger when modifying files while using [@&#8203;astrojs/cloudflare](https://github.com/astrojs/cloudflare) with prerenderEnvironment: 'node' enabled. - [#&#8203;16142](https://github.com/withastro/astro/pull/16142) [`7454854`](https://github.com/withastro/astro/commit/7454854dfcb9b7e9ae7f825dbf72bdf3106b78e1) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes HTML content being incorrectly escaped as plain text when rendering a MDX component using the `AstroContainer` APIs. - [#&#8203;16116](https://github.com/withastro/astro/pull/16116) [`12602a9`](https://github.com/withastro/astro/commit/12602a907c4eba0508145938c652362f37240878) Thanks [@&#8203;riderx](https://github.com/riderx)! - Fixes a bug where page-level CSS could leak between unrelated pages when traversing style parents across top-level route boundaries - [#&#8203;16178](https://github.com/withastro/astro/pull/16178) [`a7e7567`](https://github.com/withastro/astro/commit/a7e75678356488416a31184cdc53204094486820) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes SSR builds failing with "No matching renderer found" when a project only has injected routes and no `src/pages/` directory ### [`v6.1.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#612) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.1...astro@6.1.2) ##### Patch Changes - [#&#8203;16104](https://github.com/withastro/astro/pull/16104) [`47a394d`](https://github.com/withastro/astro/commit/47a394d7cf2eb735fcee8e90830737f9e900a274) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro preview` ignoring `vite.preview.allowedHosts` set in `astro.config.mjs` - [#&#8203;16047](https://github.com/withastro/astro/pull/16047) [`711f837`](https://github.com/withastro/astro/commit/711f837cfa3374a458f1f91e08bc388e7c0e12e6) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes catch-all routes incorrectly intercepting requests for static assets when using the `@astrojs/node` adapter in middleware mode. - [#&#8203;15981](https://github.com/withastro/astro/pull/15981) [`a60cbb6`](https://github.com/withastro/astro/commit/a60cbb6963d55aa272281edfeecf7251d987b0fb) Thanks [@&#8203;moktamd](https://github.com/moktamd)! - Fix Zod v4 validation error formatting to show human-readable messages instead of raw JSON ### [`v6.1.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#6110) [Compare Source](https://github.com/withastro/astro/compare/astro@6.1.0...astro@6.1.1) ##### Patch Changes - [#&#8203;16479](https://github.com/withastro/astro/pull/16479) [`1058428`](https://github.com/withastro/astro/commit/1058428df2d13878c6130787636dd1778273a934) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a spurious `[WARN] [content] Content config not loaded` warning during `astro dev` for projects that don't use content collections - [#&#8203;16457](https://github.com/withastro/astro/pull/16457) [`3d82220`](https://github.com/withastro/astro/commit/3d82220a1549e699e34ed433f3846a919f4c02bd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens server island encryption to prevent encrypted data from one island component being replayed against a different one - [#&#8203;16481](https://github.com/withastro/astro/pull/16481) [`152700e`](https://github.com/withastro/astro/commit/152700e08178285b240d8ef947cccd47b870ee5f) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a spurious 404 request for a dev toolbar sourcemap during `astro dev` caused by the browser mis-resolving a relative `sourceMappingURL` from the `/@id/` URL prefix - [#&#8203;16480](https://github.com/withastro/astro/pull/16480) [`1bcb43b`](https://github.com/withastro/astro/commit/1bcb43bf04f3fa8f4623897ae2a937250f35216a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an unnecessary full page reload on first navigation during dev ### [`v6.1.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#610) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.8...astro@6.1.0) ##### Minor Changes - [#&#8203;15804](https://github.com/withastro/astro/pull/15804) [`a5e7232`](https://github.com/withastro/astro/commit/a5e723217f30020ae82ca67190794150e9e94e15) Thanks [@&#8203;merlinnot](https://github.com/merlinnot)! - Allows setting codec-specific defaults for Astro's built-in Sharp image service via `image.service.config`. You can now configure encoder-level options such as `jpeg.mozjpeg`, `webp.effort`, `webp.alphaQuality`, `avif.effort`, `avif.chromaSubsampling`, and `png.compressionLevel` when using `astro/assets/services/sharp` for compile-time image generation. These settings apply as defaults for the built-in Sharp pipeline, while per-image `quality` still takes precedence when set on `<Image />`, `<Picture />`, or `getImage()`. - [#&#8203;15455](https://github.com/withastro/astro/pull/15455) [`babf57f`](https://github.com/withastro/astro/commit/babf57f83f47d4cd1fa73a55863718b71c8eebf0) Thanks [@&#8203;AhmadYasser1](https://github.com/AhmadYasser1)! - Adds `fallbackRoutes` to the `IntegrationResolvedRoute` type, exposing i18n fallback routes to integrations via the `astro:routes:resolved` hook for projects using `fallbackType: 'rewrite'`. This allows integrations such as the sitemap integration to properly include generated fallback routes in their output. ```js { 'astro:routes:resolved': ({ routes }) => { for (const route of routes) { for (const fallback of route.fallbackRoutes) { console.log(fallback.pathname) // e.g. /fr/about/ } } } } ``` - [#&#8203;15340](https://github.com/withastro/astro/pull/15340) [`10a1a5a`](https://github.com/withastro/astro/commit/10a1a5a5232fa401ca814b396cf79aeccdfdf8a9) Thanks [@&#8203;trueberryless](https://github.com/trueberryless)! - Adds support for advanced configuration of SmartyPants in Markdown. You can now pass an options object to `markdown.smartypants` in your Astro configuration to fine-tune how punctuation, dashes, and quotes are transformed. This is helpful for projects that require specific typographic standards, such as "oldschool" dash handling or localized quotation marks. ```js // astro.config.mjs export default defineConfig({ markdown: { smartypants: { backticks: 'all', dashes: 'oldschool', ellipses: 'unspaced', openingQuotes: { double: '«', single: '‹' }, closingQuotes: { double: '»', single: '›' }, quotes: false, }, }, }); ``` See [the `retext-smartypants` options](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields) for more information. ##### Patch Changes - [#&#8203;16025](https://github.com/withastro/astro/pull/16025) [`a09f319`](https://github.com/withastro/astro/commit/a09f3194f6ddf04874be424c28db03caf33d2c75) Thanks [@&#8203;koji-1009](https://github.com/koji-1009)! - Instructs the client router to skip view transition animations when the browser is already providing its own visual transition, such as a swipe gesture. - [#&#8203;16055](https://github.com/withastro/astro/pull/16055) [`ccecb8f`](https://github.com/withastro/astro/commit/ccecb8fc057cada9b0e70924d364181391c647e4) Thanks [@&#8203;Gautam-Bharadwaj](https://github.com/Gautam-Bharadwaj)! - Fixes an issue where `client:only` components could have duplicate `client:component-path` attributes added in MDX in rare cases - [#&#8203;16081](https://github.com/withastro/astro/pull/16081) [`44fc340`](https://github.com/withastro/astro/commit/44fc34015d702824c55b031c7b800165f7ba807d) Thanks [@&#8203;crazylogic03](https://github.com/crazylogic03)! - Fixes the `emitFile() is not supported in serve mode` warning that appears during `astro dev` when using integrations that inject before-hydration scripts (e.g. `@astrojs/react`) - [#&#8203;16068](https://github.com/withastro/astro/pull/16068) [`31d733b`](https://github.com/withastro/astro/commit/31d733b00a7efe5b29bdadab21daf8b3eea6ae55) Thanks [@&#8203;Karthikeya1500](https://github.com/Karthikeya1500)! - Fixes the dev toolbar a11y audit incorrectly classifying `menuitemradio` as a non-interactive ARIA role. - [#&#8203;16080](https://github.com/withastro/astro/pull/16080) [`e80ac73`](https://github.com/withastro/astro/commit/e80ac73e4433d1ac0518af731f2af00f8aaa46ad) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `experimental.queuedRendering` incorrectly escaping the HTML output of `.html` page files, causing the page content to render as plain text instead of HTML in the browser. - [#&#8203;16048](https://github.com/withastro/astro/pull/16048) [`13b9d56`](https://github.com/withastro/astro/commit/13b9d5685d0e1b34b793d0a00d64e3f8310f9f17) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a dev server crash (`serverIslandNameMap.get is not a function`) that occurred when navigating to a page with `server:defer` after first visiting a page without one, when using `@astrojs/cloudflare` - [#&#8203;16093](https://github.com/withastro/astro/pull/16093) [`336e086`](https://github.com/withastro/astro/commit/336e086e084202d9c6f218226a3133bb1e10f0ba) Thanks [@&#8203;Snugug](https://github.com/Snugug)! - Fixes Zod meta not correctly being rendered on top-level schema when converted into JSON Schema - [#&#8203;16043](https://github.com/withastro/astro/pull/16043) [`d402485`](https://github.com/withastro/astro/commit/d402485b4b196630e891d7fd21683d9b1e1c1ab8) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `checkOrigin` CSRF protection in `astro dev` behind a TLS-terminating reverse proxy. The dev server now reads `X-Forwarded-Proto` (gated on `security.allowedDomains`, matching production behaviour) so the constructed request origin matches the `https://` origin the browser sends. Also ensures `security.allowedDomains` and `security.checkOrigin` are respected in dev. - [#&#8203;16064](https://github.com/withastro/astro/pull/16064) [`ba58e0d`](https://github.com/withastro/astro/commit/ba58e0d6edbc3f8a651ab0c20df9b1f33572bd7b) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Updates the dependency `svgo` to the latest, to fix a security issue. - [#&#8203;16007](https://github.com/withastro/astro/pull/16007) [`2dcd8d5`](https://github.com/withastro/astro/commit/2dcd8d54c6fb00183228d757bf684e67c79029d8) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where fonts files would unecessarily be copied several times during the build - [#&#8203;16017](https://github.com/withastro/astro/pull/16017) [`b089b90`](https://github.com/withastro/astro/commit/b089b904f1ed578e9edaefd129bf9843120a808f) Thanks [@&#8203;felmonon](https://github.com/felmonon)! - Fix the `astro sync` error message when `getImage()` is called while loading content collections. - [#&#8203;16014](https://github.com/withastro/astro/pull/16014) [`fa73fbb`](https://github.com/withastro/astro/commit/fa73fbbac25c96eeadb766666ea3b2aded440bab) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a build error where using `astro:config/client` inside a `<script>` tag would cause Rollup to fail with "failed to resolve import `virtual:astro:routes` from `virtual:astro:manifest`" - [#&#8203;16054](https://github.com/withastro/astro/pull/16054) [`f74465a`](https://github.com/withastro/astro/commit/f74465aa406ddfbc9d458189bf7a2e67a227b33c) Thanks [@&#8203;seroperson](https://github.com/seroperson)! - Fixes an issue with the development server, where changes to the middleware weren't picked, and it required a full restart of the server. - [#&#8203;16033](https://github.com/withastro/astro/pull/16033) [`198d31b`](https://github.com/withastro/astro/commit/198d31b3a816c76b9119112589ae2bf8379346ad) Thanks [@&#8203;adampage](https://github.com/adampage)! - Fixes a bug where the the role `image` was incorrectly reported by audit tool bar. - [#&#8203;15935](https://github.com/withastro/astro/pull/15935) [`278828c`](https://github.com/withastro/astro/commit/278828cd35409f6db9dab766c7208fbab5f204c1) Thanks [@&#8203;oliverlynch](https://github.com/oliverlynch)! - Fixes cached assets failing to revalidate due to redirect check mishandling Not Modified responses. - [#&#8203;16075](https://github.com/withastro/astro/pull/16075) [`2c1ae85`](https://github.com/withastro/astro/commit/2c1ae859d915726d95d38ea08c4c141eeda2cd3f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where invalid URLs would be generated in development when using font families with an oblique `style` and angles - [#&#8203;16062](https://github.com/withastro/astro/pull/16062) [`87fd6a4`](https://github.com/withastro/astro/commit/87fd6a4fcb075efa10a518aa8b92a11dd3284964) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Warns on dev server startup when Vite 8 is detected at the top level of the user's project, and automatically adds a `"overrides": { "vite": "^7" }` entry to `package.json` when running `astro add cloudflare`. This prevents a `require_dist is not a function` crash caused by a Vite version split between Astro (requires Vite 7) and packages like `@tailwindcss/vite` that hoist Vite 8. - Updated dependencies \[[`10a1a5a`](https://github.com/withastro/astro/commit/10a1a5a5232fa401ca814b396cf79aeccdfdf8a9)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.1.0 ### [`v6.0.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#608) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.7...astro@6.0.8) ##### Patch Changes - [#&#8203;15978](https://github.com/withastro/astro/pull/15978) [`6d182fe`](https://github.com/withastro/astro/commit/6d182fe267586e2ee57113ad559912a456019306) Thanks [@&#8203;seroperson](https://github.com/seroperson)! - Fixes a bug where Astro Actions didn't properly support nested object properties, causing problems when users used zod functions such as `superRefine` or `discriminatedUnion`. - [#&#8203;16011](https://github.com/withastro/astro/pull/16011) [`e752170`](https://github.com/withastro/astro/commit/e752170b64f436ccb4acef9612951c50927afa0c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a dev server hang on the first request when using the Cloudflare adapter - [#&#8203;15997](https://github.com/withastro/astro/pull/15997) [`1fddff7`](https://github.com/withastro/astro/commit/1fddff7ae6510812f04e62c77eea9de6fbc76f57) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `Astro.rewrite()` failing when the target path contains duplicate slashes (e.g. `//about`). The duplicate slashes are now collapsed before URL parsing, preventing them from being interpreted as a protocol-relative URL. ### [`v6.0.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#607) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.6...astro@6.0.7) ##### Patch Changes - [#&#8203;15950](https://github.com/withastro/astro/pull/15950) [`acce5e8`](https://github.com/withastro/astro/commit/acce5e84046f1f459a8f37686cf6054e2243f5ad) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a build regression in projects with multiple frontend integrations where `server:defer` server islands could fail at runtime when all pages are prerendered. - [#&#8203;15988](https://github.com/withastro/astro/pull/15988) [`c93b4a0`](https://github.com/withastro/astro/commit/c93b4a02fdf3b477d1668a8576f23d4526f25d87) Thanks [@&#8203;ossaidqadri](https://github.com/ossaidqadri)! - Fix styles from dynamically imported components not being injected on first dev server load. - [#&#8203;15968](https://github.com/withastro/astro/pull/15968) [`3e7a9d5`](https://github.com/withastro/astro/commit/3e7a9d5fe07ef17057ede6f6f443f47e11905701) Thanks [@&#8203;chasemccoy](https://github.com/chasemccoy)! - Fixes `renderMarkdown` in custom content loaders not resolving images in markdown content. Images referenced in markdown processed by `renderMarkdown` are now correctly optimized, matching the behavior of the built-in `glob()` loader. - [#&#8203;15990](https://github.com/withastro/astro/pull/15990) [`1e6017f`](https://github.com/withastro/astro/commit/1e6017ffdfa11ccb5f5de33a0b8b57096c76e675) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where `Astro.currentLocale` would always be the default locale instead of the actual one when using a dynamic route like `[locale].astro` or `[locale]/index.astro`. It now resolves to the correct locale from the URL. - [#&#8203;15990](https://github.com/withastro/astro/pull/15990) [`1e6017f`](https://github.com/withastro/astro/commit/1e6017ffdfa11ccb5f5de33a0b8b57096c76e675) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where visiting an invalid locale URL (e.g. `/asdf/`) would show the content of a dynamic `[locale]` page with a 404 status code, instead of showing your custom 404 page. Now, the correct 404 page is rendered when the locale in the URL doesn't match any configured locale. - [#&#8203;15960](https://github.com/withastro/astro/pull/15960) [`1d84020`](https://github.com/withastro/astro/commit/1d840201c63f2b0dae91f5b4894afe25fc5d23ad) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes Cloudflare dev server islands with `prerenderEnvironment: 'node'` by sharing the serialized manifest encryption key across dev environments and routing server island requests through the SSR runtime. - [#&#8203;15735](https://github.com/withastro/astro/pull/15735) [`9685e2d`](https://github.com/withastro/astro/commit/9685e2d5ef132ca113144c1714163511a93fd29e) Thanks [@&#8203;fa-sharp](https://github.com/fa-sharp)! - Fixes an EventEmitter memory leak when serving static pages from Node.js middleware. When using the middleware handler, requests that were being passed on to Express / Fastify (e.g. static files / pre-rendered pages / etc.) weren't cleaning up socket listeners before calling `next()`, causing a memory leak warning. This fix makes sure to run the cleanup before calling `next()`. ### [`v6.0.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#606) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.5...astro@6.0.6) ##### Patch Changes - [#&#8203;15965](https://github.com/withastro/astro/pull/15965) [`2dca307`](https://github.com/withastro/astro/commit/2dca3074ed3de24bd23d0a17fd10a168660b2ac1) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes client hydration for components imported through Node.js subpath imports (`package.json#imports`, e.g. `#components/*`), for example when using the Cloudflare adapter in development. - [#&#8203;15770](https://github.com/withastro/astro/pull/15770) [`6102ca2`](https://github.com/withastro/astro/commit/6102ca2c16d5bf0ea621764351a33a99455fa0a0) Thanks [@&#8203;jpc-ae](https://github.com/jpc-ae)! - Updates the `create astro` welcome message to highlight the graceful dev/preview server quit command rather than the kill process shortcut - [#&#8203;15953](https://github.com/withastro/astro/pull/15953) [`7eddf22`](https://github.com/withastro/astro/commit/7eddf22cd4d4719d966ed7168e9890fac8fc29f5) Thanks [@&#8203;Desel72](https://github.com/Desel72)! - fix(hmr): eagerly recompile on style-only change to prevent stale slots render - [#&#8203;15916](https://github.com/withastro/astro/pull/15916) [`5201ed4`](https://github.com/withastro/astro/commit/5201ed464258e799a1e898f4c4adc84d7445bad3) Thanks [@&#8203;trueberryless](https://github.com/trueberryless)! - Fixes `InferLoaderSchema` type inference for content collections defined with a loader that includes a `schema` - [#&#8203;15864](https://github.com/withastro/astro/pull/15864) [`d3c7de9`](https://github.com/withastro/astro/commit/d3c7de9253e9cb31fa5c4bf9f4bdf59dd1ada7b0) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default - [#&#8203;15944](https://github.com/withastro/astro/pull/15944) [`a5e1acd`](https://github.com/withastro/astro/commit/a5e1acdebef4e061341eca24128667a3009a7048) Thanks [@&#8203;fkatsuhiro](https://github.com/fkatsuhiro)! - Fixes SSR dynamic routes with `.html` extension (e.g. `[slug].html.astro`) not working - [#&#8203;15937](https://github.com/withastro/astro/pull/15937) [`d236245`](https://github.com/withastro/astro/commit/d236245faf676082df6756654e504ad69e2e4d28) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where HMR didn't correctly work on Windows when adding/changing/deleting routes in `pages/`. - [#&#8203;15931](https://github.com/withastro/astro/pull/15931) [`98dfb61`](https://github.com/withastro/astro/commit/98dfb61f963d70961dc2b28d786a6280f52603a1) Thanks [@&#8203;Strernd](https://github.com/Strernd)! - Fix skew protection query params not being applied to island hydration `component-url` and `renderer-url`, and ensure query params are appended safely for asset URLs with existing search/hash parts. - Updated dependencies \[]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.0.1 ### [`v6.0.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#605) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.4...astro@6.0.5) ##### Patch Changes - [#&#8203;15891](https://github.com/withastro/astro/pull/15891) [`b889231`](https://github.com/withastro/astro/commit/b88923114e3cfe30c945680a62c7bd7f667bbf4d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix dev routing for `server:defer` islands when adapters opt into handling prerendered routes in Astro core. Server island requests are now treated as prerender-handler eligible so prerendered pages using `prerenderEnvironment: 'node'` can load island content without `400` errors. - [#&#8203;15890](https://github.com/withastro/astro/pull/15890) [`765a887`](https://github.com/withastro/astro/commit/765a8871ed5fb30bb0211e2f8524bd97081acbca) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro:actions` validation to check resolved routes, so projects using default static output with at least one `prerender = false` page or endpoint no longer fail during startup. - [#&#8203;15884](https://github.com/withastro/astro/pull/15884) [`dcd2c8e`](https://github.com/withastro/astro/commit/dcd2c8e2df88ad81a027b49f6f9dcdba614f836a) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Avoid a `MaxListenersExceededWarning` during `astro dev` startup by increasing the shared Vite watcher listener limit when attaching content server listeners. - [#&#8203;15904](https://github.com/withastro/astro/pull/15904) [`23d5244`](https://github.com/withastro/astro/commit/23d5244361f9452c1d124600d2cc97aa3fe4a63c) Thanks [@&#8203;jlukic](https://github.com/jlukic)! - Emit the `before-hydration` script chunk for the `client` Vite environment. The chunk was only emitted for `prerender` and `ssr` environments, causing a 404 when browsers tried to load it. This broke hydration for any integration using `injectScript('before-hydration', ...)`, including Lit SSR. - [#&#8203;15933](https://github.com/withastro/astro/pull/15933) [`325901e`](https://github.com/withastro/astro/commit/325901e623462babd8d07ba7527e141e08ef1901) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where `<style>` tags inside SVG components weren't correctly tracked when enabling CSP. - [#&#8203;15875](https://github.com/withastro/astro/pull/15875) [`c43ef8a`](https://github.com/withastro/astro/commit/c43ef8a565564770f022bd7cf9d2fcccf5949308) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Ensure custom prerenderers are always torn down during build, even when `getStaticPaths()` throws. - [#&#8203;15887](https://github.com/withastro/astro/pull/15887) [`1861fed`](https://github.com/withastro/astro/commit/1861fedef36394ff89604125b785aca073c0d35d) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the build incorrectly leaked server entrypoint into the client environment, causing adapters to emit warnings during the build. - [#&#8203;15888](https://github.com/withastro/astro/pull/15888) [`925252e`](https://github.com/withastro/astro/commit/925252e8c361a169d1f4dc1e3677b96b9e815dea) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix a bug where `server:defer` could fail at runtime in prerendered pages for some adapters (including Cloudflare), causing errors like `serverIslandMap?.get is not a function`. - [#&#8203;15901](https://github.com/withastro/astro/pull/15901) [`07c1002`](https://github.com/withastro/astro/commit/07c1002835f9bd91c9acaa82515254e4e11094d4) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes JSON schema generation for content collection schemas that have differences between their input and output shapes. - [#&#8203;15882](https://github.com/withastro/astro/pull/15882) [`759f946`](https://github.com/withastro/astro/commit/759f9461bf8818380e3cc83a9bc1844c82a52c6d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix `Astro.url.pathname` for the root page when using `build.format: "file"` so it resolves to `/index.html` instead of `/.html` during builds. ### [`v6.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#604) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.3...astro@6.0.4) ##### Patch Changes - [#&#8203;15870](https://github.com/withastro/astro/pull/15870) [`920f10b`](https://github.com/withastro/astro/commit/920f10bb3a49da8355967df99c32c43cc9f53b46) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Prebundle `astro/toolbar` in dev when custom dev toolbar apps are registered, preventing re-optimization reloads that can hide or break the toolbar. - [#&#8203;15876](https://github.com/withastro/astro/pull/15876) [`f47ac53`](https://github.com/withastro/astro/commit/f47ac5352dcb36daa64ec12b7d4ac193045d10e3) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `redirectToDefaultLocale` producing a protocol-relative URL (`//locale`) instead of an absolute path (`/locale`) when `base` is `'/'`. - [#&#8203;15767](https://github.com/withastro/astro/pull/15767) [`e0042f7`](https://github.com/withastro/astro/commit/e0042f720274d8763907c1d429723192a71d6932) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes server islands (`server:defer`) not working when only used in prerendered pages with `output: 'server'`. - [#&#8203;15873](https://github.com/withastro/astro/pull/15873) [`35841ed`](https://github.com/withastro/astro/commit/35841ed273581a567cd726bb2d14d2ed3886bed0) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix a dev server bug where newly created pages could miss layout-imported CSS until restart. - [#&#8203;15874](https://github.com/withastro/astro/pull/15874) [`ce0669d`](https://github.com/withastro/astro/commit/ce0669d68115c5e2d00238f3e780a2af50f5be11) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a warning when using `prefetchAll` - [#&#8203;15754](https://github.com/withastro/astro/pull/15754) [`58f1d63`](https://github.com/withastro/astro/commit/58f1d63cbcdd351d80cc65ceff4cb1a8d1aa1853) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes a bug where a directory at the project root sharing the same name as a page route would cause the dev server to return a 404 instead of serving the page. - [#&#8203;15869](https://github.com/withastro/astro/pull/15869) [`76b3a5e`](https://github.com/withastro/astro/commit/76b3a5e4bb1e9f2855d4169602295d601d7e7436) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Update the unknown file extension error hint to recommend `vite.resolve.noExternal`, which is the correct Vite 7 config key. ### [`v6.0.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#603) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.2...astro@6.0.3) ##### Patch Changes - [#&#8203;15711](https://github.com/withastro/astro/pull/15711) [`b2bd27b`](https://github.com/withastro/astro/commit/b2bd27bcb605d1e44e94ab922a8d7d2aa685149d) Thanks [@&#8203;OliverSpeir](https://github.com/OliverSpeir)! - Improves Astro core's dev environment handling for prerendered routes by ensuring route/CSS updates and prerender middleware behavior work correctly across both SSR and prerender environments. This enables integrations that use Astro's prerender dev environment (such as Cloudflare with `prerenderEnvironment: 'node'`) to get consistent route matching and HMR behavior during development. - [#&#8203;15852](https://github.com/withastro/astro/pull/15852) [`1cdaf9f`](https://github.com/withastro/astro/commit/1cdaf9f488e4db158db2c80ce192890b0b9bfa00) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a regression where the the routes emitted by the `astro:build:done` hook didn't have the `distURL` array correctly populated. - [#&#8203;15765](https://github.com/withastro/astro/pull/15765) [`ca76ff1`](https://github.com/withastro/astro/commit/ca76ff1dedafdc764f551e753e0772b54f807fa1) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens server island POST endpoint validation to use own-property checks for improved consistency ### [`v6.0.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#602) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.1...astro@6.0.2) ##### Patch Changes - [#&#8203;15832](https://github.com/withastro/astro/pull/15832) [`95e12a2`](https://github.com/withastro/astro/commit/95e12a250ece206f55f8c0c07c9c05489f3df93f) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes `return;` syntax not working in the frontmatter correctly in certain contexts ### [`v6.0.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#601) [Compare Source](https://github.com/withastro/astro/compare/astro@6.0.0...astro@6.0.1) ##### Patch Changes - [#&#8203;15827](https://github.com/withastro/astro/pull/15827) [`a4c0d0b`](https://github.com/withastro/astro/commit/a4c0d0b4df540b23fa85bf926f9cc97470737fa1) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `astro add` so the tsconfig preview shows the actual pending changes before confirmation ### [`v6.0.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#600) [Compare Source](https://github.com/withastro/astro/compare/astro@5.18.2...astro@6.0.0) ##### Major Changes - [#&#8203;14446](https://github.com/withastro/astro/pull/14446) [`ece667a`](https://github.com/withastro/astro/commit/ece667a737a96c8bfea2702de7207bed0842b37c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes `entryPoints` on `astro:build:ssr` hook (Integration API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-entrypoints-on-astrobuildssr-hook-integration-api)) - [#&#8203;15535](https://github.com/withastro/astro/pull/15535) [`dfe2e22`](https://github.com/withastro/astro/commit/dfe2e22042f92172442ab32777b3cce90685b76a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `loadManifest()` and `loadApp()` from `astro/app/node` (Adapter API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-loadmanifest-and-loadapp-from-astroappnode-adapter-api)) - [#&#8203;15006](https://github.com/withastro/astro/pull/15006) [`f361730`](https://github.com/withastro/astro/commit/f361730bc820c01a2ec3e508ac940be8077d8c04) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes session `test` driver - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-session-test-driver)) - [#&#8203;15461](https://github.com/withastro/astro/pull/15461) [`9f21b24`](https://github.com/withastro/astro/commit/9f21b243d21478cdc5fb0193e05adad8e753839f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the v6 beta Adapter API only**: renames `entryType` to `entrypointResolution` and updates possible values Astro 6 introduced a way to let adapters have more control over the entrypoint by passing `entryType: 'self'` to `setAdapter()`. However during beta development, the name was unclear and confusing. `entryType` is now renamed to `entrypointResolution` and its possible values are updated: - `legacy-dynamic` becomes `explicit`. - `self` becomes `auto`. If you are building an adapter with v6 beta and specifying `entryType`, update it: ```diff setAdapter({ // ... - entryType: 'legacy-dynamic' + entrypointResolution: 'explicit' }) setAdapter({ // ... - entryType: 'self' + entrypointResolution: 'auto' }) ``` - [#&#8203;14426](https://github.com/withastro/astro/pull/14426) [`861b9cc`](https://github.com/withastro/astro/commit/861b9cc770a05d9fcfcb2f1f442a3ba41e94b510) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the deprecated `emitESMImage()` function - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-emitesmimage)) - [#&#8203;15006](https://github.com/withastro/astro/pull/15006) [`f361730`](https://github.com/withastro/astro/commit/f361730bc820c01a2ec3e508ac940be8077d8c04) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates session driver string signature - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-session-driver-string-signature)) - [#&#8203;15180](https://github.com/withastro/astro/pull/15180) [`8780ff2`](https://github.com/withastro/astro/commit/8780ff2926d59ed196c70032d2ae274b8415655c) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds support for converting SVGs to raster images (PNGs, WebP, etc) to the default Sharp image service - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-svg-rasterization)) - [#&#8203;14446](https://github.com/withastro/astro/pull/14446) [`ece667a`](https://github.com/withastro/astro/commit/ece667a737a96c8bfea2702de7207bed0842b37c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes `routes` on `astro:build:done` hook (Integration API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-routes-on-astrobuilddone-hook-integration-api)) - [#&#8203;15424](https://github.com/withastro/astro/pull/15424) [`33d6146`](https://github.com/withastro/astro/commit/33d6146e4872bb1e3feef0a6c0ea8e62f49f4c7e) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Throws an error when `getImage()` from `astro:assets` is called on the client - ([v6 upgrade guidance](https://v6.docs.astro.build/en/guides/upgrade-to/v6/#changed-getimage-throws-when-called-on-the-client)) - [#&#8203;14462](https://github.com/withastro/astro/pull/14462) [`9fdfd4c`](https://github.com/withastro/astro/commit/9fdfd4c620313827e65664632a9c9cb435ad07ca) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the old `app.render()` signature (Adapter API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-old-apprender-signature-adapter-api)) - [#&#8203;14956](https://github.com/withastro/astro/pull/14956) [`0ff51df`](https://github.com/withastro/astro/commit/0ff51dfa3c6c615af54228e159f324034472b1a2) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Astro v6.0 upgrades to Zod v4 for schema validation - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#zod-4)) - [#&#8203;14759](https://github.com/withastro/astro/pull/14759) [`d7889f7`](https://github.com/withastro/astro/commit/d7889f768a4d27e8c4ad3a0022099d19145a7d58) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates how schema types are inferred for content loaders with schemas (Loader API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-schema-types-are-inferred-instead-of-generated-content-loader-api)) - [#&#8203;15192](https://github.com/withastro/astro/pull/15192) [`ada2808`](https://github.com/withastro/astro/commit/ada2808a23fc70ea1f1663f3e1b69c6b735251e5) Thanks [@&#8203;gameroman](https://github.com/gameroman)! - Removes support for CommonJS config files - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-support-for-commonjs-config-files)) - [#&#8203;14462](https://github.com/withastro/astro/pull/14462) [`9fdfd4c`](https://github.com/withastro/astro/commit/9fdfd4c620313827e65664632a9c9cb435ad07ca) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes `prefetch()` `with` option - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-prefetch-with-option)) - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes support for routes with percent-encoded percent signs (e.g. `%25`) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-percent-encoding-in-routes)) - [#&#8203;14432](https://github.com/withastro/astro/pull/14432) [`b1d87ec`](https://github.com/withastro/astro/commit/b1d87ec3bc2fbe214437990e871df93909d18f62) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `Astro` in `getStaticPaths()` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-astro-in-getstaticpaths)) - [#&#8203;14759](https://github.com/withastro/astro/pull/14759) [`d7889f7`](https://github.com/withastro/astro/commit/d7889f768a4d27e8c4ad3a0022099d19145a7d58) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the option to define dynamic schemas in content loaders as functions and adds a new equivalent `createSchema()` property (Loader API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-schema-function-signature-content-loader-api)) - [#&#8203;14457](https://github.com/withastro/astro/pull/14457) [`049da87`](https://github.com/withastro/astro/commit/049da87cb7ce1828f3025062ce079dbf132f5b86) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates trailing slash behavior of endpoint URLs - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-endpoints-with-a-file-extension-cannot-be-accessed-with-a-trailing-slash)) - [#&#8203;14494](https://github.com/withastro/astro/pull/14494) [`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates Markdown heading ID generation - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-markdown-heading-id-generation)) - [#&#8203;14461](https://github.com/withastro/astro/pull/14461) [`55a1a91`](https://github.com/withastro/astro/commit/55a1a911aa4e0d38191f8cb9464ffd58f3eb7608) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `import.meta.env.ASSETS_PREFIX` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-importmetaenvassets_prefix)) - [#&#8203;14586](https://github.com/withastro/astro/pull/14586) [`669ca5b`](https://github.com/withastro/astro/commit/669ca5b0199d9933f54c76448de9ec5a9f13c430) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Changes the values allowed in `params` returned by `getStaticPaths()` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-getstaticpaths-cannot-return-params-of-type-number)) - [#&#8203;15668](https://github.com/withastro/astro/pull/15668) [`1118ac4`](https://github.com/withastro/astro/commit/1118ac4f299341e15061e8a4e6e8423071c4d41c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Changes TypeScript configuration - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-typescript-configuration)) - [#&#8203;14421](https://github.com/withastro/astro/pull/14421) [`df6d2d7`](https://github.com/withastro/astro/commit/df6d2d7bbcaf6b6a327a37a6437d4adade6e2485) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the previously deprecated `Astro.glob()` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-astroglob)) - [#&#8203;15049](https://github.com/withastro/astro/pull/15049) [`beddfeb`](https://github.com/withastro/astro/commit/beddfeb31e807cb472a43fa56c69f85dbadc9604) Thanks [@&#8203;Ntale3](https://github.com/Ntale3)! - Removes the ability to render Astro components in Vitest client environments - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-astro-components-cannot-be-rendered-in-vitest-client-environments-container-api)) - [#&#8203;15461](https://github.com/withastro/astro/pull/15461) [`9f21b24`](https://github.com/withastro/astro/commit/9f21b243d21478cdc5fb0193e05adad8e753839f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `createExports()` and `start()` (Adapter API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-createexports-and-start-adapter-api)) - [#&#8203;15535](https://github.com/withastro/astro/pull/15535) [`dfe2e22`](https://github.com/withastro/astro/commit/dfe2e22042f92172442ab32777b3cce90685b76a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `NodeApp` from `astro/app/node` (Adapter API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-nodeapp-from-astroappnode-adapter-api)) - [#&#8203;14462](https://github.com/withastro/astro/pull/14462) [`9fdfd4c`](https://github.com/withastro/astro/commit/9fdfd4c620313827e65664632a9c9cb435ad07ca) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `handleForms` prop for the `<ClientRouter />` component - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-handleforms-prop-for-the-clientrouter--component)) - [#&#8203;14427](https://github.com/withastro/astro/pull/14427) [`e131261`](https://github.com/withastro/astro/commit/e1312615b39c59ebc05d5bb905ee0960b50ad3cf) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Increases minimum Node.js version to 22.12.0 - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#node-22)) - [#&#8203;15332](https://github.com/withastro/astro/pull/15332) [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds frontmatter parsing support to `renderMarkdown` in content loaders. When markdown content includes frontmatter, it is now extracted and available in `metadata.frontmatter`, and excluded from the HTML output. This makes `renderMarkdown` behave consistently with the `glob` loader. ```js const loader = { name: 'my-loader', load: async ({ store, renderMarkdown }) => { const content = `--- title: My Post --- # Hello World `; const rendered = await renderMarkdown(content); // rendered.metadata.frontmatter is now { title: 'My Post' } // rendered.html contains only the content, not the frontmatter }, }; ``` - [#&#8203;14400](https://github.com/withastro/astro/pull/14400) [`c69c7de`](https://github.com/withastro/astro/commit/c69c7de1ffeff29f919d97c262f245927556f875) Thanks [@&#8203;ellielok](https://github.com/ellielok)! - Removes the deprecated `<ViewTransitions />` component - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-viewtransitions--component)) - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes `RouteData.generate` from the Integration API - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-routedatagenerate-adapter-api)) - [#&#8203;14406](https://github.com/withastro/astro/pull/14406) [`4f11510`](https://github.com/withastro/astro/commit/4f11510c9ed932f5cb6d1075b1172909dd5db23e) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Changes the default routing configuration value of `i18n.routing.redirectToDefaultLocale` from `true` to `false` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-i18nroutingredirecttodefaultlocale-default-value)) - [#&#8203;14989](https://github.com/withastro/astro/pull/14989) [`73e8232`](https://github.com/withastro/astro/commit/73e823201cc5bdd6ccab14c07ff0dca5117436ad) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates exposed `astro:transitions` internals - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-exposed-astrotransitions-internals)) - [#&#8203;15726](https://github.com/withastro/astro/pull/15726) [`6f19ecc`](https://github.com/withastro/astro/commit/6f19ecc35adfb2ddaabbba2269630f95c13f5a57) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates dependency `shiki` to v4 Check [Shiki's upgrade guide](https://shiki.style/blog/v4). - [#&#8203;14758](https://github.com/withastro/astro/pull/14758) [`010f773`](https://github.com/withastro/astro/commit/010f7731becbaaba347da21ef07b8a410e31442a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `setManifestData` method from `App` and `NodeApp` (Adapter API) - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-appsetmanifestdata-adapter-api)) - [#&#8203;14477](https://github.com/withastro/astro/pull/14477) [`25fe093`](https://github.com/withastro/astro/commit/25fe09396dbcda2e1008c01a982f4eb2d1f33ae6) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes `rewrite()` from Actions context - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-rewrite-from-actions-context)) - [#&#8203;14826](https://github.com/withastro/astro/pull/14826) [`170f64e`](https://github.com/withastro/astro/commit/170f64e977290b8f9d316b5f283bd03bae33ddde) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `experimental.failOnPrerenderConflict` flag and replaces it with a new configuration option `prerenderConflictBehavior` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#experimental-flags)) - [#&#8203;14923](https://github.com/withastro/astro/pull/14923) [`95a1969`](https://github.com/withastro/astro/commit/95a1969a05cc9c15f16dcf2177532882bb392581) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Deprecates `astro:schema` and `z` from `astro:content` in favor of `astro/zod` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#deprecated-astroschema-and-z-from-astrocontent)) - [#&#8203;14844](https://github.com/withastro/astro/pull/14844) [`8d43b1d`](https://github.com/withastro/astro/commit/8d43b1d678eed5be85f99b939d55346824c03cb5) Thanks [@&#8203;trueberryless](https://github.com/trueberryless)! - Removes exposed `astro:actions` internals - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-exposed-astroactions-internals)) - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Changes the shape of `SSRManifest` properties and adds several new required properties in the Adapter API - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-ssrmanifest-interface-structure-adapter-api)) - [#&#8203;15266](https://github.com/withastro/astro/pull/15266) [`f7c9365`](https://github.com/withastro/astro/commit/f7c9365d92b2196d4ba6cffd01b01967ca73728c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Allows `Astro.csp` and `context.csp` to be undefined instead of throwing errors when `csp: true` is not configured When using the experimental Content Security Policy feature in Astro 5.x, `context.csp` was always defined but would throw if `experimental.csp` was not enabled in the Astro config. For the stable version of this API in Astro 6, `context.csp` can now be undefined if CSP is not enabled and its methods will never throw. ##### What should I do? If you were using experimental CSP runtime utilities, you must now access methods conditionally: ```diff -Astro.csp.insertDirective("default-src 'self'"); +Astro.csp?.insertDirective("default-src 'self'"); ``` - [#&#8203;14445](https://github.com/withastro/astro/pull/14445) [`ecb0b98`](https://github.com/withastro/astro/commit/ecb0b98396f639d830a99ddb5895ab9223e4dc87) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#vite-70)) - [#&#8203;15407](https://github.com/withastro/astro/pull/15407) [`aedbbd8`](https://github.com/withastro/astro/commit/aedbbd818628bed0533cdd627b73e2c5365aa17e) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Changes how styles of responsive images are emitted - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-how-responsive-image-styles-are-emitted)) - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Changes integration hooks and HMR access patterns in the Integration API - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-integration-hooks-and-hmr-access-patterns-integration-api)) - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes the unused `astro:ssr-manifest` virtual module - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-astrossr-manifest-virtual-module-integration-api)) - [#&#8203;14485](https://github.com/withastro/astro/pull/14485) [`6f67c6e`](https://github.com/withastro/astro/commit/6f67c6eef2647ef1a1eab78a65a906ab633974bb) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates `import.meta.env` values to always be inlined - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-importmetaenv-values-are-always-inlined)) - [#&#8203;14480](https://github.com/withastro/astro/pull/14480) [`36a461b`](https://github.com/withastro/astro/commit/36a461bf3f64c467bc52aecf511cd831d238e18b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates `<script>` and `<style>` tags to render in the order they are defined - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#changed-script-and-style-tags-are-rendered-in-the-order-they-are-defined)) - [#&#8203;14407](https://github.com/withastro/astro/pull/14407) [`3bda3ce`](https://github.com/withastro/astro/commit/3bda3ce4edcb1bd1349890c6ed8110f05954c791) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Removes legacy content collection support - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#removed-legacy-content-collections)) ##### Minor Changes - [#&#8203;14306](https://github.com/withastro/astro/pull/14306) [`141c4a2`](https://github.com/withastro/astro/commit/141c4a26419fe5bb4341953ea5a0a861d9b398c0) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds new optional properties to `setAdapter()` for adapter entrypoint handling in the Adapter API **Changes:** - New optional properties: - `entryType?: 'self' | 'legacy-dynamic'` - determines if the adapter provides its own entrypoint (`'self'`) or if Astro constructs one (`'legacy-dynamic'`, default) **Migration:** Adapter authors can optionally add these properties to support custom dev entrypoints. If not specified, adapters will use the legacy behavior. - [#&#8203;15700](https://github.com/withastro/astro/pull/15700) [`4e7f3e8`](https://github.com/withastro/astro/commit/4e7f3e8e6849c314a0ab031ebd7f23fb982f0529) Thanks [@&#8203;ocavue](https://github.com/ocavue)! - Updates the internal logic during SSR by providing additional metadata for UI framework integrations. - [#&#8203;15231](https://github.com/withastro/astro/pull/15231) [`3928b87`](https://github.com/withastro/astro/commit/3928b879dd35fa4ec4dcf545f1610a0f0a55fdae) Thanks [@&#8203;rururux](https://github.com/rururux)! - Adds a new optional `getRemoteSize()` method to the Image Service API. Previously, `inferRemoteSize()` had a fixed implementation that fetched the entire image to determine its dimensions. With this new helper function that extends `inferRemoteSize()`, you can now override or extend how remote image metadata is retrieved. This enables use cases such as: - Caching: Storing image dimensions in a database or local cache to avoid redundant network requests. - Provider APIs: Using a specific image provider's API (like Cloudinary or Vercel) to get dimensions without downloading the file. For example, you can add a simple cache layer to your existing image service: ```js const cache = new Map(); const myService = { ...baseService, async getRemoteSize(url, imageConfig) { if (cache.has(url)) return cache.get(url); const result = await baseService.getRemoteSize(url, imageConfig); cache.set(url, result); return result; }, }; ``` See the [Image Services API reference documentation](https://docs.astro.build/en/reference/image-service-reference/#getremotesize) for more information. - [#&#8203;15077](https://github.com/withastro/astro/pull/15077) [`a164c77`](https://github.com/withastro/astro/commit/a164c77336059f2dc3e7f7fe992aa754ed145ef3) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Updates the Integration API to add `setPrerenderer()` to the `astro:build:start` hook, allowing adapters to provide custom prerendering logic. The new API accepts either an `AstroPrerenderer` object directly, or a factory function that receives the default prerenderer: ```js 'astro:build:start': ({ setPrerenderer }) => { setPrerenderer((defaultPrerenderer) => ({ name: 'my-prerenderer', async setup() { // Optional: called once before prerendering starts }, async getStaticPaths() { // Returns array of { pathname: string, route: RouteData } return defaultPrerenderer.getStaticPaths(); }, async render(request, { routeData }) { // request: Request // routeData: RouteData // Returns: Response }, async teardown() { // Optional: called after all pages are prerendered } })); } ``` Also adds the `astro:static-paths` virtual module, which exports a `StaticPaths` class for adapters to collect all prerenderable paths from within their target runtime. This is useful when implementing a custom prerenderer that runs in a non-Node environment: ```js // In your adapter's request handler (running in target runtime) import { App } from 'astro/app'; import { StaticPaths } from 'astro:static-paths'; export function createApp(manifest) { const app = new App(manifest); return { async fetch(request) { const { pathname } = new URL(request.url); // Expose endpoint for prerenderer to get static paths if (pathname === '/__astro_static_paths') { const staticPaths = new StaticPaths(app); const paths = await staticPaths.getAll(); return new Response(JSON.stringify({ paths })); } // Normal request handling return app.render(request); }, }; } ``` See the [adapter reference](https://docs.astro.build/en/reference/adapter-reference/#custom-prerenderer) for more details on implementing a custom prerenderer. - [#&#8203;15345](https://github.com/withastro/astro/pull/15345) [`840fbf9`](https://github.com/withastro/astro/commit/840fbf9e4abc7f847e23da8d67904ffde4d95fff) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a new `emitClientAsset` function to `astro/assets/utils` for integration authors. This function allows emitting assets that will be moved to the client directory during SSR builds, useful for assets referenced in server-rendered content that need to be available on the client. ```ts import { emitClientAsset } from 'astro/assets/utils'; // Inside a Vite plugin's transform or load hook const handle = emitClientAsset(this, { type: 'asset', name: 'my-image.png', source: imageBuffer, }); ``` - [#&#8203;15460](https://github.com/withastro/astro/pull/15460) [`ee7e53f`](https://github.com/withastro/astro/commit/ee7e53f9de2338517e149895efd26fca44ad80b6) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates the Adapter API to allow providing a `serverEntrypoint` when using `entryType: 'self'` Astro 6 introduced a new powerful yet simple Adapter API for defining custom server entrypoints. You can now call `setAdapter()` with the `entryType: 'self'` option and specify your custom `serverEntrypoint`: ```js export function myAdapter() { return { name: 'my-adapter', hooks: { 'astro:config:done': ({ setAdapter }) => { setAdapter({ name: 'my-adapter', entryType: 'self', serverEntrypoint: 'my-adapter/server.js', supportedAstroFeatures: { // ... }, }); }, }, }; } ``` If you need further customization at the Vite level, you can omit `serverEntrypoint` and instead specify your custom server entrypoint with [`vite.build.rollupOptions.input`](https://rollupjs.org/configuration-options/#input). - [#&#8203;15781](https://github.com/withastro/astro/pull/15781) [`2de969d`](https://github.com/withastro/astro/commit/2de969d1f5279d2d0f3024208146f9cd895267b6) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds a new `clientAddress` option to the `createContext()` function Providing this value gives adapter and middleware authors explicit control over the client IP address. When not provided, accessing `clientAddress` throws an error consistent with other contexts where it is not set by the adapter. Additionally, both of the official Netlify and Vercel adapters have been updated to provide this information in their edge middleware. ```js import { createContext } from 'astro/middleware'; createContext({ clientAddress: context.headers.get('x-real-ip'), }); ``` - [#&#8203;15258](https://github.com/withastro/astro/pull/15258) [`d339a18`](https://github.com/withastro/astro/commit/d339a182b387a7a1b0d5dd0d67a0638aaa2b4262) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Stabilizes the adapter feature `experimentalStatiHeaders`. If you were using this feature in any of the supported adapters, you'll need to change the name of the flag: ```diff export default defineConfig({ adapter: netlify({ - experimentalStaticHeaders: true + staticHeaders: true }) }) ``` - [#&#8203;15535](https://github.com/withastro/astro/pull/15535) [`dfe2e22`](https://github.com/withastro/astro/commit/dfe2e22042f92172442ab32777b3cce90685b76a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Exports new `createRequest()` and `writeResponse()` utilities from `astro/app/node` To replace the deprecated `NodeApp.createRequest()` and `NodeApp.writeResponse()` methods, the `astro/app/node` module now exposes new `createRequest()` and `writeResponse()` utilities. These can be used to convert a NodeJS `IncomingMessage` into a web-standard `Request` and stream a web-standard `Response` into a NodeJS `ServerResponse`: ```js import { createApp } from 'astro/app/entrypoint'; import { createRequest, writeResponse } from 'astro/app/node'; import { createServer } from 'node:http'; const app = createApp(); const server = createServer(async (req, res) => { const request = createRequest(req); const response = await app.render(request); await writeResponse(response, res); }); ``` - [#&#8203;15755](https://github.com/withastro/astro/pull/15755) [`f9ee868`](https://github.com/withastro/astro/commit/f9ee8685dd26e9afeba3b48d41ad6714f624b12f) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a new `security.serverIslandBodySizeLimit` configuration option Server island POST endpoints now enforce a body size limit, similar to the existing `security.actionBodySizeLimit` for Actions. The new option defaults to `1048576` (1 MB) and can be configured independently. Requests exceeding the limit are rejected with a 413 response. You can customize the limit in your Astro config: ```js export default defineConfig({ security: { serverIslandBodySizeLimit: 2097152, // 2 MB }, }); ``` - [#&#8203;15529](https://github.com/withastro/astro/pull/15529) [`a509941`](https://github.com/withastro/astro/commit/a509941a7a7a1e53f402757234bb88e5503e5119) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new build-in font provider `npm` to access fonts installed as NPM packages You can now add web fonts specified in your `package.json` through Astro's type-safe Fonts API. The `npm` font provider allows you to add fonts either from locally installed packages in `node_modules` or from a CDN. Set `fontProviders.npm()` as your fonts provider along with the required `name` and `cssVariable` values, and add `options` as needed: ```js import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ experimental: { fonts: [ { name: 'Roboto', provider: fontProviders.npm(), cssVariable: '--font-roboto', }, ], }, }); ``` See the [NPM font provider reference documentation](https://docs.astro.build/en/reference/font-provider-reference/#npm) for more details. - [#&#8203;15471](https://github.com/withastro/astro/pull/15471) [`32b4302`](https://github.com/withastro/astro/commit/32b430213bbe51898b77ec2eadbacb9dfb220f75) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds a new experimental flag `queuedRendering` to enable a queue-based rendering engine The new engine is based on a two-pass process, where the first pass traverses the tree of components, emits an ordered queue, and then the queue is rendered. The new engine does not use recursion, and comes with two customizable options. Early benchmarks showed significant speed improvements and memory efficiency in big projects. ##### Queue-rendered based The new engine can be enabled in your Astro config with `experimental.queuedRendering.enabled` set to `true`, and can be further customized with additional sub-features. ```js // astro.config.mjs export default defineConfig({ experimental: { queuedRendering: { enabled: true, }, }, }); ``` ##### Pooling With the new engine enabled, you now have the option to have a pool of nodes that can be saved and reused across page rendering. Node pooling has no effect when rendering pages on demand (SSR) because these rendering requests don't share memory. However, it can be very useful for performance when building static pages. ```js // astro.config.mjs export default defineConfig({ experimental: { queuedRendering: { enabled: true, poolSize: 2000, // store up to 2k nodes to be reused across renderers }, }, }); ``` ##### Content caching The new engine additionally unlocks a new `contentCache` option. This allows you to cache values of nodes during the rendering phase. This is currently a boolean feature with no further customization (e.g. size of cache) that uses sensible defaults for most large content collections: When disabled, the pool engine won't cache strings, but only types. ```js // astro.config.mjs export default defineConfig({ experimental: { queuedRendering: { enabled: true, contentCache: true, // enable re-use of node values }, }, }); ``` For more information on enabling and using this feature in your project, see the [experimental queued rendering docs](https://docs.astro.build/en/reference/experimental-flags/queued-rendering/) for more details. - [#&#8203;14888](https://github.com/withastro/astro/pull/14888) [`4cd3fe4`](https://github.com/withastro/astro/commit/4cd3fe412bddbb0deb1383e83f3f8ae6e72596af) Thanks [@&#8203;OliverSpeir](https://github.com/OliverSpeir)! - Updates `astro add cloudflare` to better setup types, by adding `./worker-configuration.d.ts` to tsconfig includes and a `generate-types` script to package.json - [#&#8203;15646](https://github.com/withastro/astro/pull/15646) [`0dd9d00`](https://github.com/withastro/astro/commit/0dd9d00cf8be38c53217426f6b0e155a6f7c2a22) Thanks [@&#8203;delucis](https://github.com/delucis)! - Removes redundant `fetchpriority` attributes from the output of Astro’s `<Image>` component Previously, Astro would always include `fetchpriority="auto"` on images not using the `priority` attribute. However, this is the default value, so specifying it is redundant. This change omits the attribute by default. - [#&#8203;15291](https://github.com/withastro/astro/pull/15291) [`89b6cdd`](https://github.com/withastro/astro/commit/89b6cdd4075f5c9362291c386bb1e7c100b467a5) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `experimental.fonts` flag and replaces it with a new configuration option `fonts` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#experimental-flags)) - [#&#8203;15495](https://github.com/withastro/astro/pull/15495) [`5b99e90`](https://github.com/withastro/astro/commit/5b99e9077a92602f1e46e9b6eb9094bcd00c640e) Thanks [@&#8203;leekeh](https://github.com/leekeh)! - Adds a new `middlewareMode` adapter feature to replace the previous `edgeMiddleware` option. This feature only impacts adapter authors. If your adapter supports `edgeMiddleware`, you should upgrade to the new `middlewareMode` option to specify the middleware mode for your adapter as soon as possible. The `edgeMiddleware` feature is deprecated and will be removed in a future major release. ```diff export default function createIntegration() { return { name: '@example/my-adapter', hooks: { 'astro:config:done': ({ setAdapter }) => { setAdapter({ name: '@example/my-adapter', serverEntrypoint: '@example/my-adapter/server.js', adapterFeatures: { - edgeMiddleware: true + middlewareMode: 'edge' } }); }, }, }; } ``` - [#&#8203;15694](https://github.com/withastro/astro/pull/15694) [`66449c9`](https://github.com/withastro/astro/commit/66449c930e73e9a58ce547b9c32635a98a310966) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `preserveBuildClientDir` option to adapter features Adapters can now opt in to preserving the client/server directory structure for static builds by setting `preserveBuildClientDir: true` in their adapter features. When enabled, static builds will output files to `build.client` instead of directly to `outDir`. This is useful for adapters that require a consistent directory structure regardless of the build output type, such as deploying to platforms with specific file organization requirements. ```js // my-adapter/index.js export default function myAdapter() { return { name: 'my-adapter', hooks: { 'astro:config:done': ({ setAdapter }) => { setAdapter({ name: 'my-adapter', adapterFeatures: { buildOutput: 'static', preserveBuildClientDir: true, }, }); }, }, }; } ``` - [#&#8203;15332](https://github.com/withastro/astro/pull/15332) [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a `fileURL` option to `renderMarkdown` in content loaders, enabling resolution of relative image paths. When provided, relative image paths in markdown will be resolved relative to the specified file URL and included in `metadata.localImagePaths`. ```js const loader = { name: 'my-loader', load: async ({ store, renderMarkdown }) => { const content = ` # My Post ![Local image](./image.png) `; // Provide a fileURL to resolve relative image paths const fileURL = new URL('./posts/my-post.md', import.meta.url); const rendered = await renderMarkdown(content, { fileURL }); // rendered.metadata.localImagePaths now contains the resolved image path }, }; ``` - [#&#8203;15407](https://github.com/withastro/astro/pull/15407) [`aedbbd8`](https://github.com/withastro/astro/commit/aedbbd818628bed0533cdd627b73e2c5365aa17e) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Adds support for responsive images when `security.csp` is enabled, out of the box. Astro's implementation of responsive image styles has been updated to be compatible with a configured Content Security Policy. Instead of, injecting style elements at runtime, Astro will now generate your styles at build time using a combination of `class=""` and `data-*` attributes. This means that your processed styles are loaded and hashed out of the box by Astro. If you were previously choosing between Astro's CSP feature and including responsive images on your site, you may now use them together. - [#&#8203;15543](https://github.com/withastro/astro/pull/15543) [`d43841d`](https://github.com/withastro/astro/commit/d43841dfa8998c4dc1a510a2b120fedbd9ce77c6) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Adds a new `experimental.rustCompiler` flag to opt into the experimental Rust-based Astro compiler This experimental compiler is faster, provides better error messages, and generally has better support for modern JavaScript, TypeScript, and CSS features. After enabling in your Astro config, the `@astrojs/compiler-rs` package must also be installed into your project separately: ```js import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { rustCompiler: true, }, }); ``` This new compiler is still in early development and may exhibit some differences compared to the existing Go-based compiler. Notably, this compiler is generally more strict in regard to invalid HTML syntax and may throw errors in cases where the Go-based compiler would have been more lenient. For example, unclosed tags (e.g. `<p>My paragraph`) will now result in errors. For more information about using this experimental feature in your project, especially regarding expected differences and limitations, please see the [experimental Rust compiler reference docs](https://docs.astro.build/en/reference/experimental-flags/rust-compiler/). To give feedback on the compiler, or to keep up with its development, see the [RFC for a new compiler for Astro](https://github.com/withastro/roadmap/discussions/1306) for more information and discussion. - [#&#8203;15349](https://github.com/withastro/astro/pull/15349) [`a257c4c`](https://github.com/withastro/astro/commit/a257c4c3c7f0cdc5089b522ed216401d46d214c9) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Passes collection name to live content loaders Live content collection loaders now receive the collection name as part of their parameters. This is helpful for loaders that manage multiple collections or need to differentiate behavior based on the collection being accessed. ```ts export function storeLoader({ field, key }) { return { name: 'store-loader', loadCollection: async ({ filter, collection }) => { // ... }, loadEntry: async ({ filter, collection }) => { // ... }, }; } ``` - [#&#8203;15006](https://github.com/withastro/astro/pull/15006) [`f361730`](https://github.com/withastro/astro/commit/f361730bc820c01a2ec3e508ac940be8077d8c04) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds new session driver object shape For greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object: ```diff -import { defineConfig } from 'astro/config' +import { defineConfig, sessionDrivers } from 'astro/config' export default defineConfig({ session: { - driver: 'redis', - options: { - url: process.env.REDIS_URL - }, + driver: sessionDrivers.redis({ + url: process.env.REDIS_URL + }), } }) ``` Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver. - [#&#8203;15291](https://github.com/withastro/astro/pull/15291) [`89b6cdd`](https://github.com/withastro/astro/commit/89b6cdd4075f5c9362291c386bb1e7c100b467a5) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new Fonts API to provide first-party support for adding custom fonts in Astro. This feature allows you to use fonts from both your file system and several built-in supported providers (e.g. Google, Fontsource, Bunny) through a unified API. Keep your site performant thanks to sensible defaults and automatic optimizations including preloading and fallback font generation. To enable this feature, configure `fonts` with one or more fonts: ```js title="astro.config.mjs" import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ fonts: [ { provider: fontProviders.fontsource(), name: 'Roboto', cssVariable: '--font-roboto', }, ], }); ``` Import and include the `<Font />` component with the required `cssVariable` property in the head of your page, usually in a dedicated `Head.astro` component or in a layout component directly: ```astro --- // src/layouts/Layout.astro import { Font } from 'astro:assets'; --- <html> <head> <Font cssVariable="--font-roboto" preload /> </head> <body> <slot /> </body> </html> ``` In any page rendered with that layout, including the layout component itself, you can now define styles with your font's `cssVariable` to apply your custom font. In the following example, the `<h1>` heading will have the custom font applied, while the paragraph `<p>` will not. ```astro --- // src/pages/example.astro import Layout from '../layouts/Layout.astro'; --- <Layout> <h1>In a galaxy far, far away...</h1> <p>Custom fonts make my headings much cooler!</p> <style> h1 { font-family: var('--font-roboto'); } </style> </Layout> ``` Visit the updated [fonts guide](https://docs.astro.build/en/guides/fonts/) to learn more about adding custom fonts to your project. - [#&#8203;14550](https://github.com/withastro/astro/pull/14550) [`9c282b5`](https://github.com/withastro/astro/commit/9c282b5e6d3f0d678bc478a863e883fa4765dd17) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds support for live content collections Live content collections are a new type of [content collection](https://docs.astro.build/en/guides/content-collections/) that fetch their data at runtime rather than build time. This allows you to access frequently updated data from CMSs, APIs, databases, or other sources using a unified API, without needing to rebuild your site when the data changes. ##### Live collections vs build-time collections In Astro 5.0, the content layer API added support for adding diverse content sources to content collections. You can create loaders that fetch data from any source at build time, and then access it inside a page via `getEntry()` and `getCollection()`. The data is cached between builds, giving fast access and updates. However, there was no method for updating the data store between builds, meaning any updates to the data needed a full site deploy, even if the pages are rendered on demand. This meant that content collections were not suitable for pages that update frequently. Instead, these pages tended to access the APIs directly in the frontmatter. This worked, but it led to a lot of boilerplate, and meant users didn't benefit from the simple, unified API that content loaders offer. In most cases, users tended to individually create loader libraries shared between pages. Live content collections ([introduced experimentally in Astro 5.10](https://astro.build/blog/live-content-collections-deep-dive/)) solve this problem by allowing you to create loaders that fetch data at runtime, rather than build time. This means that the data is always up-to-date, without needing to rebuild the site. ##### How to use To use live collections, create a new `src/live.config.ts` file (alongside your `src/content.config.ts` if you have one) to define your live collections with a live content loader using the new `defineLiveCollection()` function from the `astro:content` module: ```ts title="src/live.config.ts" import { defineLiveCollection } from 'astro:content'; import { storeLoader } from '@mystore/astro-loader'; const products = defineLiveCollection({ loader: storeLoader({ apiKey: process.env.STORE_API_KEY, endpoint: 'https://api.mystore.com/v1', }), }); export const collections = { products }; ``` You can then use the `getLiveCollection()` and `getLiveEntry()` functions to access your live data, along with error handling (since anything can happen when requesting live data!): ```astro --- import { getLiveCollection, getLiveEntry, render } from 'astro:content'; // Get all products const { entries: allProducts, error } = await getLiveCollection('products'); if (error) { // Handle error appropriately console.error(error.message); } // Get products with a filter (if supported by your loader) const { entries: electronics } = await getLiveCollection('products', { category: 'electronics' }); // Get a single product by ID (string syntax) const { entry: product, error: productError } = await getLiveEntry('products', Astro.params.id); if (productError) { return Astro.redirect('/404'); } // Get a single product with a custom query (if supported by your loader) using a filter object const { entry: productBySlug } = await getLiveEntry('products', { slug: Astro.params.slug }); const { Content } = await render(product); --- <h1>{product.data.title}</h1> <Content /> ``` ##### Upgrading from experimental live collections If you were using the experimental feature, you must remove the `experimental.liveContentCollections` flag from your `astro.config.*` file: ```diff export default defineConfig({ // ... - experimental: { - liveContentCollections: true, - }, }); ``` No other changes to your project code are required as long as you have been keeping up with Astro 5.x patch releases, which contained breaking changes to this experimental feature. If you experience problems with your live collections after upgrading to Astro v6 and removing this flag, please review the [Astro CHANGELOG from 5.10.2](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md#5102) onwards for any potential updates you might have missed, or follow the [current v6 documentation for live collections](https://docs.astro.build/en/guides/content-collections/). - [#&#8203;15548](https://github.com/withastro/astro/pull/15548) [`5b8f573`](https://github.com/withastro/astro/commit/5b8f5737feb1a051b7cbd5d543dd230492e5211f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new optional `embeddedLangs` prop to the `<Code />` component to support languages beyond the primary `lang` This allows, for example, highlighting `.vue` files with a `<script setup lang="tsx">` block correctly: ```astro --- import { Code } from 'astro:components'; const code = ` <script setup lang="tsx"> const Text = ({ text }: { text: string }) => <div>{text}</div>; </script> <template> <Text text="hello world" /> </template>`; --- <Code {code} lang="vue" embeddedLangs={['tsx']} /> ``` See the [`<Code />` component documentation](https://docs.astro.build/en/guides/syntax-highlighting/#code-) for more details. - [#&#8203;14826](https://github.com/withastro/astro/pull/14826) [`170f64e`](https://github.com/withastro/astro/commit/170f64e977290b8f9d316b5f283bd03bae33ddde) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds an option `prerenderConflictBehavior` to configure the behavior of conflicting prerendered routes By default, Astro warns you during the build about any conflicts between multiple dynamic routes that can result in the same output path. For example `/blog/[slug]` and `/blog/[...all]` both could try to prerender the `/blog/post-1` path. In such cases, Astro renders only the [highest priority route](https://docs.astro.build/en/guides/routing/#route-priority-order) for the conflicting path. This allows your site to build successfully, although you may discover that some pages are rendered by unexpected routes. With the new `prerenderConflictBehavior` configuration option, you can now configure this further: - `prerenderConflictBehavior: 'error'` fails the build - `prerenderConflictBehavior: 'warn'` (default) logs a warning and the highest-priority route wins - `prerenderConflictBehavior: 'ignore'` silently picks the highest-priority route when conflicts occur ```diff import { defineConfig } from 'astro/config'; export default defineConfig({ + prerenderConflictBehavior: 'error', }); ``` - [#&#8203;14946](https://github.com/withastro/astro/pull/14946) [`95c40f7`](https://github.com/withastro/astro/commit/95c40f7109ce240206c3951761a7bb439dd809cb) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes the `experimental.csp` flag and replaces it with a new configuration option `security.csp` - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#experimental-flags)) - [#&#8203;15579](https://github.com/withastro/astro/pull/15579) [`08437d5`](https://github.com/withastro/astro/commit/08437d531e31b79a42333a9f7aabaa9fe646ce4f) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds two new experimental flags for a Route Caching API and further configuration-level Route Rules for controlling SSR response caching. Route caching gives you a platform-agnostic way to cache server-rendered responses, based on web standard cache headers. You set caching directives in your routes using `Astro.cache` (in `.astro` pages) or `context.cache` (in API routes and middleware), and Astro translates them into the appropriate headers or runtime behavior depending on your adapter. You can also define cache rules for routes declaratively in your config using `experimental.routeRules`, without modifying route code. This feature requires on-demand rendering. Prerendered pages are already static and do not use route caching. ##### Getting started Enable the feature by configuring `experimental.cache` with a cache provider in your Astro config: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; import { memoryCache } from 'astro/config'; export default defineConfig({ adapter: node({ mode: 'standalone' }), experimental: { cache: { provider: memoryCache(), }, }, }); ``` ##### Using `Astro.cache` and `context.cache` In `.astro` pages, use `Astro.cache.set()` to control caching: ```astro --- // src/pages/index.astro Astro.cache.set({ maxAge: 120, // Cache for 2 minutes swr: 60, // Serve stale for 1 minute while revalidating tags: ['home'], // Tag for targeted invalidation }); --- <html><body>Cached page</body></html> ``` In API routes and middleware, use `context.cache`: ```ts // src/pages/api/data.ts export function GET(context) { context.cache.set({ maxAge: 300, tags: ['api', 'data'], }); return Response.json({ ok: true }); } ``` ##### Cache options `cache.set()` accepts the following options: - **`maxAge`** (number): Time in seconds the response is considered fresh. - **`swr`** (number): Stale-while-revalidate window in seconds. During this window, stale content is served while a fresh response is generated in the background. - **`tags`** (string\[]): Cache tags for targeted invalidation. Tags accumulate across multiple `set()` calls within a request. - **`lastModified`** (Date): When multiple `set()` calls provide `lastModified`, the most recent date wins. - **`etag`** (string): Entity tag for conditional requests. Call `cache.set(false)` to explicitly opt out of caching for a request. Multiple calls to `cache.set()` within a single request are merged: scalar values use last-write-wins, `lastModified` uses most-recent-wins, and tags accumulate. ##### Invalidation Purge cached entries by tag or path using `cache.invalidate()`: ```ts // Invalidate all entries tagged 'data' await context.cache.invalidate({ tags: ['data'] }); // Invalidate a specific path await context.cache.invalidate({ path: '/api/data' }); ``` ##### Config-level route rules Use `experimental.routeRules` to set default cache options for routes without modifying route code. Supports Nitro-style shortcuts for ergonomic configuration: ```js import { memoryCache } from 'astro/config'; export default defineConfig({ experimental: { cache: { provider: memoryCache(), }, routeRules: { // Shortcut form (Nitro-style) '/api/*': { swr: 600 }, // Full form with nested cache '/products/*': { cache: { maxAge: 3600, tags: ['products'] } }, }, }, }); ``` Route patterns support static paths, dynamic parameters (`[slug]`), and rest parameters (`[...path]`). Per-route `cache.set()` calls merge with (and can override) the config-level defaults. You can also read the current cache state via `cache.options`: ```ts const { maxAge, swr, tags } = context.cache.options; ``` ##### Cache providers Cache behavior is determined by the configured **cache provider**. There are two types: - **CDN providers** set response headers (e.g. `CDN-Cache-Control`, `Cache-Tag`) and let the CDN handle caching. Astro strips these headers before sending the response to the client. - **Runtime providers** implement `onRequest()` to intercept and cache responses in-process, adding an `X-Astro-Cache` header (HIT/MISS/STALE) for observability. ##### Built-in memory cache provider Astro includes a built-in, in-memory LRU runtime cache provider. Import `memoryCache` from `astro/config` to configure it. Features: - In-memory LRU cache with configurable max entries (default: 1000) - Stale-while-revalidate support - Tag-based and path-based invalidation - `X-Astro-Cache` response header: `HIT`, `MISS`, or `STALE` - Query parameter sorting for better hit rates (`?b=2&a=1` and `?a=1&b=2` hit the same entry) - Common tracking parameters (`utm_*`, `fbclid`, `gclid`, etc.) excluded from cache keys by default - `Vary` header support — responses that set `Vary` automatically get separate cache entries per variant - Configurable query parameter filtering via `query.exclude` (glob patterns) and `query.include` (allowlist) For more information on enabling and using this feature in your project, see the [Experimental Route Caching docs](https://docs.astro.build/en/reference/experimental-flags/route-caching/). For a complete overview and to give feedback on this experimental API, see the [Route Caching RFC](https://github.com/withastro/roadmap/pull/1245). - [#&#8203;15483](https://github.com/withastro/astro/pull/15483) [`7be3308`](https://github.com/withastro/astro/commit/7be3308bf4b1710a3f378ba338d09a8528e01e76) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds `streaming` option to the `createApp()` function in the Adapter API, mirroring the same functionality available when creating a new `App` instance An adapter's `createApp()` function now accepts `streaming` (defaults to `true`) as an option. HTML streaming breaks a document into chunks to send over the network and render on the page in order. This normally results in visitors seeing your HTML as fast as possible but factors such as network conditions and waiting for data fetches can block page rendering. HTML streaming helps with performance and generally provides a better visitor experience. In most cases, disabling streaming is not recommended. However, when you need to disable HTML streaming (e.g. your host only supports non-streamed HTML caching at the CDN level), you can opt out of the default behavior by passing `streaming: false` to `createApp()`: ```ts import { createApp } from 'astro/app/entrypoint'; const app = createApp({ streaming: false }); ``` See more about [the `createApp()` function](https://docs.astro.build/en/reference/adapter-reference/#createapp) in the Adapter API reference. ##### Patch Changes - [#&#8203;15423](https://github.com/withastro/astro/pull/15423) [`c5ea720`](https://github.com/withastro/astro/commit/c5ea720261a35324988147fbf69d8200e496e1d0) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves error message when a dynamic redirect destination does not match any existing route. Previously, configuring a redirect like `/categories/[category]` → `/categories/[category]/1` in static output mode would fail with a misleading "getStaticPaths required" error. Now, Astro detects this early and provides a clear error explaining that the destination does not match any existing route. - [#&#8203;15167](https://github.com/withastro/astro/pull/15167) [`4fca170`](https://github.com/withastro/astro/commit/4fca1701eca1d107df43ef280cab342dfdacbb44) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where CSS from unused components, when using content collections, could be incorrectly included between page navigations in development mode. - [#&#8203;15565](https://github.com/withastro/astro/pull/15565) [`30cd6db`](https://github.com/withastro/astro/commit/30cd6dbebe771efb6f71dcff7e6b44026fad6797) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the use of the Astro internal logger couldn't work with Cloudflare Vite plugin. - [#&#8203;15508](https://github.com/withastro/astro/pull/15508) [`2c6484a`](https://github.com/withastro/astro/commit/2c6484a4c34e86b8a26342a48986da26768de27b) Thanks [@&#8203;KTibow](https://github.com/KTibow)! - Fixes behavior when shortcuts are used before server is ready - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves JSDoc annotations for `AstroGlobal`, `AstroSharedContext` and `APIContext` types - [#&#8203;15712](https://github.com/withastro/astro/pull/15712) [`7ac43c7`](https://github.com/withastro/astro/commit/7ac43c713be0c69b8df0fdaaca1e85e022361216) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves `astro info` by supporting more operating systems when copying the information to the clipboard. - [#&#8203;15054](https://github.com/withastro/astro/pull/15054) [`22db567`](https://github.com/withastro/astro/commit/22db567d4cea7a4476271c101c452a2624b7d996) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves zod union type error messages to show expected vs received types instead of generic "Invalid input" - [#&#8203;15064](https://github.com/withastro/astro/pull/15064) [`caf5621`](https://github.com/withastro/astro/commit/caf5621b324344fc0d46fb462c88c0d79fccca6b) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused incorrect warnings of duplicate entries to be logged by the glob loader when editing a file - [#&#8203;15801](https://github.com/withastro/astro/pull/15801) [`01db4f3`](https://github.com/withastro/astro/commit/01db4f37ddc14e2148df8390e0c0c600677a2417) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Improves the experience of working with experimental route caching in dev mode by replacing some errors with silent no-ops, avoiding the need to write conditional logic to handle different modes Adds a `cache.enabled` property to `CacheLike` so libraries can check whether caching is active without try/catch. - [#&#8203;15562](https://github.com/withastro/astro/pull/15562) [`e14a51d`](https://github.com/withastro/astro/commit/e14a51d30196bad534bacb14aac7033b91aed741) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes types for the `astro:ssr-manifest` module, which was removed - [#&#8203;15542](https://github.com/withastro/astro/pull/15542) [`9760404`](https://github.com/withastro/astro/commit/97604040b73ec1d029f5d5a489aa744aaecfd173) Thanks [@&#8203;rururux](https://github.com/rururux)! - Improves rendering by preserving `hidden="until-found"` value in attributes - [#&#8203;15044](https://github.com/withastro/astro/pull/15044) [`7cac71b`](https://github.com/withastro/astro/commit/7cac71b89f7462e197a69d797bdfefe6c7d15689) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes an exposed internal API of the preview server - [#&#8203;15573](https://github.com/withastro/astro/pull/15573) [`d789452`](https://github.com/withastro/astro/commit/d78945221d68ceab073f93572d87f12be0c72d47) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Clear the route cache on content changes so slug pages reflect updated data during dev. - [#&#8203;15308](https://github.com/withastro/astro/pull/15308) [`89cbcfa`](https://github.com/withastro/astro/commit/89cbcfadcf2d777dc5dbd210f9f88117c0101931) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes styles missing in dev for prerendered pages when using Cloudflare adapter - [#&#8203;15435](https://github.com/withastro/astro/pull/15435) [`957b9fe`](https://github.com/withastro/astro/commit/957b9fe2d887a365c55c6e87f0c67c10beb60d1b) Thanks [@&#8203;rururux](https://github.com/rururux)! - Improves compatibility of the built-in image endpoint with runtimes that don't support CJS dependencies correctly - [#&#8203;15640](https://github.com/withastro/astro/pull/15640) [`4c1a801`](https://github.com/withastro/astro/commit/4c1a801618b9c4a3147b683d6b4c8f35dc4bdb26) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Reverts the support of Shiki with CSP. Unfortunately, after exhaustive tests, the highlighter can't be supported to cover all cases. Adds a warning when both Content Security Policy (CSP) and Shiki syntax highlighting are enabled, as they are incompatible due to Shiki's use of inline styles - [#&#8203;15415](https://github.com/withastro/astro/pull/15415) [`cc3c46c`](https://github.com/withastro/astro/commit/cc3c46c73774d5c4b67c3b7a68f7da5de5544ba8) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where CSP headers were incorrectly injected in the development server. - [#&#8203;15412](https://github.com/withastro/astro/pull/15412) [`c546563`](https://github.com/withastro/astro/commit/c546563f361343b2494ebfb1c06ef3101a4d083c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves the `AstroAdapter` type and how legacy adapters are handled - [#&#8203;15322](https://github.com/withastro/astro/pull/15322) [`18e0980`](https://github.com/withastro/astro/commit/18e09800e459ff292f33370d4cf5f70d97bdbdb4) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Prevents missing CSS when using both SSR and prerendered routes - [#&#8203;15760](https://github.com/withastro/astro/pull/15760) [`f49a27f`](https://github.com/withastro/astro/commit/f49a27fd2ac2559c06671979487f642360791a92) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixed an issue where queued rendering wasn't correctly re-using the saved nodes. - [#&#8203;15277](https://github.com/withastro/astro/pull/15277) [`cb99214`](https://github.com/withastro/astro/commit/cb99214ebb991d1b929978f46e1b3ae68b561366) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the function `createShikiHighlighter` would always create a new Shiki highlighter instance. Now the function returns a cached version of the highlighter based on the Shiki options. This should improve the performance for sites that heavily rely on Shiki and code in their pages. - [#&#8203;15394](https://github.com/withastro/astro/pull/15394) [`5520f89`](https://github.com/withastro/astro/commit/5520f89d5df125e0c2d7fcdb3f9f0c81ff754e86) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where using the Fonts API with `netlify dev` wouldn't work because of query parameters - [#&#8203;15605](https://github.com/withastro/astro/pull/15605) [`f6473fd`](https://github.com/withastro/astro/commit/f6473fd45b74291e1a038f2f4142eb61a932d01d) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Improves `.astro` component SSR rendering performance by up to 2x. This includes several optimizations to the way that Astro generates and renders components on the server. These are mostly micro-optimizations, but they add up to a significant improvement in performance. Most pages will benefit, but pages with many components will see the biggest improvement, as will pages with lots of strings (e.g. text-heavy pages with lots of HTML elements). - [#&#8203;15721](https://github.com/withastro/astro/pull/15721) [`e6e146c`](https://github.com/withastro/astro/commit/e6e146cb0ac535e21c26f6b1c3d2f65be9dbdb4c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes action route handling to return 404 for requests to prototype method names like `constructor` or `toString` used as action paths - [#&#8203;15497](https://github.com/withastro/astro/pull/15497) [`a93c81d`](https://github.com/withastro/astro/commit/a93c81de493e912aeba1d829d9ccf6997b2eb806) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix dev reloads for content collection Markdown updates under Vite 7. - [#&#8203;15780](https://github.com/withastro/astro/pull/15780) [`e0ac125`](https://github.com/withastro/astro/commit/e0ac1250bb6db87f4c2ac79b6521b0fee0092d7a) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Prevents `vite.envPrefix` misconfiguration from exposing `access: "secret"` environment variables in client-side bundles. Astro now throws a clear error at startup if any `vite.envPrefix` entry matches a variable declared with `access: "secret"` in `env.schema`. For example, the following configuration will throw an error for `API_SECRET` because it's defined as `secret` its name matches `['PUBLIC_', 'API_']` defined in `env.schema`: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ env: { schema: { API_SECRET: envField.string({ context: 'server', access: 'secret', optional: true }), API_URL: envField.string({ context: 'server', access: 'public', optional: true }), }, }, vite: { envPrefix: ['PUBLIC_', 'API_'], }, }); ``` - [#&#8203;15514](https://github.com/withastro/astro/pull/15514) [`999a7dd`](https://github.com/withastro/astro/commit/999a7dd1f2913ea04e4f18f3557e8363edef45a8) Thanks [@&#8203;veeceey](https://github.com/veeceey)! - Fixes font flash (FOUT) during ClientRouter navigation by preserving inline `<style>` elements and font preload links in the head during page transitions. Previously, `@font-face` declarations from the `<Font>` component were removed and re-inserted on every client-side navigation, causing the browser to re-evaluate them. - [#&#8203;15560](https://github.com/withastro/astro/pull/15560) [`170ed89`](https://github.com/withastro/astro/commit/170ed89ae2b0482ddc5a6f1244452490319ae99e) Thanks [@&#8203;z0mt3c](https://github.com/z0mt3c)! - Fix X-Forwarded-Proto validation when allowedDomains includes both protocol and hostname fields. The protocol check no longer fails due to hostname mismatch against the hardcoded test URL. - [#&#8203;15704](https://github.com/withastro/astro/pull/15704) [`862d77b`](https://github.com/withastro/astro/commit/862d77bd6c3e05e20fd58293f9577ae685a9b8c9) Thanks [@&#8203;umutkeltek](https://github.com/umutkeltek)! - Fixes i18n fallback middleware intercepting non-404 responses The fallback middleware was triggering for all responses with status >= 300, including legitimate 3xx redirects, 403 forbidden, and 5xx server errors. This broke auth flows and form submissions on localized server routes. The fallback now correctly only triggers for 404 (page not found) responses. - [#&#8203;15661](https://github.com/withastro/astro/pull/15661) [`7150a2e`](https://github.com/withastro/astro/commit/7150a2e2aa022a9a957684ad8091f85aedb243f1) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a build error when generating projects with 100k+ static routes. - [#&#8203;15580](https://github.com/withastro/astro/pull/15580) [`a92333c`](https://github.com/withastro/astro/commit/a92333cb48291008dc08afd0da9e1bb349443934) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a build error when generating projects with a large number of static routes - [#&#8203;15176](https://github.com/withastro/astro/pull/15176) [`9265546`](https://github.com/withastro/astro/commit/92655460785e4b0a9eca9bac2e493a9c989dff47) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes hydration for framework components inside MDX when using `Astro.slots.render()` Previously, when multiple framework components with `client:*` directives were passed as named slots to an Astro component in MDX, only the first slot would hydrate correctly. Subsequent slots would render their HTML but fail to include the necessary hydration scripts. - [#&#8203;15506](https://github.com/withastro/astro/pull/15506) [`074901f`](https://github.com/withastro/astro/commit/074901fe6b599e9ffc740feb1c06d4590e9da43a) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a race condition where concurrent requests to dynamic routes in the dev server could produce incorrect params. - [#&#8203;15444](https://github.com/withastro/astro/pull/15444) [`10b0422`](https://github.com/withastro/astro/commit/10b0422b89d12320da3c026e8a4728ae7265cfb8) Thanks [@&#8203;AhmadYasser1](https://github.com/AhmadYasser1)! - Fixes `Astro.rewrite` returning 404 when rewriting to a URL with non-ASCII characters When rewriting to a path containing non-ASCII characters (e.g., `/redirected/héllo`), the route lookup compared encoded `distURL` hrefs against decoded pathnames, causing the comparison to always fail and resulting in a 404. This fix compares against the encoded pathname instead. - [#&#8203;15728](https://github.com/withastro/astro/pull/15728) [`12ca621`](https://github.com/withastro/astro/commit/12ca6213a68280293485d091e14899e7f2a4fee8) Thanks [@&#8203;SvetimFM](https://github.com/SvetimFM)! - Improves internal state retention for persisted elements during view transitions, especially avoiding WebGL context loss in Safari and resets of CSS transitions and iframes in modern Chromium and Firefox browsers - [#&#8203;15279](https://github.com/withastro/astro/pull/15279) [`8983f17`](https://github.com/withastro/astro/commit/8983f17d530b63d230ffb06f7ce65476f77c60b5) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the dev server would serve files like `/README.md` from the project root when they shouldn't be accessible. A new route guard middleware now blocks direct URL access to files that exist outside of `srcDir` and `publicDir`, returning a 404 instead. - [#&#8203;15703](https://github.com/withastro/astro/pull/15703) [`829182b`](https://github.com/withastro/astro/commit/829182bbdfc307a005aea00ac8c00923f76efb08) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes server islands returning a 500 error in dev mode for adapters that do not set `adapterFeatures.buildOutput` (e.g. `@astrojs/netlify`) - [#&#8203;15749](https://github.com/withastro/astro/pull/15749) [`573d188`](https://github.com/withastro/astro/commit/573d188de9a7e6635f24004291c3e71e0ddc7a7a) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused `session.regenerate()` to silently lose session data Previously, regenerated session data was not saved under the new session ID unless `set()` was also called. - [#&#8203;15549](https://github.com/withastro/astro/pull/15549) [`be1c87e`](https://github.com/withastro/astro/commit/be1c87e40e851e1020343a3a3f04e3ec9d39d832) Thanks [@&#8203;0xRozier](https://github.com/0xRozier)! - Fixes an issue where original (unoptimized) images from prerendered pages could be kept in the build output during SSR builds. - [#&#8203;15454](https://github.com/withastro/astro/pull/15454) [`b47a4e1`](https://github.com/withastro/astro/commit/b47a4e19a0b0b7e57068add94adc01c88d380fa8) Thanks [@&#8203;Fryuni](https://github.com/Fryuni)! - Fixes a race condition in the content layer which could result in dropped content collection entries. - [#&#8203;15685](https://github.com/withastro/astro/pull/15685) [`1a323e5`](https://github.com/withastro/astro/commit/1a323e5c64c7c23212ed80546f593d930115d55c) Thanks [@&#8203;jcayzac](https://github.com/jcayzac)! - Fix regression where SVG images in content collection `image()` fields could not be rendered as inline components. This behavior is now restored while preserving the TLA deadlock fix. - [#&#8203;15603](https://github.com/withastro/astro/pull/15603) [`5bc2b2c`](https://github.com/withastro/astro/commit/5bc2b2c2f4a9928efa16452b64729586dc79a0c7) Thanks [@&#8203;0xRozier](https://github.com/0xRozier)! - Fixes a deadlock that occurred when using SVG images in content collections - [#&#8203;15385](https://github.com/withastro/astro/pull/15385) [`9e16d63`](https://github.com/withastro/astro/commit/9e16d63cdd2537c406e50d005b389ac115755e8e) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes content layer loaders that use dynamic imports Content collection loaders can now use `await import()` and `import.meta.glob()` to dynamically import modules during build. Previously, these would fail with "Vite module runner has been closed." - [#&#8203;15565](https://github.com/withastro/astro/pull/15565) [`30cd6db`](https://github.com/withastro/astro/commit/30cd6dbebe771efb6f71dcff7e6b44026fad6797) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the use of the `Code` component would result in an unexpected error. - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes remote images `Etag` header handling by disabling internal cache - [#&#8203;15317](https://github.com/withastro/astro/pull/15317) [`7e1e35a`](https://github.com/withastro/astro/commit/7e1e35a8c28dba6495f9068c35faeb01abc08a1c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `?raw` imports failing when used in both SSR and prerendered routes - [#&#8203;15809](https://github.com/withastro/astro/pull/15809) [`94b4a46`](https://github.com/withastro/astro/commit/94b4a465f12e89b018bf120c9b163fc567aa0e84) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes `fit` defaults not being applied unless `layout` was also specified - [#&#8203;15563](https://github.com/withastro/astro/pull/15563) [`e959698`](https://github.com/withastro/astro/commit/e959698fedee4e548053e251d103eaeb9c6995cd) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where warnings would be logged during the build using one of the official adapters - [#&#8203;15121](https://github.com/withastro/astro/pull/15121) [`06261e0`](https://github.com/withastro/astro/commit/06261e03d55a571c6affbd7321f7e28c997d6d5d) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where the Astro, with the Cloudflare integration, couldn't correctly serve certain routes in the development server. - [#&#8203;15585](https://github.com/withastro/astro/pull/15585) [`98ea30c`](https://github.com/withastro/astro/commit/98ea30c56d6d317d76e2290ed903f11961204714) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Add a default body size limit for server actions to prevent oversized requests from exhausting memory. - [#&#8203;15264](https://github.com/withastro/astro/pull/15264) [`11efb05`](https://github.com/withastro/astro/commit/11efb058e85cda68f9a8e8f15a2c7edafe5a4789) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Lower the Node version requirement to allow running on Stackblitz until it supports v22 - [#&#8203;15778](https://github.com/withastro/astro/pull/15778) [`4ebc1e3`](https://github.com/withastro/astro/commit/4ebc1e328ac40e892078031ed9dfecf60691fd56) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the computed `clientAddress` was incorrect in cases of a Request header with multiple values. The `clientAddress` is now also validated to contain only characters valid in IP addresses, rejecting injection payloads. - [#&#8203;15565](https://github.com/withastro/astro/pull/15565) [`30cd6db`](https://github.com/withastro/astro/commit/30cd6dbebe771efb6f71dcff7e6b44026fad6797) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the new Astro v6 development server didn't log anything when navigating the pages. - [#&#8203;15024](https://github.com/withastro/astro/pull/15024) [`22c48ba`](https://github.com/withastro/astro/commit/22c48ba6643ed7153400781ca1affb3e8dc1351a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where JSON schema generation would fail for unrepresentable types - [#&#8203;15669](https://github.com/withastro/astro/pull/15669) [`d5a888b`](https://github.com/withastro/astro/commit/d5a888ba645de356673605a0b70f9c721cf6cb3b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes the `cssesc` dependency This CommonJS dependency could sometimes cause errors because Astro is ESM-only. It is now replaced with a built-in ESM-friendly implementation. - [#&#8203;15740](https://github.com/withastro/astro/pull/15740) [`c5016fc`](https://github.com/withastro/astro/commit/c5016fc86c4928a26b49dbe144b5569d5d89ac04) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Removes an escape hatch that skipped attribute escaping for URL values containing `&`, ensuring all dynamic attribute values are consistently escaped - [#&#8203;15756](https://github.com/withastro/astro/pull/15756) [`b6c64d1`](https://github.com/withastro/astro/commit/b6c64d1760ded517db37e1dd86a909959f7f619d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens the dev server by validating Sec-Fetch metadata headers to restrict cross-origin subresource requests - [#&#8203;15744](https://github.com/withastro/astro/pull/15744) [`fabb710`](https://github.com/withastro/astro/commit/fabb710c2514c5a1298e002dd961a1d79686f021) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes cookie handling during error page rendering to ensure cookies set by middleware are consistently included in the response - [#&#8203;15776](https://github.com/withastro/astro/pull/15776) [`e9a9cc6`](https://github.com/withastro/astro/commit/e9a9cc6002e35325447856e9a3e0866f285c0638) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens error page response merging to ensure framing headers from the original response are not carried over to the rendered error page - [#&#8203;15759](https://github.com/withastro/astro/pull/15759) [`39ff2a5`](https://github.com/withastro/astro/commit/39ff2a565614250acae83d35bf196e0463857d9e) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds a new `bodySizeLimit` option to the `@astrojs/node` adapter You can now configure a maximum allowed request body size for your Node.js standalone server. The default limit is 1 GB. Set the value in bytes, or pass `0` to disable the limit entirely: ```js import node from '@astrojs/node'; import { defineConfig } from 'astro/config'; export default defineConfig({ adapter: node({ mode: 'standalone', bodySizeLimit: 1024 * 1024 * 100, // 100 MB }), }); ``` - [#&#8203;15777](https://github.com/withastro/astro/pull/15777) [`02e24d9`](https://github.com/withastro/astro/commit/02e24d952de29c1c633744e7408215bedeb4d436) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes CSRF origin check mismatch by passing the actual server listening port to `createRequest`, ensuring the constructed URL origin includes the correct port (e.g., `http://localhost:4321` instead of `http://localhost`). Also restricts `X-Forwarded-Proto` to only be trusted when `allowedDomains` is configured. - [#&#8203;15742](https://github.com/withastro/astro/pull/15742) [`9d9699c`](https://github.com/withastro/astro/commit/9d9699c04aba7524bd3c8e1b8303691db19fa5bd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens `clientAddress` resolution to respect `security.allowedDomains` for `X-Forwarded-For`, consistent with the existing handling of `X-Forwarded-Host`, `X-Forwarded-Proto`, and `X-Forwarded-Port`. The `X-Forwarded-For` header is now only used to determine `Astro.clientAddress` when the request's host has been validated against an `allowedDomains` entry. Without a matching domain, `clientAddress` falls back to the socket's remote address. - [#&#8203;15768](https://github.com/withastro/astro/pull/15768) [`6328f1a`](https://github.com/withastro/astro/commit/6328f1ac7ba84d75e2889e415537620d51af5154) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens internal cookie parsing to use a null-prototype object consistently for the fallback path, aligning with how the cookie library handles parsed values - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes images not working in development when using setups with port forwarding - [#&#8203;15811](https://github.com/withastro/astro/pull/15811) [`2ba0db5`](https://github.com/withastro/astro/commit/2ba0db5ef78d29c816a358f88487c1e9aa87a2d8) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes integration-injected scripts (e.g. Alpine.js via `injectScript()`) not being loaded in the dev server when using non-runnable environment adapters like `@astrojs/cloudflare`. - [#&#8203;15208](https://github.com/withastro/astro/pull/15208) [`8dbdd8e`](https://github.com/withastro/astro/commit/8dbdd8efc12926eddbe189cf67a161bebf9fb5dd) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Makes `session.driver` optional in config schema, allowing adapters to provide default drivers Adapters like Cloudflare, Netlify, and Node provide default session drivers, so users can now configure session options (like `ttl`) without explicitly specifying a driver. - [#&#8203;15260](https://github.com/withastro/astro/pull/15260) [`abca1eb`](https://github.com/withastro/astro/commit/abca1ebc0ed4b89b1904c58b7969f8386250f8de) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where adding new pages weren't correctly shown when using the development server. - [#&#8203;15591](https://github.com/withastro/astro/pull/15591) [`1ed07bf`](https://github.com/withastro/astro/commit/1ed07bf85c07a641c255ebea28fb633d60fca1c0) Thanks [@&#8203;renovate](https://github.com/apps/renovate)! - Upgrades `devalue` to v5.6.3 - [#&#8203;15137](https://github.com/withastro/astro/pull/15137) [`2f70bf1`](https://github.com/withastro/astro/commit/2f70bf14ec953cd6e813ed4e1aa0ef2245846dd0) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds `legacy.collectionsBackwardsCompat` flag that restores v5 backwards compatibility behavior for legacy content collections - ([v6 upgrade guidance](https://docs.astro.build/en/guides/upgrade-to/v6/#legacy-content-collections-backwards-compatibility)) When enabled, this flag allows: - Collections defined without loaders (automatically get glob loader) - Collections with `type: 'content'` or `type: 'data'` - Config files located at `src/content/config.ts` (legacy location) - Legacy entry API: `entry.slug` and `entry.render()` methods - Path-based entry IDs instead of slug-based IDs ```js // astro.config.mjs export default defineConfig({ legacy: { collectionsBackwardsCompat: true, }, }); ``` This is a temporary migration helper for v6 upgrades. Migrate collections to the Content Layer API, then disable this flag. - [#&#8203;15550](https://github.com/withastro/astro/pull/15550) [`58df907`](https://github.com/withastro/astro/commit/58df9072391fbfcd703e8d791ca51b7bedefb730) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves the JSDoc annotations for the `AstroAdapter` type - [#&#8203;15696](https://github.com/withastro/astro/pull/15696) [`a9fd221`](https://github.com/withastro/astro/commit/a9fd221bda99db4660c241c494b6d3225eb4e51d) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes images not working in MDX when using the Cloudflare adapter in certain cases - [#&#8203;15386](https://github.com/withastro/astro/pull/15386) [`a0234a3`](https://github.com/withastro/astro/commit/a0234a36d8407d24270e187cd6133171b938583e) Thanks [@&#8203;OliverSpeir](https://github.com/OliverSpeir)! - Updates `astro add cloudflare` to use the latest valid `compatibility_date` in the wrangler config, if available - [#&#8203;15036](https://github.com/withastro/astro/pull/15036) [`f125a73`](https://github.com/withastro/astro/commit/f125a73ebf395d81bf44ccfce4af63a518f6f724) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes certain aliases not working when using images in JSON files with the content layer - [#&#8203;15693](https://github.com/withastro/astro/pull/15693) [`4db2089`](https://github.com/withastro/astro/commit/4db2089a8e01cdb298c49f61817daf240ae07fa5) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes the links to Astro Docs to match the v6 structure. - [#&#8203;15093](https://github.com/withastro/astro/pull/15093) [`8d5f783`](https://github.com/withastro/astro/commit/8d5f783ad8d236c9d768a629d3b929a074276ac2) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Reduces build memory by filtering routes per environment so each only builds the pages it needs - [#&#8203;15268](https://github.com/withastro/astro/pull/15268) [`54e5cc4`](https://github.com/withastro/astro/commit/54e5cc476b7d8ea8da0ddaba97ced0b789a2550a) Thanks [@&#8203;rururux](https://github.com/rururux)! - fix: avoid creating unused images during build in Picture component - [#&#8203;15757](https://github.com/withastro/astro/pull/15757) [`631aaed`](https://github.com/withastro/astro/commit/631aaedce99a2233d69fc2aa369164d286f34dbc) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens URL pathname normalization to consistently handle backslash characters after decoding, ensuring middleware and router see the same canonical pathname - [#&#8203;15337](https://github.com/withastro/astro/pull/15337) [`7ff7b11`](https://github.com/withastro/astro/commit/7ff7b1160d2d60e40073ddc422fc7a00c59696aa) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where the development server couldn't serve newly created new pages while the development server is running. - [#&#8203;15535](https://github.com/withastro/astro/pull/15535) [`dfe2e22`](https://github.com/withastro/astro/commit/dfe2e22042f92172442ab32777b3cce90685b76a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes the types of `createApp()` exported from `astro/app/entrypoint` - [#&#8203;15073](https://github.com/withastro/astro/pull/15073) [`2a39c32`](https://github.com/withastro/astro/commit/2a39c32857ad090efcfd77fb781e420f43800bc9) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Don't log an error when there is no content config - [#&#8203;15717](https://github.com/withastro/astro/pull/15717) [`4000aaa`](https://github.com/withastro/astro/commit/4000aaa2d361cbfc9bbf280a9b0e78e6db167945) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Ensures that URLs with multiple leading slashes (e.g. `//admin`) are normalized to a single slash before reaching middleware, so that pathname checks like `context.url.pathname.startsWith('/admin')` work consistently regardless of the request URL format - [#&#8203;15450](https://github.com/withastro/astro/pull/15450) [`50c9129`](https://github.com/withastro/astro/commit/50c912978cca4afbe4b3ebd11c30305d5e9c8315) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `build.serverEntry` would not be respected when using the new Adapter API - [#&#8203;15331](https://github.com/withastro/astro/pull/15331) [`4592be5`](https://github.com/withastro/astro/commit/4592be5bb7490474fe5e204f60b7131d9a79dae5) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an issue where API routes would overwrite public files during build. Public files now correctly take priority over generated routes in both dev and build modes. - [#&#8203;15414](https://github.com/withastro/astro/pull/15414) [`faedcc4`](https://github.com/withastro/astro/commit/faedcc40bccc43e27a53eee495b34448532866d6) Thanks [@&#8203;sapphi-red](https://github.com/sapphi-red)! - Fixes a bug where some requests to the dev server didn't start with the leading `/`. - [#&#8203;15419](https://github.com/withastro/astro/pull/15419) [`a18d727`](https://github.com/withastro/astro/commit/a18d727fc717054df85177c8e0c3d38a5252f2da) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the `add` command could accept any arbitrary value, leading the possible command injections. Now `add` and `--add` accepts values that are only acceptable npmjs.org names. - [#&#8203;15507](https://github.com/withastro/astro/pull/15507) [`07f6610`](https://github.com/withastro/astro/commit/07f66101ed2850874c8a49ddf1f1609e6b1339fb) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Avoid bundling SSR renderers when only API endpoints are dynamic - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Reduces Astro’s install size by around 8 MB - [#&#8203;15752](https://github.com/withastro/astro/pull/15752) [`918d394`](https://github.com/withastro/astro/commit/918d3949f3b92b1ae46dadd77cfb1404869c50bd) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes an issue where a session ID from a cookie with no matching server-side data was accepted as-is. The session now generates a new ID when the cookie value has no corresponding storage entry. - [#&#8203;15743](https://github.com/withastro/astro/pull/15743) [`3b4252a`](https://github.com/withastro/astro/commit/3b4252a82a937fccbfd433d90a93ad524a7a6f7b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Hardens config-based redirects with catch-all parameters to prevent producing protocol-relative URLs (e.g. `//example.com`) in the `Location` header - [#&#8203;15761](https://github.com/withastro/astro/pull/15761) [`8939751`](https://github.com/withastro/astro/commit/89397517830fec1d5b40e57ba1e35db1eb5fee79) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where it wasn't possible to set `experimental.queuedRendering.poolSize` to `0`. - [#&#8203;15633](https://github.com/withastro/astro/pull/15633) [`9d293c2`](https://github.com/withastro/astro/commit/9d293c21afc17fccaa55ea6c69f6403ad288ba57) Thanks [@&#8203;jwoyo](https://github.com/jwoyo)! - Fixes a case where `<script>` tags from components passed as slots to server islands were not included in the response - [#&#8203;15491](https://github.com/withastro/astro/pull/15491) [`6c60b05`](https://github.com/withastro/astro/commit/6c60b05b8d6774da04567dc8b85b5f2956e9da0c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes a case where setting `vite.server.allowedHosts: true` was turned into an invalid array - [#&#8203;15459](https://github.com/withastro/astro/pull/15459) [`a4406b4`](https://github.com/withastro/astro/commit/a4406b4dfbca3756983b82c37d7c74f84d2de096) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `context.csp` was logging warnings in development that should be logged in production only - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Enables the ClientRouter to preserve the original hash part of the target URL during server side redirects. - [#&#8203;15133](https://github.com/withastro/astro/pull/15133) [`53b125b`](https://github.com/withastro/astro/commit/53b125b7f0886f9ca75c4b2b80e3557645fb71df) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes an issue where adding or removing `<style>` tags in Astro components would not visually update styles during development without restarting the development server. - [#&#8203;15362](https://github.com/withastro/astro/pull/15362) [`dbf71c0`](https://github.com/withastro/astro/commit/dbf71c021e3adf060c34e6f268cf1b5cd480233d) Thanks [@&#8203;jcayzac](https://github.com/jcayzac)! - Fixes `inferSize` being kept in the HTML attributes of the emitted `<img>` when that option is used with an image that is not remote. - [#&#8203;15421](https://github.com/withastro/astro/pull/15421) [`bf62b6f`](https://github.com/withastro/astro/commit/bf62b6fa3eb7b0562cb9390a5362b23381f07276) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Removes unintended logging - [#&#8203;15732](https://github.com/withastro/astro/pull/15732) [`2ce9e74`](https://github.com/withastro/astro/commit/2ce9e7477e38bca3e13a9b6993125c798377dd50) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates docs links to point to the stable release - [#&#8203;15718](https://github.com/withastro/astro/pull/15718) [`14f37b8`](https://github.com/withastro/astro/commit/14f37b80aa2bd086cf31feccd5016c73a09822ae) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where internal headers may leak when rendering error pages - [#&#8203;15214](https://github.com/withastro/astro/pull/15214) [`6bab8c9`](https://github.com/withastro/astro/commit/6bab8c992add3ecad7581b26f6bc28a74e5d3485) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where the internal performance timers weren't correctly updated to reflect new build pipeline. - [#&#8203;15112](https://github.com/withastro/astro/pull/15112) [`5751d2b`](https://github.com/withastro/astro/commit/5751d2be14ccdcb752e11b6abdb5cdd3268a5b87) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes a Windows-specific build issue when importing an Astro component with a `<script>` tag using an import alias. - [#&#8203;15345](https://github.com/withastro/astro/pull/15345) [`840fbf9`](https://github.com/withastro/astro/commit/840fbf9e4abc7f847e23da8d67904ffde4d95fff) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an issue where `.sql` files (and other non-asset module types) were incorrectly moved to the client assets folder during SSR builds, causing "no such module" errors at runtime. The `ssrMoveAssets` function now reads the Vite manifest to determine which files are actual client assets (CSS and static assets like images) and only moves those, leaving server-side module files in place. - [#&#8203;15259](https://github.com/withastro/astro/pull/15259) [`8670a69`](https://github.com/withastro/astro/commit/8670a699e96fcc972d441c75e503b20e8961a71f) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where styles weren't correctly reloaded when using the `@astrojs/cloudflare` adapter. - [#&#8203;15473](https://github.com/withastro/astro/pull/15473) [`d653b86`](https://github.com/withastro/astro/commit/d653b864252e0b39a3774f0e1ecf4b7b69851288) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves Host header handling for SSR deployments behind proxies - [#&#8203;15047](https://github.com/withastro/astro/pull/15047) [`5580372`](https://github.com/withastro/astro/commit/55803724bb50c0fe4303c26f0df8f254e42b4d61) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes wrangler config template in `astro add cloudflare` to use correct entrypoint and compatibility date - [#&#8203;14589](https://github.com/withastro/astro/pull/14589) [`7038f07`](https://github.com/withastro/astro/commit/7038f0700898a17cb87b5a2e408480c1226a47f4) Thanks [@&#8203;43081j](https://github.com/43081j)! - Improves CLI styling - [#&#8203;15586](https://github.com/withastro/astro/pull/15586) [`35bc814`](https://github.com/withastro/astro/commit/35bc81428b7fd08d8d7249c58666fc13e9609d90) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes an issue where allowlists were not being enforced when handling remote images - [#&#8203;15422](https://github.com/withastro/astro/pull/15422) [`68770ef`](https://github.com/withastro/astro/commit/68770ef9e981f37a0b1b8febf76958010975add9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Upgrade to [@&#8203;astrojs/compiler](https://github.com/astrojs/compiler)@&#8203;3.0.0-beta - [#&#8203;15205](https://github.com/withastro/astro/pull/15205) [`12adc55`](https://github.com/withastro/astro/commit/12adc5507c99fa7f315d0c78e82005524e7bbb32) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Fixes an issue where the `astro:page-load` event did not fire on initial page loads. - [#&#8203;15125](https://github.com/withastro/astro/pull/15125) [`6feb0d7`](https://github.com/withastro/astro/commit/6feb0d7bec1e333eb795ae0fc51516182a73eb2b) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Changes the font format downloaded by default when using the experimental Fonts API. Additionally, adds a new `formats` configuration option to specify which font formats to download. Previously, Astro was opinionated about which font sources would be kept for usage, mainly keeping `woff2` and `woff` files. You can now specify what font formats should be downloaded (if available). Only `woff2` files are downloaded by default. ##### What should I do? If you were previously relying on Astro downloading the `woff` format, you will now need to specify this explicitly with the new `formats` configuration option. Additionally, you may also specify any additional file formats to download if available: ```diff // astro.config.mjs import { defineConfig, fontProviders } from 'astro/config' export default defineConfig({ experimental: { fonts: [{ name: 'Roboto', cssVariable: '--font-roboto', provider: fontProviders.google(), + formats: ['woff2', 'woff', 'otf'] }] } }) ``` - [#&#8203;15179](https://github.com/withastro/astro/pull/15179) [`8c8aee6`](https://github.com/withastro/astro/commit/8c8aee6ddefb1918b1f00415e34d2531e287acf8) Thanks [@&#8203;HiDeoo](https://github.com/HiDeoo)! - Fixes an issue when importing using an import alias a file with a name matching a directory name. - [#&#8203;15036](https://github.com/withastro/astro/pull/15036) [`f125a73`](https://github.com/withastro/astro/commit/f125a73ebf395d81bf44ccfce4af63a518f6f724) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a vite warning log during builds when using npm - [#&#8203;15269](https://github.com/withastro/astro/pull/15269) [`6f82aae`](https://github.com/withastro/astro/commit/6f82aae24c64a059531f4b924c201fbd4c3e9180) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a regression where `build.serverEntry` stopped working as expected. - [#&#8203;15053](https://github.com/withastro/astro/pull/15053) [`674b63f`](https://github.com/withastro/astro/commit/674b63f26d2e3b1878bcc8d770b9895357752ae9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Excludes `astro:*` and `virtual:astro:*` from client optimizeDeps in core. Needed for prefetch users since virtual modules are now in the dependency graph. - [#&#8203;15764](https://github.com/withastro/astro/pull/15764) [`44daecf`](https://github.com/withastro/astro/commit/44daecfc722cd5763a2afc4b1697169a9a0bb74e) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes form actions incorrectly auto-executing during error page rendering. When an error page (e.g. 404) is rendered, form actions from the original request are no longer executed, since the full request handling pipeline is not active. - [#&#8203;15788](https://github.com/withastro/astro/pull/15788) [`a91da9f`](https://github.com/withastro/astro/commit/a91da9fe6c6bfad8cc204c0f4a35268a915a0417) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Reverts changes made to TSConfig templates - [#&#8203;15657](https://github.com/withastro/astro/pull/15657) [`cb625b6`](https://github.com/withastro/astro/commit/cb625b62596582047ec8cc4256960cc11804e931) Thanks [@&#8203;qzio](https://github.com/qzio)! - Adds a new `security.actionBodySizeLimit` option to configure the maximum size of Astro Actions request bodies. This lets you increase the default 1 MB limit when your actions need to accept larger payloads. For example, actions that handle file uploads or large JSON payloads can now opt in to a higher limit. If you do not set this option, Astro continues to enforce the 1 MB default to help prevent abuse. ```js // astro.config.mjs export default defineConfig({ security: { actionBodySizeLimit: 10 * 1024 * 1024, // set to 10 MB }, }); ``` - [#&#8203;15176](https://github.com/withastro/astro/pull/15176) [`9265546`](https://github.com/withastro/astro/commit/92655460785e4b0a9eca9bac2e493a9c989dff47) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes scripts in components not rendering when a sibling `<Fragment slot="...">` exists but is unused - Updated dependencies \[[`bbb5811`](https://github.com/withastro/astro/commit/bbb5811eb801a42dc091bb09ea19d6cde3033795), [`4ebc1e3`](https://github.com/withastro/astro/commit/4ebc1e328ac40e892078031ed9dfecf60691fd56), [`cb99214`](https://github.com/withastro/astro/commit/cb99214ebb991d1b929978f46e1b3ae68b561366), [`80f0225`](https://github.com/withastro/astro/commit/80f022559e81b5609a69ba31c7f0d93dcb0bf74d), [`727b0a2`](https://github.com/withastro/astro/commit/727b0a205eb765f1c36f13a73dfc69e17e44df8f), [`4e7f3e8`](https://github.com/withastro/astro/commit/4e7f3e8e6849c314a0ab031ebd7f23fb982f0529), [`a164c77`](https://github.com/withastro/astro/commit/a164c77336059f2dc3e7f7fe992aa754ed145ef3), [`1fa4177`](https://github.com/withastro/astro/commit/1fa41779c458123f707940a5253dbe6e540dbf7d), [`7c55f80`](https://github.com/withastro/astro/commit/7c55f80fa1fd91f8f71ad60437f81e6c7f98f69d), [`cf6ea6b`](https://github.com/withastro/astro/commit/cf6ea6b36b67c7712395ed3f9ca19cb14ba1a013), [`6f19ecc`](https://github.com/withastro/astro/commit/6f19ecc35adfb2ddaabbba2269630f95c13f5a57), [`f94d3c5`](https://github.com/withastro/astro/commit/f94d3c5313e5a7576cf2cb316a85d68d335a188f), [`a18d727`](https://github.com/withastro/astro/commit/a18d727fc717054df85177c8e0c3d38a5252f2da), [`240c317`](https://github.com/withastro/astro/commit/240c317faab52d7f22494e9181f5d2c2c404b0bd), [`745e632`](https://github.com/withastro/astro/commit/745e632fc590e41a5701509e9cc4ed971bdddf74)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;7.0.0 - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.8.0 ### [`v5.18.2`](https://github.com/withastro/astro/releases/tag/astro%405.18.2) [Compare Source](https://github.com/withastro/astro/compare/astro@5.18.1...astro@5.18.2) ##### Patch Changes - [#&#8203;16813](https://github.com/withastro/astro/pull/16813) [`8f7d8c4`](https://github.com/withastro/astro/commit/8f7d8c46ffc79b23200a98fcf6b72c53e19d71db) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Populates styles in the SSR manifest for prerendered routes. Previously, prerendered routes had `styles: []` in the manifest, making it impossible for workers or middleware to discover which CSS files a prerendered page uses. ### [`v5.18.1`](https://github.com/withastro/astro/releases/tag/astro%405.18.1) [Compare Source](https://github.com/withastro/astro/compare/astro@5.18.0...astro@5.18.1) ##### Patch Changes - Updated dependencies \[[`c2cd371`](https://github.com/withastro/astro/commit/c2cd371f9f2003ab8c9ce70a24fc0af40c5de531)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.6 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.11 ### [`v5.18.0`](https://github.com/withastro/astro/releases/tag/astro%405.18.0) [Compare Source](https://github.com/withastro/astro/compare/astro@5.17.3...astro@5.18.0) ##### Minor Changes - [#&#8203;15589](https://github.com/withastro/astro/pull/15589) [`b7dd447`](https://github.com/withastro/astro/commit/b7dd447e319a7b435c01ccd69347e5261bd9dc14) Thanks [@&#8203;qzio](https://github.com/qzio)! - Adds a new `security.actionBodySizeLimit` option to configure the maximum size of Astro Actions request bodies. This lets you increase the default 1 MB limit when your actions need to accept larger payloads. For example, actions that handle file uploads or large JSON payloads can now opt in to a higher limit. If you do not set this option, Astro continues to enforce the 1 MB default to help prevent abuse. ```js // astro.config.mjs export default defineConfig({ security: { actionBodySizeLimit: 10 * 1024 * 1024, // set to 10 MB }, }); ``` ##### Patch Changes - [#&#8203;15594](https://github.com/withastro/astro/pull/15594) [`efae11c`](https://github.com/withastro/astro/commit/efae11cef1ebe1f2f54ceb55db0d1ff1938351c6) Thanks [@&#8203;qzio](https://github.com/qzio)! - Fix X-Forwarded-Proto validation when allowedDomains includes both protocol and hostname fields. The protocol check no longer fails due to hostname mismatch against the hardcoded test URL. ### [`v5.17.3`](https://github.com/withastro/astro/releases/tag/astro%405.17.3) [Compare Source](https://github.com/withastro/astro/compare/astro@5.17.2...astro@5.17.3) ##### Patch Changes - [#&#8203;15564](https://github.com/withastro/astro/pull/15564) [`522f880`](https://github.com/withastro/astro/commit/522f880b07a4ea7d69a19b5507fb53a5ed6c87f8) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Add a default body size limit for server actions to prevent oversized requests from exhausting memory. - [#&#8203;15569](https://github.com/withastro/astro/pull/15569) [`e01e98b`](https://github.com/withastro/astro/commit/e01e98b063e90d274c42130ec2a60cc0966622c9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Respect image allowlists when inferring remote image sizes and reject remote redirects. ### [`v5.17.2`](https://github.com/withastro/astro/releases/tag/astro%405.17.2) [Compare Source](https://github.com/withastro/astro/compare/astro@5.17.1...astro@5.17.2) ##### Patch Changes - [`c13b536`](https://github.com/withastro/astro/commit/c13b536197a70d8d4fd0037c5bd3aaa2be0598b9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves Host header handling for SSR deployments behind proxies ### [`v5.17.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5171) [Compare Source](https://github.com/withastro/astro/compare/astro@5.17.0...astro@5.17.1) ##### Patch Changes - [#&#8203;15334](https://github.com/withastro/astro/pull/15334) [`d715f1f`](https://github.com/withastro/astro/commit/d715f1f88777a4ce0fb61c8043cccfbac2486ab4) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Removes the `getFontBuffer()` helper function exported from `astro:assets` when using the experimental Fonts API This experimental feature introduced in v15.6.13 ended up causing significant memory usage during build. This feature has been removed and will be reintroduced after further exploration and testing. If you were relying on this function, you can replicate the previous behavior manually: - On prerendered routes, read the file using `node:fs` - On server rendered routes, fetch files using URLs from `fontData` and `context.url` ### [`v5.17.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5170) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.16...astro@5.17.0) ##### Minor Changes - [#&#8203;14932](https://github.com/withastro/astro/pull/14932) [`b19d816`](https://github.com/withastro/astro/commit/b19d816c914022c4e618d6012e09aed82be34213) Thanks [@&#8203;patrickarlt](https://github.com/patrickarlt)! - Adds support for returning a Promise from the `parser()` option of the `file()` loader This enables you to run asynchronous code such as fetching remote data or using async parsers when loading files with the Content Layer API. For example: ```js import { defineCollection } from 'astro:content'; import { file } from 'astro/loaders'; const blog = defineCollection({ loader: file('src/data/blog.json', { parser: async (text) => { const data = JSON.parse(text); // Perform async operations like fetching additional data const enrichedData = await fetch(`https://api.example.com/enrich`, { method: 'POST', body: JSON.stringify(data), }).then((res) => res.json()); return enrichedData; }, }), }); export const collections = { blog }; ``` See [the `parser()` reference documentation](https://docs.astro.build/en/reference/content-loader-reference/#parser) for more information. - [#&#8203;15171](https://github.com/withastro/astro/pull/15171) [`f220726`](https://github.com/withastro/astro/commit/f22072607c79f5ba3459ba7522cfdf2581f1869b) Thanks [@&#8203;mark-ignacio](https://github.com/mark-ignacio)! - Adds a new, optional `kernel` configuration option to select a resize algorithm in the Sharp image service By default, Sharp resizes images with the `lanczos3` kernel. This new config option allows you to set the default resizing algorithm to any resizing option supported by [Sharp](https://sharp.pixelplumbing.com/api-resize/#resize) (e.g. `linear`, `mks2021`). Kernel selection can produce quite noticeable differences depending on various characteristics of the source image - especially drawn art - so changing the kernel gives you more control over the appearance of images on your site: ```js export default defineConfig({ image: { service: { entrypoint: 'astro/assets/services/sharp', config: { kernel: "mks2021" } } }) ``` This selection will apply to all images on your site, and is not yet configurable on a per-image basis. For more information, see [Sharps documentation on resizing images](https://sharp.pixelplumbing.com/api-resize/#resize). - [#&#8203;15063](https://github.com/withastro/astro/pull/15063) [`08e0fd7`](https://github.com/withastro/astro/commit/08e0fd723742dda4126665f5e32f4065899af83e) Thanks [@&#8203;jmortlock](https://github.com/jmortlock)! - Adds a new `partitioned` option when setting a cookie to allow creating partitioned cookies. [Partitioned cookies](https://developer.mozilla.org/en-US/docs/Web/Privacy/Guides/Privacy_sandbox/Partitioned_cookies) can only be read within the context of the top-level site on which they were set. This allows cross-site tracking to be blocked, while still enabling legitimate uses of third-party cookies. You can create a partitioned cookie by passing `partitioned: true` when setting a cookie. Note that partitioned cookies must also be set with `secure: true`: ```js Astro.cookies.set('my-cookie', 'value', { partitioned: true, secure: true, }); ``` For more information, see the [`AstroCookieSetOptions` API reference](https://docs.astro.build/en/reference/api-reference/#astrocookiesetoptions). - [#&#8203;15022](https://github.com/withastro/astro/pull/15022) [`f1fce0e`](https://github.com/withastro/astro/commit/f1fce0e7cc3c1122bf5c4f1c5985ca716c8417db) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds a new `retainBody` option to the `glob()` loader to allow reducing the size of the data store. Currently, the `glob()` loader stores the raw body of each content file in the entry, in addition to the rendered HTML. The `retainBody` option defaults to `true`, but you can set it to `false` to prevent the raw body of content files from being stored in the data store. This significantly reduces the deployed size of the data store and helps avoid hitting size limits for sites with very large collections. The rendered body will still be available in the `entry.rendered.html` property for markdown files, and the `entry.filePath` property will still point to the original file. ```js import { defineCollection } from 'astro:content'; import { glob } from 'astro/loaders'; const blog = defineCollection({ loader: glob({ pattern: '**/*.md', base: './src/content/blog', retainBody: false, }), }); ``` When `retainBody` is `false`, `entry.body` will be `undefined` instead of containing the raw file contents. - [#&#8203;15153](https://github.com/withastro/astro/pull/15153) [`928529f`](https://github.com/withastro/astro/commit/928529f824d37e9bfb297ff931ebfcb3f0b56428) Thanks [@&#8203;jcayzac](https://github.com/jcayzac)! - Adds a new `background` property to the `<Image />` component. This optional property lets you pass a background color to flatten the image with. By default, Sharp uses a black background when flattening an image that is being converted to a format that does not support transparency (e.g. `jpeg`). Providing a value for `background` on an `<Image />` component, or passing it to the `getImage()` helper, will flatten images using that color instead. This is especially useful when the requested output format doesn't support an alpha channel (e.g. `jpeg`) and can't support transparent backgrounds. ```astro --- import { Image } from 'astro:assets'; --- <Image src="/transparent.png" alt="A JPEG with a white background!" format="jpeg" background="#ffffff" /> ``` See more about this new property in [the image reference docs](https://docs.astro.build/en/reference/modules/astro-assets/#background) - [#&#8203;15015](https://github.com/withastro/astro/pull/15015) [`54f6006`](https://github.com/withastro/astro/commit/54f6006c3ddae8935a5550e2c3b38d25bf662ea6) Thanks [@&#8203;tony](https://github.com/tony)! - Adds optional `placement` config option for the dev toolbar. You can now configure the default toolbar position (`'bottom-left'`, `'bottom-center'`, or `'bottom-right'`) via `devToolbar.placement` in your Astro config. This option is helpful for sites with UI elements (chat widgets, cookie banners) that are consistently obscured by the toolbar in the dev environment. You can set a project default that is consistent across environments (e.g. dev machines, browser instances, team members): ```js // astro.config.mjs export default defineConfig({ devToolbar: { placement: 'bottom-left', }, }); ``` User preferences from the toolbar UI (stored in `localStorage`) still take priority, so this setting can be overridden in individual situations as necessary. ### [`v5.16.16`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51616) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.15...astro@5.16.16) ##### Patch Changes - [#&#8203;15281](https://github.com/withastro/astro/pull/15281) [`a1b80c6`](https://github.com/withastro/astro/commit/a1b80c65e5dddefba7ada20c7ccfdab26fb4e16b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Ensures server island requests carry an encrypted component export identifier so they do not accidentally resolve to the wrong component. - [#&#8203;15304](https://github.com/withastro/astro/pull/15304) [`02ee3c7`](https://github.com/withastro/astro/commit/02ee3c745297203c38ee013b500126b15f7e5fc9) Thanks [@&#8203;cameronapak](https://github.com/cameronapak)! - Fix: Remove await from getActionResult example - [#&#8203;15324](https://github.com/withastro/astro/pull/15324) [`ab41c3e`](https://github.com/withastro/astro/commit/ab41c3e789b821e9179d11d67f453ba955448be6) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes an issue where certain unauthorized links could be rendered as clickable in the error overlay ### [`v5.16.15`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51615) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.14...astro@5.16.15) ##### Patch Changes - [#&#8203;15286](https://github.com/withastro/astro/pull/15286) [`0aafc83`](https://github.com/withastro/astro/commit/0aafc8342a47f5c96cd13bfc02539d89c3c358a7) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where font providers provided as class instances may not work when using the experimental Fonts API. It affected the local provider ### [`v5.16.14`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51614) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.13...astro@5.16.14) ##### Patch Changes - [#&#8203;15213](https://github.com/withastro/astro/pull/15213) [`c775fce`](https://github.com/withastro/astro/commit/c775fce98f50001bc59025dceaf8ea5287675f17) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Updates how the local provider must be used when using the experimental Fonts API Previously, there were 2 kinds of font providers: remote and local. Font providers are now unified. If you are using the local provider, the process for configuring local fonts must be updated: ```diff -import { defineConfig } from "astro/config"; +import { defineConfig, fontProviders } from "astro/config"; export default defineConfig({ experimental: { fonts: [{ name: "Custom", cssVariable: "--font-custom", - provider: "local", + provider: fontProviders.local(), + options: { variants: [ { weight: 400, style: "normal", src: ["./src/assets/fonts/custom-400.woff2"] }, { weight: 700, style: "normal", src: ["./src/assets/fonts/custom-700.woff2"] } // ... ] + } }] } }); ``` Once configured, there is no change to using local fonts in your project. However, you should inspect your deployed site to confirm that your new font configuration is being applied. See [the experimental Fonts API docs](https://docs.astro.build/en/reference/experimental-flags/fonts/) for more information. - [#&#8203;15213](https://github.com/withastro/astro/pull/15213) [`c775fce`](https://github.com/withastro/astro/commit/c775fce98f50001bc59025dceaf8ea5287675f17) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Exposes `root` on `FontProvider` `init()` context When building a custom `FontProvider` for the experimental Fonts API, the `init()` method receives a `context`. This context now exposes a `root` URL, useful for resolving local files: ```diff import type { FontProvider } from "astro"; export function registryFontProvider(): FontProvider { return { // ... - init: async ({ storage }) => { + init: async ({ storage, root }) => { // ... }, }; } ``` - [#&#8203;15185](https://github.com/withastro/astro/pull/15185) [`edabeaa`](https://github.com/withastro/astro/commit/edabeaa3cd3355fa33e4eb547656033fe7b66845) Thanks [@&#8203;EricGrill](https://github.com/EricGrill)! - Add `.vercel` to `.gitignore` when adding the Vercel adapter via `astro add vercel` ### [`v5.16.13`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51613) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.12...astro@5.16.13) ##### Patch Changes - [#&#8203;15182](https://github.com/withastro/astro/pull/15182) [`cb60ee1`](https://github.com/withastro/astro/commit/cb60ee16051da258ab140f3bb64ff3fd8e4c9e17) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `getFontBuffer()` method to retrieve font file buffers when using the experimental Fonts API The `getFontData()` helper function from `astro:assets` was introduced in 5.14.0 to provide access to font family data for use outside of Astro. One of the goals of this API was to be able to retrieve buffers using URLs. However, it turned out to be impractical and even impossible during prerendering. Astro now exports a new `getFontBuffer()` helper function from `astro:assets` to retrieve font file buffers from URL returned by `getFontData()`. For example, when using [satori](https://github.com/vercel/satori) to generate Open Graph images: ```diff // src/pages/og.png.ts import type{ APIRoute } from "astro" -import { getFontData } from "astro:assets" +import { getFontData, getFontBuffer } from "astro:assets" import satori from "satori" export const GET: APIRoute = (context) => { const data = getFontData("--font-roboto") const svg = await satori( <div style={{ color: "black" }}>hello, world</div>, { width: 600, height: 400, fonts: [ { name: "Roboto", - data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then(res => res.arrayBuffer()), + data: await getFontBuffer(data[0].src[0].url), weight: 400, style: "normal", }, ], }, ) // ... } ``` See the [experimental Fonts API documentation](https://docs.astro.build/en/reference/experimental-flags/fonts/#accessing-font-data-programmatically) for more information. ### [`v5.16.12`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51612) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.11...astro@5.16.12) ##### Patch Changes - [#&#8203;15175](https://github.com/withastro/astro/pull/15175) [`47ae148`](https://github.com/withastro/astro/commit/47ae1480eecd5da7080f1e659b6aef211aaf3300) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Allows experimental Font providers to specify family options Previously, an Astro `FontProvider` could only accept options at the provider level when called. That could result in weird data structures for family-specific options. Astro `FontProvider`s can now declare family-specific options, by specifying a generic: ```diff // font-provider.ts import type { FontProvider } from "astro"; import { retrieveFonts, type Fonts } from "./utils.js", interface Config { token: string; } +interface FamilyOptions { + minimal?: boolean; +} -export function registryFontProvider(config: Config): FontProvider { +export function registryFontProvider(config: Config): FontProvider<FamilyOptions> { let data: Fonts = {} return { name: "registry", config, init: async () => { data = await retrieveFonts(token); }, listFonts: () => { return Object.keys(data); }, - resolveFont: ({ familyName, ...rest }) => { + // options is typed as FamilyOptions + resolveFont: ({ familyName, options, ...rest }) => { const fonts = data[familyName]; if (fonts) { return { fonts }; } return undefined; }, }; } ``` Once the font provider is registered in the Astro config, types are automatically inferred: ```diff // astro.config.ts import { defineConfig } from "astro/config"; import { registryFontProvider } from "./font-provider"; export default defineConfig({ experimental: { fonts: [{ provider: registryFontProvider({ token: "..." }), name: "Custom", cssVariable: "--font-custom", + options: { + minimal: true + } }] } }); ``` - [#&#8203;15175](https://github.com/withastro/astro/pull/15175) [`47ae148`](https://github.com/withastro/astro/commit/47ae1480eecd5da7080f1e659b6aef211aaf3300) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Updates how options are passed to the Google and Google Icons font providers when using the experimental Fonts API Previously, the Google and Google Icons font providers accepted options that were specific to given font families. These options must now be set using the `options` property instead. For example using the Google provider: ```diff import { defineConfig, fontProviders } from "astro/config"; export default defineConfig({ experimental: { fonts: [{ name: 'Inter', cssVariable: '--astro-font-inter', weights: ['300 900'], - provider: fontProviders.google({ - experimental: { - variableAxis: { - Inter: { opsz: ['14..32'] } - } - } - }), + provider: fontProviders.google(), + options: { + experimental: { + variableAxis: { opsz: ['14..32'] } + } + } }] } }) ``` - [#&#8203;15200](https://github.com/withastro/astro/pull/15200) [`c0595b3`](https://github.com/withastro/astro/commit/c0595b3e71a3811921ddc24e6ed7538c0df53a96) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Removes `getFontData()` exported from `astro:assets` with `fontData` when using the experimental Fonts API Accessing font data can be useful for advanced use cases, such as generating meta tags or Open Graph images. Before, we exposed a `getFontData()` helper function to retrieve the font data for a given `cssVariable`. That was however limiting for programmatic usages that need to access all font data. The `getFontData()` helper function is removed and replaced by a new `fontData` object: ```diff -import { getFontData } from "astro:assets"; -const data = getFontData("--font-roboto") +import { fontData } from "astro:assets"; +const data = fontData["--font-roboto"] ``` We may reintroduce `getFontData()` later on for a more friendly DX, based on your feedback. - [#&#8203;15254](https://github.com/withastro/astro/pull/15254) [`8d84b30`](https://github.com/withastro/astro/commit/8d84b3040181018f358b4e5684f9df55949aa4ca) Thanks [@&#8203;lamalex](https://github.com/lamalex)! - Fixes CSS `assetsPrefix` with remote URLs incorrectly prepending a forward slash When using `build.assetsPrefix` with a remote URL (e.g., `https://cdn.example.com`) for CSS assets, the generated `<link>` elements were incorrectly getting a `/` prepended to the full URL, resulting in invalid URLs like `/https://cdn.example.com/assets/style.css`. This fix checks if the stylesheet link is a remote URL before prepending the forward slash. - [#&#8203;15178](https://github.com/withastro/astro/pull/15178) [`731f52d`](https://github.com/withastro/astro/commit/731f52dd68c538a3372d4ac078e72d1090cc4cce) Thanks [@&#8203;kedarvartak](https://github.com/kedarvartak)! - Fixes an issue where stopping the dev server with `q+enter` incorrectly created a `dist` folder and copied font files when using the experimental Fonts API - [#&#8203;15230](https://github.com/withastro/astro/pull/15230) [`3da6272`](https://github.com/withastro/astro/commit/3da62721f02e7cbf1344ae9766ca73cae71b23c8) Thanks [@&#8203;rahuld109](https://github.com/rahuld109)! - Fixes greedy regex in error message markdown rendering that caused link syntax examples to capture extra characters - [#&#8203;15253](https://github.com/withastro/astro/pull/15253) [`2a6315a`](https://github.com/withastro/astro/commit/2a6315a3a38273ed47e4aa16a4dd9449fc7927c9) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes hydration for React components nested inside HTML elements in MDX files - [#&#8203;15227](https://github.com/withastro/astro/pull/15227) [`9a609f4`](https://github.com/withastro/astro/commit/9a609f4a6264fc2238e02cffb00a9285f4a10973) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes styles not being included for conditionally rendered Svelte 5 components in production builds - [#&#8203;14607](https://github.com/withastro/astro/pull/14607) [`ee52160`](https://github.com/withastro/astro/commit/ee52160f3374f65d1a8cb460c1340172902313bc) Thanks [@&#8203;simensfo](https://github.com/simensfo)! - Reintroduces css deduplication for hydrated client components. Ensures assets already added to a client chunk are not flagged as orphaned ### [`v5.16.11`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51611) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.10...astro@5.16.11) ##### Patch Changes - [#&#8203;15017](https://github.com/withastro/astro/pull/15017) [`9e7a3c8`](https://github.com/withastro/astro/commit/9e7a3c86198956e558384235b71a6c12e87fc5fb) Thanks [@&#8203;ixchio](https://github.com/ixchio)! - Fixes CSS double-bundling when the same CSS file is imported in both a page's frontmatter and a component's script tag - [#&#8203;15225](https://github.com/withastro/astro/pull/15225) [`6fe62e1`](https://github.com/withastro/astro/commit/6fe62e169cf9e1054cba95ce4084d8a58bdd0a66) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Updates to the latest version of `devalue` ### [`v5.16.10`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51610) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.9...astro@5.16.10) ##### Patch Changes - [`2fa19c4`](https://github.com/withastro/astro/commit/2fa19c41be895e5255a8b12a43f9f9691cb57e5d) - Improved error handling in the rendering phase Added defensive validation in `App.render()` and `#renderError()` to provide a descriptive error message when a route module doesn't have a valid page function. - [#&#8203;15199](https://github.com/withastro/astro/pull/15199) [`d8e64ef`](https://github.com/withastro/astro/commit/d8e64ef77ef364b1541a5d192bcff299135d3bc8) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes the links to Astro Docs so that they match the current docs structure. - [#&#8203;15169](https://github.com/withastro/astro/pull/15169) [`b803d8b`](https://github.com/withastro/astro/commit/b803d8b4b4e5e71ef4b28b23186e2786dc80a308) Thanks [@&#8203;rururux](https://github.com/rururux)! - fix: fix image 500 error when moving dist directory in standalone Node - [#&#8203;14622](https://github.com/withastro/astro/pull/14622) [`9b35c62`](https://github.com/withastro/astro/commit/9b35c62cb38d3507f426b872d972b1b4d7b20bc8) Thanks [@&#8203;aprici7y](https://github.com/aprici7y)! - Fixes CSS url() references to public assets returning 404 in dev mode when base path is configured - [#&#8203;15219](https://github.com/withastro/astro/pull/15219) [`43df4ce`](https://github.com/withastro/astro/commit/43df4ce1c6c221a751b640c45687adfa83226e7c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Upgrades the `diff` package to v8 ### [`v5.16.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5169) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.8...astro@5.16.9) ##### Patch Changes - [#&#8203;15174](https://github.com/withastro/astro/pull/15174) [`37ab65a`](https://github.com/withastro/astro/commit/37ab65acb1af6e41d25ec29f3c04c690c7601c87) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds Google Icons to built-in font providers To start using it, access it on `fontProviders`: ```ts import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ experimental: { fonts: [ { name: 'Material Symbols Outlined', provider: fontProviders.googleicons(), cssVariable: '--font-material', }, ], }, }); ``` - [#&#8203;15150](https://github.com/withastro/astro/pull/15150) [`a77c4f4`](https://github.com/withastro/astro/commit/a77c4f42b56b46b08064a99e9cb9a2b4bace4445) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes hydration for framework components inside MDX when using `Astro.slots.render()` Previously, when multiple framework components with `client:*` directives were passed as named slots to an Astro component in MDX, only the first slot would hydrate correctly. Subsequent slots would render their HTML but fail to include the necessary hydration scripts. - [#&#8203;15130](https://github.com/withastro/astro/pull/15130) [`9b726c4`](https://github.com/withastro/astro/commit/9b726c4e36bb1560badf5bf9b78783a240939124) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Changes how font providers are implemented with updates to the `FontProvider` type This is an implementation detail that changes how font providers are created. This process allows Astro to take more control rather than relying directly on `unifont` types. **All of Astro's built-in font providers have been updated to reflect this new type, and can be configured as before**. However, using third-party unifont providers that rely on `unifont` types will require an update to your project code. Previously, an Astro `FontProvider` was made of a config and a runtime part. It relied directly on `unifont` types, which allowed a simple configuration for third-party unifont providers, but also coupled Astro's implementation to unifont, which was limiting. Astro's font provider implementation is now only made of a config part with dedicated hooks. This allows for the separation of config and runtime, but requires you to create a font provider object in order to use custom font providers (e.g. third-party unifont providers, or private font registries). ##### What should I do? If you were using a 3rd-party `unifont` font provider, you will now need to write an Astro `FontProvider` using it under the hood. For example: ```diff // astro.config.ts import { defineConfig } from "astro/config"; import { acmeProvider, type AcmeOptions } from '@acme/unifont-provider' +import type { FontProvider } from "astro"; +import type { InitializedProvider } from 'unifont'; +function acme(config?: AcmeOptions): FontProvider { + const provider = acmeProvider(config); + let initializedProvider: InitializedProvider | undefined; + return { + name: provider._name, + config, + async init(context) { + initializedProvider = await provider(context); + }, + async resolveFont({ familyName, ...rest }) { + return await initializedProvider?.resolveFont(familyName, rest); + }, + async listFonts() { + return await initializedProvider?.listFonts?.(); + }, + }; +} export default defineConfig({ experimental: { fonts: [{ - provider: acmeProvider({ /* ... */ }), + provider: acme({ /* ... */ }), name: "Material Symbols Outlined", cssVariable: "--font-material" }] } }); ``` - [#&#8203;15147](https://github.com/withastro/astro/pull/15147) [`9cd5b87`](https://github.com/withastro/astro/commit/9cd5b875f2d45a08bfa8312ed7282a6f0f070265) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes scripts in components not rendering when a sibling `<Fragment slot="...">` exists but is unused ### [`v5.16.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5168) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.7...astro@5.16.8) ##### Patch Changes - [#&#8203;15124](https://github.com/withastro/astro/pull/15124) [`81db3c0`](https://github.com/withastro/astro/commit/81db3c06e8f75bf1ec6f3d4d31a42d16dcf0e969) Thanks [@&#8203;leonace924](https://github.com/leonace924)! - Fixes an issue where requests with query parameters to the `base` path would return a 404 if trailingSlash was not `'ignore'` in development - [#&#8203;15152](https://github.com/withastro/astro/pull/15152) [`39ee41f`](https://github.com/withastro/astro/commit/39ee41fa56b362942162dc17b0b4252d2f881e7e) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes a case where `context.cookies.set()` would be overridden when setting cookies via response headers in development - [#&#8203;15140](https://github.com/withastro/astro/pull/15140) [`6f6f8f8`](https://github.com/withastro/astro/commit/6f6f8f8c0c3ccf346d741a8625bbfbe1329e472e) Thanks [@&#8203;cameronraysmith](https://github.com/cameronraysmith)! - Fixes esbuild warning due to dead code in assets virtual module - [#&#8203;15127](https://github.com/withastro/astro/pull/15127) [`2cff904`](https://github.com/withastro/astro/commit/2cff9045256a2b551465750de7cba29087046658) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Updates "Unsupported page types found" error to only appear in more realistic cases - [#&#8203;15149](https://github.com/withastro/astro/pull/15149) [`34f84c2`](https://github.com/withastro/astro/commit/34f84c2437fd078e299a29eeb1f931c9f83c8d2e) Thanks [@&#8203;rahuld109](https://github.com/rahuld109)! - Skips "Use the Image component" audit warning for images inside framework components (React, Vue, Svelte, etc.) ### [`v5.16.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5167) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.6...astro@5.16.7) ##### Patch Changes - [#&#8203;15122](https://github.com/withastro/astro/pull/15122) [`b137946`](https://github.com/withastro/astro/commit/b1379466e8c6ded9fbcc3687c7faca4c2d3472b2) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves JSDoc annotations for `AstroGlobal`, `AstroSharedContext` and `APIContext` types - [#&#8203;15123](https://github.com/withastro/astro/pull/15123) [`3f58fa2`](https://github.com/withastro/astro/commit/3f58fa20540ee3753158d8d0372affa47775c561) Thanks [@&#8203;43081j](https://github.com/43081j)! - Improves rendering performance by grouping render chunks when emitting from async iterables to avoid encoding costs - [#&#8203;14954](https://github.com/withastro/astro/pull/14954) [`7bec4bd`](https://github.com/withastro/astro/commit/7bec4bdadda1d66da1c7dc0a01ad4412a47337d9) Thanks [@&#8203;volpeon](https://github.com/volpeon)! - Fixes remote images `Etag` header handling by disabling internal cache - [#&#8203;15052](https://github.com/withastro/astro/pull/15052) [`b2bcd5a`](https://github.com/withastro/astro/commit/b2bcd5af28dfb75541f3249b0277b458355395cf) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes images not working in development when using setups with port forwarding - [#&#8203;15028](https://github.com/withastro/astro/pull/15028) [`87b19b8`](https://github.com/withastro/astro/commit/87b19b8df49d08ee7a7a1855f3645fe7bebf1997) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes certain aliases not working when using images in JSON files with the content layer - [#&#8203;15118](https://github.com/withastro/astro/pull/15118) [`cfa382b`](https://github.com/withastro/astro/commit/cfa382b7aa23a9f5a506181c75a0706595208396) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Removes the `defineAstroFontProvider()` type helper. If you are building a custom font provider, remove any occurrence of `defineAstroFontProvider()` and use the `FontProvider` type instead: ```diff -import { defineAstroFontProvider } from 'astro/config'; -export function myProvider() { - return defineAstroFontProvider({ - entrypoint: new URL('./implementation.js', import.meta.url) - }); -}; +import type { FontProvider } from 'astro'; +export function myProvider(): FontProvider { + return { + entrypoint: new URL('./implementation.js', import.meta.url) + }, +} ``` - [#&#8203;15055](https://github.com/withastro/astro/pull/15055) [`4e28db8`](https://github.com/withastro/astro/commit/4e28db8d125b693039b393111fa48d7bcc913968) Thanks [@&#8203;delucis](https://github.com/delucis)! - Reduces Astro’s install size by around 8 MB - [#&#8203;15088](https://github.com/withastro/astro/pull/15088) [`a19140f`](https://github.com/withastro/astro/commit/a19140fd11efbc635a391d176da54b0dc5e4a99c) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Enables the ClientRouter to preserve the original hash part of the target URL during server side redirects. - [#&#8203;15117](https://github.com/withastro/astro/pull/15117) [`b1e8e32`](https://github.com/withastro/astro/commit/b1e8e32670ba601d3b3150514173dd7d1bb25650) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Changes the font format downloaded by default when using the experimental Fonts API. Additionally, adds a new `formats` configuration option to specify which font formats to download. Previously, Astro was opinionated about which font sources would be kept for usage, mainly keeping `woff2` and `woff` files. You can now specify what font formats should be downloaded (if available). Only `woff2` files are downloaded by default. ##### What should I do? If you were previously relying on Astro downloading the `woff` format, you will now need to specify this explicitly with the new `formats` configuration option. Additionally, you may also specify any additional file formats to download if available: ```diff // astro.config.mjs import { defineConfig, fontProviders } from 'astro/config' export default defineConfig({ experimental: { fonts: [{ name: 'Roboto', cssVariable: '--font-roboto', provider: fontProviders.google(), + formats: ['woff2', 'woff', 'otf'] }] } }) ``` - [#&#8203;15034](https://github.com/withastro/astro/pull/15034) [`8115752`](https://github.com/withastro/astro/commit/811575237d159ceac5d9f0a2ea3bf023df718759) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a vite warning log during builds when using npm ### [`v5.16.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5166) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.5...astro@5.16.6) ##### Patch Changes - [#&#8203;14982](https://github.com/withastro/astro/pull/14982) [`6849e38`](https://github.com/withastro/astro/commit/6849e3844d940f76b544822e7bd247641d61567d) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes images outside the project directory not working when using astro:assets in development mode - [#&#8203;14987](https://github.com/withastro/astro/pull/14987) [`9dd9fca`](https://github.com/withastro/astro/commit/9dd9fca81e5ed3d0d55e0b1624c6515706963b1f) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes SVGs not working in dev mode when using the passthrough image service - [#&#8203;15014](https://github.com/withastro/astro/pull/15014) [`a178422`](https://github.com/withastro/astro/commit/a178422484ed62a76b227515a798e192fdcba3b9) Thanks [@&#8203;delucis](https://github.com/delucis)! - Adds support for extending the type of the props accepted by Astro’s `<Image>` component, `<Picture>` component, and `getImage()` API. ### [`v5.16.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5165) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.4...astro@5.16.5) ##### Patch Changes - [#&#8203;14985](https://github.com/withastro/astro/pull/14985) [`c016f10`](https://github.com/withastro/astro/commit/c016f1063beddc995c4b7a60430ff8860c05b462) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where JSDoc annotations wouldn't show for fonts related APIs in the Astro config - [#&#8203;14973](https://github.com/withastro/astro/pull/14973) [`ed7cc2f`](https://github.com/withastro/astro/commit/ed7cc2fd399084bdd8ba47094fe378fc8ce43048) Thanks [@&#8203;amankumarpandeyin](https://github.com/amankumarpandeyin)! - Fixes performance regression and OOM errors when building medium-sized blogs with many content entries. Replaced O(n²) object spread pattern with direct mutation in `generateLookupMap`. - [#&#8203;14958](https://github.com/withastro/astro/pull/14958) [`70eb542`](https://github.com/withastro/astro/commit/70eb542f3b509cd25461d19d275b8c050ace184f) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Gives a helpful error message if a user sets `output: "hybrid"` in their Astro config. The option was removed in Astro 5, but lots of content online still references it, and LLMs often suggest it. It's not always clear that the replacement is `output: "static"`, rather than `output: "server"`. This change adds a helpful error message to guide humans and robots. - [#&#8203;14901](https://github.com/withastro/astro/pull/14901) [`ef53716`](https://github.com/withastro/astro/commit/ef53716f93237d29cf732baae2d90ecd2c9f3bbe) Thanks [@&#8203;Darknab](https://github.com/Darknab)! - Updates the `glob()` loader to log a warning when duplicated IDs are detected - Updated dependencies \[[`d8305f8`](https://github.com/withastro/astro/commit/d8305f8abdf92db6fa505ee9c1774553ba90b7bd)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.10 ### [`v5.16.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5164) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.3...astro@5.16.4) ##### Patch Changes - [#&#8203;14940](https://github.com/withastro/astro/pull/14940) [`2cf79c2`](https://github.com/withastro/astro/commit/2cf79c23c23e3364b0e6a86394b6584112786c5b) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where Astro didn't properly combine CSP resources from the `csp` configuration with those added using the runtime API (`Astro.csp.insertDirective()`) to form grammatically correct CSP headers Now Astro correctly deduplicate CSP resources. For example, if you have a global resource in the configuration file, and then you add a a new one using the runtime APIs. ### [`v5.16.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5163) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.2...astro@5.16.3) ##### Patch Changes - [#&#8203;14889](https://github.com/withastro/astro/pull/14889) [`4bceeb0`](https://github.com/withastro/astro/commit/4bceeb0c7183de4db0087316e2fc2d287f27ad01) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes actions types when using specific TypeScript configurations - [#&#8203;14929](https://github.com/withastro/astro/pull/14929) [`e0f277d`](https://github.com/withastro/astro/commit/e0f277d9248d2fefbd0234b53f9dea8c9b750adb) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes authentication bypass via double URL encoding in middleware Prevents attackers from bypassing path-based authentication checks using multi-level URL encoding (e.g., `/%2561dmin` instead of `/%61dmin`). Pathnames are now validated after decoding to ensure no additional encoding remains. ### [`v5.16.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5162) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.1...astro@5.16.2) ##### Patch Changes - [#&#8203;14876](https://github.com/withastro/astro/pull/14876) [`b43dc7f`](https://github.com/withastro/astro/commit/b43dc7f28d582f22a4b28aa3a712af247c908dc3) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a vite warning log during builds when using npm - [#&#8203;14884](https://github.com/withastro/astro/pull/14884) [`10273e0`](https://github.com/withastro/astro/commit/10273e01357e515050f8233442a7252b51cad364) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where setting the status of a page to `404` in ssr would show an empty page (or `404.astro` page if provided) instead of using the current page ### [`v5.16.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51616) [Compare Source](https://github.com/withastro/astro/compare/astro@5.16.0...astro@5.16.1) ##### Patch Changes - [#&#8203;15281](https://github.com/withastro/astro/pull/15281) [`a1b80c6`](https://github.com/withastro/astro/commit/a1b80c65e5dddefba7ada20c7ccfdab26fb4e16b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Ensures server island requests carry an encrypted component export identifier so they do not accidentally resolve to the wrong component. - [#&#8203;15304](https://github.com/withastro/astro/pull/15304) [`02ee3c7`](https://github.com/withastro/astro/commit/02ee3c745297203c38ee013b500126b15f7e5fc9) Thanks [@&#8203;cameronapak](https://github.com/cameronapak)! - Fix: Remove await from getActionResult example - [#&#8203;15324](https://github.com/withastro/astro/pull/15324) [`ab41c3e`](https://github.com/withastro/astro/commit/ab41c3e789b821e9179d11d67f453ba955448be6) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Fixes an issue where certain unauthorized links could be rendered as clickable in the error overlay ### [`v5.16.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5160) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.9...astro@5.16.0) ##### Minor Changes - [#&#8203;13880](https://github.com/withastro/astro/pull/13880) [`1a2ed01`](https://github.com/withastro/astro/commit/1a2ed01c92fe93843046396a2c854514747f4df8) Thanks [@&#8203;azat-io](https://github.com/azat-io)! - Adds experimental SVGO optimization support for SVG assets Astro now supports automatic SVG optimization using SVGO during build time. This experimental feature helps reduce SVG file sizes while maintaining visual quality, improving your site's performance. To enable SVG optimization with default settings, add the following to your `astro.config.mjs`: ```js import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { svgo: true, }, }); ``` To customize optimization, pass a [SVGO configuration object](https://svgo.dev/docs/plugins/): ```js export default defineConfig({ experimental: { svgo: { plugins: [ 'preset-default', { name: 'removeViewBox', active: false, }, ], }, }, }); ``` For more information on enabling and using this feature in your project, see the [experimental SVG optimization docs](https://docs.astro.build/en/reference/experimental-flags/svg-optimization/). - [#&#8203;14810](https://github.com/withastro/astro/pull/14810) [`2e845fe`](https://github.com/withastro/astro/commit/2e845fe56de45c710d282ed36f92978612810b79) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds a hint for code agents to use the `--yes` flag to skip prompts when running `astro add` - [#&#8203;14698](https://github.com/withastro/astro/pull/14698) [`f42ff9b`](https://github.com/withastro/astro/commit/f42ff9bd5b4c8d3e67247ee6e21f14cd2062c037) Thanks [@&#8203;mauriciabad](https://github.com/mauriciabad)! - Adds the `ActionInputSchema` utility type to automatically infer the TypeScript type of an action's input based on its Zod schema For example, this type can be used to retrieve the input type of a form action: ```ts import { type ActionInputSchema, defineAction } from 'astro:actions'; import { z } from 'astro/zod'; const action = defineAction({ accept: 'form', input: z.object({ name: z.string() }), handler: ({ name }) => ({ message: `Welcome, ${name}!` }), }); type Schema = ActionInputSchema<typeof action>; // typeof z.object({ name: z.string() }) type Input = z.input<Schema>; // { name: string } ``` - [#&#8203;14574](https://github.com/withastro/astro/pull/14574) [`4356485`](https://github.com/withastro/astro/commit/4356485b0f708c7abf93207105ddcb890a466729) Thanks [@&#8203;jacobdalamb](https://github.com/jacobdalamb)! - Adds new CLI shortcuts available when running `astro preview`: - `o` + `enter`: open the site in your browser - `q` + `enter`: quit the preview - `h` + `enter`: print all available shortcuts ##### Patch Changes - [#&#8203;14813](https://github.com/withastro/astro/pull/14813) [`e1dd377`](https://github.com/withastro/astro/commit/e1dd377398a3dcf6ba0697dc8d4bde6d77a45700) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Removes `picocolors` as dependency in favor of the fork `piccolore`. - [#&#8203;14609](https://github.com/withastro/astro/pull/14609) [`d774306`](https://github.com/withastro/astro/commit/d774306c517c33276adf48f2c2ea6a0a2a4a7aa6) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves `astro info` - [#&#8203;14796](https://github.com/withastro/astro/pull/14796) [`c29a785`](https://github.com/withastro/astro/commit/c29a785d57f08c5526828379d748f788797d9c39) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - **BREAKING CHANGE to the experimental Fonts API only** Updates the default `subsets` to `["latin"]` Subsets have been a common source of confusion: they caused a lot of files to be downloaded by default. You now have to manually pick extra subsets. Review your Astro config and update subsets if you need, for example if you need greek characters: ```diff import { defineConfig, fontProviders } from "astro/config" export default defineConfig({ experimental: { fonts: [{ name: "Roboto", cssVariable: "--font-roboto", provider: fontProviders.google(), + subsets: ["latin", "greek"] }] } }) ``` ### [`v5.15.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5159) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.8...astro@5.15.9) ##### Patch Changes - [#&#8203;14786](https://github.com/withastro/astro/pull/14786) [`758a891`](https://github.com/withastro/astro/commit/758a891112839a108479fd0489a1785640b31ecf) Thanks [@&#8203;mef](https://github.com/mef)! - Add handling of invalid encrypted props and slots in server islands. - [#&#8203;14783](https://github.com/withastro/astro/pull/14783) [`504958f`](https://github.com/withastro/astro/commit/504958fe7fccd7bffc177a1f4b1bf4e22989470e) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves the experimental Fonts API build log to show the number of downloaded files. This can help spotting excessive downloading because of misconfiguration - [#&#8203;14791](https://github.com/withastro/astro/pull/14791) [`9e9c528`](https://github.com/withastro/astro/commit/9e9c528191b6f5e06db9daf6ad26b8f68016e533) Thanks [@&#8203;Princesseuh](https://github.com/Princesseuh)! - Changes the remote protocol checks for images to require explicit authorization in order to use data URIs. In order to allow data URIs for remote images, you will need to update your `astro.config.mjs` file to include the following configuration: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ images: { remotePatterns: [ { protocol: 'data', }, ], }, }); ``` - [#&#8203;14787](https://github.com/withastro/astro/pull/14787) [`0f75f6b`](https://github.com/withastro/astro/commit/0f75f6bc637d547e07324e956db21d9f245a3e8e) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes wildcard hostname pattern matching to correctly reject hostnames without dots Previously, hostnames like `localhost` or other single-part names would incorrectly match patterns like `*.example.com`. The wildcard matching logic has been corrected to ensure that only valid subdomains matching the pattern are accepted. - [#&#8203;14776](https://github.com/withastro/astro/pull/14776) [`3537876`](https://github.com/withastro/astro/commit/3537876fde3bdb2a0ded99cc9b00d53f66160a7f) Thanks [@&#8203;ktym4a](https://github.com/ktym4a)! - Fixes the behavior of `passthroughImageService` so it does not generate webp. - Updated dependencies \[[`9e9c528`](https://github.com/withastro/astro/commit/9e9c528191b6f5e06db9daf6ad26b8f68016e533), [`0f75f6b`](https://github.com/withastro/astro/commit/0f75f6bc637d547e07324e956db21d9f245a3e8e)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.5 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.9 ### [`v5.15.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5158) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.7...astro@5.15.8) ##### Patch Changes - [#&#8203;14772](https://github.com/withastro/astro/pull/14772) [`00c579a`](https://github.com/withastro/astro/commit/00c579a23322d92459e4ccad0ec365c4d1980a5d) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves the security of Server Islands slots by encrypting them before transmission to the browser, matching the security model used for props. This improves the integrity of slot content and prevents injection attacks, even when component templates don't explicitly support slots. Slots continue to work as expected for normal usage—this change has no breaking changes for legitimate requests. - [#&#8203;14771](https://github.com/withastro/astro/pull/14771) [`6f80081`](https://github.com/withastro/astro/commit/6f800813516b07bbe12c666a92937525fddb58ce) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix middleware pathname matching by normalizing URL-encoded paths Middleware now receives normalized pathname values, ensuring that encoded paths like `/%61dmin` are properly decoded to `/admin` before middleware checks. This prevents potential security issues where middleware checks might be bypassed through URL encoding. ### [`v5.15.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5157) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.6...astro@5.15.7) ##### Patch Changes - [#&#8203;14765](https://github.com/withastro/astro/pull/14765) [`03fb47c`](https://github.com/withastro/astro/commit/03fb47c0106fda823e4dc89ed98d282ecb5258a0) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `process.env` wouldn't be properly populated during the build - [#&#8203;14690](https://github.com/withastro/astro/pull/14690) [`ae7197d`](https://github.com/withastro/astro/commit/ae7197d35676b3745dc9ca71aecbcf3bbbfffb30) Thanks [@&#8203;fredriknorlin](https://github.com/fredriknorlin)! - Fixes a bug where Astro's i18n fallback system with `fallbackType: 'rewrite'` would not generate fallback files for pages whose filename started with a locale key. ### [`v5.15.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5156) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.5...astro@5.15.6) ##### Patch Changes - [#&#8203;14751](https://github.com/withastro/astro/pull/14751) [`18c55e1`](https://github.com/withastro/astro/commit/18c55e15eaef56cbe06626b6bdb43ab250ab6f49) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes hydration of client components when running the dev server and using a barrel file that re-exports both Astro and UI framework components. - [#&#8203;14750](https://github.com/withastro/astro/pull/14750) [`35122c2`](https://github.com/withastro/astro/commit/35122c278f987f9213b8e1094382398a16090aff) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates the experimental Fonts API to log a warning if families with a conflicting `cssVariable` are provided - [#&#8203;14737](https://github.com/withastro/astro/pull/14737) [`74c8852`](https://github.com/withastro/astro/commit/74c8852c534cc23217a78979e10885429b290e0b) Thanks [@&#8203;Arecsu](https://github.com/Arecsu)! - Fixes an error when using `transition:persist` with components that use declarative Shadow DOM. Astro now avoids re-attaching a shadow root if one already exists, preventing `"Unable to re-attach to existing ShadowDOM"` navigation errors. - [#&#8203;14750](https://github.com/withastro/astro/pull/14750) [`35122c2`](https://github.com/withastro/astro/commit/35122c278f987f9213b8e1094382398a16090aff) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates the experimental Fonts API to allow for more granular configuration of remote font families A font family is defined by a combination of properties such as weights and styles (e.g. `weights: [500, 600]` and `styles: ["normal", "bold"]`), but you may want to download only certain combinations of these. For greater control over which font files are downloaded, you can specify the same font (ie. with the same `cssVariable`, `name`, and `provider` properties) multiple times with different combinations. Astro will merge the results and download only the required files. For example, it is possible to download normal `500` and `600` while downloading only italic `500`: ```js // astro.config.mjs import { defineConfig, fontProviders } from 'astro/config'; export default defineConfig({ experimental: { fonts: [ { name: 'Roboto', cssVariable: '--roboto', provider: fontProviders.google(), weights: [500, 600], styles: ['normal'], }, { name: 'Roboto', cssVariable: '--roboto', provider: fontProviders.google(), weights: [500], styles: ['italic'], }, ], }, }); ``` ### [`v5.15.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5155) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.4...astro@5.15.5) ##### Patch Changes - [#&#8203;14712](https://github.com/withastro/astro/pull/14712) [`91780cf`](https://github.com/withastro/astro/commit/91780cffa7cf97cc22694d55962710609a5475b0) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where build's `process.env` would be inlined in the server output - [#&#8203;14713](https://github.com/withastro/astro/pull/14713) [`666d5a7`](https://github.com/withastro/astro/commit/666d5a7ef486aa57f20f87b6cb210619dabd9c4c) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves fallbacks generation when using the experimental Fonts API - [#&#8203;14743](https://github.com/withastro/astro/pull/14743) [`dafbb1b`](https://github.com/withastro/astro/commit/dafbb1ba29912099c4faff1440033edc768af8b4) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Improves `X-Forwarded` header validation to prevent cache poisoning and header injection attacks. Now properly validates `X-Forwarded-Proto`, `X-Forwarded-Host`, and `X-Forwarded-Port` headers against configured `allowedDomains` patterns, rejecting malformed or suspicious values. This is especially important when running behind a reverse proxy or load balancer. ### [`v5.15.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5154) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.3...astro@5.15.4) ##### Patch Changes - [#&#8203;14703](https://github.com/withastro/astro/pull/14703) [`970ac0f`](https://github.com/withastro/astro/commit/970ac0f51172e1e6bff4440516a851e725ac3097) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Adds missing documentation for some public utilities exported from `astro:i18n`. - [#&#8203;14715](https://github.com/withastro/astro/pull/14715) [`3d55c5d`](https://github.com/withastro/astro/commit/3d55c5d0fb520d470b33d391e5b68861f5b51271) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds support for client hydration in `getContainerRenderer()` The `getContainerRenderer()` function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually call `container.addClientRenderer()` with the appropriate client renderer entrypoint. See [the `container-with-vitest` demo](https://github.com/withastro/astro/blob/main/examples/container-with-vitest/test/ReactWrapper.test.ts) for a usage example, and [the Container API documentation](https://docs.astro.build/en/reference/container-reference/#renderers-option) for more information on using framework components with the experimental Container API. - [#&#8203;14711](https://github.com/withastro/astro/pull/14711) [`a4d284d`](https://github.com/withastro/astro/commit/a4d284dad1c437fa64773f43d030a3e504d783e1) Thanks [@&#8203;deining](https://github.com/deining)! - Fixes typos in documenting our error messages and public APIs. - [#&#8203;14701](https://github.com/withastro/astro/pull/14701) [`9be54c7`](https://github.com/withastro/astro/commit/9be54c77cf8c65d253a70e9b7a8ff144a0f95d66) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where the experimental Fonts API would filter available font files too aggressively, which could prevent the download of woff files when using the google provider ### [`v5.15.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5153) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.2...astro@5.15.3) ##### Patch Changes - [#&#8203;14627](https://github.com/withastro/astro/pull/14627) [`b368de0`](https://github.com/withastro/astro/commit/b368de099e74f5d65c5e8f9799c9c3e0217714ae) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes skew protection support for images and font URLs Adapter-level query parameters (`assetQueryParams`) are now applied to all image and font asset URLs, including: - Dynamic optimized images via `/_image` endpoint - Static optimized image files - Font preload tags and font requests when using the experimental Fonts API - [#&#8203;14631](https://github.com/withastro/astro/pull/14631) [`3ad33f9`](https://github.com/withastro/astro/commit/3ad33f97429fedc1a873c50b54f3cd5e0d95bec8) Thanks [@&#8203;KurtGokhan](https://github.com/KurtGokhan)! - Adds the `astro/jsx-dev-runtime` export as an alias for `astro/jsx-runtime` ### [`v5.15.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5152) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.1...astro@5.15.2) ##### Patch Changes - [#&#8203;14623](https://github.com/withastro/astro/pull/14623) [`c5fe295`](https://github.com/withastro/astro/commit/c5fe295c41c8bc3b9f85727c3635e9ddc67f0030) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes a leak of server runtime code when importing SVGs in client-side code. Previously, when importing an SVG file in client code, Astro could end up adding code for rendering SVGs on the server to the client bundle. - [#&#8203;14621](https://github.com/withastro/astro/pull/14621) [`e3175d9`](https://github.com/withastro/astro/commit/e3175d9ccbf070150ab2229b2564ca0b12a86c30) Thanks [@&#8203;GameRoMan](https://github.com/GameRoMan)! - Updates `vite` version to fix CVE ### [`v5.15.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5151) [Compare Source](https://github.com/withastro/astro/compare/astro@5.15.0...astro@5.15.1) ##### Patch Changes - [#&#8203;14612](https://github.com/withastro/astro/pull/14612) [`18552c7`](https://github.com/withastro/astro/commit/18552c733c55792a4bf8374d66134742d666e902) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a regression introduced in Astro v5.14.7 that caused `?url` imports to not work correctly. This release reverts [#&#8203;14142](https://github.com/withastro/astro/pull/14142). ### [`v5.15.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5150) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.8...astro@5.15.0) ##### Minor Changes - [#&#8203;14543](https://github.com/withastro/astro/pull/14543) [`9b3241d`](https://github.com/withastro/astro/commit/9b3241d8a903ce0092905205af883cef5498d0b2) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds two new adapter configuration options `assetQueryParams` and `internalFetchHeaders` to the Adapter API. Official and community-built adapters can now use `client.assetQueryParams` to specify query parameters that should be appended to asset URLs (CSS, JavaScript, images, fonts, etc.). The query parameters are automatically appended to all generated asset URLs during the build process. Adapters can also use `client.internalFetchHeaders` to specify headers that should be included in Astro's internal fetch calls (Actions, View Transitions, Server Islands, Prefetch). This enables features like Netlify's skew protection, which requires the deploy ID to be sent with both internal requests and asset URLs to ensure client and server versions match during deployments. - [#&#8203;14489](https://github.com/withastro/astro/pull/14489) [`add4277`](https://github.com/withastro/astro/commit/add4277b6d78080a9da32554f495d870978656af) Thanks [@&#8203;dev-shetty](https://github.com/dev-shetty)! - Adds a new Copy to Clipboard button to the error overlay stack trace. When an error occurs in dev mode, you can now copy the stack trace with a single click to more easily share it in a bug report, a support thread, or with your favorite LLM. - [#&#8203;14564](https://github.com/withastro/astro/pull/14564) [`5e7cebb`](https://github.com/withastro/astro/commit/5e7cebbfaa935dab462de6efb0bab507644e10de) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Updates `astro add cloudflare` to scaffold more configuration files Running `astro add cloudflare` will now emit `wrangler.jsonc` and `public/.assetsignore`, allowing your Astro project to work out of the box as a worker. ##### Patch Changes - [#&#8203;14591](https://github.com/withastro/astro/pull/14591) [`3e887ec`](https://github.com/withastro/astro/commit/3e887ec523b8e4ec4d01978f0fedf246dfdfbc81) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Adds TypeScript support for the `components` prop on MDX `Content` component when using `await render()`. Developers now get proper IntelliSense and type checking when passing custom components to override default MDX element rendering. - [#&#8203;14598](https://github.com/withastro/astro/pull/14598) [`7b45c65`](https://github.com/withastro/astro/commit/7b45c65c62e37d4225fb14ea378e2301de31cbea) Thanks [@&#8203;delucis](https://github.com/delucis)! - Reduces terminal text styling dependency size by switching from `kleur` to `picocolors` - [#&#8203;13826](https://github.com/withastro/astro/pull/13826) [`8079482`](https://github.com/withastro/astro/commit/807948204d3838031e8952a5b3eadb26f5612b8f) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds the option to specify in the `preload` directive which weights, styles, or subsets to preload for a given font family when using the experimental Fonts API: ```astro --- import { Font } from 'astro:assets'; --- <Font cssVariable="--font-roboto" preload={[{ subset: 'latin', style: 'normal' }, { weight: '400' }]} /> ``` Variable weight font files will be preloaded if any weight within its range is requested. For example, a font file for font weight `100 900` will be included when `400` is specified in a `preload` object. ### [`v5.14.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5148) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.7...astro@5.14.8) ##### Patch Changes - [#&#8203;14590](https://github.com/withastro/astro/pull/14590) [`577d051`](https://github.com/withastro/astro/commit/577d051637d1b5d0df3100bed4c1d815eae7291c) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes image path resolution in content layer collections to support bare filenames. The `image()` helper now normalizes bare filenames like `"cover.jpg"` to relative paths `"./cover.jpg"` for consistent resolution behavior between markdown frontmatter and JSON content collections. ### [`v5.14.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5147) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.6...astro@5.14.7) ##### Patch Changes - [#&#8203;14582](https://github.com/withastro/astro/pull/14582) [`7958c6b`](https://github.com/withastro/astro/commit/7958c6b44c4bcdaa827d33f71ae7c2def26dc1b4) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a regression that caused Actions to throw errors while loading - [#&#8203;14567](https://github.com/withastro/astro/pull/14567) [`94500bb`](https://github.com/withastro/astro/commit/94500bb22236b77c842d88407b9a73bfc7fde488) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes the actions endpoint to return 404 for nonexistent actions instead of throwing an unhandled error - [#&#8203;14566](https://github.com/withastro/astro/pull/14566) [`946fe68`](https://github.com/withastro/astro/commit/946fe68c973c966a4f589ae43858bf486cc70eb5) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes handling malformed cookies gracefully by returning the unparsed value instead of throwing When a cookie with an invalid value is present (e.g., containing invalid URI sequences), `Astro.cookies.get()` now returns the raw cookie value instead of throwing a URIError. This aligns with the behavior of the underlying `cookie` package and prevents crashes when manually-set or corrupted cookies are encountered. - [#&#8203;14142](https://github.com/withastro/astro/pull/14142) [`73c5de9`](https://github.com/withastro/astro/commit/73c5de9263c1de17804a1720d91d3475425b24d1) Thanks [@&#8203;P4tt4te](https://github.com/P4tt4te)! - Updates handling of CSS for hydrated client components to prevent duplicates - [#&#8203;14576](https://github.com/withastro/astro/pull/14576) [`2af62c6`](https://github.com/withastro/astro/commit/2af62c659c3b428561ddf1fa3d0f02126841b672) Thanks [@&#8203;aprici7y](https://github.com/aprici7y)! - Fixes a regression that caused `Astro.site` to always be `undefined` in `getStaticPaths()` ### [`v5.14.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5146) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.5...astro@5.14.6) ##### Patch Changes - [#&#8203;14562](https://github.com/withastro/astro/pull/14562) [`722bba0`](https://github.com/withastro/astro/commit/722bba0a57984b6b1c4585627cafa22af64e4251) Thanks [@&#8203;erbierc](https://github.com/erbierc)! - Fixes a bug where the behavior of the "muted" HTML attribute was inconsistent with that of other attributes. - [#&#8203;14538](https://github.com/withastro/astro/pull/14538) [`51ebe6a`](https://github.com/withastro/astro/commit/51ebe6ae9307f5c2124162212493f61152221a43) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Improves how Actions are implemented - [#&#8203;14548](https://github.com/withastro/astro/pull/14548) [`6cdade4`](https://github.com/withastro/astro/commit/6cdade49c975e717f098bb4aa7f03a7b845d0a7c) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Removes support for the `maxAge` property in `cacheHint` objects returned by live loaders. ##### :warning: Breaking change for experimental live content collections only Feedback showed that this did not make sense to set at the loader level, since the loader does not know how long each individual entry should be cached for. If your live loader returns cache hints with `maxAge`, you need to remove this property: ```diff return { entries: [...], cacheHint: { tags: ['my-tag'], - maxAge: 60, lastModified: new Date(), }, }; ``` The `cacheHint` object now only supports `tags` and `lastModified` properties. If you want to set the max age for a page, you can set the headers manually: ```astro --- Astro.headers.set('cdn-cache-control', 'max-age=3600'); --- ``` - [#&#8203;14548](https://github.com/withastro/astro/pull/14548) [`6cdade4`](https://github.com/withastro/astro/commit/6cdade49c975e717f098bb4aa7f03a7b845d0a7c) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds missing `rendered` property to experimental live collections entry type Live collections support a `rendered` property that allows you to provide pre-rendered HTML for each entry. While this property was documented and implemented, it was missing from the TypeScript types. This could lead to type errors when trying to use it in a TypeScript project. No changes to your project code are necessary. You can continue to use the `rendered` property as before, and it will no longer produce TypeScript errors. ### [`v5.14.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5145) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.4...astro@5.14.5) ##### Patch Changes - [#&#8203;14525](https://github.com/withastro/astro/pull/14525) [`4f55781`](https://github.com/withastro/astro/commit/4f5578190dab96ad0cd117b9e9bb96fdd18730ae) Thanks [@&#8203;penx](https://github.com/penx)! - Fixes `defineLiveCollection()` types - [#&#8203;14441](https://github.com/withastro/astro/pull/14441) [`62ec8ea`](https://github.com/withastro/astro/commit/62ec8ea14a42c1dba81f68c50e987b111fabcce5) Thanks [@&#8203;upsuper](https://github.com/upsuper)! - Updates redirect handling to be consistent across `static` and `server` output, aligning with the behavior of other adapters. Previously, the Node.js adapter used default HTML files with meta refresh tags when in `static` output. This often resulted in an extra flash of the page on redirect, while also not applying the proper status code for redirections. It's also likely less friendly to search engines. This update ensures that configured redirects are always handled as HTTP redirects regardless of output mode, and the default HTML files for the redirects are no longer generated in `static` output. It makes the Node.js adapter more consistent with the other official adapters. No change to your project is required to take advantage of this new adapter functionality. It is not expected to cause any breaking changes. However, if you relied on the previous redirecting behavior, you may need to handle your redirects differently now. Otherwise, you should notice smoother redirects, with more accurate HTTP status codes, and may potentially see some SEO gains. - [#&#8203;14506](https://github.com/withastro/astro/pull/14506) [`ec3cbe1`](https://github.com/withastro/astro/commit/ec3cbe178094e94fcb49cccdcc15c6ffee3104ba) Thanks [@&#8203;abdo-spices](https://github.com/abdo-spices)! - Updates the `<Font />` component so that preload links are generated after the style tag, as recommended by capo.js ### [`v5.14.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5144) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.3...astro@5.14.4) ##### Patch Changes - [#&#8203;14509](https://github.com/withastro/astro/pull/14509) [`7e04caf`](https://github.com/withastro/astro/commit/7e04caf9a4a75c75f06c4207fae601a5fd251735) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Fixes an error in the docs that specified an incorrect version for the `security.allowedDomains` release. ### [`v5.14.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5143) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.1...astro@5.14.3) ##### Patch Changes - [#&#8203;14505](https://github.com/withastro/astro/pull/14505) [`28b2a1d`](https://github.com/withastro/astro/commit/28b2a1db4f3f265632f280b0dbc4c5f241c387e2) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes `Cannot set property manifest` error in test utilities by adding a protected setter for the manifest property - [#&#8203;14235](https://github.com/withastro/astro/pull/14235) [`c4d84bb`](https://github.com/withastro/astro/commit/c4d84bb654c9a5064b243e971c3b5b280e2b3791) Thanks [@&#8203;toxeeec](https://github.com/toxeeec)! - Fixes a bug where the "tap" prefetch strategy worked only on the first clicked link with view transitions enabled ### [`v5.14.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5141) [Compare Source](https://github.com/withastro/astro/compare/astro@5.14.0...astro@5.14.1) ##### Patch Changes - [#&#8203;14440](https://github.com/withastro/astro/pull/14440) [`a3e16ab`](https://github.com/withastro/astro/commit/a3e16ab6dd0bef9ab6259f23bfeebed747e27497) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where the URLs generated by the experimental Fonts API would be incorrect in dev ### [`v5.14.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5140) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.11...astro@5.14.0) ##### Minor Changes - [#&#8203;13520](https://github.com/withastro/astro/pull/13520) [`a31edb8`](https://github.com/withastro/astro/commit/a31edb8daad8632bacd1861adf6ac720695f7173) Thanks [@&#8203;openscript](https://github.com/openscript)! - Adds a new property `routePattern` available to `GetStaticPathsOptions` This provides the original, dynamic segment definition in a routing file path (e.g. `/[...locale]/[files]/[slug]`) from the Astro render context that would not otherwise be available within the scope of `getStaticPaths()`. This can be useful to calculate the `params` and `props` for each page route. For example, you can now localize your route segments and return an array of static paths by passing `routePattern` to a custom `getLocalizedData()` helper function. The `params` object will be set with explicit values for each route segment (e.g. `locale`, `files`, and `slug)`. Then, these values will be used to generate the routes and can be used in your page template via `Astro.params`. ```astro --- // src/pages/[...locale]/[files]/[slug].astro import { getLocalizedData } from '../../../utils/i18n'; export async function getStaticPaths({ routePattern }) { const response = await fetch('...'); const data = await response.json(); console.log(routePattern); // [...locale]/[files]/[slug] // Call your custom helper with `routePattern` to generate the static paths return data.flatMap((file) => getLocalizedData(file, routePattern)); } const { locale, files, slug } = Astro.params; --- ``` For more information about this advanced routing pattern, see Astro's [routing reference](https://docs.astro.build/en/reference/routing-reference/#routepattern). - [#&#8203;13651](https://github.com/withastro/astro/pull/13651) [`dcfbd8c`](https://github.com/withastro/astro/commit/dcfbd8c9d5dc798d1bcb9b36531c2eded301050d) Thanks [@&#8203;ADTC](https://github.com/ADTC)! - Adds a new `SvgComponent` type You can now more easily enforce type safety for your `.svg` assets by directly importing `SVGComponent` from `astro/types`: ```astro --- // src/components/Logo.astro import type { SvgComponent } from 'astro/types'; import HomeIcon from './Home.svg'; interface Link { url: string; text: string; icon: SvgComponent; } const links: Link[] = [ { url: '/', text: 'Home', icon: HomeIcon, }, ]; --- ``` - [#&#8203;14206](https://github.com/withastro/astro/pull/14206) [`16a23e2`](https://github.com/withastro/astro/commit/16a23e23c3ad2309d3b84962b055f4b2d1c8604c) Thanks [@&#8203;Fryuni](https://github.com/Fryuni)! - Warn on prerendered routes collision. Previously, when two dynamic routes `/[foo]` and `/[bar]` returned values on their `getStaticPaths` that resulted in the same final path, only one of the routes would be rendered while the other would be silently ignored. Now, when this happens, a warning will be displayed explaining which routes collided and on which path. Additionally, a new experimental flag `failOnPrerenderConflict` can be used to fail the build when such a collision occurs. ##### Patch Changes - [#&#8203;13811](https://github.com/withastro/astro/pull/13811) [`69572c0`](https://github.com/withastro/astro/commit/69572c0aa2d453cc399948406dbcbfd12e03c4a8) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds a new `getFontData()` method to retrieve lower-level font family data programmatically when using the experimental Fonts API The `getFontData()` helper function from `astro:assets` provides access to font family data for use outside of Astro. This can then be used in an [API Route](/en/guides/endpoints/#server-endpoints-api-routes) or to generate your own meta tags. ```ts import { getFontData } from 'astro:assets'; const data = getFontData('--font-roboto'); ``` For example, `getFontData()` can get the font buffer from the URL when using [satori](https://github.com/vercel/satori) to generate Open Graph images: ```tsx // src/pages/og.png.ts import type { APIRoute } from 'astro'; import { getFontData } from 'astro:assets'; import satori from 'satori'; export const GET: APIRoute = (context) => { const data = getFontData('--font-roboto'); const svg = await satori(<div style={{ color: 'black' }}>hello, world</div>, { width: 600, height: 400, fonts: [ { name: 'Roboto', data: await fetch(new URL(data[0].src[0].url, context.url.origin)).then((res) => res.arrayBuffer(), ), weight: 400, style: 'normal', }, ], }); // ... }; ``` See the [experimental Fonts API documentation](https://docs.astro.build/en/reference/experimental-flags/fonts/#accessing-font-data-programmatically) for more information. ### [`v5.13.11`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51311) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.10...astro@5.13.11) ##### Patch Changes - [#&#8203;14409](https://github.com/withastro/astro/pull/14409) [`250a595`](https://github.com/withastro/astro/commit/250a595596e9c7e1a966c5cda40f9bd5cf9d3f66) Thanks [@&#8203;louisescher](https://github.com/louisescher)! - Fixes an issue where `astro info` would log errors to console in certain cases. - [#&#8203;14398](https://github.com/withastro/astro/pull/14398) [`a7df80d`](https://github.com/withastro/astro/commit/a7df80d284652b500079e4476b17d5d1b7746b06) Thanks [@&#8203;idawnlight](https://github.com/idawnlight)! - Fixes an unsatisfiable type definition when calling `addServerRenderer` on an experimental container instance - [#&#8203;13747](https://github.com/withastro/astro/pull/13747) [`120866f`](https://github.com/withastro/astro/commit/120866f35a6b27c31bae1c04c0ea9d6bdaf09b16) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Adds automatic request signal abortion when the underlying socket closes in the Node.js adapter The Node.js adapter now automatically aborts the `request.signal` when the client connection is terminated. This enables better resource management and allows applications to properly handle client disconnections through the standard `AbortSignal` API. - [#&#8203;14428](https://github.com/withastro/astro/pull/14428) [`32a8acb`](https://github.com/withastro/astro/commit/32a8acba50bb15101c099fc7a14081d1a8cf0331) Thanks [@&#8203;drfuzzyness](https://github.com/drfuzzyness)! - Force sharpService to return a Uint8Array if Sharp returns a SharedArrayBuffer - [#&#8203;14411](https://github.com/withastro/astro/pull/14411) [`a601186`](https://github.com/withastro/astro/commit/a601186fb9ac0e7c8ff20887024234ecbfdd6ff1) Thanks [@&#8203;GameRoMan](https://github.com/GameRoMan)! - Fixes relative links to docs that could not be opened in the editor. ### [`v5.13.10`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51310) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.9...astro@5.13.10) ##### Patch Changes - Updated dependencies \[[`1e2499e`](https://github.com/withastro/astro/commit/1e2499e8ea83ebfa233a18a7499e1ccf169e56f4)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.3 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.7 ### [`v5.13.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5139) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.8...astro@5.13.9) ##### Patch Changes - [#&#8203;14402](https://github.com/withastro/astro/pull/14402) [`54dcd04`](https://github.com/withastro/astro/commit/54dcd04350b83cbf368dfb8d72f7d2ddf209a91e) Thanks [@&#8203;FredKSchott](https://github.com/FredKSchott)! - Removes warning that caused unexpected console spam when using Bun ### [`v5.13.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5138) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.7...astro@5.13.8) ##### Patch Changes - [#&#8203;14300](https://github.com/withastro/astro/pull/14300) [`bd4a70b`](https://github.com/withastro/astro/commit/bd4a70bde3c8e0c04e2754cf26d222aa36d3c3c8) Thanks [@&#8203;louisescher](https://github.com/louisescher)! - Adds Vite version & integration versions to output of `astro info` - [#&#8203;14341](https://github.com/withastro/astro/pull/14341) [`f75fd99`](https://github.com/withastro/astro/commit/f75fd9977f0f3f8afd1128cc3616205edec0a11c) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes support for declarative Shadow DOM when using the `<ClientRouter>` component - [#&#8203;14350](https://github.com/withastro/astro/pull/14350) [`f59581f`](https://github.com/withastro/astro/commit/f59581f2d4566c684c587af816e22763440ded19) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Improves error reporting for content collections by adding logging for configuration errors that had previously been silently ignored. Also adds a new error that is thrown if a live collection is used in `content.config.ts` rather than `live.config.ts`. - [#&#8203;14343](https://github.com/withastro/astro/pull/14343) [`13f7d36`](https://github.com/withastro/astro/commit/13f7d36688042cdb5644786d795fc921841da76a) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a regression in non node runtimes ### [`v5.13.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5137) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.6...astro@5.13.7) ##### Patch Changes - [#&#8203;14330](https://github.com/withastro/astro/pull/14330) [`72e14ab`](https://github.com/withastro/astro/commit/72e14abed6e20d31b1cd2caeeaa7e43703bf3aa3) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Removes pinned package that is no longer needed. - [#&#8203;14335](https://github.com/withastro/astro/pull/14335) [`17c7b03`](https://github.com/withastro/astro/commit/17c7b0395c00a0ea29dad9517b60bad3bd3a87a1) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Bumps `sharp` minimal version to `0.34.0` ### [`v5.13.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5136) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.5...astro@5.13.6) ##### Patch Changes - [#&#8203;14294](https://github.com/withastro/astro/pull/14294) [`e005855`](https://github.com/withastro/astro/commit/e0058553b2a6bb03fd864d77a1f07c25c60f7d91) Thanks [@&#8203;martrapp](https://github.com/martrapp)! - Restores the ability to use Google Analytics `History change trigger` with the `<ClientRouter />`. - [#&#8203;14326](https://github.com/withastro/astro/pull/14326) [`c24a8f4`](https://github.com/withastro/astro/commit/c24a8f42a17410ea78fc2d68ff0105b931a381eb) Thanks [@&#8203;jsparkdev](https://github.com/jsparkdev)! - Updates `vite` version to fix CVE - [#&#8203;14108](https://github.com/withastro/astro/pull/14108) [`218e070`](https://github.com/withastro/astro/commit/218e07054f4fe7a16e13479861dc162f6d886edc) Thanks [@&#8203;JusticeMatthew](https://github.com/JusticeMatthew)! - Updates dynamic route split regex to avoid infinite retries/exponential complexity - [#&#8203;14327](https://github.com/withastro/astro/pull/14327) [`c1033be`](https://github.com/withastro/astro/commit/c1033beafa331bbd67f0ee76b47303deb3db806f) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Pins simple-swizzle to avoid compromised version ### [`v5.13.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5135) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.4...astro@5.13.5) ##### Patch Changes - [#&#8203;14286](https://github.com/withastro/astro/pull/14286) [`09c5db3`](https://github.com/withastro/astro/commit/09c5db37d12862eef8d4ecf62389e10f30a22de9) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - **BREAKING CHANGES only to the experimental CSP feature** The following runtime APIs of the `Astro` global have been renamed: - `Astro.insertDirective` to `Astro.csp.insertDirective` - `Astro.insertStyleResource` to `Astro.csp.insertStyleResource` - `Astro.insertStyleHash` to `Astro.csp.insertStyleHash` - `Astro.insertScriptResource` to `Astro.csp.insertScriptResource` - `Astro.insertScriptHash` to `Astro.csp.insertScriptHash` The following runtime APIs of the `APIContext` have been renamed: - `ctx.insertDirective` to `ctx.csp.insertDirective` - `ctx.insertStyleResource` to `ctx.csp.insertStyleResource` - `ctx.insertStyleHash` to `ctx.csp.insertStyleHash` - `ctx.insertScriptResource` to `ctx.csp.insertScriptResource` - `ctx.insertScriptHash` to `ctx.csp.insertScriptHash` - [#&#8203;14283](https://github.com/withastro/astro/pull/14283) [`3224637`](https://github.com/withastro/astro/commit/3224637eca5c065872d92449216cb33baac2dbfd) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where CSP headers were incorrectly injected in the development server. - [#&#8203;14275](https://github.com/withastro/astro/pull/14275) [`3e2f20d`](https://github.com/withastro/astro/commit/3e2f20d07e92b1acfadb1357a59b6952e85227f3) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds support for experimental CSP when using experimental fonts Experimental fonts now integrate well with experimental CSP by injecting hashes for the styles it generates, as well as `font-src` directives. No action is required to benefit from it. - [#&#8203;14280](https://github.com/withastro/astro/pull/14280) [`4b9fb73`](https://github.com/withastro/astro/commit/4b9fb736dab42b8864012db0a981d3441366c388) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused cookies to not be correctly set when using middleware sequences - [#&#8203;14276](https://github.com/withastro/astro/pull/14276) [`77281c4`](https://github.com/withastro/astro/commit/77281c4616b65959715dcbac42bf948bebfee755) Thanks [@&#8203;ArmandPhilippot](https://github.com/ArmandPhilippot)! - Adds a missing export for `resolveSrc`, a documented image services utility. ### [`v5.13.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5134) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.3...astro@5.13.4) ##### Patch Changes - [#&#8203;14260](https://github.com/withastro/astro/pull/14260) [`86a1e40`](https://github.com/withastro/astro/commit/86a1e40ce21b629a956057b059d06ba78bd89402) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Fixes `Astro.url.pathname` to respect `trailingSlash: 'never'` configuration when using a base path. Previously, the root path with a base would incorrectly return `/base/` instead of `/base` when `trailingSlash` was set to 'never'. - [#&#8203;14248](https://github.com/withastro/astro/pull/14248) [`e81c4bd`](https://github.com/withastro/astro/commit/e81c4bd1cca6739192d33068cbfb2c9e4ced1ffe) Thanks [@&#8203;julesyoungberg](https://github.com/julesyoungberg)! - Fixes a bug where actions named 'apply' do not work due to being a function prototype method. ### [`v5.13.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5133) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.2...astro@5.13.3) ##### Patch Changes - [#&#8203;14239](https://github.com/withastro/astro/pull/14239) [`d7d93e1`](https://github.com/withastro/astro/commit/d7d93e19fbfa52cf74dee40f5af6b7ea6a7503d2) Thanks [@&#8203;wtchnm](https://github.com/wtchnm)! - Fixes a bug where the types for the live content collections were not being generated correctly in dev mode - [#&#8203;14221](https://github.com/withastro/astro/pull/14221) [`eadc9dd`](https://github.com/withastro/astro/commit/eadc9dd277d0075d7bff0e33c7a86f3fb97fdd61) Thanks [@&#8203;delucis](https://github.com/delucis)! - Fixes JSON schema support for content collections using the `file()` loader - [#&#8203;14229](https://github.com/withastro/astro/pull/14229) [`1a9107a`](https://github.com/withastro/astro/commit/1a9107a4049f43c1e4e9f40e07033f6bfe4398e4) Thanks [@&#8203;jonmichaeldarby](https://github.com/jonmichaeldarby)! - Ensures `Astro.currentLocale` returns the correct locale during SSG for pages that use a locale param (such as `[locale].astro` or `[locale]/index.astro`, which produce `[locale].html`) ### [`v5.13.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5132) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.1...astro@5.13.2) ##### Patch Changes - [`4d16de7`](https://github.com/withastro/astro/commit/4d16de7f95db5d1ec1ce88610d2a95e606e83820) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Improves the detection of remote paths in the `_image` endpoint. Now `href` parameters that start with `//` are considered remote paths. - Updated dependencies \[[`4d16de7`](https://github.com/withastro/astro/commit/4d16de7f95db5d1ec1ce88610d2a95e606e83820)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.2 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.6 ### [`v5.13.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#51311) [Compare Source](https://github.com/withastro/astro/compare/astro@5.13.0...astro@5.13.1) ##### Patch Changes - [#&#8203;14409](https://github.com/withastro/astro/pull/14409) [`250a595`](https://github.com/withastro/astro/commit/250a595596e9c7e1a966c5cda40f9bd5cf9d3f66) Thanks [@&#8203;louisescher](https://github.com/louisescher)! - Fixes an issue where `astro info` would log errors to console in certain cases. - [#&#8203;14398](https://github.com/withastro/astro/pull/14398) [`a7df80d`](https://github.com/withastro/astro/commit/a7df80d284652b500079e4476b17d5d1b7746b06) Thanks [@&#8203;idawnlight](https://github.com/idawnlight)! - Fixes an unsatisfiable type definition when calling `addServerRenderer` on an experimental container instance - [#&#8203;13747](https://github.com/withastro/astro/pull/13747) [`120866f`](https://github.com/withastro/astro/commit/120866f35a6b27c31bae1c04c0ea9d6bdaf09b16) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Adds automatic request signal abortion when the underlying socket closes in the Node.js adapter The Node.js adapter now automatically aborts the `request.signal` when the client connection is terminated. This enables better resource management and allows applications to properly handle client disconnections through the standard `AbortSignal` API. - [#&#8203;14428](https://github.com/withastro/astro/pull/14428) [`32a8acb`](https://github.com/withastro/astro/commit/32a8acba50bb15101c099fc7a14081d1a8cf0331) Thanks [@&#8203;drfuzzyness](https://github.com/drfuzzyness)! - Force sharpService to return a Uint8Array if Sharp returns a SharedArrayBuffer - [#&#8203;14411](https://github.com/withastro/astro/pull/14411) [`a601186`](https://github.com/withastro/astro/commit/a601186fb9ac0e7c8ff20887024234ecbfdd6ff1) Thanks [@&#8203;GameRoMan](https://github.com/GameRoMan)! - Fixes relative links to docs that could not be opened in the editor. ### [`v5.13.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5130) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.9...astro@5.13.0) ##### Minor Changes - [#&#8203;14173](https://github.com/withastro/astro/pull/14173) [`39911b8`](https://github.com/withastro/astro/commit/39911b823d4617d99cc95e4b7584e9e4b7b90038) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Adds an experimental flag `staticImportMetaEnv` to disable the replacement of `import.meta.env` values with `process.env` calls and their coercion of environment variable values. This supersedes the `rawEnvValues` experimental flag, which is now removed. Astro allows you to configure a [type-safe schema for your environment variables](https://docs.astro.build/en/guides/environment-variables/#type-safe-environment-variables), and converts variables imported via `astro:env` into the expected type. This is the recommended way to use environment variables in Astro, as it allows you to easily see and manage whether your variables are public or secret, available on the client or only on the server at build time, and the data type of your values. However, you can still access environment variables through `process.env` and `import.meta.env` directly when needed. This was the only way to use environment variables in Astro before `astro:env` was added in Astro 5.0, and Astro's default handling of `import.meta.env` includes some logic that was only needed for earlier versions of Astro. The `experimental.staticImportMetaEnv` flag updates the behavior of `import.meta.env` to align with [Vite's handling of environment variables](https://vite.dev/guide/env-and-mode.html#env-variables) and for better ease of use with Astro's current implementations and features. **This will become the default behavior in Astro 6.0**, and this early preview is introduced as an experimental feature. Currently, non-public `import.meta.env` environment variables are replaced by a reference to `process.env`. Additionally, Astro may also convert the value type of your environment variables used through `import.meta.env`, which can prevent access to some values such as the strings `"true"` (which is converted to a boolean value), and `"1"` (which is converted to a number). The `experimental.staticImportMetaEnv` flag simplifies Astro's default behavior, making it easier to understand and use. Astro will no longer replace any `import.meta.env` environment variables with a `process.env` call, nor will it coerce values. To enable this feature, add the experimental flag in your Astro config and remove `rawEnvValues` if it was enabled: ```diff // astro.config.mjs import { defineConfig } from "astro/config"; export default defineConfig({ + experimental: { + staticImportMetaEnv: true - rawEnvValues: false + } }); ``` ##### Updating your project If you were relying on Astro's default coercion, you may need to update your project code to apply it manually: ```diff // src/components/MyComponent.astro - const enabled: boolean = import.meta.env.ENABLED; + const enabled: boolean = import.meta.env.ENABLED === "true"; ``` If you were relying on the transformation into `process.env` calls, you may need to update your project code to apply it manually: ```diff // src/components/MyComponent.astro - const enabled: boolean = import.meta.env.DB_PASSWORD; + const enabled: boolean = process.env.DB_PASSWORD; ``` You may also need to update types: ```diff // src/env.d.ts interface ImportMetaEnv { readonly PUBLIC_POKEAPI: string; - readonly DB_PASSWORD: string; - readonly ENABLED: boolean; + readonly ENABLED: string; } interface ImportMeta { readonly env: ImportMetaEnv; } + namespace NodeJS { + interface ProcessEnv { + DB_PASSWORD: string; + } + } ``` See the [experimental static `import.meta.env` documentation](https://docs.astro.build/en/reference/experimental-flags/static-import-meta-env/) for more information about this feature. You can learn more about using environment variables in Astro, including `astro:env`, in the [environment variables documentation](https://docs.astro.build/en/guides/environment-variables/). - [#&#8203;14122](https://github.com/withastro/astro/pull/14122) [`41ed3ac`](https://github.com/withastro/astro/commit/41ed3ac54adf1025a38031757ee0bfaef8504092) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds experimental support for automatic [Chrome DevTools workspace folders](https://developer.chrome.com/docs/devtools/workspaces) This feature allows you to edit files directly in the browser and have those changes reflected in your local file system via a connected workspace folder. This allows you to apply edits such as CSS tweaks without leaving your browser tab! With this feature enabled, the Astro dev server will automatically configure a Chrome DevTools workspace for your project. Your project will then appear as a workspace source, ready to connect. Then, changes that you make in the "Sources" panel are automatically saved to your project source code. To enable this feature, add the experimental flag `chromeDevtoolsWorkspace` to your Astro config: ```js // astro.config.mjs import { defineConfig } from 'astro/config'; export default defineConfig({ experimental: { chromeDevtoolsWorkspace: true, }, }); ``` See the [experimental Chrome DevTools workspace feature documentation](https://docs.astro.build/en/reference/experimental-flags/chrome-devtools-workspace/) for more information. ### [`v5.12.9`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5129) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.8...astro@5.12.9) ##### Patch Changes - [#&#8203;14020](https://github.com/withastro/astro/pull/14020) [`9518975`](https://github.com/withastro/astro/commit/951897553921c1419fb96aef74d42ec99976d8be) Thanks [@&#8203;jp-knj](https://github.com/jp-knj) and [@&#8203;asieradzk](https://github.com/asieradzk)! - Prevent double-prefixed redirect paths when using fallback and redirectToDefaultLocale together Fixes an issue where i18n fallback routes would generate double-prefixed paths (e.g., `/es/es/test/item1/`) when `fallback` and `redirectToDefaultLocale` configurations were used together. The fix adds proper checks to prevent double prefixing in route generation. - [#&#8203;14199](https://github.com/withastro/astro/pull/14199) [`3e4cb8e`](https://github.com/withastro/astro/commit/3e4cb8e52a83974cc2671d13fb1b4595fe65085d) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that prevented HMR from working with inline styles ### [`v5.12.8`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5128) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.7...astro@5.12.8) ##### Patch Changes - [`0567fb7`](https://github.com/withastro/astro/commit/0567fb7b50c0c452be387dd7c7264b96bedab48f) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Adds `//` to list of internal path prefixes that do not have automated trailing slash handling - [#&#8203;13894](https://github.com/withastro/astro/pull/13894) [`b36e72f`](https://github.com/withastro/astro/commit/b36e72f11fbcc0f3d5826f2b1939084f1fb1e3a8) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Removes Astro Studio commands from the CLI help - Updated dependencies \[[`0567fb7`](https://github.com/withastro/astro/commit/0567fb7b50c0c452be387dd7c7264b96bedab48f)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.1 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.5 ### [`v5.12.7`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5127) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.6...astro@5.12.7) ##### Patch Changes - [#&#8203;14169](https://github.com/withastro/astro/pull/14169) [`f4e8889`](https://github.com/withastro/astro/commit/f4e8889c10c25aeb7650b389c35a70780d5ed172) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Skips trailing slash handling for paths that start with `/.`. - [#&#8203;14170](https://github.com/withastro/astro/pull/14170) [`34e6b3a`](https://github.com/withastro/astro/commit/34e6b3a87dd3e9be4886059d1c0efee4c5fa3cda) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes an issue where static redirects couldn't correctly generate a redirect when the destination is a prerendered route, and the `output` is set to `"server"`. - [#&#8203;14169](https://github.com/withastro/astro/pull/14169) [`f4e8889`](https://github.com/withastro/astro/commit/f4e8889c10c25aeb7650b389c35a70780d5ed172) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that prevented images from being displayed in dev when using the Netlify adapter with `trailingSlash` set to `always` - Updated dependencies \[[`f4e8889`](https://github.com/withastro/astro/commit/f4e8889c10c25aeb7650b389c35a70780d5ed172)]: - [@&#8203;astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@&#8203;0.7.0 - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.4 ### [`v5.12.6`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5126) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.5...astro@5.12.6) ##### Patch Changes - [#&#8203;14153](https://github.com/withastro/astro/pull/14153) [`29e9283`](https://github.com/withastro/astro/commit/29e928391a90844f8b701a581c4f163e0b6c46db) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Fixes a regression introduced by a recent optimisation of how SVG images are emitted during the build. - [#&#8203;14156](https://github.com/withastro/astro/pull/14156) [`592f08d`](https://github.com/withastro/astro/commit/592f08d1b4a3e03c61b34344e36cb772bd67709a) Thanks [@&#8203;TheOtterlord](https://github.com/TheOtterlord)! - Fix the client router not submitting forms if the active URL contained a hash - [#&#8203;14160](https://github.com/withastro/astro/pull/14160) [`d2e25c6`](https://github.com/withastro/astro/commit/d2e25c6e9d52160d4f8d8cbf7bc44e6794483f20) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that meant some remote image URLs could cause invalid filenames to be used for processed images - [#&#8203;14167](https://github.com/withastro/astro/pull/14167) [`62bd071`](https://github.com/withastro/astro/commit/62bd0717ab810c049ed7f3f63029895dfb402797) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that prevented destroyed sessions from being deleted from storage unless the session had been loaded ### [`v5.12.5`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5125) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.4...astro@5.12.5) ##### Patch Changes - [#&#8203;14059](https://github.com/withastro/astro/pull/14059) [`19f53eb`](https://github.com/withastro/astro/commit/19f53eb59dfeeff08078cec0a903c8722b5650ca) Thanks [@&#8203;benosmac](https://github.com/benosmac)! - Fixes a bug in i18n implementation, where Astro didn't emit the correct pages when `fallback` is enabled, and a locale uses a catch-all route, e.g. `src/pages/es/[...catchAll].astro` - [#&#8203;14155](https://github.com/withastro/astro/pull/14155) [`31822c3`](https://github.com/withastro/astro/commit/31822c3f0c8401e20129d0fc6bf8d1d670249265) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused an error "serverEntrypointModule\[\_start] is not a function" in some adapters ### [`v5.12.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5124) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.3...astro@5.12.4) ##### Patch Changes - [#&#8203;14031](https://github.com/withastro/astro/pull/14031) [`e9206c1`](https://github.com/withastro/astro/commit/e9206c192fc4a4dbf2d02f921fa540f987ccbe89) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Optimized the build pipeline for SVG images. Now, Astro doesn't reprocess images that have already been processed. - [#&#8203;14132](https://github.com/withastro/astro/pull/14132) [`976879a`](https://github.com/withastro/astro/commit/976879a400af9f44aee52c9112a7bd9788163588) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where the property `Astro.routePattern`/`context.routePattern` wasn't updated when using a rewrite via middleware. - [#&#8203;14131](https://github.com/withastro/astro/pull/14131) [`aafc4d7`](https://github.com/withastro/astro/commit/aafc4d7f8b3f198ace24a8a7f6cc9298771542da) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where an error occurring in a middleware would show the dev overlay instead of the custom `500.astro` page - [#&#8203;14127](https://github.com/withastro/astro/pull/14127) [`2309ada`](https://github.com/withastro/astro/commit/2309ada1c6d96c75815eda0760656147de435ba2) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Upgrades zod - [#&#8203;14134](https://github.com/withastro/astro/pull/14134) [`186c201`](https://github.com/withastro/astro/commit/186c201a1bd83593c880ab784d79f69245b445c2) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Throws a more helpful error in dev if trying to use a server island without an adapter - [#&#8203;14129](https://github.com/withastro/astro/pull/14129) [`3572d85`](https://github.com/withastro/astro/commit/3572d85ba89ef9c374f3631654eee704adf00e73) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a bug where the CSP headers was incorrectly added to a page when using an adapter. ### [`v5.12.3`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5123) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.2...astro@5.12.3) ##### Patch Changes - [#&#8203;14119](https://github.com/withastro/astro/pull/14119) [`14807a4`](https://github.com/withastro/astro/commit/14807a4581b5ba2e61bc63ef9ef9f14848564edd) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused builds to fail if a client directive was mistakenly added to an Astro component - [#&#8203;14001](https://github.com/withastro/astro/pull/14001) [`4b03d9c`](https://github.com/withastro/astro/commit/4b03d9c9d9237d9af38425062559eafdfc27f76f) Thanks [@&#8203;dnek](https://github.com/dnek)! - Fixes an issue where `getImage()` assigned the resized base URL to the srcset URL of `ImageTransform`, which matched the width, height, and format of the original image. ### [`v5.12.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5122) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.1...astro@5.12.2) ##### Patch Changes - [#&#8203;14071](https://github.com/withastro/astro/pull/14071) [`d2cb35d`](https://github.com/withastro/astro/commit/d2cb35d2b7ff999fea8aa39c79f9f048c3500aeb) Thanks [@&#8203;Grisoly](https://github.com/Grisoly)! - Exposes the `Code` component `lang` prop type: ```ts import type { CodeLanguage } from 'astro'; ``` - [#&#8203;14111](https://github.com/withastro/astro/pull/14111) [`5452ee6`](https://github.com/withastro/astro/commit/5452ee67f95f51dcfdca8c1988b29f89553efe1c) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that prevented "key" from being used as a prop for Astro components in MDX - [#&#8203;14106](https://github.com/withastro/astro/pull/14106) [`b5b39e4`](https://github.com/withastro/astro/commit/b5b39e4d4bf5e5816bccf7fbfd9a48e4d8ee302a) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Exits with non-zero exit code when config has an error - [#&#8203;14112](https://github.com/withastro/astro/pull/14112) [`37458b3`](https://github.com/withastro/astro/commit/37458b31aeee23df0b5a8ab9e319a23ee4eddc6d) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that meant that SVG components could no longer be serialized with `JSON.stringify` - [#&#8203;14061](https://github.com/withastro/astro/pull/14061) [`c7a7dd5`](https://github.com/withastro/astro/commit/c7a7dd5f612b302f02a0ff468beeadd8e142a5ad) Thanks [@&#8203;jonasgeiler](https://github.com/jonasgeiler)! - Add module declaration for `?no-inline` asset imports - [#&#8203;14109](https://github.com/withastro/astro/pull/14109) [`5a08fa2`](https://github.com/withastro/astro/commit/5a08fa22b4023810fea45876f62152bd196e6062) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Throw a more helpful error if defineLiveCollection is used outside of a live.config file - [#&#8203;14110](https://github.com/withastro/astro/pull/14110) [`e7dd4e1`](https://github.com/withastro/astro/commit/e7dd4e1116103892ddc6a83052c8f1ba25d8abdc) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Warn if duplicate IDs are found by file loader ### [`v5.12.1`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5121) [Compare Source](https://github.com/withastro/astro/compare/astro@5.12.0...astro@5.12.1) ##### Patch Changes - [#&#8203;14094](https://github.com/withastro/astro/pull/14094) [`22e9087`](https://github.com/withastro/astro/commit/22e90873f85d7b5b5d556f456362656f04b32341) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Correct types to allow `priority` on all images - [#&#8203;14091](https://github.com/withastro/astro/pull/14091) [`26c6b6d`](https://github.com/withastro/astro/commit/26c6b6db264f9cbd98ddf97c3f7a34ec7f488095) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a bug that caused a type error when defining session options without a driver - [#&#8203;14082](https://github.com/withastro/astro/pull/14082) [`93322cb`](https://github.com/withastro/astro/commit/93322cbe36c40401256eea2a9e34f5fbe13a28ec) Thanks [@&#8203;louisescher](https://github.com/louisescher)! - Fixes an issue where Astro's default 404 route would incorrectly match routes containing "/404" in dev - [#&#8203;14089](https://github.com/withastro/astro/pull/14089) [`687d253`](https://github.com/withastro/astro/commit/687d25365a41ff8a9e6da155d3527f841abb70dd) Thanks [@&#8203;florian-lefebvre](https://github.com/florian-lefebvre)! - Fixes a case where `astro:env` would not load the right environments variables in dev - [#&#8203;14092](https://github.com/withastro/astro/pull/14092) [`6692c71`](https://github.com/withastro/astro/commit/6692c71ed609690ebf6a697d88582130a5cbfdfb) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Improves error handling in live collections - [#&#8203;14074](https://github.com/withastro/astro/pull/14074) [`144a950`](https://github.com/withastro/astro/commit/144a950b55f22c2beeff710e5672e9fa611520b3) Thanks [@&#8203;abcfy2](https://github.com/abcfy2)! - Fixes a bug that caused some image service builds to fail - [#&#8203;14092](https://github.com/withastro/astro/pull/14092) [`6692c71`](https://github.com/withastro/astro/commit/6692c71ed609690ebf6a697d88582130a5cbfdfb) Thanks [@&#8203;ascorbic](https://github.com/ascorbic)! - Fixes a case where zod could not be imported from `astro:content` virtual module in live collection config ### [`v5.12.0`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5120) [Compare Source](https://github.com/withastro/astro/compare/astro@5.11.2...astro@5.12.0) ##### Minor Changes - [#&#8203;13971](https://github.com/withastro/astro/pull/13971) [`fe35ee2`](https://github.com/withastro/astro/commit/fe35ee2835997e7e6c3e1975dc6dacfa1052a765) Thanks [@&#8203;adamhl8](https://github.com/adamhl8)! - Adds an experimental flag `rawEnvValues` to disable coercion of `import.meta.env` values (e.g. converting strings to other data types) that are populated from `process.env` Astro allows you to configure a [type-safe schema for your environment variables](https://docs.astro.build/en/guides/environment-variables/#type-safe-environment-variables), and converts variables imported via `astro:env` into the expected type. However, Astro also converts your environment variables used through `import.meta.env` in some cases, and this can prevent access to some values such as the strings `"true"` (which is converted to a boolean value), and `"1"` (which is converted to a number). The `experimental.rawEnvValues` flag disables coercion of `import.meta.env` values that are populated from `process.env`, allowing you to use the raw value. To enable this feature, add the experimental flag in your Astro config: ```diff import { defineConfig } from "astro/config" export default defineConfig({ + experimental: { + rawEnvValues: true, + } }) ``` If you were relying on this coercion, you may need to update your project code to apply it manually: ```ts diff - const enabled: boolean = import.meta.env.ENABLED + const enabled: boolean = import.meta.env.ENABLED === "true" ``` See the [experimental raw environment variables reference docs](https://docs.astro.build/en/reference/experimental-flags/raw-env-values/) for more information. - [#&#8203;13941](https://github.com/withastro/astro/pull/13941) [`6bd5f75`](https://github.com/withastro/astro/commit/6bd5f75806cb4df39d9e4e9b1f2225dcfdd724b0) Thanks [@&#8203;aditsachde](https://github.com/aditsachde)! - Adds support for TOML files to Astro's built-in `glob()` and `file()` content loaders. In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader. Astro 5.12 now directly supports loading data from TOML files in content collections in both the `glob()` and the `file()` loaders. If you had added your own TOML content parser for the `file()` loader, you can now remove it as this functionality is now included: ```diff // src/content.config.ts 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) }), + loader: file("src/data/dogs.toml") schema: /* ... */ }) ``` Note that TOML does not support top-level arrays. Instead, the `file()` loader considers each top-level table to be an independent entry. The table header is populated in the `id` field of the entry object. See Astro's [content collections guide](https://docs.astro.build/en/guides/content-collections/#built-in-loaders) for more information on using the built-in content loaders. ##### Patch Changes - Updated dependencies \[[`6bd5f75`](https://github.com/withastro/astro/commit/6bd5f75806cb4df39d9e4e9b1f2225dcfdd724b0)]: - [@&#8203;astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@&#8203;6.3.3 ### [`v5.11.2`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#5112) [Compare Source](https://github.com/withastro/astro/compare/astro@5.11.1...astro@5.11.2) ##### Patch Changes - [#&#8203;14064](https://github.com/withastro/astro/pull/14064) [`2eb77d8`](https://github.com/withastro/astro/commit/2eb77d8f54be3faea38370693d33fb220231ea84) Thanks [@&#8203;jp-knj](https://github.com/jp-knj)! - Allows using `tsconfig` `compilerOptions.paths` without setting `compilerOptions.baseUrl` - [#&#8203;14068](https://github.com/withastro/astro/pull/14068) [`10189c0`](https://github.com/withastro/astro/commit/10189c0b44881fd22bac69acc182834d597d9603) Thanks [@&#8203;jsparkdev](https://github.com/jsparkdev)! - Fixes the incorrect CSS import path shown in the terminal message during Tailwind integration setup. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjI5LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
Update astro monorepo
Some checks failed
renovate/artifacts Artifact file update failure
d552592af5
renovate force-pushed renovate/major-astro-monorepo from d552592af5
Some checks failed
renovate/artifacts Artifact file update failure
to fedb657f72 2026-06-20 02:12:51 +02:00
Compare
renovate force-pushed renovate/major-astro-monorepo from fedb657f72 to bff7ac3bb3 2026-06-21 02:14:15 +02:00 Compare
renovate force-pushed renovate/major-astro-monorepo from bff7ac3bb3 to 0ba9daa23b 2026-06-22 02:14:19 +02:00 Compare
renovate force-pushed renovate/major-astro-monorepo from 0ba9daa23b to a9230e35dc
Some checks failed
renovate/artifacts Artifact file update failure
2026-06-23 02:14:10 +02:00
Compare
renovate changed title from Update astro monorepo (major) to Update astro monorepo to v7 2026-06-23 02:14:15 +02:00
renovate force-pushed renovate/major-astro-monorepo from a9230e35dc
Some checks failed
renovate/artifacts Artifact file update failure
to d347bd4720
Some checks failed
renovate/artifacts Artifact file update failure
2026-07-18 02:15:09 +02:00
Compare
renovate force-pushed renovate/major-astro-monorepo from d347bd4720
Some checks failed
renovate/artifacts Artifact file update failure
to 21e50aa271 2026-07-19 02:13:01 +02:00
Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/major-astro-monorepo:renovate/major-astro-monorepo
git switch renovate/major-astro-monorepo

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renovate/major-astro-monorepo
git switch renovate/major-astro-monorepo
git rebase main
git switch main
git merge --ff-only renovate/major-astro-monorepo
git switch renovate/major-astro-monorepo
git rebase main
git switch main
git merge --no-ff renovate/major-astro-monorepo
git switch main
git merge --squash renovate/major-astro-monorepo
git switch main
git merge --ff-only renovate/major-astro-monorepo
git switch main
git merge renovate/major-astro-monorepo
git push origin main
Sign in to join this conversation.
No description provided.