Skip to content

fix(deps): update astro monorepo (major)#263

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/major-astro-monorepo
Open

fix(deps): update astro monorepo (major)#263
renovate[bot] wants to merge 1 commit intomainfrom
renovate/major-astro-monorepo

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 10, 2026

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
@astrojs/react (source) ^4.4.2^5.0.0 age confidence
astro (source) ^5.17.2^6.0.0 age confidence

Release Notes

withastro/astro (@​astrojs/react)

v5.0.0

Compare Source

Major Changes
Minor Changes
Patch Changes
withastro/astro (astro)

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: '@&#8203;example/my-adapter',
        hooks: {
          'astro:config:done': ({ setAdapter }) => {
            setAdapter({
              name: '@&#8203;example/my-adapter',
              serverEntrypoint: '@&#8203;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 '@&#8203;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.


Configuration

📅 Schedule: 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.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants