Wiki: Rethinking JS form validations. Say hi to Passable
For agents: Markdown version · Wiki index · Explore
- Speaker: Evyatar Alush
- Event: Reversim Summit 2019
- Video: https://www.youtube.com/watch?v=_R5WfSXBruk
- Transcript: /transcripts/2019/32-_R5WfSXBruk.md
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: Frontend, Software Engineering, Technical Debt, JavaScript
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
The speaker introduces an open-source JavaScript validation library designed to solve common maintenance and readability issues in complex form validations. By adopting a syntax inspired by unit testing frameworks, the library allows developers to write decoupled, framework-agnostic validation logic. The presentation covers features such as asynchronous tests, warnings, conditional validations, and a live code demonstration using React hooks. Ultimately, the audience learns how to structure validation code cleanly to prevent spaghetti code and improve reusability across applications.
Key points
- 1:16 Complex forms with numerous interdependent fields often lead to spaghetti code and unmaintainable validation logic.
- 2:35 The speaker outlines core requirements for a better validation solution: ease of writing, code reusability, and framework agnosticism.
- 3:52 The introduced library, Passable, borrows its syntax and structural patterns from unit testing tools to make validations readable.
- 5:01 Library features include asynchronous checks, non-failing warnings instead of strict errors, and conditional field testing.
- 6:14 A live coding demonstration integrates the validation library into a React form using standard hooks and state management.
- 12:26 The demonstration shows how to perform asynchronous server-side checks and guard them using intermediate draft validation states.
Takeaways
- Separate validation logic from UI components to improve maintainability and code reuse.
- Use unit-test-like syntax (such as describe, test, and expect equivalents) to make validation rules more readable.
- Implement non-blocking warnings to guide users without preventing form submission.
Questions this talk answers
- How can I structure complex form validations in JavaScript without creating spaghetti code?
- How do I handle asynchronous validations, such as checking if a username already exists on the server?
- Can I issue warnings that do not block form submission alongside strict validation errors?
Technologies
JavaScript, React
Tags
code quality, form validation, frontend, javascript, open source, react