Partial Prerendering in NextJs 14

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • This video will examine partial prerendering in NextJs 14, which combines ultra-quick static edge delivery with fully dynamic capabilities at the component level.
    👉🏼 New courses
    → www.hamedbahram.io/courses
    👉🏼 NextJs docs
    → nextjs.org/docs
    👉🏼 Partial prerendering example
    → www.partialprerendering.com/
    👉🏼 Work with me
    → www.hamedbahram.io/hire
    Chapters
    0:00 Intro
    3:30 Convention
    5:46 Caveats
    8:10 Examples
    9:48 Recap
  • Věda a technologie

Komentáře • 30

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

    U just dropped this Hamed right when I am giving myself a Sunday to play with server action fetching and pre-rendering 💥🔥 🎉

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

      There you have it Matt! Let's go!

  • @solomonakinbiyi
    @solomonakinbiyi Před 2 měsíci +21

    I thought we had this already. Right now I could wrap a component with suspense and this feature would be replicated. What am I missing?

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +3

      We have the `Suspense` but currently your entire route is either static or dynamic. Whereas in partial prerendering you can break one route into static and dynamic parts.

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

      ​@@hamedbahramoooo9ooo9ooo😊ooo😊😊😊😊😊😊😊😊😊oo😊999😊

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

      😅

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

    how to configure the app to send the static part and static pages from a CDN but the dynamic parts from a dynamic server?

    • @hamedbahram
      @hamedbahram  Před 3 měsíci

      While this is experimental, I've explained how to do it in the video.

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

    Hello I am getting this error while I am bulding my nextjs project how can I fix it:
    Error occurred prerendering page "/dashboard".

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

      Check if you installed the `next@canary` version, and wrapped your dynamic component with Suspense, and lastly that you're not using the edge runtime.

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

    Isnt this what we already do with streaming ?
    I am failing to see the fundamental difference here ?

    • @hamedbahram
      @hamedbahram  Před 3 měsíci

      Currently we're at the route level, partial prerendering is at the component level.

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

      ​@@hamedbahram , I have the same doubt , don't we use loading.tsx for route level fallback , and for component level we use Suspense . How partial pre-rendering is different

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

      @@hamedbahram i still fail to see what you mean by that ? in order for a component to render it should be inside the tree of that route some where correct ? if its a server component fetching something asynchronously we could suspend it do you mean to say that if i am using a 'use client' directive in a client component and if i am performing some api call inside my useEffect() i can suspend that as well ? i think it would be best if you made a video where you could clearly showcase the difference between streaming RSC vs PPR ??

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

      @@inderjotsingh5868 partial prerendring is blend of both static and dynamic rendring while "concept of streaming" belongs to only dynamic rendring.The concept of streaming with static rendring is equal to partial prerendring introduced by NEXT 14

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

      @@shahidmughal8466 thanks bro,
      Now my whole misconceptions is cleared about partial prerendering.
      Earlier i used to think that nature of rendering is component based . But I was wrong it is based on all the components we are going to use in the page . If we are using dynamic elements in any component within the page then entire page will be shifted to dynamic rendering.
      But with partial prerendering nature of rendering is component based. So cool and performant.
      Thanks 🙏

  • @user-gc3tv6vx7x
    @user-gc3tv6vx7x Před 3 měsíci +1

    Sir why we can't use sockets in nextjs. can you please make a video on nextjs limitations ?

    • @darrenpierre9903
      @darrenpierre9903 Před 3 měsíci +2

      If you're deploying your Next.js application to a serverless environment like Vercel then you can't use web sockets due to the time limit of serverless functions

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

      That's right! Thanks for the reponse!

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

      @@darrenpierre9903 alright got it.

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

    Your hand watch is cool. Can you give me the link for your watch😅... And great tutorial.

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

    'edge cdn' = a vercel feature? or is this something easily replicated on a self hosted platform?

    • @hamedbahram
      @hamedbahram  Před měsícem +1

      The edge cdn is not a vercel feature, you can use cloudflare for example. The part I'm not sure about yet is how to set it up with PPR. We'd have to wait and see as this feature matures into stability.

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

      @@hamedbahram ah, yeah i just thought it might have indicated it was not possible to self host. will give it a try :)

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

    Bonjour monsieur, j'espère que vous allez bien. je suis entrain de chercher une bibliothèque pour m'aider à fait de OTP sur téléphone mobile via SMS avec NextJS, pouvez vous fait du contenu dessus svp 😢😢

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

      Absolutely! You can use Clerk to implement OTP. I'll have content on creating this using nextauth as well.

    • @adloukondo2148
      @adloukondo2148 Před 3 měsíci

      @@hamedbahram je suis au courant pour Clerk. Mais je me demande si il ont juste la partie OTP Mobile seule ou bien il faut intégrer tout l'authentification.
      Je veut éviter clerk parceque j'ai déjà utilisé nextAuth

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

    Bjh Yoo on