React server components from scratch!

Поділитися
Вставка
  • Опубліковано 14 гру 2023
  • Repo: github.com/bholmesdev/simple-rsc
    Let's build a node server, stream an RSC to your browser, and handle client component bundling!
    #javascript #programming #reactjs #tutorial
  • Ігри

КОМЕНТАРІ • 110

  • @t3dotgg
    @t3dotgg 6 місяців тому +140

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

    • @developsdaniel
      @developsdaniel 6 місяців тому +4

      You meant the best though right?

  • @thejackshelton
    @thejackshelton 6 місяців тому +48

    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 6 місяців тому +53

    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  6 місяців тому +4

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

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

    This was effing wild! damn lol

  • @dgurney
    @dgurney 6 місяців тому +10

    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

  • @rockNbrain
    @rockNbrain 6 місяців тому +3

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

  • @antoniojurkic7455
    @antoniojurkic7455 5 місяців тому

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

  • @sylarfx
    @sylarfx 6 місяців тому +1

    Instant subscribe within the first minute. Love the energy!

  • @JohnBuildWebsites
    @JohnBuildWebsites 6 місяців тому

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

  • @maxwebstudio
    @maxwebstudio 5 місяців тому

    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 !

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

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

  • @brayanjpm
    @brayanjpm 6 місяців тому +2

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

  • @pvsagar92
    @pvsagar92 5 місяців тому +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 !

  • @TanweerAlam2008
    @TanweerAlam2008 4 місяці тому

    This a great presentation style. Appreciate the energy.

  • @thisweekinreact
    @thisweekinreact 6 місяців тому +1

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

  • @NiklasZiermann
    @NiklasZiermann 6 місяців тому

    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 :)

  • @Akshatgiri
    @Akshatgiri 6 місяців тому +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 6 місяців тому +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 6 місяців тому

      Never though about using React server components outside JS

    • @Akshatgiri
      @Akshatgiri 6 місяців тому +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.

  • @ProjectNeo-tk4hm
    @ProjectNeo-tk4hm 3 місяці тому +1

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

  • @developsdaniel
    @developsdaniel 6 місяців тому

    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. ❤❤

  • @4lissondev
    @4lissondev 6 місяців тому +1

    This video is amazing!!!! Thanks Ben.

  • @combatninjaturtle
    @combatninjaturtle 6 місяців тому +1

    Yessss! This is what I needed. Thanks man!

  • @abdessamadchokri352
    @abdessamadchokri352 4 місяці тому

    Woow, Absolutely the best SSR tuto explanation !

  • @aleksamitic6655
    @aleksamitic6655 6 місяців тому

    Amazing content mate! Keep it up!

  • @DEV_XO
    @DEV_XO 6 місяців тому

    Amazing video Ben!

  • @DanelonNicolas
    @DanelonNicolas 6 місяців тому +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.

  • @Andrei_Calazans
    @Andrei_Calazans 6 місяців тому

    Incredible tutorial

  • @saramshshrestha7641
    @saramshshrestha7641 4 місяці тому

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

  • @idmt93
    @idmt93 4 місяці тому

    Great content man! Subscribed

  • @TrostCodes
    @TrostCodes 6 місяців тому +1

    You're incredible dude, this was excellent!

    • @bholmesdev
      @bholmesdev  6 місяців тому

      Thank you Mr. Horse! ❤

  • @codante-io
    @codante-io 6 місяців тому +1

    Amazing video! Thanks

  • @igrb
    @igrb 6 місяців тому +10

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

  • @s1n7ax
    @s1n7ax 4 місяці тому

    Bruh. This is the best react related video ever

  • @Marhaenism1930
    @Marhaenism1930 6 місяців тому +1

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

    • @bholmesdev
      @bholmesdev  6 місяців тому

      Thanks! Short explainers are my specialty :)

  • @jitx2797
    @jitx2797 6 місяців тому +1

    Wow. I am stunned

  • @waldemarkunz9173
    @waldemarkunz9173 6 місяців тому

    Great video! Thank you.

  • @aamiramin6112
    @aamiramin6112 6 місяців тому +1

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

      Appreciate that so much! Will do ❤️

  • @kengreeff
    @kengreeff 6 місяців тому +1

    Amazing!

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

    Wow this is awesome ❤️

  • @pauljeremiahmugaya3292
    @pauljeremiahmugaya3292 4 місяці тому

    This is amazing 👏

  • @jens2635
    @jens2635 6 місяців тому

    well done, really interesting.

  • @FreeCodeArena
    @FreeCodeArena 5 місяців тому

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

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

  • @SSn0wx
    @SSn0wx 6 місяців тому

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

  • @aryomuhammad8254
    @aryomuhammad8254 4 місяці тому

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

  • @ThugLifeModafocah
    @ThugLifeModafocah 6 місяців тому

    impressive knowledge display.

  • @justpatrick_
    @justpatrick_ 5 місяців тому

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

  • @0xtz_
    @0xtz_ 6 місяців тому

    bro all this in 20 min 😮 🔥

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

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

  • @mattwayne9128
    @mattwayne9128 6 місяців тому +1

    Let's gooooooo

  • @BrendonSled
    @BrendonSled 6 місяців тому +2

    This is amazing. Have you tried implementing server actions?

  • @crapfartsmen
    @crapfartsmen 6 місяців тому

    Hell yeah dude

  • @muhammadyousufhere
    @muhammadyousufhere 6 місяців тому

    Wow Man! 😮

  • @thegithaka
    @thegithaka 3 місяці тому

    kudos!

  • @kumnegerwondimu9848
    @kumnegerwondimu9848 4 місяці тому

    u are so underrated

  • @najlepszyinformatyk1661
    @najlepszyinformatyk1661 6 місяців тому +1

    Cool

  • @pogospoofer69420
    @pogospoofer69420 4 місяці тому

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

    • @jim.....
      @jim..... 4 місяці тому

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

  • @wouter1625
    @wouter1625 6 місяців тому +1

    this video is cracked

  • @romank1ng528
    @romank1ng528 5 місяців тому

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

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

  • @amaechinaikechukwu8266
    @amaechinaikechukwu8266 6 місяців тому

    ❤❤❤

  • @anasrin
    @anasrin 6 місяців тому

    cool way to use snippet

  • @toothless.tarantula
    @toothless.tarantula 6 місяців тому

    Wow

  •  24 дні тому

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

  • @noahginsburg6140
    @noahginsburg6140 5 місяців тому +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  5 місяців тому

      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 5 місяців тому

      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

  • @iPankBMW
    @iPankBMW 6 місяців тому +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  6 місяців тому +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 6 місяців тому

      Whats your preferred JS Framework/Library?@@bholmesdev

  • @drprdcts
    @drprdcts 6 місяців тому

    Great tutorial! What browser are you using?

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

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

  • @lutfiikbalmajid
    @lutfiikbalmajid 6 місяців тому

    I have try creating Htmx server component with Elysia :D

  • @supriyomonndal6199
    @supriyomonndal6199 6 місяців тому

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

    • @bholmesdev
      @bholmesdev  6 місяців тому

      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

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

    Bro coded up nextjs in 20 minutes

  • @ahmedAltariqi
    @ahmedAltariqi 6 місяців тому +2

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

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

      @@bholmesdev Thank you, Ben!

  • @guozhangliew7302
    @guozhangliew7302 6 місяців тому +2

    so RSC is not doing SSR?

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

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

  • @Alcani3ca
    @Alcani3ca 4 місяці тому

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

  • @smithshaw1151
    @smithshaw1151 3 місяці тому

    Can one use rsc with htmx?

    • @bholmesdev
      @bholmesdev  3 місяці тому

      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

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

      stfu it ain't that complex

  • @bobobo1673
    @bobobo1673 6 місяців тому

    How old are you?

  • @jackpurdoneverydayzero
    @jackpurdoneverydayzero 6 місяців тому +1

    Spotifn't haha

  • @fullstack_journey
    @fullstack_journey 6 місяців тому +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)

  • @ray-lee
    @ray-lee 6 місяців тому +1

    please fix nextjs

    • @bholmesdev
      @bholmesdev  6 місяців тому +2

      We did! astro.build ;)

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

    why cant you simply first explain the "WHY" ?

  • @atharvapise
    @atharvapise 6 місяців тому

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

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

    Wow!

  • @madeinhvn
    @madeinhvn 6 місяців тому

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

  • @passarygmail2780
    @passarygmail2780 3 місяці тому

    I wonder how the virtual dom would look like in the browser... would love a reels on that one

  • @planetmall2
    @planetmall2 6 місяців тому

    Amazing!