I've identified some structural issues with form core and would like to suggest improvements.
- FormApi: 1000+ lines, 19 generic parameters
- FieldApi: 800+ lines, complex validation logic
- Memory leak risks (timers/AbortControllers)
- Difficult to test and maintain
Proposed Solutions
1. ValidationRunner pattern (quick win) - Remove 30% code duplication
2. Separation of concerns (long-term) - Extract validation engines into separate classes
What are your thoughts on this structural improvement?
Any concerns or similar experiences to share?
Do you think we need to improve in this direction?
From what I've seen, I think the current structure could be problematic if the structure of Form core is expanded.
I have detailed analysis and implementation plans ready to share.
Looking forward to your feedback!
1 Reply
fair-rose•3mo ago
If you have plans ready to share, feel free to open a Discussion about it on GitHub! https://github.com/TanStack/form
You can also share them here, or if you have code ready for feedback, you can open a PR
GitHub
GitHub - TanStack/form: 🤖 Headless, performant, and type-safe fo...
🤖 Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, and Lit. - TanStack/form