3 ms·
That has already happened, but the libraries are being utilized at runtime with associated overheads, and in fact the hoops jumped through are larger and uglier
by com2kid 3y ago
That has already happened, but the libraries are being utilized at runtime with associated overheads, and in fact the hoops jumped through are larger and uglier than if TS had plugins.
There is no bloody reason why a custom JSON.parse shouldn't be able to look at compile time at what the expected type of a JSON blog is and compile time generate validation code.
- nawgz 3y agoYour example already exists, it’s called TSON, unless you are complaining about how they had to implement that I also disagree that type validators like Zod/io-ts would benefit from plugins, they are just js code in the end that does defensive checks for you. Unless you have something else in mind