Giorgio Boa

tRPC: API schemas are pure overhead

What if your API schema was just... TypeScript? See how tRPC delivers end-to-end typesafety with zero code generation or overhead.

tRPC: API schemas are pure overhead
#1about 3 minutes

Understanding the problem of API schema fatigue

Traditional API approaches like OpenAPI and GraphQL require learning new specifications and running code generation steps, which can be cumbersome.

#2about 2 minutes

Introducing tRPC for end-to-end type safety

tRPC is a popular library that enables sharing types between a client and server without schemas by leveraging TypeScript's built-in type inference.

#3about 4 minutes

Live demo of setting up a tRPC server

The setup involves installing client and server packages, creating a main app router that combines business logic, and exporting its inferred type for the client.

#4about 3 minutes

Demonstrating type safety between client and server

Changing a backend procedure's name or parameters instantly triggers a TypeScript error in the frontend code, preventing broken APIs from being shipped.

#5about 6 minutes

Debugging tRPC communication and server execution

By inspecting network requests and using breakpoints, you can trace how the client calls the server via HTTP and how the server library resolves and executes your backend functions.

#6about 2 minutes

Analyzing the pros and cons of using tRPC

tRPC eliminates code generation and improves collaboration but requires a full TypeScript stack and manual handling for API versioning or public APIs.

#7about 3 minutes

Learning from real-world open source examples

Use tools like grep.app to search open source projects like cal.com and learn advanced patterns, such as implementing custom authentication middleware.

#8about 4 minutes

Getting started and handling different project setups

Bootstrap a new project using create-t3-app and handle separate client/server repositories by publishing the shared router type as a private NPM package.

Related jobs
Jobs that call for the skills explored in this talk.

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
JavaScript is the backbone of web development, powering everything from small websites to large-scale enterprise applications. However, as projects grow in complexity, maintaining JavaScript code can become increasingly difficult. This is where TypeS...
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
DC
Daniel Cranney
Dev Digest 159: AI Pipelines, 10x Faster TypeScript, How to Interview
Inside last week’s Dev Digest 159 . 🤖 How to use LLMs to help you write code ⚡ How much electricity does AI need? 🔒 Is your API secure? Learn all about hardening it… 🟦 TypeScript switches to go and gets 10 times faster 🖼️ An image cropper in your ap...
Dev Digest 159: AI Pipelines, 10x Faster TypeScript, How to Interview
DC
Daniel Cranney
What Developers Really Need to Create Great Code Demos
Every developer on earth has, at some point, had another developer to thank for a breakthrough, a success, an aha moment they wouldn’t have had without coming across that blog post, that open-source contribution, that reply on socials or that humble ...
What Developers Really Need to Create Great Code Demos
DC
Daniel Cranney
Next.js App Router: Explained
IntroductionVercel’s Next.js has come a long way since its initial release in 2016. What would become the most popular React framework (according to their own website, at least), started as a simple solution for handling routing, SEO optimisation and...
Next.js App Router: Explained

From learning to earning

Jobs that call for the skills explored in this talk.