Skip to content

[v2] Port submit metadata support from v1 #2303

Description

@LeCarbonator

Submit metadata has not yet been implemented in v2. Adding it would allow metadata associated with a submission to remain available throughout the relevant form lifecycle.

Submit metadata should be available in the following places:

  • Validators: Optional, because a validator may run for an event other than submission.
  • Listeners: Always optional to keep the shared listener context manageable.
  • onSubmit: Required. The callback should receive the effective metadata, using the per-submission override when provided and the configured default otherwise.

Some thoughts

For validators, a discriminated union with a submit event could make the metadata available with stronger type safety only when the event is a submission. Listener metadata should likely remain optional because expressing the same relationship in the shared listener types may be too cumbersome.

Activity

  1. added
    v2This issue affects v2 as well.
    scope: coreThis issue affects the core package, meaning any adapter is also affected by it.
    area: runtimeThis issue affects the runtime of the library.
    area: typesThis issue affects the types of the library.
    on Aug 9, 2026
  2. jkugsiya commented on Oct 6, 2026

    @jkugsiya

    Hi @LeCarbonator, I'd like to take this. My plan, following your notes:

    • a default meta on form options, with an optional per-submit override on handleSubmit
    • onSubmit always receives the resolved meta
    • validators get it through a union on the event, so it's typed only for submits
    • listeners get it as optional

    Is this safe to start on alpha now, or should it wait for the submission rework / #2306?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimeThis issue affects the runtime of the library.area: typesThis issue affects the types of the library.scope: coreThis issue affects the core package, meaning any adapter is also affected by it.type: enhancementThis requests an enhancement to existing behaviour.v2This issue affects v2 as well.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions