Don't Migrate To tRPC

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 97

  • @moneymayhem2000
    @moneymayhem2000 ปีที่แล้ว +346

    Clickbait / manipulative content is destroying TH-cam

    • @SuperLazyCat
      @SuperLazyCat 5 หลายเดือนก่อน +4

      its so annoying it makes these people all useless to listen to...blocking this channel from now on.

    • @AstroFusion369
      @AstroFusion369 3 หลายเดือนก่อน +1

      Even if i have subscribed to this channel, we should DISLIKE those video to discourage such cheap strategy !

    • @mou2173
      @mou2173 หลายเดือนก่อน +1

      He really said do not migrate your existing projects to tRPC otherwise he encouraged us to use tRPC in our future new projects

    • @ArjoRoy-pe6tf
      @ArjoRoy-pe6tf หลายเดือนก่อน

      It isn't clickbait. *Migrating* to tRPC and *creating* a project in tRPC is different. Perhaps you were thinking of the latter one.

  • @taylorswe
    @taylorswe ปีที่แล้ว +111

    This probably goes without saying, but I'd thought I'd mention it. Doing a major overhaul to a codebase could introduce a lot of question marks about your app's stability. So, when I'm creating a new feature, I'll also refactor an old one, then kick it out to prod and watch them carefully. Slow and steady, rinse and repeat...

    • @dealloc
      @dealloc ปีที่แล้ว +2

      This is very true. Incremental refactoring also has the benefit that you're more likely to think about choices that you and your team makes, such as what kind of abstractions you need, what kind of performance to aim for, based on real stats and how important these features are to your product and users, compared to the time and effort you put into it.
      Major rewrites works very rarely (if at all) and often results in crunch, creating new and unknown problems that makes you to stay up all weekend. Not good for your mental health and work-life balanace, and not good for the business, because it most often that not does not result in more revenue.

    • @rand0mtv660
      @rand0mtv660 ปีที่แล้ว +1

      ​@@dealloc Refactoring and rewriting aren't always the same thing. Incremental rewrites also have their own issues. You might require a bunch of "interop" code to make old and new code work together and that adds its own problems, mental overhead and potential constrains.
      I do agree that rewriting for the sake of rewriting just because you love some other technology more is usually a bad move on a larger codebase. On a smaller project with minimal impact it's very doable just because the amount of features and code is just smaller.
      What Theo has shown here it looks like he had something like 20 API endpoints and that's really not a lot. That's easy to migrate, especially since it's just Typescript code before and after and it's all logic code because it's backend (no UI code). It would be a different story if it was about migrating from Go/Python/C# to Typescript.
      Migrating UI code (frontend) on the other hand is a whole different topic as far as I'm concerned.

    • @dealloc
      @dealloc ปีที่แล้ว +1

      @@rand0mtv660 I agree with a lot you said here.
      Where I disagree is assuming that 20 API endpoints isn't a lot. Endpoints are abstractions and they most often than not, hide a lot of complexity underneath; middleware such as authorization, telemetry and analytics as well as integration with other systems which may not be trivial to easily rewrite for, even at the API level. And as we agree that rewriting just for the sake of it is a bad move, then you would just spend time on moving from one tech to another without improving the initial problems with the existing tech.

    • @mac1414
      @mac1414 ปีที่แล้ว +2

      If switching from REST to tRPC is a "major overhaul" then it's architectured wrong. REST/tRCP/GraphQL are an adapter layer, they *should be* totally swappable. It's actually trivial to migrate when you encapsulate business domain in Use Case driven development without polluting it with any framework/infrastructure stuff.
      That aside, its trivial to make these work side to side with regular REST first and create new /trpc endpoint) rather than break it all for the clients. Again, make sure that your business logic is properly independent of frameworks and infrastructure stuff and that'll be easy.

    • @rafaelrocha3991
      @rafaelrocha3991 2 หลายเดือนก่อน

      That’s iterative refactoring, one of the key takeaways of the refactoring book by Martin Fowler

  • @plexq
    @plexq ปีที่แล้ว +16

    I'm a pretty old-school guy, most of my back-ends are written in Scala/Play framework and front-ends in React/Typescript. I love how Honest Scala keeps you if you do it right, and how solid the solution you build tend to be - borderline bullet-proof. I have to say, as the Typescript stack has matured, I'm seriously considering if I should be taking more of a deep dive into tRPC based solutions (where it makes sense). I think for me, Typescript is the new hotness that Scala wishes it could be to a large degree. And this TH-cam channel has already clued me into plenty of libraries that really help connect the dots in a great way. So thanks for that - I recommend this channel to everyone I work with who cares about React/Typescript stuff.

    • @LusidDreaming
      @LusidDreaming ปีที่แล้ว

      I think Typescript would be more enjoyable for me if I had never used Scala. The combo of algebraic types and string literals as types in TS makes it possible to do pattern matching and gives great type inference on union types. That being said, after using Scala on a project I now find tagging every union type in TS to be tedious. But I totally agree with you, I think the modern TS stack is incredibly developer friendly and makes programming very enjoyable (Zod alone has changed the way I handle type safety across the whole application). But when I'm having to bring in Immutable.js as a dep or manually tag union types I do feel myself missing Scala.

  • @MattChinander
    @MattChinander ปีที่แล้ว +21

    I've migrated my large REST API over to tRPC because of the end-to-end type safety, client code generation, and better developer experience. However, I still have kept some traditional REST endpoints around for non-JSON data purposes, such as file uploads and XML responses (RSS feed). tRPC doesn't solve every problem but it solves 99% of them and I absolutely love it.
    Doing the migration, however, I kept a lot of RESTful API design implementation around so that my frontends can keep working as-is (just swapping in trpc/client) with the same data model and structure. My next step is to rethink the "endpoint" (function) designs to better align with this new world and not be coupled to RESTful standards.

  • @PyroFire-Firework_is_a_passion
    @PyroFire-Firework_is_a_passion 11 หลายเดือนก่อน +1

    Spot on! Watched this at 9 AM, coded non-stop until 3:15 AM, and now my project's transformed from REST to tRPC.

  • @noamisaac
    @noamisaac ปีที่แล้ว +3

    What's ya'll's opinion on the usage of tRPC in a non-monorepo context (i.e. via publishing a private package)?

  • @froxx93
    @froxx93 ปีที่แล้ว +12

    When migrating to trpc, doing it step by step is a good idea. Especially in regards of stability. But when you start using trpc, like it, and keep on using it for new features, keeping the old graphql, rest, etc api in the long term is not a good idea imo since you have different approaches to request / send data for different endpoints. I'd prefer having a unique way for that in the long term

  • @TomDoesTech
    @TomDoesTech ปีที่แล้ว +16

    Hey, you're the guy from the Destiny videos!

    • @dosomecoding
      @dosomecoding ปีที่แล้ว

      tom do you know any way to use trpc in next js 13

  • @LuNemec
    @LuNemec ปีที่แล้ว +24

    While the trpc may be super great dev experience, you are basically locking yourself to typescript only for backend and frontend. Thus making any future migration to different backend technology very costly. Since you cant just reimplement one backend endpoint at a time using different tech.

    • @s4chinraja
      @s4chinraja ปีที่แล้ว +1

      What's preventing you from reimplementing one endpoint at a time? Also how is that different from other API tech like GraphQL?

    • @alanmartin528
      @alanmartin528 ปีที่แล้ว +3

      @@s4chinraja I think he means because of the programming language. You can write graphql apis and rest apis in other languages like Go, C, Python etc.
      But, it would still take a while... I think.

    • @LuNemec
      @LuNemec ปีที่แล้ว +2

      @@s4chinraja tRPC is typescript only if I get it right? That means you'll have to 1st rewrite the BE endpoint, then rewrite FE to use different tech, and then switch over. Compared to using protocol that is lanuage-agnostic, where you would just switch FE to new implementation using same protocol.

    • @hyunchae1093
      @hyunchae1093 ปีที่แล้ว

      @@LuNemec Using tRPC most often comes with the decision to also use react query. So even if BE endpoint is rewritten in another technology, as far as the new endpoints can be consumed by react query (which will most probably be), your FE won't change much.

    • @LuNemec
      @LuNemec ปีที่แล้ว +1

      @@hyunchae1093 Yes, so it is plain JSON as usual. But then you basically loose any advantage of using tRPC - like type safety. Might as well use gRPC to have schema type safety, cross-language compatibility and a little efficiency bonus.

  • @MikeHTMLAllTheThings
    @MikeHTMLAllTheThings ปีที่แล้ว +1

    Honestly great advice.
    I'm just starting to use TRPc and it was a bit of a ramp up initially, if I had gone in trying to migrate everything it might have become a blocker. I'm now using it though and can't see going back to REST anytime soon.

  • @joshc5466
    @joshc5466 ปีที่แล้ว +2

    I like what I see from tRPC but I'm currently not using a monorepo. The code reusablitiy from the monorepo also looks attractive to me. What are your thoughts on moving from distributed repos (some for multiple different front ends and microservices backends) to a monorepo?

  • @MerkieAE
    @MerkieAE ปีที่แล้ว +2

    can you do a video explaining the server$() function in solid start compared to the functionality of tRPC?

  • @2penry2
    @2penry2 ปีที่แล้ว +1

    One ergonomic benefit of tRPC that I've not seen many people praise is the component level SSR data fetching story.

  • @anshnanda
    @anshnanda ปีที่แล้ว +2

    I migrated my whole app to tRPC in 3 days. Worth it! Was super annoying but new endpoints are much better.

  • @kazuma9496
    @kazuma9496 ปีที่แล้ว +3

    No fkn way dude, my man changed his whole personality

  • @lewistyler2401
    @lewistyler2401 ปีที่แล้ว +2

    I think the question that's getting dodged is whether or not tRPC will become obsolete if RSC / Next 13 becomes the meta for full stack app development. I have played around with the t3 stack and I love the ergonomics of tRPC, but I also love the ergonomics of Remix and the Next 13 app directory. What is the optimal path for full stack apps and DX? Am looking forward to seeing how things shake out!

  • @milanpatel3159
    @milanpatel3159 ปีที่แล้ว

    @t3dotgg can you tell me that if I have a standalone next js application why do I need trpc, i'm asking this because the real benefit of using trpc is that you can have better client-server communication but with using getServersideProp and other similar function we can do the same. And the trpc endpoint can't be treated as rest endpoints. So lets say in your ping app what is the significance of using it instead of something like getServersideProp ?

  • @Mitsunee_
    @Mitsunee_ ปีที่แล้ว

    but if it lets me migrate off of useSWR I should definitely migrate the one Page that's done before starting the next one I just started writing the SSG for, right? :)

  • @paulomirandaarias9544
    @paulomirandaarias9544 ปีที่แล้ว

    It is possible to hace the client tRPC on a React app running on a Kubernetes pod and the server tRPC on a BFF running on another pod?

  • @misterhtmlcss
    @misterhtmlcss ปีที่แล้ว +1

    Not sure about other languages or frameworks, but no one I've talked to that uses Ruby on Rails would feel this way. tRPC is much harder to use than Rails. Here are lots of reasons why; be aware the scale or my perspective is very large projects not Google size, but Medium Enterprise CRM size.
    Ok here is why:
    1. tRPC's nested routing and routing in general. The structure isn't noisy and hard to discern. This is an area that needs to be memorized-ish on any project since the names are not always so obvious. It's just delay and cognitive load. I spend zero time in Rails on this problem. People will say "Roger, but you have a single file with all the routes and it's noisey". That's true, but due to conventions I open and file and can immediately without thought find what I need anywhere in the file and that's on bad projects done by weak devs.
    2. Testing! Postman nor any other tool like that makes little to no sense, since setting up any routes is massively time consuming and wlll often run afoul of some procedure. It's hard graft just to do something that any RESTful API can do in 5-10 seconds. In development cognitive load is a huge cost on development.
    3. Bug fixing: So you are clicking a button and you don't see a route or anything. No console log? Oh well. You are lucky if the developer created any kind of URL that will even hint at where that call is being responded to within your procedures and where it is based on a button click. This is one of the worst aspects of tRPC.
    I'm tired of griping, so I'll stop, but honestly if you are a nodeland user and haven't tried anything outside that ecosystem, then learn Rails and you'll see what I see.
    Also I really don't know why people think Typesafe code is such a huge thing; Github and many other large critical applications are written in Ruby which isn't typesafe. Typesafe is a nice to have, but good tests, that are easy to write and easy to reason about are more valuable.

  • @solomonogu1393
    @solomonogu1393 ปีที่แล้ว

    How did you approach real-time chat in trpc?
    Websockets or polling?

  • @damiangilz
    @damiangilz ปีที่แล้ว

    What's the way to add rest to it? Like integrating an existing API.

  • @guilhermenascimento8250
    @guilhermenascimento8250 ปีที่แล้ว

    Hey guys you think it's a jump of concepts learn trpc befor learning graphQL?

  • @joshuaborseth
    @joshuaborseth ปีที่แล้ว +3

    The t3 stack has spoiled me and now I don’t wanna work with anything else haha

  • @oscaryiudev
    @oscaryiudev ปีที่แล้ว

    Which cms I can use in t3 stack?

  • @dosomecoding
    @dosomecoding ปีที่แล้ว

    @dosomecoding
    1 second ago
    theo do you know any way to use trpc in next js 13

    • @t3dotgg
      @t3dotgg  ปีที่แล้ว +1

      It works fine! Do you mean the /app directory?

    • @dosomecoding
      @dosomecoding ปีที่แล้ว +1

      /app directory is main problem. i want to migrate

    • @t3dotgg
      @t3dotgg  ปีที่แล้ว +5

      @@dosomecoding we’ve got a long time til that’s viable because react context doesn’t work over server components 😅

  • @soulninjadev
    @soulninjadev ปีที่แล้ว +2

    i literally decided to learn trpc today 💀💀

    • @ArnoldsKtm
      @ArnoldsKtm หลายเดือนก่อน +1

      you've missed the point. it's fine to use it.

  • @SonAyoD
    @SonAyoD ปีที่แล้ว +1

    Whats the best way to share types when you’re client and backend is not in the same repo?

    • @kubagrott
      @kubagrott ปีที่แล้ว +3

      In my company usually types are generated based on swagger schema for rest api and on graphql schema for graphql. I'm leaving comment for starting discussion. I'm really curious is that good way, or there is better solution.

    • @rand0mtv660
      @rand0mtv660 ปีที่แล้ว +1

      @@kubagrott Yeah we do that as well where I work, but that's because our endpoints are .NET, so C#. Not really a way to import those directly into Typescript without a codegen step. We use "swagger-typescript-api" npm module to generate all types and an HTTP client class from Swagger/OpenAPI schema. Works really really well I gotta say. You just run a single command and get everything. This improved our developer experience 10x while working with endpoints that our backend developers create.
      This approach allows backend devs to use C# which they really like and us frontend devs continue using whatever we love. Even if we didn't do it that way, Swagger/OpenAPI docs that get created are really useful as API documentation in general, not just for generating Typescript types.

  • @craigasketch
    @craigasketch ปีที่แล้ว

    "Chance's R..." is a great country western club. tRPC is great if you can make the rest of your org happy.

  • @toastrecon
    @toastrecon ปีที่แล้ว +2

    I've seen a few out there, but anybody have a good recommendation for a T3 or tRPC tutorial?

    • @TielmanNieuwoudtTech
      @TielmanNieuwoudtTech ปีที่แล้ว +1

      tRPC only. Jack Herrington is pretty solid choice for tutorials th-cam.com/video/Lam0cYOEst8/w-d-xo.html

    • @alastairtheduke
      @alastairtheduke ปีที่แล้ว +5

      Look through the basic examples on the trpc docs. It really is 2 files, you don't even have to worry about a web framework (no express no nothing) just a client and a server (the built in one that comes with trpc for dev testing). Reading through the trpc docs feels like a tutorial. I'd start there.

    • @paulomirandaarias9544
      @paulomirandaarias9544 ปีที่แล้ว

      @@alastairtheduke it is possible to use tRPC front and back on separate Kubernetes pods?

    • @alastairtheduke
      @alastairtheduke ปีที่แล้ว

      @@paulomirandaarias9544 That I do not know as I have no experience with Kubernetes.

  • @SchwadoGaming
    @SchwadoGaming ปีที่แล้ว

    Can tRPC Endpoints be externally consumed (outside of the Next.js App) for e.g. a Python script?

  • @zoffy3750
    @zoffy3750 8 หลายเดือนก่อน

    TLDR: trpc is addictive, it has a very strong inhibitory response.

  • @JustSkillGG
    @JustSkillGG ปีที่แล้ว

    Another great video as always.
    Guys, I am looking for a job that uses T3 stack.
    Any recommendations on where to look?
    Thanks in advance

  • @MishinMachine
    @MishinMachine ปีที่แล้ว

    Please make a video of how to implement trpc with the next 13 app folder 🙏

  • @thisgnop3177
    @thisgnop3177 ปีที่แล้ว

    That's what I thought. tRPC is useless if you are not using the same repo for both your FE and BE and if you are not using Typescript. Add It forces you to use React-Query. WTF!

  • @fcnealvillangca7943
    @fcnealvillangca7943 10 หลายเดือนก่อน

    The only reason im using typescript is for frontend other than that i hate js/typescript

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis ปีที่แล้ว +2

    2:27 - finally, the "slower" form of content pays off - Theo of yesteryear wouldn't even mention the possibility that there are shops that have their BE teams using other languages (also, love you mention Go / Python but not mentioning the most widely used language in enterprise / public sector land). Nonetheless, great video.
    Please more type of "slower" content, no need to go ballistic on every topic. Aspire to be Jack, not Prime.

  • @chebrubin
    @chebrubin ปีที่แล้ว

    Why don't we talk about module federation?

  • @PavelLitkinBorisovich
    @PavelLitkinBorisovich ปีที่แล้ว

    Your hair is amazing!

  • @alkeryn1700
    @alkeryn1700 ปีที่แล้ว

    i write my backend in rust, so no trpc

  • @questionyourbeliefs
    @questionyourbeliefs ปีที่แล้ว

    Is this still relevant or can I ignore? Considering t3 stack is in love w trpc.

  • @njdarda
    @njdarda ปีที่แล้ว

    just do a full rewrite.

  • @the_inalienable_dreamless
    @the_inalienable_dreamless ปีที่แล้ว

    this is a cute bag but i would never wear this no i would not

  • @_fayeznazzal
    @_fayeznazzal ปีที่แล้ว +1

    You have amazing content, but why your video titles sound sarcastic :(

  • @RobertScott-Buccleuch
    @RobertScott-Buccleuch 7 หลายเดือนก่อน +1

    The content is good, the title is horrible.

  • @eloualielouali4949
    @eloualielouali4949 ปีที่แล้ว +2

    love ur videos ,man u r just an inspiration to me ❤

  • @fpvgods
    @fpvgods ปีที่แล้ว

    Subbed to learn so thank you dude 😎

  • @lilililliilil
    @lilililliilil ปีที่แล้ว

    Theo 사랑해💚

  • @officialstrike
    @officialstrike ปีที่แล้ว +1

    First time I’ve been early to a video!

  • @Luis-kg5gm
    @Luis-kg5gm ปีที่แล้ว +2

    He's just talking nonsense :)

  • @ddoice
    @ddoice ปีที่แล้ว +2

    This is the way Theo! Sub 4 mins video with no BS, don't get me wrong I really appreciate your content but my time is precious and limited.

    • @seyadeodin
      @seyadeodin ปีที่แล้ว +5

      Idk why, but people saying time is precious on youtube commentaries always rub me on the wrong way,.

  • @codelucky
    @codelucky ปีที่แล้ว +2

    Is frontend and backend written in TS? Yes? use tRPC, else don't. Simple.

  • @samislam2746
    @samislam2746 13 วันที่ผ่านมา

    The guy doesn't have a point

  • @programmingterrain1244
    @programmingterrain1244 6 หลายเดือนก่อน

    I just subscribed

  • @UwU-dx5hu
    @UwU-dx5hu 10 หลายเดือนก่อน

    I love this video❤

  • @ak-loz
    @ak-loz ปีที่แล้ว +2

    Teach us how to understand this stuff so well.

    • @rand0mtv660
      @rand0mtv660 ปีที่แล้ว +7

      Experience as time goes by and trying out stuff. That's really it. Just watching videos or reading blogs posts, but not actually trying out stuff will only get you part of the way there. Experimenting and forming your own opinion will allow you to improve more.

  • @mr.random8447
    @mr.random8447 ปีที่แล้ว

    does trpc work with golang

  • @mohammadrezasheylani2417
    @mohammadrezasheylani2417 ปีที่แล้ว

    not gonna lie, You are getting better at writing eye-catching titles. 😂

  • @tempaccount8256
    @tempaccount8256 ปีที่แล้ว

    First🤫

  • @1998goodboy
    @1998goodboy ปีที่แล้ว

    I'm literally gunna u sub bc you always try to guilt trip us into subbing and liking lol. The good vids will get recommended to me by the alg anyways

  • @JTWebMan
    @JTWebMan ปีที่แล้ว

    Have you looked at gRPC? Support across many languages!

  • @dfsgjlgsdklgjnmsidrg
    @dfsgjlgsdklgjnmsidrg ปีที่แล้ว +1

    this dude changes like the tailwind