React server components from scratch!

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024
  • Repo: github.com/bho...
    Let's build a node server, stream an RSC to your browser, and handle client component bundling!
    #javascript #programming #reactjs #tutorial

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

  • @t3dotgg
    @t3dotgg 11 месяцев назад +170

    One of the best RSC videos I've seen so far

    • @developsdaniel
      @developsdaniel 10 месяцев назад +6

      You meant the best though right?

  • @thejackshelton
    @thejackshelton 11 месяцев назад +59

    I think Ben just did a better job explaining RSC's in 20 minutes than the entire industry in the last 2 years 😅

  • @iamfrankstallone
    @iamfrankstallone 11 месяцев назад +58

    This is one of the best 20 minute tutorials I’ve ever watched. 👏🏻
    Ben, your format, production, depth of knowledge, ability to articulate that knowledge, and humor created a masterpiece. 🎉
    I had no interest in ever learning how to do this. As a front of the front end recovering React developer my interest in this subject was low coming in. You magically peaked my interest, keep me engaged, and - to my absolute shock - I understood everything… including the webpack monkey patch. 😅

    • @bholmesdev
      @bholmesdev  11 месяцев назад +4

      Appreciate that so much! Glad it all clicked for you 🙌

  • @dgurney
    @dgurney 11 месяцев назад +12

    Wow this was an incredible explanation. Of all the videos and posts I’ve seen about RSC, this is the ONLY ONE THAT ACTUALLY MAKES SENSE and explains how things really work under the hood. Well done

  • @ProjectNeo-tk4hm
    @ProjectNeo-tk4hm 7 месяцев назад +1

    So cool, I also had an idea that RSC looks a lot like PHP, and you confirmed it!

  • @antoniojurkic7455
    @antoniojurkic7455 10 месяцев назад +1

    This is awesome. So concise, fun and without unnecessary info. Please do more! 👏

  • @pvsagar92
    @pvsagar92 10 месяцев назад +1

    With this depth of knowledge and the ability to code it as well, you can very well be a core React team member. Great work bro !

  • @rockNbrain
    @rockNbrain 11 месяцев назад +3

    Great job Ben ... very interest to understand the magic behind these frameworks!!

  • @brayanjpm
    @brayanjpm 11 месяцев назад +4

    Dang, I will just say ‘underrated video for devs’, great video Ben

  • @Akshatgiri
    @Akshatgiri 11 месяцев назад +6

    This is awesome! Can't wait for every ecosystem ( go, laravel, rust etc ) to add react server components to their frameworks.

    • @armchair-architect
      @armchair-architect 11 месяцев назад +1

      If all you need is server side rendering, then Laravel Livewire would get you there without all the extra plumbing. However if your use case requires server side rendering and then intricate client side logic as well, then this approach is perfecto.

    • @neociber24
      @neociber24 11 месяцев назад

      Never though about using React server components outside JS

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

      @@armchair-architect Absolutely. Most projects I work on happen to require a dynamic frontend somewhere in the app. And though web components are a pretty good solution, react server components + react client side components + a solid backend stack is the move.

  • @FreeCodeArena
    @FreeCodeArena 10 месяцев назад +1

    I dont know half the things you just did, but this was super fun to watch😅. I'm gonna go watch more of your videos

    • @bholmesdev
      @bholmesdev  9 месяцев назад +1

      Haha, glad I could be some nerd entertainment for you! Feel the same watching LowLevelLearning explain C 😅

  • @aryomuhammad8254
    @aryomuhammad8254 9 месяцев назад +1

    Half of the video kinda hurt my brain. Great video Ben! Thank you!

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

    I want you as president of the whole world.
    I think it's impossible to be more clear. Thanks!
    And thanks to Sebastian for sharing your video.

  • @maxwebstudio
    @maxwebstudio 10 месяцев назад

    Men, first this format is really cool. Nice to see you on a setup different than from your YT shorts. Second that explanation was just awesome ! Thank you !

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

    the fact that you did this in 19 mins is CRAZY
    common whiteboard man win

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

    Instant subscribe within the first minute. Love the energy!

  • @lebon1211
    @lebon1211 7 месяцев назад

    Amazing! You do make RSC look simple, and definitely understandable 👏🏼

  • @developsdaniel
    @developsdaniel 10 месяцев назад

    I’m enjoying following your journey Ben, I keep ending up at the places you’ve been solving - 11ty islanding, then fed up with 11ty dev experience, I’ve been looking to make a JAM stack site boilerplate with static server component islanding, and this vid did half the work for me. ❤❤

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

    Ben, I'm amazed by the level of knowledge and expertise that you have it's amazing. Thanks for sharing this and I love it please keep sharing your knowledge

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

      Appreciate that so much! Will do ❤️

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

    Would love to see more like this on things like hydration and react query.
    What are those guys doing with suspense, hydration and RSC?

  • @NiklasZiermann
    @NiklasZiermann 11 месяцев назад

    Awesome explanation. Stuff like this will hopefully help more people understand which parts of server components actually are just react and which are nextjs magic :)

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

    Great video, and also nice teaser for the 4h stream that I want to watch now 😄

  • @JohnBuildWebsites
    @JohnBuildWebsites 11 месяцев назад

    Only a few minutes in and became an instant subscribe. So few videos are this clearly explained! Thank you.

  • @fkondratov
    @fkondratov 7 месяцев назад

    my brain got grilled a couple of times during this, but it was worth it

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

    This a great presentation style. Appreciate the energy.

  • @echobucket
    @echobucket 7 месяцев назад +2

    At any point when watching this or writing this, did anyone stop to say "Wait.. this is too complex, perhaps we shouldn't be doing this"

    • @acopier
      @acopier 6 месяцев назад

      stfu it ain't that complex

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

    Woow, Absolutely the best SSR tuto explanation !

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

    Dan Abramov will write a Novel explaining this (also other Reat devs). You are the best!

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

      i believe this video is inspired by dan's post from last June of the same name github /reactwg/server-components/discussions/5

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

    Am a vue but my goodness this was great. It even clicked why this would be beneficial for react native

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

    good one ben, and thanks for ur explanation in less than 20mins

    • @bholmesdev
      @bholmesdev  11 месяцев назад

      Thanks! Short explainers are my specialty :)

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

    This was effing wild! damn lol

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

    You're incredible dude, this was excellent!

    • @bholmesdev
      @bholmesdev  11 месяцев назад

      Thank you Mr. Horse! ❤

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

    Bruh. This is the best react related video ever

  • @noahginsburg6140
    @noahginsburg6140 10 месяцев назад +1

    What a video! Question: I have an async data fetching RSC. When my application builds, a static page is rendered with the HTML rendering the data from the data fetch. Correct so far? Now when a user say navigates to my application site, I need that component to render with fresh data. How will that currently static page know to re-render with fresh data? I can't imagine everything needs to be marked "force dynamic", at least in nextjs. I may still be missing a concept around this. Thanks again for a great video.

    • @bholmesdev
      @bholmesdev  10 месяцев назад

      Hey thanks Noah! Yes, page re-rendering is an interesting concept we didn't cover in the video. Next.js has special automations for caching static vs. dynamic data. My understanding is:
      - if a component is *only* used for static content, it's render to HTML at build time as you described.
      - if that component is then used to re-render content dynamically, that component now ships as a Javacript endpoint. Next.js smartly decides when this switch happens.
      Hope that helps!

    • @noahginsburg6140
      @noahginsburg6140 10 месяцев назад

      That does help. I think this video offered great clarity into RSC implementation but the NextJs abstractions seem to muddy that up a bit. Anyways, thanks for responding. Look forward to more content.@@bholmesdev

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

    This is amazing. Have you tried implementing server actions?

  • @romank1ng528
    @romank1ng528 10 месяцев назад

    Amazing video! Very thorough, I also like to use hono, however I couldn't help but wonder what shell prompt you're using

    • @bholmesdev
      @bholmesdev  10 месяцев назад +1

      Ah thanks! And I'm using oh-my-zsh with spaceship prompt github.com/spaceship-prompt/spaceship-prompt

  • @minhđoàncông
    @minhđoàncông 4 месяца назад

    amazing work. Thank for helping of you.

  • @niranjansingh-il1pf
    @niranjansingh-il1pf Месяц назад

    Hey Ben, this is so easy and still detailed. But...
    If you are not returning HTML, how does crawlers figure out the SEO??

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

    Damn, you're really good.
    It was awesome.

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

    My man built Next in 20 mins.

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

    This video is amazing!!!! Thanks Ben.

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

    Amazing!

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

    Wow. I am stunned

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

    Hey! thanks for the video. Did you create those snippets or are you using an extension?

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

    Yessss! This is what I needed. Thanks man!

  • @anasrin
    @anasrin 11 месяцев назад

    cool way to use snippet

  • @ThugLifeModafocah
    @ThugLifeModafocah 11 месяцев назад

    impressive knowledge display.

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

    Nice video! Do you know how we can make the default 30second (client side cache)/(router cache) for server components in Nextjs to 0 seconds? Its kinda impossible to get the latest data in SRC on subnavigation (clicking on component). Maybe create a PR for Nextjs about this issue :)

    • @bholmesdev
      @bholmesdev  11 месяцев назад +6

      Yeah, I generally just... don't like NextJS' aggressive caching strategy. Hoping they make caching a manual opt-in instead of an invisible default

    • @iPankBMW
      @iPankBMW 11 месяцев назад

      Whats your preferred JS Framework/Library?@@bholmesdev

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

    You make easy to understand thanks

  •  5 месяцев назад

    Nice explanation, nice video. Thanks!
    I'd better stick to PHP instead of this much dark magic 😬

  • @codante-io
    @codante-io 11 месяцев назад +1

    Amazing video! Thanks

  • @0xtz_
    @0xtz_ 11 месяцев назад

    bro all this in 20 min 😮 🔥

  • @DEV_XO
    @DEV_XO 11 месяцев назад

    Amazing video Ben!

  • @echobucket
    @echobucket 7 месяцев назад

    Where is the W3C RFC on this proprietary format React is using here?

  • @Andrei_Calazans
    @Andrei_Calazans 11 месяцев назад

    Incredible tutorial

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

    Great content man! Subscribed

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

    this video is cracked

  • @flexdash
    @flexdash 11 месяцев назад

    Great tutorial! What browser are you using?

  • @aleksamitic6655
    @aleksamitic6655 11 месяцев назад

    Amazing content mate! Keep it up!

  • @DidierHernandez
    @DidierHernandez Месяц назад

    How its could works loading a millions of records on streaming and looking every single day this react technology becomes more complex instead of easy to dev. Every React project is a very complicated environment that is worked on by other developers.

  • @SSn0wx
    @SSn0wx 11 месяцев назад

    Damn this is a super nice video, keep up the content

  • @sonipratik6405
    @sonipratik6405 7 месяцев назад

    Wow this is awesome ❤️

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

    Let's gooooooo

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

    Fantastic

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

    This is amazing 👏

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

    Can you please guide me how to convert existing large react app to server side?

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

    u are so underrated

  • @najlepszyinformatyk1661
    @najlepszyinformatyk1661 10 месяцев назад +1

    Cool

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

    kudos!

  • @jens2635
    @jens2635 11 месяцев назад

    well done, really interesting.

  • @kikevanegazz325
    @kikevanegazz325 6 месяцев назад

    Wow!

  • @atharvapise
    @atharvapise 11 месяцев назад

    ohh damn, hot clip by Ben after a long time. RSCs for the win

  • @waldemarkunz9173
    @waldemarkunz9173 11 месяцев назад

    Great video! Thank you.

  • @graphiclife5416
    @graphiclife5416 25 дней назад

    Web dev 2024 is fked up. Can we please make this 100x more complicated and if we want to add auth 100x more complicated? That would be epic 🤓

  • @amaechinaikechukwu8266
    @amaechinaikechukwu8266 11 месяцев назад

    ❤❤❤

  • @martingreler6236
    @martingreler6236 7 месяцев назад

    Bro coded up nextjs in 20 minutes

  • @lutfiikbalmajid
    @lutfiikbalmajid 11 месяцев назад

    I have try creating Htmx server component with Elysia :D

  • @supriyomonndal6199
    @supriyomonndal6199 11 месяцев назад

    Amazing work ben!
    What's the extension doing the auto complete?

    • @bholmesdev
      @bholmesdev  11 месяцев назад

      I'm using VS Code snippets I wrote myself! Intended to make the video run smoother, but you can use them yourself by cloning github.com/bholmesdev/simple-rsc

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

    so RSC is not doing SSR?

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

      Ah, good observation! SSR is a separate step that we *can* add so the user sees an initial view while the rest of the page streams down. I reached out to the React team about this and got a pretty minimal example if you're curious: github.com/mattcarrollcode/react-serving-patterns/tree/main/ssr-and-rsc

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

      @@bholmesdev awesome thanks for reaching out to the team! appreciate it!

  • @muhammadyousufhere
    @muhammadyousufhere 11 месяцев назад

    Wow Man! 😮

  • @toothless.tarantula
    @toothless.tarantula 11 месяцев назад

    Wow

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

    I'm so lost. How do you center a div??

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

      sir this is a wendy's

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

    Dude, I can't code along without pausing, because you're using a lot of snippets lol
    Share them please!

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

      Understood! Kinda expect coders to pause. It's a delicate balance between tight explanations and typing every thing. If you clone github.com/bholmesdev/simple-rsc and open in VS Code, all the snippets are there. Just empty out `server.js` and get going.

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

      @@bholmesdev Thank you, Ben!

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

    Can one use rsc with htmx?

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

      Admittedly no, they are very different approaches to rerendering server content. RSCs send a format from the server that isn't _quite_ HTML, so HTMX couldn't process it

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

    This is what the company I'm in did, 7 years ago.. and were still maintaining this proprietary piece of sh.. code to this day (it's horrible)

  • @alexodan
    @alexodan 17 дней назад

    it's amazing how i get 420 errors while trying to do this by my own, i wonder if others have faced the same

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

    Spotifn't haha

  • @bobobo1673
    @bobobo1673 11 месяцев назад

    How old are you?

  • @ronalchenco
    @ronalchenco Месяц назад

    A lot of config things to set a simple list :'(

  • @mohamedtaher88
    @mohamedtaher88 7 месяцев назад

    why cant you simply first explain the "WHY" ?

  • @ray-lee
    @ray-lee 11 месяцев назад +1

    please fix nextjs

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

      We did! astro.build ;)

  • @madeinhvn
    @madeinhvn 11 месяцев назад

    Woah what a new Ben video that's more than 2 minutes??

  • @planetmall2
    @planetmall2 11 месяцев назад

    Amazing!