Skip to content

AstroEco is Releasing…

Display your GitHub releases using astro-loader-github-releases

withastro/astro

Patch Changes

withastro/astro

Minor Changes

  • #14386 f75f446 Thanks @yanthomasdev! - Stabilizes the formerly experimental getActionState() and withState() functions introduced in @astrojs/react v3.4.0 used to integrate Astro Actions with React 19's useActionState() hook.

    This example calls a like action that accepts a postId and returns the number of likes. Pass this action to the withState() function to apply progressive enhancement info, and apply to useActionState() to track the result:

    import { actions } from 'astro:actions';
    import { withState } from '@astrojs/react/actions';
    import { useActionState } from 'react';
    
    export function Like({ postId }: { postId: string }) {
      const [state, action, pending] = useActionState(
        withState(actions.like),
        0, // initial likes
      );
    
      return (
        <form action={action}>
          <input type="hidden" name="postId" value={postId} />
          <button disabled={pending}>{state} ❤️</button>
        </form>
      );
    }
    

    You can also access the state stored by useActionState() from your action handler. Call getActionState() with the API context, and optionally apply a type to the result:

    import { defineAction } from 'astro:actions';
    import { z } from 'astro:schema';
    import { getActionState } from '@astrojs/react/actions';
    
    export const server = {
      like: defineAction({
        input: z.object({
          postId: z.string(),
        }),
        handler: async ({ postId }, ctx) => {
          const currentLikes = getActionState<number>(ctx);
          // write to database
          return currentLikes + 1;
        },
      }),
    };
    

    If you were previously using this experimental feature, you will need to update your code to use the new stable exports:

    // src/components/Form.jsx
    import { actions } from 'astro:actions';
    -import { experimental_withState } from '@astrojs/react/actions';
    +import { withState } from '@astrojs/react/actions';
    import { useActionState } from "react";
    // src/actions/index.ts
    import { defineAction, type SafeResult } from 'astro:actions';
    import { z } from 'astro:schema';
    -import { experimental_getActionState } from '@astrojs/react/actions';
    +import { getActionState } from '@astrojs/react/actions';
withastro/astro

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 OpenGraph 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.

withastro/astro

Minor Changes

  • #14430 78011ba Thanks @ascorbic! - Adds support for async server rendering

    Svelte 5.36 added experimental support for async rendering. This allows you to use await in your components in several new places. This worked out of the box with client-rendered components, but server-rendered components needed some extra help. This update adds support for async server rendering in Svelte components used in Astro.

    To use async rendering, you must enable it in your Svelte config:

    // svelte.config.js
    export default {
      compilerOptions: {
        experimental: {
          async: true,
        },
      },
    };

    Then you can use await in your components:

    <script>
      let data = await fetch('/api/data').then(res => res.json());
    </script>
    <h1>{data.title}</h1>

    See the Svelte docs for more information on using await in Svelte components, including inside $derived blocks and directly in markup.

Patch Changes

  • #14433 9cc8f21 Thanks @ascorbic! - Fixes a bug that prevented Svelte 5.39.1+ components rendering when multiple frameworks were present
withastro/astro

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.

withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
    • @astrojs/markdown-remark@6.3.7
withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • Updated dependencies []:
    • @astrojs/markdown-remark@6.3.7
withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
withastro/astro

Patch Changes

  • Updated dependencies [1e2499e]:
    • @astrojs/internal-helpers@0.7.3
    • @astrojs/markdown-remark@6.3.7
withastro/starlight

Minor Changes

  • #3427 c3b2d0f Thanks @delucis! - Fixes styling of labels that wrap across multiple lines in <Tabs> component

    ⚠️ Potentially breaking change: Tab labels now have a narrower line-height and additional vertical padding. If you have custom CSS targetting the <Tabs> component, you may want to double check the visual appearance of your tabs when updating.

    If you want to preserve the previous styling, you can add the following custom CSS to your site:

    .tab > [role='tab'] {
      line-height: var(--sl-line-height);
      padding-block: 0;
    }
  • #3380 3364af3 Thanks @HiDeoo! - Makes head entry parsing stricter in Starlight config and content frontmatter.

    ⚠️ Potentially breaking change: Previously Starlight would accept a head entry for a meta tag defining some content which generates invalid HTML as <meta> is a void element which cannot have any child nodes. Now, it is an error to define a meta tag including some content.

    If you see errors after updating, look for head entries in the Starlight configuration in the astro.config.mjs file or in the frontmatter of your content files that include a content property for a meta tag. To fix the error, move the content property to the attrs object with at least an additional attribute to identify the kind of metadata it represents:

    head: {
      tag: 'meta',
    - content: 'foo',
      attrs: {
        name: 'my-meta',
    +   content: 'foo',
      },
    },
  • #3340 2018c31 Thanks @HiDeoo! - Adds missing vertical spacing between Markdown content and UI Framework components using client directives.

    ⚠️ Potentially breaking change: By default, Starlight applies some vertical spacing (--sl-content-gap-y) between Markdown content blocks. This change introduces similar spacing between Markdown content blocks and UI Framework components using client directives which was not present before.

    If you were relying on the previous behavior, you can manually override the spacing by manually specifying the top margin on the component using custom CSS, e.g. by relying on a CSS class to target the component.

    .my-custom-component {
      margin-top: 0;
    }

