Type safety is opinionated, and TypeScript team choose not to emit runtime type checks.
I think Hegel is a tried alternative. I don't know how well it works, though.
You should always consider safety beyond types. Validating users' (or even devs') inputs are way beyond that (e.g. empty string "", and empty arrays [], are possible even in dev environment).
Wow. Hegel looks very promising, but I'd imagine the build times to exponentially soar. I'd say this is an option worth considering particularly for the front-end (i.e. clients and front-facing APIs).
Yup, I believe I am too familiar with that reality. 😂
I just figured that the additional runtime checks make compilation more computationally expensive, hence the longer build times than "just" TypeScript.
""
, and empty arrays[]
, are possible even in dev environment).Wow. Hegel looks very promising, but I'd imagine the build times to exponentially soar. I'd say this is an option worth considering particularly for the front-end (i.e. clients and front-facing APIs).
You know that even
tsc
(orts-node
/ts-node-dev
) can be slow to compile, right? Not as bad as Gradle, though.Yup, I believe I am too familiar with that reality. 😂
I just figured that the additional runtime checks make compilation more computationally expensive, hence the longer build times than "just" TypeScript.
Oh... that's cool. I hadn't even heard of Hegel before. I'm definitely going to look into that one.