tRPC: Smart and Easy APIs

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

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

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

    This guy makes complex stuff so simple. What a great skill to have!

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

      He’s got a great voice, could go into voice acting if he gets tired of software

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

    11:05 - Out of the entire tutorial, as useful as it is... This is what I value the most. Being able to share the excitement of getting something to work when I barely know anything about it. Don't ever lose this energy Jack!

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

    I really like how you teach different technologies and how excited you are to teach them. That’s really helping people getting involved! Keep up

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

    I love seeing that tRPC uses React Query. It deserves to be the standard for all React http requests.

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

      Share the same opinion!

    • @pieter-venter
      @pieter-venter 2 ปีที่แล้ว

      I agree! We been using trpc for over a year now with Prisma and next and we're hiring. Hit me up on Twitter if you keen to join

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

    I wanted to get started with tRPC, and the first thing I did was check if you’ve made a video about it.

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

    Thanks Jack. You saved me so much time by demystify the whole process, from setting up the development environment to wrapping up the project. Clean and effective code.

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

    I watched half a dozen videos today on this topic and this is the first one where I understood how to use it and where its trade-offs are. Great tutorial.

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

    One of the best decisions I've made is subscribing to this channel. This guy is awesome!

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

    A few weeks ago I said you had a knack for dropping videos on exactly what I'm looking for.
    And you've done it again!

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

    0:39 slick transition

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

    Ok a lot of awesome stuff, great examples, excited to discover you and subscribe, etc., but... that transition at 21:26! Had to back it up and rewatch that a couple times! Haha nice work

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

    Another fantastic video on new technology.
    Perhaps in pros/cons, on backend side trpc is only nodejs unlike REST, GraphQL, gRPC supported in most programming languages. Apologies if I missed that in the video.
    Really keen to try it out 🙂

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

    Wow... how have I not heard of this channel until now? This is great. Thanks!

  • @user-tz6nn8iw9m
    @user-tz6nn8iw9m 2 ปีที่แล้ว +1

    love your vscode theme and font

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

    I didn't know anything about tRPC and this video explained it so well. Also, it wasn't boring at all. Thanks for the video!

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

    Awesome stuff - been waiting for a good tPRC tutorial as I've seen a few devs use it

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

    Hope you can make a video that shows a production example of using rabbitmq or queues in the wild with a react app. Thanks for the awesome content!

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

    Such a great walkthrough. Thank you!

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

    These new transitions are 🔥

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

    Cool stuff! Please keep making videos like these. Ps: The video quality is getting sooo much better these days.

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

    Great love it! Reminds me a bit of my WCF adventures back in the days where I could just import a wsdl file (versioned) on the client and I had the models and type safety setup within a breeze. ❤️ This comes really close. 👍🏻

    • @DanKaschel
      @DanKaschel 2 ปีที่แล้ว

      I do not have fond memories of wsdl. In general, a workflow that requires a bunch of code generation eventually runs into synchronization issues unless there's a lot of discipline (or it's just a single developer).
      Not saying it doesn't have its place (in C# I'm find of linq2db with T4 templating), but I think sharing types between client and server without code generation is better than wsdl.
      ...Well, after accounting for everything you lose by not being in a strongly typed environment.

    • @friso2591
      @friso2591 2 ปีที่แล้ว

      @@DanKaschel yes exactly it is nice when there are not a lot of devs involved. It works nicely in rapid development cases.

  • @petarkolev6928
    @petarkolev6928 2 ปีที่แล้ว

    Wow! Amazing video, Jack! Thank you so much ❤

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

    Thanks jack !!! All your efforts are priceless ❤️

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

    OOOKAY! Those transitions are cool

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

    Thanks for the vid, @jack.
    You are my fav. channel for getting react ecosystem news :D When you make a video about it, its about time to put it on the radar.

  • @EvanDotJS
    @EvanDotJS 2 ปีที่แล้ว

    Apparently that router method at 3:55 is deprecated now? Not sure if its gonna break my server or not but we'll see!

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

    A-mazing content! I'm trying out the T3 stack and your video is incredibly helpful to understand trpc!
    question, shouldn't the onAdd query be auto invalidated because it suffered a mutation? I feel like forcing invalidation in the onSuccess callback shouldn't be necessary

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

    Great video, nice and clear thanks ❤
    I feel like you undersold the benefits of that e2e typesafety a bit
    1 other downside to tRPC compared to REST/GraphQL/gRPC that you didn't mention is that unlike those others tRPC is only useful if both your FE & BE are TypeScript. Technically it probably also works with a JS frontend, but you'd lose the main benefit
    I'm really glad I stumbled on your channel, lots of great content I can share with team mates

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

      I would say that tRPC is no worse than REST in that situation. gRPC is kind of a different story altogether because protos define everything and you can't get around the protos. GQL is different again in that there is runtime introspection, which neither REST nor tRPC (or gRPC) have.
      Anyway, I think tRPC is a no downsides upgrade on REST, but tRPC vs GQL or tRPC vs gRPC is a different story.

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

    Thanks very interesting ! Really thinking about how it could compete with GQL ❤️

  • @FacterNerz
    @FacterNerz 2 ปีที่แล้ว

    What a cozy house I love that forest view

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

    I personally use apollo client with graphql, I have the same features but trpc is also really interesting.

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

    Really awesome explanation

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

    You should check out Telefunc. It's similar to tRPC but has a more ergonomic api. IMHO

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

    Excellent and clearly explained. Trpc's advantage seems to be in its simplicity and speed in terms of design. As long as you're in a monorepo and are using typescript, I think it's a great option.

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

    Thanks, Jack

  • @Light-nn6hn
    @Light-nn6hn 2 ปีที่แล้ว +1

    Please, when u did npx create-react-app, it showed a bunch of option to select such as if u wanna use css or tailwind
    How do i get that to work on my pc as well?

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

    great tutorial. thank you!

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

    Just FYI: The NPM package for create-mf-app doesn't link to the Github repo

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

    Wow this is like prisma but from frontend to backend or cross service calls. Basically remove contract testing.

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

    It looks a lot like how we make graphql servers.
    What do you think would be better trpc or graphql server if we know graphql, as we can use the graphql schema to generate type safe code on the client using packages like graphql-code-gen

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

    One of the best ways to build apis wow can't imagine takes all the work using traditional rest APIS

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

    Thanks for monorepo. I didn’t know how to link those without npm link command

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

    Hi Jack! I'm new to backend development, what do you mean at 22:10, when you talk about "adding a reporting mechanism on top of REST"? thanks!

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

      REST is an entity based model. Your model entities like user, product, and order. You can read, write, update and delete individual entities, and also get lists of that type of entity (e.g. all products.) But you can't get a joined set of entities in that model, for example, all the users that placed orders for a give product. That's why people created a REST API and then bolted on a set of reporting APIs to make up for the limitations of the REST API.

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

      @@jherr got it! 😁thank you for your awesome channel

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

    Jack, amazing content and great presentation. Thank you for covering the frontier of dev tools. A quck question: is there any materials in which you explain how to setup concurrently, wsrun and how to handle errors caused by these tools?

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

    Hell yeah man good work

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

    How would this work if the API source is in a completely different repo? What if the API is running and hosted on a different server from where the UI static files are served?

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

      You'd generate into a shared npm module, or generate into the server module and have the client app consume whichever shared module you created.

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

    You're awesome Jack!!!

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

    Thanks, Jack for the always awesome video. Can we get a video on utilizing the workers in browser to at the best extent possible to get performance.

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

      Definitely thinking about that one.

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

    Awesome and clear! Please make a tutorial of how to
    implement tRPC with nextjs 13 app directly

  • @DB-dk2mj
    @DB-dk2mj 2 ปีที่แล้ว +1

    Thanks a lot, man! You do great!

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

    Very neat Jack, for those who don't want to expose graphql, is tRPC a good practice to wrap or hide graphql data source ?

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

      Yep. IMHO, GraphQL is a good fit for when you have a lot of flexibility on the frontend and the structure of queries may change a lot, or if you are providing a customer API (though that has some issues as well). If you don't fit either of those then something like tRPC is fine because you know the data you need at build time.

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

    I love you give the github repo. There is alot to like about the trpc, fresh, deno stack. So moving my stuff over. Keep running into small issues, like do i need a mono for trpc etc. Love more on this stack together. Also what scales better gql or trcp for request etc? Or should i just go server api. We always talk about developer happiness. But i want whats best for my consumer.

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

      What scales best... Depends on what scales means to you. In terms of load I think tRPC scales better because the per-transaction costs aren't as high. IMHO, if you are offering API as as service, then go with GraphQL, if you are building both the server and the client, use tRPC.

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

    Thanks Jack. It's a great video. One thing that I need to know is that tRPC can run at the Edge like in Cloudflare Workers, Deno Deploy, Fastly Compute@Edge, others...
    Recently I have started using Cloudflare Workers with Solid Start (The Awesome Solid.js Meta Framework) & Deno Deploy with Oak & Faunadb. as a result, the whole thing is fast. Building API's & SSR (with HTML Streaming) at the Edge is Really Awesome 👍😎.

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

      I honestly don't know. You'd have to ask the tRPC author on that one. :)

  • @carlosricardoziegler2650
    @carlosricardoziegler2650 2 ปีที่แล้ว

    Some examples are using monorepo , right? How can I use it with different repos for front and backend ? Do the app like package ?

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

    - error
    ```
    Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
    ```
    - solution: upgrade version in package.json like below
    ```
    "ts-node": "^10.8.0",
    "ts-node-dev": "^2.0.0",
    "typescript": "^4.6.4"
    ```

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

    Great video! I'm curious, what software/hardware are you using for the on screen annotations with a stylus/pen? It's so seamless!

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

      ScreenFlow plus a commodity drawing tablet from Gaomon.

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

    Great video as always! I learned something new every time and trpc is so cool! I've always found sharing types with the front and back end such a pain. Not to pick nits though: isn't it the browser that enforces CORS? That's a security mechanism that always mystified me...

    • @jherr
      @jherr  2 ปีที่แล้ว

      Yeah, CORS is only required for CSR.

    • @DanKaschel
      @DanKaschel 2 ปีที่แล้ว

      The browser enforces requirements established by the API. CORS is the mechanism that allows an API to say it's okay with requests from other origins.

    • @jasonthorpe3470
      @jasonthorpe3470 2 ปีที่แล้ว

      @@DanKaschel I wasn't really confused by how it worked, just that it's so easy to write a proxy that enforces a different set of CORS rules, makes that protection useless against all but the least savvy would be API theives. I'd be happy to learn otherwise...

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

      @@jasonthorpe3470 an important feature of cors is to protect requests using cookies. If you create a proxy you will have a different origin so the browser won't send the same cookies. If the api doesn't use cookies, then there isn't much security benefit to cors

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

    Hey really cool vid as usual. I'm picking some new stuff thanks to you. I have two question:s I see that you use ScreenFlow and I like the effects. Any resources to look at to learn more? I want to make nice videos as well. And what do you use to draw on the screen? I saw you were looking down while doing that. Thanks!

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

      For drawing i use a Gaomon tablet and Screenbrush. I do all the code work in Screenflow then use After Effects to put it all toghether.

    • @JGBSolutions
      @JGBSolutions 2 ปีที่แล้ว

      @@jherr thank you!

  • @pieter-venter
    @pieter-venter 2 ปีที่แล้ว

    Hi Jack or anyone that knows, what tool do you use to have the nice graphics with the apple logo and node version? Is it a oh-my-zsh plugin?

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

    Well another Con agains GraphQL is that it can't choose what it will be sent to the client, cause in tRPC, what you have on your query is what is going to be sent, right?

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

      You mean a con against tRPC right? Yeah, that's correct, the payload is the payload.

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

    Very intersting. Thanks.

  • @bhaveekjain4246
    @bhaveekjain4246 2 ปีที่แล้ว

    What fish shell theme are you using?

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

    Hey Jack!
    I'm curious about creating the trpcClient as state here. Why would this be required as opposed to, for example, useCallback? Would this still work? Can you think of any reason to prefer one over the other?

    • @jherr
      @jherr  2 ปีที่แล้ว

      Can you give me a time reference?

    • @mmmikem
      @mmmikem 2 ปีที่แล้ว

      @@jherr sure thing! 9:54 should do the trick - sorry that'd have been pertinent considering this is from Feb!

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

      @@mmmikem Well, it's not a function, so I wouldn't use `useCallback` but you could use `useMemo` if you want instead, though as some folks have said the docs state that in the future React reserves the right to flush memos to recover space. Or you could use a `useRef` for this, but then you'd need to say `trpcClient.current`, which is not exactly a game changer.
      Frankly you could probably just pull this out of the component altogether and just define it at the top of the file. I'm not 100% sure why I found it necessary to define it in the component here. As you say, it has been a while since I did this video.
      Lots of interest in TRPC tho!

    • @mmmikem
      @mmmikem 2 ปีที่แล้ว

      ​@@jherr ah of course - it's the return of the function that we care about. Oddly enough, I'd thought about whether it *might* need to be invoked inside the component if it was relying on hooks somewhere in there. I feel as though, if that works, it'd be the simplest/cleanest option, as it'd be colocated with the RQ client? I'm gonna give this a bash and see!
      Thanks for taking the time to respond, really appreciate it!

  • @DuyTran-ss4lu
    @DuyTran-ss4lu 2 ปีที่แล้ว +1

    Great as always

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

    It is like reading Dostoyevsky and then trying to pick up a pen and write watching you

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

    i notice a lot of hype about trpc lately but i havent figured out and havent tried it myself yet. is this also beneficial for java backends ? i have very limited fullstack experience and dont know what server this is supporting

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

      No, this wouldn't benefit the Java backend world. The idea here is that tRPC is TypeScript on both ends of the pipe, so it makes it easy to define your object types once and use them in both places.

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

    can someone tell me what kind of extension is in the video which shows the text autocomplete highlights in the editor as we type.

    • @jherr
      @jherr  2 ปีที่แล้ว

      Github Copilot

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

    Thanks Jack! I have my cross feelings about TRPC. Why would anyone would like to make a non-language agnostic API? So if I'm a python dev, I will have to first learn TS and then TRPC to consume the API?

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

      It can be accessed just like any other REST API. It's just easier when you use TypeScript.

  • @tatenda_mk
    @tatenda_mk 2 ปีที่แล้ว

    So helpful! Thank you

  • @webdev_telugu
    @webdev_telugu 2 ปีที่แล้ว

    When he installed dependencies with "yarn", why were there no node_modules created in client and api-server

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

    tRPC is great but there seem to be a lot of unnecessary complexities. Telefunc is probably a more literal RPC. Would be fun and helpful to see you try it.

  • @v333b
    @v333b 2 ปีที่แล้ว

    Hey Jack, this video is really helpful and has gotten me more interested in tRPC and typescript. One small thing that left me a little confused is that when you connected the api-server with the client, while this works for the dev process, how would this pan out during deployment? The client would not be able to access the api-server package as it only exists in the local env... Would adding the server as a dev dependency yield the same result?

    • @pieter-venter
      @pieter-venter 2 ปีที่แล้ว

      Very good question. You not actually importing any code between the 2 apps. Your simply importing types. In production the types are compiled away. Under the hood trpc makes an http call with the route names. So it's not like the files need to be collocated at all.
      Ps. We been using trpc for over a year now with Prisma and next and we're hiring. Hit me up on Twitter if you keen to join

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

    I'm love with this terminal theme. Is this a zsh theme?

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

      Nope, it's oh-my-posh.

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

      @@jherr what theme is this?

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

      @@jeielmosi Night Wolf [black] and Operator Mono.

  • @asyncxeno
    @asyncxeno 2 ปีที่แล้ว

    How did you make the terminal like that?

  • @SumitYadav-bk3jw
    @SumitYadav-bk3jw ปีที่แล้ว

    Awesome content
    Can you share your vs code theme?

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

    What font do you use in terminal?

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

      SpaceMono NF

  • @aleksd286
    @aleksd286 2 ปีที่แล้ว

    so TRPC is Graphql without the additional syntax learning?
    You can also get your types from Graphql server to the client

    • @Glinkis
      @Glinkis 2 ปีที่แล้ว

      You'll have to add a type generation build step for GraphQL though, while tRPC seem to be able to infer the types directly.

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

    What’s that terminal theme you use. I like that it shows you the full path.

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

      Night Wolf [black] and Operator Mono.

    • @rcarias78
      @rcarias78 2 ปีที่แล้ว

      @@jherr and how do you get your ZSH terminal to show you the full path

    • @kiranojha8811
      @kiranojha8811 2 ปีที่แล้ว

      @@rcarias78 oh-my-zsh probably

  • @esotomay21
    @esotomay21 2 ปีที่แล้ว

    How do you setup ur terminal to give you all those pretty icons

  • @Zagoorland
    @Zagoorland 2 ปีที่แล้ว

    Can you give some tutorial how to style fonts the way they look in your IDE? Also, what's the name of your theme?

  • @DB-dk2mj
    @DB-dk2mj 2 ปีที่แล้ว +1

    Please - what is your extension for terminal - so it looks cool!?

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

      Fig is what I think you are looking for.

  • @卡卡西-p7i
    @卡卡西-p7i 2 ปีที่แล้ว +1

    How do you type so quick, what vscode plugin you use?

    • @jherr
      @jherr  2 ปีที่แล้ว

      GitHub Copilot?

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

    Thanks!

  • @DiegoBM
    @DiegoBM 2 ปีที่แล้ว

    I kind of get the same feeling that I got when I first saw Redux. I was in awe when I saw the time-travelling feature, but I couldn't help but thinking that it was kind of cumbersome to set-up for the value. Maybe they'll improve the API or the general DX in future releases.
    All in all, I'm not sure to get the full value of tRPC? Maybe I was so hyped before reaching this video, with so many people singing it's wonders of and swearing by it, that it was easy to feel kind of disappointed.

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

    Can we use ionic with backend express trpc?

    • @jherr
      @jherr  2 ปีที่แล้ว

      I don't see why not.

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

    Thanks 🐐

  • @BathingAfrican
    @BathingAfrican 2 ปีที่แล้ว

    I’m tryna transition from fastAPI to gRPC, is there a fundamental difference between the two as to why you’d pick tRPC?

    • @jherr
      @jherr  2 ปีที่แล้ว

      Are you talking about the Python fastAPI? If so, then, a big difference would be Node vs Python.

  • @vincentgauthier2298
    @vincentgauthier2298 2 ปีที่แล้ว

    hey can you tell me the VS code theme you use? Thanks! Great video.

    • @jherr
      @jherr  2 ปีที่แล้ว

      Night Wolf [black] and Operator Mono or JETBrains Mono.

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

    I wonder why devs decided to create a trpcClient with useState hook. Why not just create it the same way as react query client... I checked tRCP docs, I don't know. I checked your code as changed it, nothing broke, everything still works. Feels like trap, but I think it should be just fine, at least in this case. Maybe it has something to do with async stuff and the new React use hook , I don't know

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

    how to deploy this project to vercel?

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

    Niceee!

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

    I am trying to see how tRPC is different from the regular REST API, and it seems it is nothing different from REST except the name.

    • @jherr
      @jherr  2 ปีที่แล้ว

      It depends on what. you mean by REST. REST isn't a standard. It's an "architectural style". And the only specific thing it covers is the basic verbs associated with entities and collections and the hierarchal relationship between them.
      Generally speaking REST is both incomplete in that it doesn't allow for one query that involve more than one entity or collection at a time, and also incorrectly structured because the hierarchy of the entities doesn't allow for important permutations of queries.
      I usually see REST coupled with a set of RPC endpoints. And people just call that "REST" when it's not really anything "standard". Every team/project/company just comes up with their own standards.
      tRPC is a standard (though not as well specified as GraphQL) and it provides easy end-to-end typing.

    • @ziranshuzhang6831
      @ziranshuzhang6831 2 ปีที่แล้ว

      @@jherr What I mean is that the things you did in the video, seems like I can do all of them with bare ExpressJS with the same amount of effort, and probably even less amount of code. That's what I am not sure why I need tRPC for my project.

    • @jherr
      @jherr  2 ปีที่แล้ว

      @@ziranshuzhang6831 You might not. If you don't think that tRPC adds anything then don't use it.

  • @tubenzr
    @tubenzr 2 ปีที่แล้ว

    Hy Jack, Excellent content as always, but I'm always wondering what is your opinion on NodeRed low-code, because I'm amaze with how NodeRed handle business-flow. can you give me one or two opinions on this. thanks so much Sensei.. 🥳

  • @patite3103
    @patite3103 2 ปีที่แล้ว

    Could you please update this video using tRPC V10? Thank so much for your valuable videos!

  • @yankee-in-london
    @yankee-in-london 2 ปีที่แล้ว +1

    Feels like tRPC's assumption about having typescript in the backend is a major limiting factor for it. I did notice a few Rust crates in early stage but unless other languages are designed to support it ... and TS as a type system is amazing for JS but maybe not what you want to marshal to with other languages. For now, I'd say gRPC's relative maturity and multi-language binding makes it a better choice for most RPC projects.

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

      I agree with your issues with TS and other languages. But gRPC is no picnic either. I use gRPC every day and the TS generation is pretty flaky. And some of the data type marshaling has issues. Also you have to proxy gRPC it to web clients. So I end up wrapping my gRPC in GraphQL.

    • @yankee-in-london
      @yankee-in-london 2 ปีที่แล้ว

      @@jherr surprised to hear about the marshaling issues with gRPC but I will admit I don't have a lot of hands on with it ... would have thought a solution in the market as long as gRPC would have worked out all of these kinks. Do you use Zod for validation on the gRPC setup? Seems like that would help in assurances for run time type checks.

    • @jherr
      @jherr  2 ปีที่แล้ว

      @@yankee-in-london I don't use Zod for that. The generated TS is good types wise. The marshalling thing comes down to number values. If the number is undefined it still returns zero. So I end up hand code special casing every field that could be nullable, which kinda sucks. I should probably wrap it to make it generic... Ah, well.

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

    you are doing great

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

    The (obvious) con of tRPC: It requires running TypeScript on the server. So for many teams, that rules it out. That's why GraphQL is so popular - it's a standard that isn't tied to a specific server-side language. But if you're using TypeScript on the server, tRPC a wonderful option that's simpler than GraphQL.

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

    Did you just import server code into client code? I know... tree shaking and this is just a quick demo and all but... my eyes are burning 🔥

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

      At what time marker?

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

    very kool

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

    With HTTP2 and the rise of DaaS I do wonder if the value of websockets is as high or broadly useful as it once was. It feels like web sockets is possibly better for niche situations nowadays