Types at the edges of your system
Find and fix your TypeScript blind spots
😃 Coding with TypeScript feels safe, the compiler has your back.
😨 But today, you got a critical issue in prod: payments are failing! A quick check of the logs left you puzzled: TypeError: discount.toFixed is not a function
.
😕 Wait… Isn't discount
supposed to be a number here? How did that happen? Why didn't TS catch it before?! Worry no more.
🤠 In this talk, I will show you where your blind spots are, and a simple way for you to fix them.
🧰 Resources
- Slides of my talk
- Why
array[0]
doesn't returnT | undefined
by default? - Parse, Don't Validate
- Advanced TypeScript Patterns: API Contracts
- Fixing TypeScript's Blindspots: Runtime Typechecking
- colinhacks/zod the TypeScript-first schema validation with static type inference
Written by Nicolas Carlo who lives and works in Montreal, Canada 🍁
He founded the Software Crafters Montreal community which cares about building maintainable softwares.