by jonathrg · 2y ago · 0 comments
Ideally constraints would also propagate from model definitions, so there could be a single source of truth for "what phone numbers do we accept". Some years back I tried to do this by parsing SQL table definitions, but never got far enough. Django does this, but it lacks pretty much any client-side validation support IIRC. (Or client-side anything, really...)
With Typescript, this is now my preferred way to build full-stack sites.
You still need to handle the "what happens next" part on each side, but at least your validation rules are shared.