tRPC + NextJS App Router = Simple Typesafe APIs

  Рет қаралды 74,397

Jack Herrington

Jack Herrington

Күн бұрын

👉 Upcoming NextJS course: pronextjs.dev
👉 Code : github.com/jherr/trpc-on-the-...
👉 Don't forget to subscribe to this channel for more updates: bit.ly/2E7drfJ
👉 Discord server signup: / discord
👉 VS Code theme and font? Night Wolf [black] and Operator Mono
👉 Terminal Theme and font? oh-my-posh with powerlevel10k_rainbow and SpaceMono NF
0:00 Introduction
1:22 NextJS/trpc Setup
5:05 tRPC Client Setup
7:38 Drizzle Setup
9:31 Using Drizzle from tRPC
13:35 Why tRPC is awesome?
15:28 Supporting Server Side Rendering
18:44 Outro

Пікірлер: 367
@MikeyUchiha
@MikeyUchiha 10 ай бұрын
I have never subscribed so fast. I have been waiting over a month for someone to finally show how to do this. You are the GOAT. Thank you 😊
@cryptoaddict6715
@cryptoaddict6715 10 ай бұрын
The timing of me finding this is perfect. Thank you for your time. You're helping me learn as I go .ore than I can say.
@olivercordingley6588
@olivercordingley6588 3 ай бұрын
This has got to be the 30th time I've watched this video over a 7 month period. Legendary.
@jherr
@jherr 3 ай бұрын
Thank you!
@lemonz445
@lemonz445 3 ай бұрын
Same, it's so good! Thanks for all the work here Jack, you're making us all better.
@khushalbhardwaj6192
@khushalbhardwaj6192 8 ай бұрын
There's hasn't been a video on how to set up tRPC on the app router for such a long time. I had stopped using tRPC in the projects after I switched to APP Router, after seeing this video I'm probably back at it. Thanks for this 👏
@TheRoseWoodBody
@TheRoseWoodBody 10 ай бұрын
Thanks, Jack! It's exactly what I've been looking for.
@tamir.s
@tamir.s 10 ай бұрын
Another great video from you, Jack, thank you very much! I wish I could watch that few weeks ago, it could save me so much time wasted on figuring it out on my own. But I still decided to move away from tRPC for now, as I didn't know how to add and connect the other important layers that you covered in your older video, like creating the context with stuff you need like prisma, and oAuth. It will be really helpful if you continue where you left off in this video with these topics. Much appreciation and love to you and your family!
@edwardselirah4764
@edwardselirah4764 2 ай бұрын
Just had a project and I had to understand tPRC quick. This was the right video for me. Thanks
@davidhavl
@davidhavl 10 ай бұрын
Fantastic. Thank you for the good work and for educating the dev world the right way!!
@GuilhermeSiebert
@GuilhermeSiebert 3 ай бұрын
Wow, it's just Monday and you have already saved me the full week! Thank you so much. Subscribed!
@xanthe7045
@xanthe7045 10 ай бұрын
Always love your content. I'm creating an app that is using Nextjs 13 app + tRPC. and this video was just what I needed. Thanks.
@mjohnson510
@mjohnson510 10 ай бұрын
Omg! This is a game changer! I really liked trpc and didn’t want to move away from it
@wagnermoreira786
@wagnermoreira786 5 ай бұрын
What an aaaawesome video! thanks so much Jack! This is just what I was looking for :)
@mauricioyepes3394
@mauricioyepes3394 10 ай бұрын
Hi Jack, this is the first video I've watched on your channel, and you've saved me an incredible amount of time. I'm a new follower here. Thank you!!
@jherr
@jherr 10 ай бұрын
Thanks! Happy to have helped.
@randomuser6789
@randomuser6789 10 ай бұрын
Extremely high quality content, thank you very much
@merveillevaneck5906
@merveillevaneck5906 10 ай бұрын
LOVE IT!!!! i literally did EXACTLY this about 2 months ago when setting up our new internal R&D project and i gotta say the TRPC + app router + drizzle combo is just pure bliss. great to see some tested content on the topic!!
@Furki4_4
@Furki4_4 9 ай бұрын
Thank you so much! I was searching for a way to implement tRPC with the app directory. This video explains everything very clearly!
@victortriathlete
@victortriathlete 4 ай бұрын
Amazing introduction to integrating tRPC into the NextJS app router.
@adlerspencer
@adlerspencer 10 ай бұрын
Amazing, Mr. Herrington! Thank you!
@ThEldeRS
@ThEldeRS 10 ай бұрын
I think that the biggest thing I’ve learned from this video is actually the Awaited type. I’ve been wondering if something like that exists since yesterday!!! Thanks for the great video, Jack! Hope that you and your wife are doing great 🙂
@jherr
@jherr 10 ай бұрын
We are. Thank you for asking.
@JEM_GG
@JEM_GG 10 ай бұрын
Agreed! I've just used it on a App dir/Drizzle/fetch setup and it worked quite well with handing types from server components to client
@Labastidaa
@Labastidaa 6 ай бұрын
Same here, that awaited type is very useful. Thanks for the video Jack!
@eovandodev
@eovandodev 10 ай бұрын
This is what I've be waiting for! Thanks Jack
@yurisoares2596
@yurisoares2596 5 ай бұрын
Awesome. This is the third vídeo I have seen about tRPC, and this was the best out there. Even since the setup is really similar to the T3.
@bytequest1552
@bytequest1552 5 ай бұрын
Is is working?
@noccer
@noccer 10 ай бұрын
A really great walkthrough, thanks a lot! ☘
@FutureExC-gd7zv
@FutureExC-gd7zv 22 күн бұрын
Crystal clear explanation.
@phranjay2545
@phranjay2545 3 ай бұрын
You have no idea how much you have helped me, thank you for what you do
@tarzan7994
@tarzan7994 10 ай бұрын
Incredible video Jack honestly you've helped me progress massively throughout my coding journey. I was only starting to implement typescript in one of my projects and was faced with how to implement trpc in the app router so your video came at the perfect time. Any chance there will be a further video explaining how to implement optimistic UI updates using this pattern? Thanks again for all the content!
@MuhammadHanann
@MuhammadHanann 6 ай бұрын
Thank You So Much Sir. Before your video tRPC was a rocket science for me.
@andriiantoniuk8419
@andriiantoniuk8419 10 ай бұрын
This is excellent!!! Thanks for the video :)
@Dgiulian
@Dgiulian 10 ай бұрын
Amazing, love the stack. I'm going to try it myself.
@abhinav.sharma
@abhinav.sharma 10 ай бұрын
Exactly the video I was looking for JACK!
@asimalqasmi7316
@asimalqasmi7316 10 ай бұрын
Thanks a lot for this awesome video. I saw it twice and maybe I will see it again tell I grasp the ideas from it.
@Its-InderjeetSinghGill
@Its-InderjeetSinghGill 10 ай бұрын
You made my day. Currently TRPC with next 12 kinda sucks because came across some issues like caching and couldn't figure out why trpc making same request when we reload our page which is not as performant and it eats up lot of database usage. May be I am wrong with the caching problem because I tried what you have suggested at 18:22 but it didn't work in my case. But now I am going to use TRPC with next 13 confidently only because of you. Thanks
@oggy112
@oggy112 10 ай бұрын
Jack, you're absolutely amazing.
@noor_codes
@noor_codes 8 ай бұрын
Such a great video, straight and easy to understand. I just hope you dived deeper into the important things like how to add the db into the context so you can access it all over the place and also explain middlewares and how that works with authentication. I would love to see a video on that, the official docs do not cover app-router on nextjs
@teetanrobotics5363
@teetanrobotics5363 10 ай бұрын
"Hey Tom! Just wanted to drop by and let you know how much I'm loving your content, especially your T3 Stack, TRPC tutorials, and Next.js guides. Your explanations are clear and really help me grasp these concepts better. 🚀 I'm eagerly looking forward to more of your tutorials in the future. If you could create more content like this, it would be amazing! Your insights and tutorials are a great resource for learners like me. Keep up the fantastic work and keep those tutorials coming! 👍📚"
@jherr
@jherr 10 ай бұрын
Thanks! Name is Jack though.
@kickbuttowsk2i
@kickbuttowsk2i 10 ай бұрын
​@@jherrlol
@iSkreme
@iSkreme 8 ай бұрын
You crushed this; taught us how to create a dynamic SSR web-app with database in under 20 minutes....
@AlbertPak
@AlbertPak 10 ай бұрын
as always - quality content :)
@willurban837
@willurban837 10 ай бұрын
AMAZING, thanks for the video!
@JEM_GG
@JEM_GG 10 ай бұрын
So cool thanks Jack!
@oscarljimenez5717
@oscarljimenez5717 10 ай бұрын
Amazing video. Actually you can even do streaming with tRPC 👀, and they have a experimental package for server actions too. And in RQ to avoid the second request, is better to set stale time to 30 globally, that's what TkDodo is going to do in the next version to avoid this.
@z3rocodes
@z3rocodes 10 ай бұрын
Great video! tRPC with Astro is cool too
@snatvb
@snatvb 10 ай бұрын
many thanks for the video, really helpful and looks better than server actions that's experemental
@RegalWK
@RegalWK 10 ай бұрын
This is the best video I seen in a while
@tomaszbazelczuk4987
@tomaszbazelczuk4987 10 ай бұрын
Great video as usual 👍
@mayrarincones8427
@mayrarincones8427 4 ай бұрын
Thank you!! this was really helpful ❤
@ShaunCullen
@ShaunCullen 10 ай бұрын
Looking at the type spaghetti at @17:40 on line 10: Now we C++'n. But seriously this is really cool, thanks for the full end to end walk through Jack.
@BeBoBE
@BeBoBE 10 ай бұрын
tRPC has a utility type for this exact situation called inferRouterOutputs to retrieve the outputs of each endpoint
@berleytrails
@berleytrails 10 ай бұрын
Great video! Thanks
@mubin-ansari
@mubin-ansari 10 ай бұрын
I always loved tRPC and was disappointed to see it not sustained in the app directory workflow. Super excited to see this setup, and can't wait to use it in my future projects!!
@seannewell397
@seannewell397 10 ай бұрын
This is awesome!
@Moe-Ali11
@Moe-Ali11 10 ай бұрын
Great video!
@sebcuadros
@sebcuadros 10 ай бұрын
So good thx Jack
@tzuilee588
@tzuilee588 9 ай бұрын
Wow this one is amazing
@nedimarabaci
@nedimarabaci 10 ай бұрын
amazing!
@mertdr
@mertdr 10 ай бұрын
Perfect timing Jack! I’ve been thinking trpc and react query has become irrelevant after app directory released but apparently they’re more relevant than ever because of app dir’s persistant caching issue. Actually I’m not even sure if it’s an issue or intended behavior because next team hasn’t provided a proper solution for months.
@YordisPrieto
@YordisPrieto 9 ай бұрын
What issue are you referring to if you do not mind to share? Is there any particular Issue or Discussion opened?
@mertdr
@mertdr 9 ай бұрын
@@YordisPrieto it’s about server component’s caching. Next team somehow decided a 30 seconds minimum caching for server components and revalidate value cannot change it. As far as I’m concerned it’s something similar to opcache of php. It’s mainly for html content inside of a server component but I noticed it also affects fetching as well. There was a discussion on github to provide a new global similar to revalidate in order to override caching time but it’s not implemented yet. That being said, mutations or refetching is not handled properly without additional methods like router.refresh() etc. and it complicates things. Many people had issues about this “cached by default” approach.
@YordisPrieto
@YordisPrieto 9 ай бұрын
@@mertdr that explained what happened to me. Debugged for ours Nats message passing because I couldn’t figure out why my next page didn’t show the results… until I opened the console and forced the cache to be invalid … never understood the duck was going on until now … really stupid if you ask me
@mertdr
@mertdr 9 ай бұрын
@@YordisPrieto I switched to TRPC the day I posted the comment above so I remember the actual problem vaguely. As far as I can remember router.refresh() didn't help to invalidate fetch calls in server component, which is a huge problem. Caching is vital part of applications but like you said cached by default approach is not sensible and brings more problems than it resolves. I got used to server/client components and enjoy the concept very much but there are still so many things to iron out.
@MikeyUchiha
@MikeyUchiha 10 ай бұрын
If it's not too much to ask, I would really appreciate a couple if things to expand on this. 1. Showing how to use the db as a context in TRPC like how T3 stack does it. 2. Show how to use context in TRPC for Clerk. This couple of pieces would offer a complete replacement and comparison to the T3 stack not providing support for App Directory but still leverage some of the good practices that are part of the framework. Thanks for your time and consideration.
@ovidiuk2
@ovidiuk2 10 ай бұрын
I am also looking for some details about how to use context for implementing Clerk with TRPC in this setup
@rogueturnip
@rogueturnip 10 ай бұрын
@@ovidiuk2 I'm getting closer. this works but always fails on auth right now. maybe it will help you solve it context.ts next to the trpc.ts file import * as trpcNext from '@trpc/server/adapters/next'; import { SignedInAuthObject, SignedOutAuthObject, getAuth, } from '@clerk/nextjs/server'; // import { FetchCreateContextFnOptions } from '@trpc/server/adapters/fetch'; import { inferAsyncReturnType } from '@trpc/server'; interface AuthContext { auth: SignedInAuthObject | SignedOutAuthObject; } export const createContextInner = async ({ auth }: AuthContext) => { return { auth, }; }; export const createContext = async ( opts: trpcNext.CreateNextContextOptions ) => { const context = await createContextInner({ auth: getAuth(opts.req) }); return context; }; export type Context = inferAsyncReturnType; update trpc.ts to import { TRPCError, initTRPC } from '@trpc/server'; import type { Context } from './context'; const t = initTRPC.context().create(); export const router = t.router; export const middleware = t.middleware; export const mergeRouters = t.mergeRouters; const isAuthed = t.middleware((opts) => { const { ctx } = opts; if (!ctx.auth?.user?.id) { throw new TRPCError({ code: 'UNAUTHORIZED' }); } return opts.next({ ctx: { user: ctx.auth.user, }, }); }); export const publicProcedure = t.procedure.use(isAuthed); change route.ts to import { NextRequest } from 'next/server'; /* eslint-disable @typescript-eslint/no-explicit-any */ import { appRouter } from '@/server'; import { fetchRequestHandler } from '@trpc/server/adapters/fetch'; import { getAuth } from '@clerk/nextjs/server'; const handler = (req: NextRequest) => fetchRequestHandler({ endpoint: '/api/trpc', req, router: appRouter, createContext: () => ({ auth: getAuth(req) }), }); export { handler as GET, handler as POST };
@rogueturnip
@rogueturnip 10 ай бұрын
I got it fully working.. not sure if this is best practices or not but what I found is you can't pass the auth from clerk on the server fetch, but you don't need too cause your page should be auth'd too. So what I did was updated the context.ts file to handle no context from server by putting in a userId===system. /* eslint-disable @typescript-eslint/no-explicit-any */ import * as trpcNext from '@trpc/server/adapters/next'; import { getAuth } from '@clerk/nextjs/server'; // import { FetchCreateContextFnOptions } from '@trpc/server/adapters/fetch'; import { inferAsyncReturnType } from '@trpc/server'; export const createContextInner = (req: any) => { if (!req) { return { auth: { userId: 'system' } }; } return { auth: getAuth(req), }; }; export const createContext = async ( opts: trpcNext.CreateNextContextOptions ) => { const contextInner = createContextInner(opts.req); return { ...contextInner, req: opts.req, res: opts.res, }; }; export type Context = inferAsyncReturnType; then you modify the serverClient.ts to import { appRouter } from '@/server'; import { createContextInner } from '@/server/context'; export const serverClient = appRouter.createCaller( createContextInner(undefined) ); @jherr
@IcedTears
@IcedTears 10 ай бұрын
Not sure the best approach for this but in my case I've created a createTRPCContext function that return my db object: export const createTRPCContext = () => { return { db, }; }; Then I used this in the init function: const t = initTRPC.context().create({ when creating the serverClient: export const serverClient = appRouter.createCaller(createTRPCContext()); and in the handler: const handler = (req: Request) => fetchRequestHandler({ endpoint: "/api/trpc", req, router: appRouter, createContext: createTRPCContext, }); For Clerk in your trpc file: const isAuthed = t.middleware(async ({ next }) => { const user = await currentUser(); if (!user) { throw new TRPCError({ code: "UNAUTHORIZED", message: "Not authenticated" }); } return next({ ctx: { user: user, }, }); }); export const protectedProcedure = t.procedure.use(isAuthed); Now your protected procedure are going to have user within the context
@paweknot9047
@paweknot9047 9 ай бұрын
@@IcedTears thanks pal, thats exactly what I needed for clerk
@carlosricardoziegler2650
@carlosricardoziegler2650 10 ай бұрын
Amazing ❤
@agha-mou
@agha-mou 10 ай бұрын
Amazing!
@mattwooddc
@mattwooddc 10 ай бұрын
Thank you!
@wavyboyjodii
@wavyboyjodii 3 ай бұрын
Thank You Sir
@toothless.tarantula
@toothless.tarantula 10 ай бұрын
Great Video.
@nicolascalathus7349
@nicolascalathus7349 10 ай бұрын
It would be very enlightening to see a video where you showcase tRPC against the server actions way of doing things to clarify why tRPC.
@soheilweb
@soheilweb 10 ай бұрын
عالی بود❤❤❤❤❤❤❤❤❤❤
@oscaresteve5344
@oscaresteve5344 10 ай бұрын
Great video! Would be fantastic to have a video handling validation error from Zod :)
@pauldudich
@pauldudich 10 ай бұрын
You're awesome 🔥
@josephdburdick
@josephdburdick 9 ай бұрын
I was racking my brainz over this all weekend and finally found your video. Liked and subscribed, thank you.
@daigahou
@daigahou 10 ай бұрын
awesome!
@bojack4800
@bojack4800 10 ай бұрын
thx for u share!
@chance2480
@chance2480 7 ай бұрын
You are my savior
@TheIpicon
@TheIpicon 10 ай бұрын
Beautiful video! missing app router trpc integration is one of the feew reasons people don't move to the app router yet.
@gadgetboyplaysmc
@gadgetboyplaysmc 10 ай бұрын
Also the router caching problems tho
@shteev
@shteev 8 ай бұрын
Great stuff! I may be jumping the gun as I haven't finished the video just yet, but you're saying that we have to use "use client" and react query to interact with our server code, and I'm sure it's possible to bypass all that using server components plus server actions within the form action attribute.
@MattChinander
@MattChinander 10 ай бұрын
The flashes of the white background browser and terminal are brutal to my eyes.
@MirkoVukusic
@MirkoVukusic 10 ай бұрын
oh yesss. wait was too long.
@cristianmargineanu1458
@cristianmargineanu1458 8 ай бұрын
big up for the video, I've made it work months ago tho 😎
@27sosite73
@27sosite73 7 ай бұрын
thank you
@MascleGinger
@MascleGinger 10 ай бұрын
Jack, your content is just the next level! I am wondering how do you manage to do a full time software development job and provide such a high quality content
@jherr
@jherr 10 ай бұрын
I don't. I'm now a full time content creator.
@xWildStorm7x
@xWildStorm7x 10 ай бұрын
Hello Jack, thanks for the awesome video! I have a question, I added a context to my TRPC app router and now I am getting a type error on the serverClient. It asks me to pass it the context. In the TRPC docs it indicates to pass the context like this: createCaller(await createContext()) but I get a type error saying the createContext function expects to receive req and res params. Not sure what to do since I don't have access to req and res in this file. Do you know how to solve this issue? Any guidance will be appreciated
@bibblebabl
@bibblebabl 10 ай бұрын
Hi Jack! Thanks for the video! BTW, what kind of zsh theme/plugin are you using?
@huynhhoangphuc9027
@huynhhoangphuc9027 10 ай бұрын
Amazing ! Thanks Jack I really like your vscode theme, please tell me which theme you use
@kosti2647
@kosti2647 10 ай бұрын
the explanation was really good! I'm struggling to add next-auth session to server client, do u think u could extend this repo to also have next auth session implementation? I think many folks could use such video, having auth is common thing nowadays. I'm not sure how to have user context/session available in trpc context
@StabilDEV
@StabilDEV 7 ай бұрын
Superb video, thanks a lot! What is the advantage of putting client.ts and serverClient.ts into app/_trpc instead of e.g. lib or utils outside of the app dir?
@lobataros
@lobataros 10 ай бұрын
Hi mr. Herrington, this is out of topic, but i wondering what zsh theme did you use? I love the fonts also the color combination of your terminal
@nomadmack
@nomadmack 9 ай бұрын
Great video!!. Any example with a protected route using next-auth?
@vazus171
@vazus171 9 ай бұрын
Hi Jack, Great video! However I've noticed an issue. In 16:10 you are creating a caller and pass links there. But tRPC caller accepts context rather than config, so now you have this weird context on server. I've tried to get "normal" context preserver, but failed. Not sure how it can be done with App router. I have NextAuth to create a session and want to always preserve this session on context, so it can be used in middleware for protected routes. Any ideas on how to do it?
@computing1
@computing1 10 ай бұрын
How would you deploy the serverClient to something like vercel? Specifically, for the httpLink url, what do you put there?
@6_nikki_9
@6_nikki_9 9 ай бұрын
👌😩
@2u675
@2u675 3 ай бұрын
Thank you very much for sharing. Could you share your zsh configuration? It looks great.
@zachmeyer_
@zachmeyer_ 10 ай бұрын
Curious why not just use NextJS server actions? Wouldn't that still maintian typesaftey across the client server boundry?
@raygan3
@raygan3 9 ай бұрын
I don't get why do we need to make a http requests using serverClient if we are already on the server (server component), can't we just call the server procedure? why the http link is needed?
@user-nu1qg9mi9v
@user-nu1qg9mi9v 10 ай бұрын
I would like to ask for advice. I really appreciate your video. How should wsLink be configured for createClient if the WebSocket server is set to run on port 3001 according to the documentation?
@RatherBeCancelledThanHandled
@RatherBeCancelledThanHandled Ай бұрын
Wow I love your terminal ! Can you please share how you set that up ?
@martinfulop484
@martinfulop484 5 ай бұрын
Hi Jack! May I know which VSCode theme and font are you using? I love it.
@user-vj6in7er4r
@user-vj6in7er4r 10 ай бұрын
Will there be any problems with Edge runtime? I have a working app router and trpc thing on edge already but it works with patches, and really weird stuff, so looking for other solutions to simplify and stabilise things.
@electrpaleo
@electrpaleo 9 ай бұрын
Great video! but I have a question, how can I do a server side call if my trpc router is hosted separately?
@binh1298ify
@binh1298ify 3 күн бұрын
Thanks, Mr Herrington, very helpful video. Although I wish it was postgres instead of sqlite
@jherr
@jherr 3 күн бұрын
Should be pretty straightforward to swap out sqlite for Postgres. They are both SQL databases and in this simple usage context are essentially identical.
@binh1298ify
@binh1298ify 3 күн бұрын
@@jherr ahhh yes, i had done it before i made the comment
@infisspablo8602
@infisspablo8602 8 ай бұрын
Would u say using trpc with app router is better or just do fetching with functions and using setver wctions for mutating the data?
@Tiaguex
@Tiaguex 10 ай бұрын
Nice terminal, can you provide some info of what themes are you using to have it?
@rottenpancakes
@rottenpancakes 5 ай бұрын
Hello Jack, it would be amazing if you could make another tutorial explaining the more advanced features of trpc together with next and tanstack. Holy hell i'm going crazy trying to get infinite queries to render on the server first and then work on the client. I get that you need to create a SSR helper, then prefetchInfininte, then use a HydrationBoundry, then dehydrate the state... or something. Yeah, there's no a lot of information about how to do it with the app router. It doesn't help that a lot of guides are outdated and use the old API.
@killiangemoets1360
@killiangemoets1360 Ай бұрын
Hi Jack, love your content! A few thoughts: - Wouldn't be nice to use server actions to create a new item instead? - Why using ssr at first and then csr on revalidation? Would it be interesting to use ssr on revalidation as well? I guess your approach if more performant?
@jherr
@jherr Ай бұрын
When I do a video on a technology like tRPC, what I'm looking to do is to focus the content of the video on that topic. So in this case I want to show queries and mutations using tRPC to demonstrate tRPC. Is tRPC the right choice on the App Router? Totally up to you. But if you decide to use it, then you can use this video as a reference for that. It's not meant to indicate that in all circumnstances that tRPC is the correct choice architecturally. If you can get away with it, server actions are far easier.
@tomassabol59
@tomassabol59 10 ай бұрын
hey Jack. love the video! I have a question. In case you have multiple routers (let's say you have a router for storing public procedures for users, one for posts, etc), that you then export as a single appRouter in src/server/index.ts file, how would a url to the specific procedure look like? I have it set up same way you did, but once I create multiple routers as mentioned above, I get an error when accessing them via url - they work fine in my app.
@jherr
@jherr 10 ай бұрын
TBH, I haven't tried multiple routers. Feel free to post an example of your code on the Blue Collar Coder discord and folks on there can have a look. Please read and follow the #rules before posting.
@norliegh
@norliegh 9 ай бұрын
Jack what font is that in the terminal. It looks really good. :)
@exponent42
@exponent42 10 ай бұрын
please correct me if I'm wrong, but isn't TRPC redundant with server actions? they're fully typed e2e?
@filipjnc
@filipjnc 10 ай бұрын
Server actions are alpha/experimental still. Plus, nextjs doesn‘t really promote fetching data in client components with server actions. I use RSC patterns in server components + tRPC in client components and it works wonders.
@asutula5797
@asutula5797 10 ай бұрын
Maybe you're implying something about "fetching" data vs mutating data on the server, but as far as I can tell fetching data works fine.
@filipjnc
@filipjnc 10 ай бұрын
@@asutula5797 it works, but nobody from Next.js promotes this solution in the docs and the caching story is unknown or even non existent.
@exponent42
@exponent42 10 ай бұрын
@@filipjnc thanks, that does make sense
Why I don't use React-Query and tRPC in Next.js
18:58
ByteGrad
Рет қаралды 74 М.
Is Tanstack Router Better Than React-Router?
18:00
Jack Herrington
Рет қаралды 32 М.
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 78 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 21 МЛН
I CAN’T BELIEVE I LOST 😱
00:46
Topper Guild
Рет қаралды 75 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 91 МЛН
Chris Bautista: Making typesafe APIs easy with tRPC
13:00
Vercel
Рет қаралды 69 М.
No const! How NOT To Give A JavaScript Talk
10:28
Jack Herrington
Рет қаралды 60 М.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 71 М.
Next.js App Router REVIEW (Six Months In Prod)
16:10
Theo - t3․gg
Рет қаралды 59 М.
Are You In A React Cult?
13:27
Jack Herrington
Рет қаралды 29 М.
React + Servers = Confusion
20:30
Theo - t3․gg
Рет қаралды 40 М.
T3: TRPC, Prisma and NextAuth Done Right
43:14
Jack Herrington
Рет қаралды 90 М.
Do I even need this anymore?
5:41
Theo - t3․gg
Рет қаралды 45 М.
Drizzle ORM in 100 Seconds
2:54
Fireship
Рет қаралды 443 М.
YOTAPHONE 2 - СПУСТЯ 10 ЛЕТ
15:13
ЗЕ МАККЕРС
Рет қаралды 149 М.