A typed dialect of JavaScript.

Joined November 2014
Flow is now written in Rust 🦀 The migration from OCaml to Rust brought up to 2x faster type-checking on large codebases.
29
67
42
618
249,006
TypeScript lets you pass Array<string> where Array<string | Error> is expected, so the function pushes an Error to your string array. Flow rejects it. TS Playground, 0 errors: typescriptlang.org/play/?#co… Flow Playground, rejects with an error: flow.org/try/#1N4Igxg9gdgZgl…
3
18
4,990
Crashes at runtime - but TypeScript accepts it: zero errors under strict. Can you spot the bug?
17
5
2
99
29,888
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.
2
1
11
1,459
Where the two still diverge, Flow keeps the stricter, safer default. Extract a method off an instance and it loses its 'this' binding. TypeScript lets the extraction through, so tick() crashes without a valid 'this'. Flow rejects it right where 'this' is lost.
1
1
8
580
First-class component syntax for React. 'renders' types compose through wrappers - MainHeader renders Header slots anywhere a Header is expected, and unrelated elements are rejected.
3
1
10
597
Flow also has features TypeScript lacks. Pattern matching as an expression. It's exhaustively checked, with structural patterns that destructure as they match. Forget a case, like 'remove', and match flags it and tells you what to add.
2
1
8
809
TypeScript or Flow? You can't tell. Flow has keyof, readonly props, unknown, indexed access types T[K], and extends generic bounds. Plus conditional types, mapped types, and type guards.
1
2
9
1,182
Over the past few weeks we've been picking up our slack on pull requests. Thank you for all the contributions!
4
14
1
140
Flow just reached 10,000 stars on GitHub! github.com/facebook/flow
1
53
3
212