Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] release #12762

Merged
merged 1 commit into from
Dec 19, 2024
Merged

[ci] release #12762

merged 1 commit into from
Dec 19, 2024

Conversation

astrobot-houston
Copy link
Contributor

@astrobot-houston astrobot-houston commented Dec 17, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

astro@5.1.0

Minor Changes

  • #12441 b4fec3c Thanks @ascorbic! - Adds experimental session support

    Sessions are used to store user state between requests for server-rendered pages, such as login status, shopping cart contents, or other user-specific data.

    ---
    export const prerender = false; // Not needed in 'server' mode
    const cart = await Astro.session.get('cart');
    ---
    
    <a href="/checkout">🛒 {cart?.length ?? 0} items</a>

    Sessions are available in on-demand rendered/SSR pages, API endpoints, actions and middleware. To enable session support, you must configure a storage driver.

    If you are using the Node.js adapter, you can use the fs driver to store session data on the filesystem:

    // astro.config.mjs
    {
      adapter: node({ mode: 'standalone' }),
      experimental: {
        session: {
          // Required: the name of the unstorage driver
          driver: "fs",
        },
      },
    }

    If you are deploying to a serverless environment, you can use drivers such as redis, netlify-blobs, vercel-kv, or cloudflare-kv-binding and optionally pass additional configuration options.

    For more information, including using the session API with other adapters and a full list of supported drivers, see the docs for experimental session support. For even more details, and to leave feedback and participate in the development of this feature, the Sessions RFC.

  • #12426 3dc02c5 Thanks @oliverlynch! - Improves asset caching of remote images

    Astro will now store entity tags and the Last-Modified date for cached remote images and use them to revalidate the cache when it goes stale.

  • #12721 c9d5110 Thanks @florian-lefebvre! - Adds a new getActionPath() helper available from astro:actions

    Astro 5.1 introduces a new helper function, getActionPath() to give you more flexibility when calling your action.

    Calling getActionPath() with your action returns its URL path so you can make a fetch() request with custom headers, or use your action with an API such as navigator.sendBeacon(). Then, you can handle the custom-formatted returned data as needed, just as if you had called an action directly.

    This example shows how to call a defined like action passing the Authorization header and the keepalive option:

    <script>
      // src/components/my-component.astro
      import { actions, getActionPath } from 'astro:actions';
    
      await fetch(getActionPath(actions.like), {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          Authorization: 'Bearer YOUR_TOKEN',
        },
        body: JSON.stringify({ id: 'YOUR_ID' }),
        keepalive: true,
      });
    </script>

    This example shows how to call the same like action using the sendBeacon API:

    <script>
      // src/components/my-component.astro
      import { actions, getActionPath } from 'astro:actions';
    
      navigator.sendBeacon(
        getActionPath(actions.like),
        new Blob([JSON.stringify({ id: 'YOUR_ID' })], {
          type: 'application/json',
        }),
      );
    </script>

Patch Changes

  • #12786 e56af4a Thanks @ematipico! - Fixes an issue where Astro i18n didn't properly show the 404 page when using fallback and the option prefixDefaultLocale set to true.

  • #12758 483da89 Thanks @delucis! - Adds types for ?url&inline and ?url&no-inline import queries added in Vite 6

  • #12763 8da2318 Thanks @rbsummers! - Fixed changes to vite configuration made in the astro:build:setup integration hook having no effect when target is "client"

  • #12767 36c1e06 Thanks @ascorbic! - Clears the content layer cache when the Astro config is changed

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) labels Dec 17, 2024
@github-actions github-actions bot force-pushed the changeset-release/main branch 12 times, most recently from d2203a1 to 0a3672b Compare December 19, 2024 11:24
@github-actions github-actions bot force-pushed the changeset-release/main branch from 0a3672b to 3e52743 Compare December 19, 2024 12:22
@ematipico ematipico merged commit 3f557b2 into main Dec 19, 2024
@ematipico ematipico deleted the changeset-release/main branch December 19, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants