# Rethinking JS form validations. Say hi to Passable

- Speaker: [Evyatar Alush](/wiki/speakers/evyatar-alush.md)
- Event: [Reversim Summit 2019](/wiki/years/2019.md)
- Video: https://www.youtube.com/watch?v=_R5WfSXBruk
- Transcript: [/transcripts/2019/32-_R5WfSXBruk.md](/transcripts/2019/32-_R5WfSXBruk.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Frontend](/wiki/topics/frontend.md), [Software Engineering](/wiki/topics/software-engineering.md), [Technical Debt](/wiki/topics/technical-debt.md), [JavaScript](/wiki/topics/javascript.md)

> 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](https://www.youtube.com/watch?v=_R5WfSXBruk&t=76s) Complex forms with numerous interdependent fields often lead to spaghetti code and unmaintainable validation logic.
- [2:35](https://www.youtube.com/watch?v=_R5WfSXBruk&t=155s) The speaker outlines core requirements for a better validation solution: ease of writing, code reusability, and framework agnosticism.
- [3:52](https://www.youtube.com/watch?v=_R5WfSXBruk&t=232s) The introduced library, Passable, borrows its syntax and structural patterns from unit testing tools to make validations readable.
- [5:01](https://www.youtube.com/watch?v=_R5WfSXBruk&t=301s) Library features include asynchronous checks, non-failing warnings instead of strict errors, and conditional field testing.
- [6:14](https://www.youtube.com/watch?v=_R5WfSXBruk&t=374s) A live coding demonstration integrates the validation library into a React form using standard hooks and state management.
- [12:26](https://www.youtube.com/watch?v=_R5WfSXBruk&t=746s) 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
