type checking
The compiler’s job of proving that every value in the code is used in a way its type allows.
In more detail
tRPC relies entirely on the TypeScript type checker: the client imports the server’s router type and the checker flags any call with wrong inputs. Type checking cannot see the actual data a program receives at run time.
Related terms
- TypeScript — JavaScript with added type annotations, checked by a compiler before the code runs.
- compile time — The moment source code is checked and translated by a compiler, before the program runs, as opposed to run time.
- type inference — The compiler working out a type from the code itself, so you do not have to write it out by hand.
Taught in
- End-to-End Type Safety: Shared Schemas & DTOs — Production Full-Stack Engineering
- Type-Safe RPC Architectures: tRPC & Procedures — Production Full-Stack Engineering