Nextjs Server Actions Just Got Better

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

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

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

    Thank you for your time and efforts that poured into the video.
    Stay healthy

  • @FalioV
    @FalioV 7 หลายเดือนก่อน

    No matter of the topic, I always have something to stay with you untill the end of the video. Great content as always! :)

  • @풍월상신
    @풍월상신 7 หลายเดือนก่อน +9

    I hope you get well soon.
    Feel free to skip a week or two.

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

    I hope you are feeling better, Dave

  • @oladapooluwadurotimi2865
    @oladapooluwadurotimi2865 7 หลายเดือนก่อน +6

    ❤. Your voice sounds different today boss.
    Edited: get well soon sir.and be safe out there.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  7 หลายเดือนก่อน +4

      Yes I've been sick. Hope to be back to normal by next week

    • @oladapooluwadurotimi2865
      @oladapooluwadurotimi2865 7 หลายเดือนก่อน +2

      @@DaveGrayTeachesCode that's great to hear sir. Stay strong and jiggy sir. Wishing a quick recovery 🙏😊.

  • @aymenbachiri-yh2hd
    @aymenbachiri-yh2hd 6 หลายเดือนก่อน

    Thank you so much

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

    Thanks Dave, this package helped me a lot, I would like to know how we can implement this for file type Inputs?

  • @zlackbiro
    @zlackbiro 6 หลายเดือนก่อน +4

    They just going mad out there. There is a library to fix the library in js to fix next... What the fuck is wrong with those guys!? Who can follow everything about new changes everyday!!!

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

      no problem, our emotions change every day

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

    Hope you get well soon. Your voice sounded different since the beginning of the video

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

      Several days of coughing and congestion will do that. Getting better.

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

    Greetings friend thanks for the video....
    Answering your question... What do you want to see in the following videos (12:50)
    Explanation of turborepo adding tailwind and schadcn/ui and if you can also add PRISMA or Drizzle with that we hit a home run.
    Greetings Jose Grillo from Venezuela

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

    Been trying to do some unit tests on my server actions that use next, next-safe-actions and jest. No bueno for me. I’m kinda new at this …

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

    this is looking to go a bit like the trpc way of doing things

  • @shaked1233
    @shaked1233 7 หลายเดือนก่อน

    Is there any benefits over tanstack query? If im not mistaken everything you showed is possible through use query

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  7 หลายเดือนก่อน

      I need to check the latest on that. It is possible that TanStack is also handling server actions now. I should add the main emphasis here is the integration of Zod (or other validation if you want) so you don't have to handle all of that as I showed in the refactor. Last I checked, TanStack didn't directly integrate the validation step as shown here.

  • @dileepa-mn2to
    @dileepa-mn2to 7 หลายเดือนก่อน

    Hi Dave, Im a newbie. can you exaplin why we use server actions if we are using a external API, is it make a difference with react-query and this server actions

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  7 หลายเดือนก่อน

      An external API might take a different approach. If I'm just fetching data and not mutating it, I would fetch directly from a server component if possible.

    • @dileepa-mn2to
      @dileepa-mn2to 7 หลายเดือนก่อน

      @@DaveGrayTeachesCode If we are fetching from a server component, this approach is better. am I correct?

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

      @@dileepa-mn2to that is preferable when possible.

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

    Dave I have a question I am having more than 2 years of exp but still I need to watch video before implementation anything new like useActionState new hook

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  6 หลายเดือนก่อน +2

      Nothing wrong with that. I read docs, blogs and watch videos, too.

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

      @@DaveGrayTeachesCode oh thanks Dave 💝

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

    Doesn't "useActionState" from React do exactly that? Why a third party hook?

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

      Not the same. I should have emphasized the differences more. This implements Zod or other validation and abstracts away catching errors - no try/catch necessary. Also provides clearly defined error types. I'm going to do a follow up using toasts to show some additional patterns.

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

    Any benefits over tanstack query? I am using server actions with useMutation from tanstack query right now, which has everything you need under the hood (error handling, loading states, etc.)

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

      I think the emphasis here is on validation. This integrates well with zod or other validation libraries like valibot. I need to check the latest but last time I used React query, it wasn't handling all of this under the hood.

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

      @@DaveGrayTeachesCode Got it. Definitely recommend checking it out. Hope to see the video from you!

  • @nico-y9i
    @nico-y9i 6 หลายเดือนก่อน

    Hi Dave! I've been stuck on the trouble of having to display server error to client side. I just recently learned that in production, the server would change the error that was returned to client to a generic error message(I think this is not the issue when using action and useFormState instead of onSubmit). Should I use this on every form that uses react-hook-form and server actions? In a real world scenario, is it enough to just display a generic error message from the server? Whenever I want to do a mutation, I'm thinking of using the native form action before I switch to react-hook-form if my form is complex. Is this the right approach? Lastly, base from your experience, does it matter for UX if the error message is displayed when the form is submitted or on input blur/change.

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

      There should be no problems displaying an error client side using what I show in this tutorial. I am going to do a follow-up to this with a toast message tutorial. There are several patterns that can be used. It won't just display a generic server message. As shown, you also get validation errors and fetch errors. You can modify the server error to show e.message so it can be very specific. I suggest sticking with react-hook-form and showing errors onBlur. It is a much preferred user experience.

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

      same here, I am not able to get the error on to the client side, we can throw the generic error but returning an specific error is not working

    • @MarosiMate-sq2wm
      @MarosiMate-sq2wm 3 หลายเดือนก่อน

      @@KkrDs97 Why would you do that? If you are using React Hook Form on the client side, you are already displaying errors to the user.

  • @rifatmunna
    @rifatmunna 7 หลายเดือนก่อน +2

    at this point i'm disappointed now can make a full e-comm website with payment and everything also learn new tech from document. thanks to you . but the sad part is i did't earn a penny even now. Maybe i miss the part where you tech how to land or get hired or earn from web dev

    • @MohamedElguarir
      @MohamedElguarir 7 หลายเดือนก่อน

      that's what happens if you're in this field just for the money, instead of passion.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  7 หลายเดือนก่อน +3

      Some channels focus on jobs, interviews, etc. I just focus on skills. The rest will happen if you develop skills. My top advice for getting a job is networking though. Make connections in the industry.

    • @mertdr
      @mertdr 6 หลายเดือนก่อน +2

      You can’t even imagine how huge the difference between tutorials and real world projects. I know it might be difficult to get hired but nowadays one’s priority shouldn’t be earning money. Minimum wage or even for free, it doesn’t matter. Just start working in a company where you can learn to overcome real world obstacles.

  • @njosuedev.
    @njosuedev. 6 หลายเดือนก่อน +1

    thank you so much