Next.js vs Astro Rendering Strategies (SSG, SSR, Hydration, and Server Components)

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • Next.js vs Astro...which one is better?
    Next.js and Astro both support several different strategies for rendering content to the page including SSG (statically generated), SSR (server-side rendered), server components, hydration, and hybrid which mixes all of the above.
    Learn more about Astro - astrocourse.dev/
    Grovemade link (affiliate) - grovemade.com/?You...
    Grovemade coupon code - JAMESQ10
    *DISCORD*
    Join the Learn Build Teach Discord Server 💬 - / discord
    *STAY IN TOUCH 👋*
    Newsletter 🗞 - www.jamesqquick.com/newsletter
    Follow me on Twitter 🐦 - / jamesqquick
    Check out the Podcast - compressed.fm/
    Courses - jamesqquick.com/courses
    *QUESTIONS ABOUT MY SETUP*
    Check out my Uses page for my VS Code setup, what recording equipment I use, etc. www.jamesqquick.com/uses
    *TIMESTAMPS*
    00:00 - Intro
    01:20 - SSG Static Site Generator
    06:20 - SSR Server Side Rendered Content
    09:10 - Client Side Rendering or Hydration
    09:50 - Astro Islands
    12:50 - Next.js App Router Directory
    13:50 - Server Components and Streaming
    16:40 - Astro Async Data Loading and Streaming
    17:30 - Hybrid Rendering
    18:15 - Wrap Up

Комментарии • 26

  • @BhargavaMan
    @BhargavaMan Год назад +9

    Good stuff!
    As for hybrid rendering in Astro, you can also have it the other way round. With output mode 'hybrid', pages are static by default unless you export prerender = 'false'
    I've already moved 2 production apps from React to Astro, it's very capable!

  • @haikoerinkveld4242
    @haikoerinkveld4242 Год назад

    Awesome explanation. I couldn't wrap my head around al the new stuff going on in the web dev space. But this video explains it! Just 👍 gonna bookmark it! looking forward to your Astro course btw

    • @JamesQQuick
      @JamesQQuick  Год назад

      Thanks so much for the positive feedback!

  • @alisherzaitov
    @alisherzaitov 11 месяцев назад +7

    Please, please add CMS integration block in your course on Astro. Self-hosted Directus will be optimal.
    Cause no client or a blogger will make a serious project writing every post in markdown. Once you add it, I am buying ❤️

    • @JamesQQuick
      @JamesQQuick  11 месяцев назад +2

      haha fair enough. I'm thinking I might add a CMS section to my course. For updates, make sure to sign up for the newsletter astrocourse.dev/

  • @karthiksalian1635
    @karthiksalian1635 Год назад +1

    i started using astro yesterday it is great i am currently rebuilding one of nextjs project with it one question in astro is there any way to trigger rebuild using API like using revalidatePath in nextjs

  • @portersmith9101
    @portersmith9101 8 месяцев назад +1

    At 17:02 I could be wrong but with Astro with server mode it is a little different. When you make a await async call on the server in an Astro component, all the components and markdown underneath that Astro component making the async call will be blocked until the async call is finished. While with NextJS server components you can have a server component that can make a await async call on server and it won't block components from rendering underneath it till it's finished.

    • @JamesQQuick
      @JamesQQuick  8 месяцев назад +1

      I think I confirmed this Ben Holmes from Astro on a stream recently. They don’t advertise it but I’m pretty sure they’re using streaming

  • @dzienisz
    @dzienisz 4 месяца назад

    thanks for this video

  • @ChristianKolbow
    @ChristianKolbow Год назад

    👍

  • @nickwoodward819
    @nickwoodward819 9 месяцев назад

    When is 'build time' in this case? Can't be only when you deploy, surely?

    • @JamesQQuick
      @JamesQQuick  8 месяцев назад

      Well you could trigger a built locally if you wanted, but most likely you're doing it your deployment pipeline

  • @vishalsangole836
    @vishalsangole836 9 месяцев назад

    learned a loooooooooooooooooooooooot !

  • @ilirbajrami2902
    @ilirbajrami2902 3 месяца назад

    I was waiting for the equivalent for revalidating data on static pages if we make a change in the CMS but you didnt cover that. Any good resource about that?

    • @JamesQQuick
      @JamesQQuick  3 месяца назад

      Well, you could trigger a build of your site automatically when content is updated. Is that what you're looking for?

  • @user-bc4lm3dm8d
    @user-bc4lm3dm8d 5 месяцев назад

    Hi James! thanks for the explanations. Could you help me with a doubt? Im using Astro + Strapi for build a project by the scratch and everything is new... Im looking for a solution to work with a Design System and when I try use a web component i get an error like "self is not defined", that cames when I find a js import from node_modules. To solve this, Im using the directive client:only and everything works. Is that correct? I mean, have a way to configure all of web component in time of build?

  • @anasouardini
    @anasouardini Год назад

    All I hear in this video is "Astrojs is king" :)

    • @JamesQQuick
      @JamesQQuick  Год назад

      There's a lot to like! :) I also love Next.js!

  • @dannyisrael
    @dannyisrael 9 месяцев назад

    I assume this is NextJS 12

    • @JamesQQuick
      @JamesQQuick  9 месяцев назад

      Well, the Server Components piece is 13+

  • @jonathangamble
    @jonathangamble Год назад +1

    I don't get why Astro when you can uncomplicate it... just stick with regular frameworks made for one purpose.

    • @JamesQQuick
      @JamesQQuick  Год назад

      What do you mean by regular frameworks?

  • @nested9301
    @nested9301 Год назад +1

    ahhhh i'm really depressed another framework ???? can we just stop

    • @JamesQQuick
      @JamesQQuick  11 месяцев назад +1

      hahaha it never ends