Learn tRPC in 5 minutes

preview_player
Показать описание
00:00 Intro
00:30 Basics
01:13 Querying
01:29 Server basics
02:21 Server & Client type-safety
02:45 Jumping between backend and frontend
03:06 The server
03:22 Input
04:07 Mutations
04:26 Middleware

Become a TypeScript Wizard with my free beginners TypeScript Course:

Follow Matt on Twitter

Join the Discord:

Рекомендации по теме
Комментарии
Автор

Such a clean and simple way of explaining zod and trpc. I listened to your typescript debate and learned you were once a teacher! Definitely your calling in life. I have not seen such a good explanation/example of zod trpc. And the transition to trpc without zod to with zod really made things click for me. Thanks Matt!

tenthlegionstudios
Автор

Really love these short videos explaining the core concepts.
Thanks Matt!

saurabhprakash
Автор

I was just typing tprc with zod into the search bar 3:42. Decent videos keep it up!

StephenRayner
Автор

Thank you so much, you just saved me from a gazillion years of confusion.

codewithfongoh
Автор

tRPC is amazing. It's hard to overestimate the value of end to end typesafety, it's such a pleasant way to do fullstack development. Cannot recommend it enough! Just wish there was a native way to do SSE, that would be cool!

miklschmidt
Автор

Lovely intro to tRPC. It really feels great to have autocomplete carry you through the entire api call, not to mention the fact it runs on react-query, so you get query invalidation, pagination and all that great stuff for free without any setup (besides the initial boilerplate, but that's one-and-done).
You really can just not have any defined types in the app and still get the full benefits of typescript, especially if you use an ORM of some kind. If I have at least some control over the tech stack, I simply refuse to work without tRPC.

helleye
Автор

You made it so clear, thanks for that! I am new to this and was so confused ! I left with a big thumbs up and subscribed!

SuperYoda
Автор

Awesome video Matt. You really covered a lot in just the right detail for an introduction video! ❤❤

juliusmarminge
Автор

this was the one that made tRPC click for me. thanks a lot

matheusnogueira
Автор

I like the power of this, pretty cool. Things like this exist that could be language agnostic, unfortunately code-generation is ultimately required for that, so I like that tRPC does not require code-generation, even though it is only for TypeScript, that is a worthwhile trade-off.

The way it forces you to only send the type expected on the server is great, meaning we can only really abuse it by manually requesting our backend server, and even then, because we do runtime type validation using Zod (or however we like), this is also prevented! Awesome!😄

nark
Автор

Renewing my subscription to your face! Keep up the great content. 🙂

BoudewijnDanser
Автор

Awesome video!
tRPC seems quite amazing.

extrordinaire
Автор

tRPC is incredible I actually made a video with the T3 stack and I love the autocomplete that comes as a result of this type safety

monstajoedev
Автор

I love how it integrates react-query into it. I wish I could use it as some kind of anti corruption layer against a rest api. Often I dont control the backend but get available rest endpoints to use. I want to be able to fetch against an endpoint in a query procedure, transform/map it to what the client wants and return it.

markushansson
Автор

Would be cool if you could make a showcase for such setup. Client/server workspaces with react vite trpc + production build🎉

Vantivify
Автор

The only problem is that in most projects the backend is separated from frontend, so tRPC could be created only as a BFF

roni_castro
Автор

Nice video! I wish go devs had something like this. At my startup, the frontend is nextJS but our backend is a gin server (we're doing a lot of streaming IO stuff, so go was a good fit). Petition for someone to build go-rpc lol 😂

ozzyfromspace
Автор

Good video. I learned alot. This is more for JS^TS heavy devs (like reactjs).

complexity
Автор

I am a frontend developer and I have faced problems because key name was different in database and i spelled it differently in frontend. This will help to avoid those mistakes.

AmanMavi
Автор

Thanks for this! I'm trying to learn trpc and this helped a lot to understand the basics!. Btw I'm curious, do you init a project in the root folder? do you just push all to github then? (let's say for uploading everything to a cloud server).

pablom