Closed renovate[bot] closed 1 week ago
Latest commit: cb942f629c00a5cd99a00e38e7698908af7882a4
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This PR contains the following updates:
4.15.4
->4.15.5
Release Notes
withastro/astro (astro)
### [`v4.15.5`](https://redirect.github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#4155) [Compare Source](https://redirect.github.com/withastro/astro/compare/astro@4.15.4...astro@4.15.5) ##### Patch Changes - [#11939](https://redirect.github.com/withastro/astro/pull/11939) [`7b09c62`](https://redirect.github.com/withastro/astro/commit/7b09c62b565cd7b50c35fb68d390729f936a43fb) Thanks [@bholmesdev](https://redirect.github.com/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. ```ts 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: Disabled by config. Please merge this manually once you are satisfied.
β» 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.
This PR was generated by Mend Renovate. View the repository job log.