👀 Is this Flow, or TypeScript?
Is Flow coming back?
- Flow syntax aligns with TypeScript
- Flow has pattern matching
- Useful React hooks/component/renders syntax
- Compiler has been recently ported to Rust
I'll keep an eye on it for you, but this is promising!
If your "Flow vs TypeScript" take is from 2021, it's out of date. Flow looks like TypeScript now - but it has pattern matching and React component syntax, while catching runtime crashes TypeScript waves through. Examples below. 👇
Another: TypeScript only validates the signature of a type-guard, not the body.
Flow validates the body and rejects predicates that lie about what they check.
The render types section of the blog post doesn't even go all that in depth.
This is contrived for the sake of conciseness but really pay attention to what this code is expressing and understand how buck wild it is that we can express this with complete type safety!
Flow now supports Type Guards (functions that can be used to narrow a type)! Unlike @TypeScript, we run checks on the body of the function to catch some invalid definitions.
medium.com/flow-type/announc…
@flowtype is now releasing some TS features before TS! xD
github.com/facebook/flow/rel…:
> Flow now supports the same NoInfer intrinsic that will be available in TypeScript 5.4.
Flow now supports Conditional Types, which allow you to choose an output type based on an input type - like a ternary expression for types:
medium.com/flow-type/announc…