MrManafon
MrManafon
TTCTheo's Typesafe Cult
Created by MrManafon on 7/2/2024 in #questions
Setting cookies on tRPC calls
Hey gang, I've been trying to figure out how to set cookies when making a tRPC response. With API routes its super easy - you just cookies(). But it sounds like trpc is more involved, and includes using ctx.headers. I also tried that, but I don't seem to be able to set any cookies in the browser.
1 replies
TTCTheo's Typesafe Cult
Created by MrManafon on 2/18/2024 in #questions
server actions & trpc
Heya folks, I'm compiling some information about pros and cons of these two, in hopes of opening a GH discussion thread that could lead to a PR. I've read through all mentions of this topic on GH and Discord and Reddit, and there doesn't seem to have been a serious discussion about if trpc is still needed. Most comments are either 9 months old and argue unstability, or based on unfounded claims like "trpc is better typesafety" or "better devex" which have no connection to the real world. Most of them talk about trpc without realizing that trpc is just a transport, and all of the chrome we've built on top of it could remain the same with server actions or even fetch - which means, we should look at the differences between trpc and server actions, transport to transport, and ignore the patterns around them, used by create-t3-app. Is there anything we can do with trpc, that we can't do with server actions?
In the latest Theo video you can hear the actual react press release pit the two against eachother and refer to SAs as a trpc replacement candidate.
So, I'd love to hear your experiences. I know for sure that there has been a couple of y'all who tried migrating away from trpc, and hearing your experience would make for an informed decision. I'm also interested in more practical aspects like the cost involved with one of the other, logging and debugging experience, authentication capabilities etc. These are the things that are seldom discussed, but bear huge value in making the decision.
4 replies