How Next.js is delivering React’s vision for the future (Sam Selikoff)

almost 2 years agoNovember 3, 2023
21:13
18,953 views
547 likes
V

Vercel

Channel

Interviewed Person

Sam Selikoff

Description

Presented at Next.js Conf 2023. View all talks from the conference: https://www.youtube.com/playlist?list=PLBnKlKpPeagl57K9bCw_IXShWQXePnXjY Explore templates of sites built with Next.js: https://vercel.fyi/verceltemplates Check out the Vercel product tour: https://vercel.fyi/producttour Server Components have brought React closer to fulfilling its mission of giving developers a unified paradigm for building rich user interfaces. This talk will explain how RSC, which started out as the official answer for how to fetch data in React, led to an evolution of the React paradigm that brings the composability of components across the network boundary. We’ll first look at how RSC in Next.js improves upon the previous generation of data-fetching solutions (like getServerSideProps and SWR), why RSC is about so much more than data fetching, and end with an exploration of how this new paradigm will make even the non-UI parts of our applications easier to build in the future.

Transcript

Group by:

hi there all right uh my name is Sam sakov and I'm excited to be talking to you about well next in react today and um some of the things that gamra talked about in the keynote are actually a nice little teup for my talk because what I'm going to be talking about is how a lot of these improvements and Innovations we've gotten in next in the last year uh are really delivering on react's vision

for the future so uh when I first heard about react server components I was really excited because I was excited that we were finally getting a first class way to do data fetching in react this is a great video and um Sebastian and Andrew kind of Trac the history and the evolution of server components and suspense and how server components are basically data data fetching for suspense and we were

all kind of waiting for a first class way to do data fetching and react apps so that we could all stop kind of using our own Solutions we could have things that work together and um server components is basically what we got but uh when I first heard about this I was a little skeptical because uh there's a lot I like about fetching data in the client um my use SWR her does this mean I can't use this anymore you know when you get uh an Spa set up with

a hook like use SWR or use Query on the client uh there's a lot of really nice things that fall out from this you get to drop this in your component it can render a loading State and fetch data it can revalidate it can populate a client side cache so that subsequent navigations are really fast and um so I was a little bit skeptical but I knew that apis come to react with a lot of thought and so I kind of withheld judgment until I saw something that really stuck with me and

that was this this is a server component it fetches data right inside of the component boundary it has a direct handle to the database to fetch data but then it renders a component inside of a modal and this modal does all sorts of cool stuff on the client uh it comes up from the bottom and uh it renders our news story

inside of it and it attaches click listeners to uh keyboard events like Escape that we can press to to close it so I didn't know what it was at the time but this somehow struck me as more react than any code I had written before that accomplished everything that this component did and so it's kind of what started getting me excited for this new this new paradigm in react so uh why is this feel more like react than stuff that we've had in the past well let's

talk about react what do we like about react well a lot of people say it feels like playing with Legos uh it's fun and it's easy to use and it feels like Legos well let's talk about Legos why do people like Legos Legos come in all different sorts of shapes and sizes and colors but they can all be broken down to a single interface right it's a brick that has tubes and studs and you can snap into

each other and that's it that is all you need to know to build basically anything you want you can start snapping Lego Legos together and you can get smaller pieces into bigger pieces you can snap those big pieces into each other and uh you can keep going until you have what you want and I think this story uh is really what people like most about react what we love about building with react because it feels very similar we can start with a news

43 segments (grouped from 505 original)3605 words~18 min readGrouped by 30s intervals

Video Details

Duration
21:13
Published
November 3, 2023
Channel
Vercel
Language
ENGLISH
Views
18,953
Likes
547

Related Videos