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 #11590

Merged
merged 1 commit into from
Aug 2, 2024
Merged

[ci] release #11590

merged 1 commit into from
Aug 2, 2024

Conversation

astrobot-houston
Copy link
Contributor

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

[email protected]

Patch Changes

  • #11584 a65ffe3 Thanks @bholmesdev! - Removes async local storage dependency from Astro Actions. This allows Actions to run in Cloudflare and Stackblitz without opt-in flags or other configuration.

    This also introduces a new convention for calling actions from server code. Instead of calling actions directly, you must wrap function calls with the new Astro.callAction() utility.

    callAction() is meant to trigger an action from server code. getActionResult() usage with form submissions remains unchanged.

    ---
    import { actions } from 'astro:actions';
    
    const result = await Astro.callAction(actions.searchPosts, {
      searchTerm: Astro.url.searchParams.get('search'),
    });
    ---
    
    {
      result.data &&
        {
          /* render the results */
        }
    }

    Migration

    If you call actions directly from server code, update function calls to use the Astro.callAction() wrapper for pages and context.callAction() for endpoints:

    ---
    import { actions } from 'astro:actions';
    
    - const result = await actions.searchPosts({ searchTerm: 'test' });
    + const result = await Astro.callAction(actions.searchPosts, { searchTerm: 'test' });
    ---

    If you deploy with Cloudflare and added the nodejs_compat or nodejs_als flags for Actions, we recommend removing these:

    compatibility_flags = [
    - "nodejs_compat",
    - "nodejs_als"
    ]

    You can also remove node:async_hooks from the vite.ssr.external option in your astro.config file:

    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    
    export default defineConfig({
    - vite: {
    -   ssr: {
    -     external: ["node:async_hooks"]
    -   }
    - }
    })

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) labels Aug 1, 2024
@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from 51e004a to fb24922 Compare August 2, 2024 12:22
@github-actions github-actions bot force-pushed the changeset-release/main branch from fb24922 to e3d5b0a Compare August 2, 2024 12:22
@bholmesdev bholmesdev merged commit 2abbc28 into main Aug 2, 2024
@bholmesdev bholmesdev deleted the changeset-release/main branch August 2, 2024 13:18
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