Next.js 14 - Server Actions TUTORIAL | Type Safety, Error Handling, Pending States

Sdílet
Vložit
  • čas přidán 14. 01. 2024
  • Getting close to finishing the Next 14 Course, stay tuned for the update.
    developedbyed.com/
    Resources ⛏️
    nextjs.org/docs/app/building-...
    github.com/TheEdoRan/next-saf...
    🛴 Follow me on:
    Twitter: / developedbyed
    Github: github.com/developedbyed/
    Dope tracks 🔥
    Shofel - Balcony chll.to/8d7e18be
    #react #nextjs
  • Věda a technologie

Komentáře • 59

  • @TheEdoRan
    @TheEdoRan Před 4 měsíci +6

    Thank you so much Ed for featuring next-safe-action! Very glad you find it useful.

  • @developedbyed
    @developedbyed  Před 4 měsíci +36

    Let me know if you want me to make a demo for optimistic updates as well 👍👍

  • @Logicmontana
    @Logicmontana Před 4 měsíci +5

    Hey there ED That's fantastic news! I'm really happy to hear that you found this project helpful. It's always a good idea to have server actions that prioritize type safety and error handling. I must say, the demonstrations you shared are really informative and highlight some key aspects of server actions. It's great to see that Next.js 14 is bringing in some handy features to manage loading, errors, and success. Thank you so much for sharing this valuable information!

  • @marvinkr
    @marvinkr Před 4 měsíci +2

    Glad to see you back! Saw you switch from tRPC to Server Actions in your repo. Is it due to the "experimental" stage of tRPC with server side calls?

  • @sudoalex
    @sudoalex Před 4 měsíci

    Welcome back Ed!

  • @atifali3485
    @atifali3485 Před 4 měsíci

    waiting for the course!!

  • @mihirkhode8289
    @mihirkhode8289 Před 4 měsíci

    thanks, for introducing new packages. 👍

  • @BeepBoop2221
    @BeepBoop2221 Před 4 měsíci

    I hope you are well Ed

  • @sK4hsCz
    @sK4hsCz Před 4 měsíci

    thank you very much ed! :) you explained it so well, now i'm getting this rocked. thanks

  • @neeshsamsi
    @neeshsamsi Před 4 měsíci

    I've really been struggling with the prettier endlessly loading 11:08. Have you found a fix. I pruned unnecessary extensions and other things thinking there was too many extensions but it still happens often.

  • @dummymail2495
    @dummymail2495 Před 4 měsíci +2

    When will your next14 course be published?❤

  • @doriandoussain1528
    @doriandoussain1528 Před měsícem

    Give it a shot work for heroine too, that's a double, nice shot

  • @mdsafikulislam9113
    @mdsafikulislam9113 Před 4 měsíci

    Please make a full playlist of NextJS 14~!

  • @eca8799
    @eca8799 Před měsícem

    hello one question about min 6:15 , in my app the values look like this: type Ingredient = {
    name: string;
    purchasePrice: Prisma.Decimal;
    }
    and I'm having an error ("Only plain objects can be passed to Server Functions"), so I have to to do addIngredient(JSON.stringify(values)) in the onSubmit.
    and in the definition of the action, undo by doing JSON.parse(ingredientData).
    how would you deal with that without any additional package?

  • @tnnz9920
    @tnnz9920 Před 4 měsíci

    Sir is possible to fetch API from external in server action? I always got status code 303 even its succesed

  • @JohnBuildWebsites
    @JohnBuildWebsites Před 4 měsíci

    Any idea why I might keep getting a fetch error when using `next-safe-action` saying "TypeError: Cannot redefine property: $$id". Works fine doing a raw db.insert without next-safe-action

  • @massinskendoul9640
    @massinskendoul9640 Před 4 měsíci +1

    Amazing thank u Deved

    • @developedbyed
      @developedbyed  Před 4 měsíci +2

      yeah no worries! always around 👍

    • @massinskendoul9640
      @massinskendoul9640 Před 4 měsíci +1

      ​@@developedbyed and we are always here to see what you bring us, in Deved we trust. 😁

  • @Dhanushsaji
    @Dhanushsaji Před 4 měsíci

    What's the benefit using server actions over API?

  • @mhraihan7422
    @mhraihan7422 Před 4 měsíci

    great one

  • @marvelousadesina4673
    @marvelousadesina4673 Před 4 měsíci

    HE'S BAAACK!!!!!

  • @adarshdalvi9772
    @adarshdalvi9772 Před 4 měsíci

    I'm new to nextjs, consider me dumb. Even we don't write 'use server' on top of the file , it automatically becomes a server thing? like we only need to decalre 'use client' if it's a client component, otherwise it's a server thing by default?

    • @rodneypaul9430
      @rodneypaul9430 Před 4 měsíci

      yes next js components are server components by default use the 'use server' when writing server actions not components server actions are just like functions which interact with the db directly without apis

  • @XeKT0r
    @XeKT0r Před 4 měsíci

    AWSEMOE !!

  • @midlajj
    @midlajj Před 4 měsíci

    Can you please provide the source code of last product adding form shown in this video...?

  • @quoclam7140
    @quoclam7140 Před 4 měsíci

    Can you make a video of how to do shadcn without typescript and nextjs?

  • @Zaromir
    @Zaromir Před 4 měsíci

    My body is still ready

  • @Adrian_Galilea
    @Adrian_Galilea Před 4 měsíci

    Can you drop the repo? :)

  • @dahliasan
    @dahliasan Před 4 měsíci

    what is the difference between this method vs using react query?

    • @dwin9983
      @dwin9983 Před 4 měsíci +2

      react query is used for apis and next-safe actions is used for server actions, they pretty much work the same though

    • @s3nTer
      @s3nTer Před 4 měsíci

      ​@@dwin9983web dev field is a mess, glad I moved away from it. Those mf keep reinventing wheel over and over again 😅

    • @brienaustinclayton
      @brienaustinclayton Před 4 měsíci

      Server actions are more advantageous right ?​@@dwin9983

  • @user-wy7mu3kx1h
    @user-wy7mu3kx1h Před 4 měsíci

    Where is the code links?

  • @rastikrastikk2289
    @rastikrastikk2289 Před 3 měsíci +1

    Make a lot next js project

  • @Logicmontana
    @Logicmontana Před 4 měsíci +1

    SECIND ONE HERE

  • @ShanakaDushyantha
    @ShanakaDushyantha Před 2 měsíci

    Hey I got a challange for you, (Actually I faced the same & no anyware to go 😭 😂),
    Need to build a login & perform Remember me using access Token & Refresh Token which is provided by third-party backend server
    Use:
    Next Js (App directory: latest)
    Next-Auth

  • @skorotkiewicz
    @skorotkiewicz Před 4 měsíci +1

    You need to start using Prisma for database with postgres.

  • @RhanaldiDennis
    @RhanaldiDennis Před 4 měsíci

    can you sponser me two 8gb ddr4 ram vscode can keep up

  • @user-xu3lj1ej8d
    @user-xu3lj1ej8d Před 3 měsíci

    WOW

  • @Gyurmatag
    @Gyurmatag Před 4 měsíci

    Source code?

  • @devoxygen7395
    @devoxygen7395 Před 4 měsíci

  • @rhodler
    @rhodler Před měsícem

    8:35

  • @theDanielJLewis
    @theDanielJLewis Před 4 měsíci

    Can someone please vacuum his mic pop filter? 🤣

  • @sohamdebnathpopo
    @sohamdebnathpopo Před 2 měsíci +1

    so many packages. would prefer long(er) lines of code rather than using lots of packages. IMO.

  • @shahidullahmuffakir668
    @shahidullahmuffakir668 Před 4 měsíci

    Can i watch it without getting drunk?

  • @poizonncs8264
    @poizonncs8264 Před 4 měsíci

    Man you are being lazy, people are waiting for your videos, including me 😅

  • @BeepBoop2221
    @BeepBoop2221 Před 4 měsíci

    I hope you are well Ed