TanStack / TanStack/form

[v2] Port submit metadata support from v1

Open
#2,303 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: runtime area: types scope: core type: enhancement v2
Dominant language
TypeScript
Stars
6.7k
Forks
682
Avg merge
5d 18h
Merged PRs (30d)
7

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the v1 submit metadata implementation and the corresponding v2 validator, listener, and onSubmit types. Trace how per-submission overrides and configured defaults flow through the form lifecycle. Done means validators can access metadata for submit events, listeners accept optional metadata, and onSubmit receives the effective metadata with type-safe coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.