Partial Prerendering in NextJs 14

Поділитися
Вставка
  • Опубліковано 16 лип 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
  • Наука та технологія

КОМЕНТАРІ • 30

  • @uixmat
    @uixmat 2 місяці тому +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  2 місяці тому

      There you have it Matt! Let's go!

  • @solomonakinbiyi
    @solomonakinbiyi 2 місяці тому +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  2 місяці тому +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 2 місяці тому

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

    • @lokeswaran8845
      @lokeswaran8845 Місяць тому

      😅

  • @algnadjib
    @algnadjib 2 місяці тому +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  2 місяці тому

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

  • @xayrullayev_ogabek
    @xayrullayev_ogabek 2 місяці тому +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  2 місяці тому

      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 2 місяці тому +3

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

    • @hamedbahram
      @hamedbahram  2 місяці тому

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

    • @inderjotsingh5868
      @inderjotsingh5868 2 місяці тому

      ​@@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 2 місяці тому

      @@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 2 місяці тому +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 2 місяці тому

      @@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 🙏

  • @neelmodi2812
    @neelmodi2812 2 місяці тому +1

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

    • @hamedbahram
      @hamedbahram  2 місяці тому

      Thanks, I appreciate that.

  • @user-gc3tv6vx7x
    @user-gc3tv6vx7x 2 місяці тому +1

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

    • @darrenpierre9903
      @darrenpierre9903 2 місяці тому +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  2 місяці тому +1

      That's right! Thanks for the reponse!

    • @user-gc3tv6vx7x
      @user-gc3tv6vx7x 2 місяці тому

      @@darrenpierre9903 alright got it.

  • @nickwoodward819
    @nickwoodward819 27 днів тому

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

    • @hamedbahram
      @hamedbahram  27 днів тому +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 27 днів тому

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

  • @adloukondo2148
    @adloukondo2148 2 місяці тому +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  2 місяці тому +1

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

    • @adloukondo2148
      @adloukondo2148 2 місяці тому

      @@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 2 місяці тому +1

    Bjh Yoo on