
This talk was given at ViennaJS March 2023 by Christopher Ehrlich.
TypeScript is increasingly becoming the standard in web dev. But while we now have excellent typesafety in our frontends and our backends, getting it for API calls is still takes some effort and usually requires codegen. tRPC to the rescue!
tRPC (https://github.com/trpc/trpc) is a new library that replaces OpenAPI or GraphQL (only when it makes sense - no "REST in peace" puns here!) and allows end-to-end, real-time typesafety, providing an unprecedented DX for creating full stack applications. It feels like Hot Module Reloading, but for the communication between your client and your API. It's already used in production at many companies including Netflix, and it's also an excellent choice for your next side project :)
As a contributor to tRPC and a core team member of Create T3 App (a CLI tool that allows users to bootstrap a typesafe full-stack Next.js app that includes tRPC - https://github.com/t3-oss/create-t3-app/) I will provide an overview of how tRPC works both conceptually and bin code, give a demo of the real-time typesafety and how easy and fun this makes building and consuming an API, and maybe even show some advanced patterns. If there is time at the end we can also look at some early experiments of how this might look with React Server Components.