Lies We Tell Ourselves Using TypeScript
summary
Fetch from SWAPI is typed as any so JSON results silently crash unless explicitly validated; replacing any with unknown and enabling useUnknownInCatchVariables forces runtime checks. Declared function overloads lie because the hidden implementation signature isn’t checked against public overloads, letting code return the wrong variant. Mutation via pass-by-reference breaks naive unions; adding generics ties the list to a concrete element type. Patches like declaration merging, conditional types and assertions work but create new blind spots and complexity.
AI-written summary · about
chapters (8)
- 0:00Welcome
- 1:12TypeScript’s runtime dangers
- 4:22Fetch and unsafe types
- 10:26Error handling pitfalls
- 13:56Function overload pitfalls
- 17:49Unexpected mutations
- 20:00Four solutions
- 24:13Why TypeScript is worth it
related talks
29mThe Lies we Tell Ourselves using TypeScript
31mLies We Tell Ourselves Using TypeScript v2
22mThink you know TypeScript? Think again.
30mSwipe Left, Uncaught TypeError Learning to Love Type Systems
01h 01mDeconstructing TypeScript’s Type System
27mA Wild TypeScript Safari
30mRust-Inspired Typescript
21mThe long-tail of type safety
