Understanding End-to-End Type Safety for Our Backends
summary
Discusses end-to-end type safety for JavaScript REST backends as an alternative to switching to GraphQL. Covers the mismatch of fields and types between frontend and backend, existing JS solutions like tRPC that share models and IDE types/autocomplete, and presents practical approaches including a custom script-based converter and watcher to generate and keep REST API types in sync.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 2:20What is Type Safety
- 3:47Schema mismatch problem
- 5:13Frontend backend model
- 6:14Breaking changes compatibility
- 9:26GraphQL Type Safety limits
- 11:33gRPC Web alternative
- 13:19Code First approach
- 16:31Code First benefits
- 18:14tRPC for Type Safety
- 21:44Python Type Safety
- 22:27OpenAPI TypeScript generator
- 25:15OpenAPI TypeScript pros cons
- 26:40OpenAPI Zod generator
- 28:52OpenAPI Cent generator
- 29:34React Query generator
- 31:01Solution comparison
- 33:08Q&A
