Most of the Rust port was done by a single engineer over ~8 months, while the rest of the team kept shipping features: no code freeze.
Read the full story: https://t.co/9hVjtn6GFS
@justboriss Yes, you can fix it by changing the code. If only there was a tool that would point out the problem in the first place - so you knew you had to make the fix π€
@jaydenfyi Exactly, better to have your type-checker actually enforce you're doing the right thing and prevent your app from crashing! The actual Flow error message is longer and describes:
- Either make `Array<string>` and `Array<LogLine>` the same
- Or make array a `ReadonlyArray`
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: https://t.co/4XzG9wnPml
Flow Playground, rejects with an error: https://t.co/dKqUEDKEme
π 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.