-
I was perfectly satisfied with using https://zod.dev for some runtime validation, and found it really cool that I didn't have to define some nominal type off to the side and could instead just say what I meant inline using a fluent API.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Emitting types would run counter to several of TypeScript's Design Goals [0]. In particular, it would violate:
> 3. Impose no runtime overhead on emitted programs.
> 9. Use a consistent, fully erasable, structural type system.
It's also explicitly called out as a non-goal in that doc:
> 5. Add or rely on run-time type information in programs, or emit different code based on the results of the type system. Instead, encourage programming patterns that do not require run-time metadata.
> 6. Provide additional runtime functionality or libraries. Instead, use TypeScript to describe existing libraries.
[0] https://github.com/Microsoft/TypeScript/wiki/TypeScript-Desi...
-
-
We have types at home.
My litmus test regarding whether I can even consider using a library in production is: does it have more stars than fartscroll.js?
https://github.com/theonion/fartscroll.js/tree/master
Most of the entries there are below that number, which begs the question: is this really that much of a problem that it mandates the drastic changes required?
I actually don't know if it's even doable, considering TS's structural type system, where the answer to the question "what type is X?" is not straightforward.
-
-
Since it's not explicitly listed there, I feel I should shout out David Blass and his incredibly cool ArkType project: https://github.com/arktypeio/arktype
He sometimes (used to?) streams himself working on twitch and it's a really comfy place to hang out: https://www.twitch.tv/arktypeio
-
Deepkit (listed in the article) is a fascinating project and really deserves to be more popular.
It also demonstrates that what is being asked for is actually practical.
https://deepkit.io/
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
but you can't have an overload that takes two differently parameterized expressions, this lets you write Java code in a lisp-like syntax that can be metaprogrammed on:
https://github.com/paulhoule/ferocity/blob/main/ferocity-std...
that project got me thinking a lot about the various ways types manifest in Java and I made the discovery that when you add Expression types you practically discover an extended type systems where there are many things that are implied by the existence of ordinary Java types.
Related posts
-
TypeScript Essentials: Distinguishing Types with Branding
-
Parsing URL Search Parameters with Zod 💎
-
Introdução ao TypeScript
-
Why doesn't TypeScript properly type Object.keys?
-
Why nodejs engineers prefer express over nestjs? although nestjs forces good practice and proper architecture and it seems to be a right choice for complex and enterprise applications like asp.net and Spring. What are the limitations of nestjs compared to express?