Patch Changes

  • #3423 a0d0670 Thanks @andersk! - Fixes HTML validity in sidebar groups by ensuring <summary> is the first child of <details>
withastro/astro

Patch Changes

withastro/astro

Minor Changes

  • #14285 bedc31b Thanks @jdcolombo! - Adds a new configuration option namespaces for more control over XML namespaces used in sitemap generation

    Excluding unused namespaces can help create cleaner, more focused sitemaps that are faster for search engines to parse and use less bandwidth. If your site doesn't have news content, videos, or multiple languages, you can exclude those namespaces to reduce XML bloat.

    The namespaces option allows you to configure news, xhtml, image, and video namespaces independently. All namespaces are enabled by default for backward compatibility and no change to existing projects is necessary. But now, you can choose to streamline your XML and avoid unnecessary code.

    For example, to exclude the video namespace from your sitemap, set video: false in your configuration:

    // astro.config.mjs
    import { sitemap } from '@astrojs/sitemap';
    
    export default {
      integrations: [
        sitemap({
          namespaces: {
            video: false,
            // other namespaces remain enabled by default
          }
        })
      ]
    };
    

    The generated XML will not include the xmlns:video namespace:

    <?xml version="1.0" encoding="UTF-8"?>
    <urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"
      xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
    >
      <!-- ... -->
    </urlset>
    
withastro/astro

Minor Changes

  • #14204 d71448e Thanks @Adammatthiesen! - Adds a new libSQL web driver to support environments that require a non-Node.js libSQL client such as Cloudflare or Deno. Also adds a new mode configuration option to allow you to set your client connection type: node (default) or web.

    The default db node driver mode is identical to the previous AstroDB functionality. No changes have been made to how AstroDB works in Node.js environments, and this is still the integration's default behavior. If you are currently using AstroDB, no changes to your project code are required and setting a mode is not required.

    However, if you have previously been unable to use AstroDB because you required a non-Node.js libSQL client, you can now install and configure the libSQL web driver by setting mode: 'web' in your db configuration:

    import db from '@astrojs/db';
    import { defineConfig } from 'astro/config';
    
    // https://astro.build/config
    export default defineConfig({
      integrations: [db({ mode: 'web' })],
    });

    For more information, see the @astrojs/db documentation.

withastro/starlight

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • #14326 c24a8f4 Thanks @jsparkdev! - Updates vite version to fix CVE

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • #14326 c24a8f4 Thanks @jsparkdev! - Updates vite version to fix CVE

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • #14039 da4182d Thanks @ematipico! - Fixes a bug where experimentalStaticHeaders did not work as expected.

  • #14289 ed493a6 Thanks @ascorbic! - Fixes a bug that caused invalid image sizes to be generated when the requested widths were larger than the source image

withastro/astro

Patch Changes

  • #14281 dfd88de Thanks @ascorbic! - Fixes a regression that broke sites that used the compile image service without nodejs_compat set

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • #14269 4823c42 Thanks @florian-lefebvre! - Updates context.netlify to implement all its properties

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • 9ecf359 Thanks @alexanderniebuhr! - Improves the image proxy endpoint when using the default compile option to adhere to user configuration regarding the allowed remote domains

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • #14233 896886c Thanks @gouravkhunger! - Fixes the issue with the option lastmod where if it is defined it applies correctly to <url> entries in each sitemap-${i}.xml file but not the <sitemap> entries in the root sitemap-index.xml file.
withastro/astro

Patch Changes

  • #14240 77b18fb Thanks @delucis! - Increases the minimum supported version of Astro to 5.7.0

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • #14259 02366e9 Thanks @ascorbic! - Removes warning when using the adapter with a static build.

    The Cloudflare adapter now has several uses outside of on-demand rendered pages, so this warning is misleading. Similar warnings have already been removed from other adapters.

  • #14234 15b55f3 Thanks @yanthomasdev! - Fixes an issue that could cause duplicate exports when configuring workerEntrypoint.namedExports

  • #14240 77b18fb Thanks @delucis! - Increases the minimum supported version of Astro to 5.7.0

  • Updated dependencies []:

    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • Updated dependencies [4d16de7]:
    • @astrojs/internal-helpers@0.7.2
