r/reactjs • u/Remarkable-Ad-9362 • 2d ago
Show /r/reactjs Introducing LunarHUE/forms
Most of my time building apps has been in React and Solid, and I've run into issues with almost every form library I've tried. Either they came with JS bloat and dependency hell, they were older with a less-than-great type system, or they simply didn't do what I needed.
Eventually I found TanStack Form, which was definitely a step in the right direction, though it still had its own issues. I stuck with it for a while, until I realized: frontier models are really good now, and I could spend some time trying to build something better.
So, here's my first attempt at a form library:
https://forms.lunarhue.dev/
https://github.com/LunarHUE/forms
It currently supports React 16.8+, Solid v1, and Solid v2. The core is framework-agnostic, and I plan to add adapters for Vanilla JS, Vue, Preact, Svelte, or whatever else people want.
The philosophy behind it is simple: only ship what you use, and keep the type and state systems completely extensible so the user stays in control.
In some cases you can take that first idea almost too far. With the /mini entry, you can save a full TCP round-trip in your production bundle compared to something like TanStack Form (~13.5 kB less, in my docs the comparison is definitely cherry picked but still 🤷♂️).
More in the comments if you care:
0
u/Remarkable-Ad-9362 2d ago
For anyone curious what pushed me to build this, here's a quick list of stuff I kept running into with TanStack Form, RHF, etc. and tried to fix:
TypeScript blowing up with 15+ generics and HOC wrappers breaking as soon as you try to reuse a subform. I just wanted normal components with normal types.
Having to hack around validation timing just to get "validate on blur, then update as you type" without stale errors getting stuck or async checks firing on invalid input.
Server errors being a pain to wire back to fields without locking up the submit button, disappearing on blur, or falsely marking the form as clean.
Deleting or reordering items in a dynamic array shifting errors onto the wrong row because state is keyed by index instead of a stable key.
Edit forms staying "dirty" even after you type the original value back, or background refreshes wiping out whatever the user is actively editing. (First class rebase handling)