[v2] Add on-demand field mask / `dirtyFields` generation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
Applications often need to send a partial update containing only relevant form fields. It would be useful to expose an API that generates a field mask on demand for either:
- fields whose values differ from their defaults; or
- fields currently marked as dirty.
Consumers could use the resulting mask with whichever API or patch format their application relies on. The form library would identify the relevant fields without prescribing how the final patch is constructed.
React Hook Form offers dirtyFields, but a dedicated API for generating both dirty-field and non-default-value masks could provide a more direct workflow for preparing patches.
Some thoughts
Because the form already owns the field trie, the masks could be derived from that internal structure when requested. The exact API and mask representation are open for discussion.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the form's internal field-trie implementation and existing public API patterns. Determine how the trie represents default values and dirty state, then clarify the mask representation and API shape before implementation. Done means the API can generate masks for both non-default and dirty fields, with tests covering each mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100