The Lies we Tell Ourselves using TypeScript
summary
An actual SDK example compiles under TypeScript yet crashes at runtime: a fetch result.json annotated as meta swappy people hides any vs unknown behavior so types are false, catch clauses assume SyntaxError, function overloads promise species while implementation returns people, and appending mutates arrays without type widening. The talk shows concrete mitigations—declaration merging, unknown for JSON and catch variables, conditional types instead of overloads, and generics—and then demonstrates where each mitigation still breaks, ending with 4 mitigations.
AI-written summary · about
chapters (8)
- 0:00Start
- 4:33Step by Step
- 5:53A Tale of Fetch
- 11:05The Theme is Dark and Full of Errors
- 13:34The Matrix Overloaded
- 17:12The Unexpected Virtue Of Ignorance
- 19:17Adding Generics
- 25:02I wouldn't want to work without it.
related talks
31mLies We Tell Ourselves Using TypeScript v2
30mLies We Tell Ourselves Using TypeScript
21mThe long-tail of type safety
22mThink you know TypeScript? Think again.
27mA Wild TypeScript Safari
51mTypeScript - Beyond the Basics
27mMatthew Gerstman - TypeScript: Seeing Past the Hype
01h 01mDeconstructing TypeScript’s Type System