withastro/astro

Patch Changes

  • Updated dependencies [4d16de7]:
    • @astrojs/internal-helpers@0.7.2
withastro/astro

Patch Changes

  • Updated dependencies [4d16de7]:
    • @astrojs/internal-helpers@0.7.2
    • @astrojs/markdown-remark@6.3.6
withastro/astro

Patch Changes

  • Updated dependencies [4d16de7]:
    • @astrojs/internal-helpers@0.7.2
    • @astrojs/underscore-redirects@1.0.0
withastro/astro

Patch Changes

  • 4d16de7 Thanks @ematipico! - Improves the detection of remote paths in the _image endpoint. Now href parameters that start with // are considered remote paths.
withastro/astro

Patch Changes

  • Updated dependencies []:
    • @astrojs/markdown-remark@6.3.6
withastro/astro

Patch Changes

  • Updated dependencies [4d16de7]:
    • @astrojs/internal-helpers@0.7.2
withastro/astro

Patch Changes

  • 5fc3c59 Thanks @ematipico! - Fixes a routing bug in standalone mode with trailingSlash set to "always".
withastro/astro

Minor Changes

  • #13682 5824b32 Thanks @gouravkhunger! - Adds a customSitemaps option to include extra sitemaps in the sitemap-index.xml file generated by Astro.

    This is useful for multi-framework setups on the same domain as your Astro site (example.com), such as a blog at example.com/blog whose sitemap is generated by another framework.

    The following example shows configuring your Astro site to include sitemaps for an externally-generated blog and help center along with the generated sitemap entries in sitemap-index.xml:

    Example:

    import { defineConfig } from 'astro/config';
    import sitemap from '@astrojs/sitemap';
    
    export default defineConfig({
      site: 'https://example.com',
      integrations: [
        sitemap({
          customSitemaps: [
            'https://example.com/blog/sitemap.xml',
            'https://example.com/helpcenter/sitemap.xml',
          ],
        }),
      ],
    });

    Learn more in the @astrojs/sitemap configuration documentation.

withastro/astro

Patch Changes

withastro/astro

Minor Changes

  • #14190 438adab Thanks @Adammatthiesen! - Adds support for enum support for text columns in Astro DB tables.

    import { column, defineTable } from 'astro:db';
    
    // Table definition
    const UserTable = defineTable({
      columns: {
        id: column.number({ primaryKey: true }),
        name: column.text(),
        rank: column.text({ enum: ['user', 'mod', 'admin'] }),
      },
    });
    
    // Resulting type definition
    type UserTableInferInsert = {
      id: string;
      name: string;
      rank: 'user' | 'mod' | 'admin';
    };
withastro/astro

Minor Changes

  • #14188 e3422aa Thanks @ascorbic! - Adds support for specifying a host to load prerendered error pages

    By default, if a user defines a custom error page that is prerendered, Astro will load it from the same host as the one that the request is made to. This change allows users to specify a different host for loading prerendered error pages. This can be useful in scenarios such as where the server is running behind a reverse proxy or when prerendered pages are hosted on a different domain.

    To use this feature, set the experimentalErrorPageHost adapter option in your Astro configuration to the desired host URL. For example, if your server is running on localhost and served via a proxy, you can ensure the prerendered error pages are fetched via the localhost URL:

    import { defineConfig } from 'astro/config';
    import node from '@astrojs/node';
    export default defineConfig({
      adapter: node({
        // If your server is running on localhost and served via a proxy, set the host like this to ensure prerendered error pages are fetched via the localhost URL
        experimentalErrorPageHost: 'http://localhost:4321',
      }),
    });

    For more information on enabling and using this experimental feature, see the @astrojs/node adapter docs.

withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • Updated dependencies [0567fb7]:
    • @astrojs/internal-helpers@0.7.1
    • @astrojs/markdown-remark@6.3.5
withastro/astro

Patch Changes

  • Updated dependencies []:
    • @astrojs/markdown-remark@6.3.5
withastro/astro

Patch Changes

withastro/astro

Patch Changes

  • Updated dependencies [0567fb7]:
    • @astrojs/internal-helpers@0.7.1
withastro/astro

Patch Changes

  • Updated dependencies [0567fb7]:
    • @astrojs/internal-helpers@0.7.1
withastro/astro

Patch Changes

  • 0567fb7 Thanks @ascorbic! - Adds // to list of internal path prefixes that do not have automated trailing slash handling

Last fetched:  |  Scheduled refresh: Every Saturday

See Customizing GitHub Activity Pages to configure your own

Inspired by releases.antfu.me