News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by twic on Saturday May 15, 2021 @04:41PM (#27168810)
Sharing validation for forms is definitely really nice.

It feels like it should be possible to do that cross-language, generating some JS validation rules from Java annotations, say, but i have never seen it done.

Re:Modern Javascript: Everything you missed over the last 10... by eyelidlessness on Saturday May 15, 2021 @07:33PM (#27169913)
The way it’s usually done is with a generalized language-agnostic spec like OpenAPI/JSON Schema. Because the definitions are standardized, you can effectively build tools in any language that should provide the same validation, to the extent they’re compliant and the spec is unambiguous.

These approaches can of course be combined, where the sorts of validators I mentioned generate (or even build their primitives around) those more verbose standards.