So, as you heard, my name is Mark Dalglish, and I'm here all the way from Melbourne, Australia, which means it took me 21 hours of flying to get here. So, thank you so much for having me. It's a pleasure to be here in London.
Now, I've been working in the React space, can you believe it, for a decade at this point. I only realized as I was preparing for this talk. Now, some of you, as you heard, may be familiar with my work in React in terms of design system space, CSS modules, vanilla, Extract, design systems, but going back to why I got started in React in the first place, it was actually its server-side rendering capabilities that really sold me on React being fundamentally different to everything I'd used before, not just in the JavaScript space, but in web development in general. And for me, the really exciting part of it was that finally I got to bridge the gap between what we were trying to do with rich client-side interactivity in JavaScript, while also maintaining the progressive enhancement that up until that point, up until the push for JavaScript on the client, progressive enhancement had long been a value in the web space, and now React let me get the best of both worlds and solve some very real problems that I had at work at that time, trying to have rich client-side interactivity, while also having that first load page performance, as well as importantly, SEO support for Google for us at that time. So that work, that background for me in server-side rendering is what's ultimately led me to my current full-time work on the Remix team at Shopify, working really hard to make that progressive enhancement experience a reality for all of you.
So it's with, it's in that context that I'm sure it's no surprise to you that I'm very interested in React server components, because it's such a big shift in terms of how we think about React. But I have to admit that when I first looked at server components, I found them quite intimidating. Not at a high-level API perspective, but more from the sense that it I had less of an idea of how I'm supposed to think about the architecture of my application, what's the implications on how I think about and build my apps, how does it even work, and especially if I'm in a framework context, what does it mean to build a framework on top of server components? There are a lot of open questions, and people I respected that knew a lot about React were also struggling with this question. To me, this was in stark contrast to my experience with React up until that point, because I found that, generally, I was always able to have a very simple mental model of how React worked. For example, if I had my app component that we're all used to working with, I could render it to an element on the screen, but equally, I could take that same application component, and I could render it to a string of HTML on the server. This is what got me interested in React in the first place. And to me, this mental model was nice and simple. When it came to rendering a component, of course, early on, the natural question would be what is a component, given every framework has a different take on what that sort of concept might mean. And what was interesting in React is that the answer was nice and simple, is that conceptually components are basically pure functions that just described what should be on the screen at that given time. So in the early days of React, we didn't have functional components. We had React.create class, and it would have a render method, among other properties on that object. And inside of that method, we would have access to this.props on the instance of the component. So it's a very different API. But if you squint, it kind of felt like working with a pure function. And that's how I described it to people who were new to React. And funnily enough, that ended up being the API we deal with today. They literally are functions now. And, of course, our components are going to be rendering JSX and the question then would be what is JSX? For many of us, especially in those early days, it was a very interesting question to have to deal with, but the answer was quite simple. It's that JSX is just function calls. That's just the way you had to think about it. So when we saw code like this that, again, in the early days of React, for many of us, it was almost heretical that we would be returning HTML elements from our JavaScript functions. It almost made no sense to us.
Comments