End to end typing for web applications
summary
Claim: keep one source of truth for data shapes by writing JSON Schema to TypeScript and generating types used by both Ruby produces and the frontend. Tools: JSON Schema files, generator, TypeScript, optional runtime checks (Zod/JSON Schema assertions), CI step that regenerates and runs the TS compiler. Built: generated type map of API paths and discriminated unions for Action Cable events. Result: incremental rollout over ~six months reaches ~95% frontend in TypeScript and catches mismatches before runtime.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:59Frontend-backend type mismatch
- 3:02What is TypeScript
- 5:54TypeScript features
- 7:40TypeScript with React
- 9:45Type narrowing
- 13:20Untyped external data
- 15:31JSON Schema validation
- 17:39Ruby and TypeScript bridge
- 20:08Generated types in practice
- 23:40Organizing TypeScript types
- 25:25Eliminating type assertions
- 30:46Adoption benefits summary
- 31:28Q&A
related talks
29mType safety from the database to the frontend
27mWeb applications of the future with TypeScript and GraphQL
45mType-Safe APIs - Syncing Back & Front End Types w/ Code Generation
25mWeb applications of the future with TypeScript and GraphQL
33mTypeScript for APIs
38mWeb Applications of the Future With TypeScript and GraphQL
22mThink you know TypeScript? Think again.
21mKeep alive your typescript definitions using Zod
