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

chore(deps): update astro to 4.15.5 #527

Merged
merged 1 commit into from
Sep 13, 2024
Merged

chore(deps): update astro to 4.15.5 #527

merged 1 commit into from
Sep 13, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 13, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
astro (source) 4.15.4 -> 4.15.5 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

withastro/astro (astro)

v4.15.5

Compare Source

Patch Changes
  • #​11939 7b09c62 Thanks @​bholmesdev! - Adds support for Zod discriminated unions on Action form inputs. This allows forms with different inputs to be submitted to the same action, using a given input to decide which object should be used for validation.

    This example accepts either a create or update form submission, and uses the type field to determine which object to validate against.

    import { defineAction } from 'astro:actions';
    import { z } from 'astro:schema';
    
    export const server = {
      changeUser: defineAction({
        accept: 'form',
        input: z.discriminatedUnion('type', [
          z.object({
            type: z.literal('create'),
            name: z.string(),
            email: z.string().email(),
          }),
          z.object({
            type: z.literal('update'),
            id: z.number(),
            name: z.string(),
            email: z.string().email(),
          }),
        ]),
        async handler(input) {
          if (input.type === 'create') {
            // input is { type: 'create', name: string, email: string }
          } else {
            // input is { type: 'update', id: number, name: string, email: string }
          }
        },
      }),
    };

    The corresponding create and update forms may look like this:


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


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

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

@stavros-k stavros-k merged commit d81fd0d into master Sep 13, 2024
4 checks passed
@stavros-k stavros-k deleted the renovate/non-major branch September 13, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant