A Nerdy Guide to the Web Trending Concepts

Rate this content
Bookmark

What do S.H.I.E.L.D. and A.R.G.U.S. have in common with edge computing?
How can Iron Man and Batman help you understand hydration, partial hydration, and resumability?
What can the Watchers or the Monitors tell you about Reactivity?
Join this adventure straight from the pages of a comic book as your favorite heroes and villains help you understand some of the most discussed topics on the web now.

17 min
15 Nov, 2023

Video Summary and Transcription

This Talk is about using comic book stories to explain complex software development concepts. The first part introduces the speaker and the purpose of the Talk. The second part explores the concept of hydration using Iron Man as an example. Hydration is a solution to make server-side rendered code interactive. The Talk then moves on to discuss resumability, which allows for immediate interactivity by encoding extra information into the HTML. The concept of resumability is further explained using a story with Iron Man. The Talk concludes by inviting suggestions for future topics and thanking the audience.

Available in Español

1. Introduction to the Talk

Short description:

I'm here at React Summit to share this new talk. Attending conferences can be overwhelming, especially with all the technical jargon. I realized I needed better mental models to understand these concepts. As a comic book nerd, I decided to combine my love for characters and tech concepts to create a nerdy guide. Let me introduce myself as Daniel Afons, a developer advocate at OLX. Feel free to connect with me on social media. Please note that this talk includes fan-made stories with Marvel and DC Comics characters.

I will React Summit. Thank you so much for having me here. It's a pleasure to be here with all of you today to share this new talk that I'm trying out. So, hopefully, you'll have as fun watching this as I have writing it.

So, let's start. Well, this all started when I was attending a couple of conferences. And attending conferences can be a bit overwhelming. I don't know if you understand what I mean. But there are so many words showing up back and forth, which, well, if you are like me, not very often you're going to understand what all of them mean.

The issue that kind of prompted me to do this is because I didn't have the right mental models formed for these things. Now, I don't know if you are aware of what a mental model is. Mental models are the terms, images, words or whatever that you associate with a certain subject. For instance, picture sleeping. Whenever you hear the word sleep, you immediately understand all the steps associated to it in your mind. This is because you have the right mental models formed for them.

Now, hitting pause on that for a bit, let me tell you something about myself. I'm a huge comic book nerd. I have more comic books than I can read and you might regularly find me making comic book or pop culture jokes. So, one day I thought, what if I could get the characters that I love, the tech concepts that I miss to write mental models, and I build a nerdy guide to the web trending concepts? So, this is the essence of the talk that we're going to be seeing.

Before anything else, let me start by introducing myself. My name is Daniel Afons. I'm working as a developer advocate at OLX. I'm an IDN instructor. I'm an Altura ambassador. You can find me on X and pretty much any social network at the handle DanielJCAfons. Also something about me, I recently published a book about React Query. Part of the book is state management with React Query. I'm up to chat with all the things related with React Query. Feel free to reach out to me on social networks. Now, before we start the talk, I just want to make a small disclaimer, which is this talk will include some fan-made stories using characters that are owned by Marvel or DC Comics.

2. Introduction to the Talk (Part 2)

Short description:

I'm putting this out there to help build the right mental models. I want to thank Attila and Matheus for their feedback on the mental models. This talk consists of presenting a topic and two characters, telling a comic book story, and then explaining the technical aspects. Today, we'll be exploring hydration with Iron Man. After building multiple armors by hand, Tony Stark reprogrammed his AI, Friday, to automate the process. Friday successfully built a new armor.

I'm putting this out of there so you're aware of the characters that you see. I do not own them, but I'm just using them to help build the right mental models on all of you.

Another thing that's important to say is I want to share some love. I want to thank these amazing people, Attila and the Matheus, because without them, this talk wouldn't be what it is today. They gave me the right feedback and the feedback on the mental models. So, I just want to share some love and thank them for building this talk, and helping me build this talk.

Now, before we start, how will this talk work? Well, ideally, if you were in person, you would be deciding. You see, this talk is going to be consisted by a couple of things. First, what happens is I present you with a topic and two characters. For each character, ideally, the audience would pick which character we'd be seeing. Then afterwards, for the selected character, I would tell you a comic book story. After we wrap up that story, I would show you the technical explanations behind. We'd start with the story and then go to the technical concept of it. Because today we are doing this online and it's not in person, I'll be picking only Marvel characters, so we'll go with the characters from Marvel.

In this talk, today, we'll be seeing two topics. We'll be seeing hydration and we'll be seeing reasonability. I hope you're ready to start because it's time for hydration. For hydration, like I said, if you would be picking, you would be able to choose between Iron Man or Lex Luthor. Both of them would help us see the story for hydration. For this scenario, considering, like I said, once again, we're remote, I'm picking Iron Man, so I just pick the character. And now I'll take the role of a narrator, and I'll tell you a story. And after the story ends, we'll see the technical aspects of it. So I hope you're ready, I'm ready. So, after building Mark 1, Mark 2, and Mark 3 by hand, Tony Stark didn't want to repeat the process of building a new armor by himself. You see, doing this is quite a slow process, and Tony wanted it to be faster, so he thought, maybe I can reprogram Friday, his custom AI, to know all the steps for building a new armor. And once he did so, all that was left was to ask Friday to build him that armor. And they did. So Friday plugged into the manufacturing and started to work. After a bit, the armor was ready. Great success.

3. Hydration with Iron Man

Short description:

Tony tried to get into the armor, but it didn't open. He had the idea to download Friday to power up the armor from the inside. After the download process, Friday powered up each part of the armor. With the armor powered up, Tony went for a test run, but not everything worked on the first try. This was Hydration with Iron Man, Tony Stark.

We are ready to fight, right? So Tony said, OK, let's get into the armor. And he tried to do so. So he tried to get into the armor, but apparently something didn't quite work out. The suit didn't even open. And this kind of left Tony to think, because sitting there with a non-interactive suit, Tony fought for a bit, until, well, an idea popped into his mind. What if I downloaded Friday to the armor, and then Friday could power up the armor from the inside? That would be interesting, right? So he did. And we waited, and we waited for a bit, and after the download process was completed, the new armor had Friday running on it. So once Friday started up, it started powering up each part of the armor as if it did a system check on it. As you can see on this very poor DidGif, you can see that the light is powering up on each part individually. So this was symbolizing the process of Friday going over each part of the armor and powering it on. And now that the armor is powered up, Tony was able to wear the suit and go for a test run. So, he powered up the thrusters, and well, not everything works out on the first try run, but this was Hydration with the help of Iron Man, Tony Stark, so hopefully if you're adding new Hydration, you'll pick up on some of the steps.

4. Hydration and How It Works

Short description:

Hydration solves the problem of server-side rendered code not being interactive. By downloading the framework and running the reconciliation process, the framework can interact with the HTML and attach event handlers, making the page interactive.

If you didn't, now let's recap what the heck we just saw. So, let's start with the problem. Hydration is there to solve one problem, which is server-side rendered code is not interactive. And ideally, what we need is a page that is interactive. So how it works typically is on the server, in the server-side code, using the framework, we generate our static HTML. But now, once we get the page, the page is not interactive because, well, it's just static HTML and CSS. So what we need to do is download Javascript, in this case, the framework, then run the framework and run what is called the reconciliation process. And after the reconciliation process runs, that's when the framework, the Javascript we just downloaded, goes over each part of the HTML and interacts and attaches event handlers and all the interactivity that we need. And after this bit, that's when we get the interactive page. And this is kind of how hydration works.

5. Hydration Recap and Introduction to Resumability

Short description:

So let's recap how this thing is set up on the story. We started with the issue of slow client-side rendering and the idea of teaching the framework how to build a page. The server builds new static HTML using the framework, and the client receives this static HTML. However, the page is not interactive yet. The client needs to wait for the framework to download and run the reconciliation process, attaching event handlers and logic to make the page fully interactive. This is hydration. Now, let's move on to the next story, Resumability, with Ironman.

So let's recap how this thing is set up on the story. So we started with this part, where Tony said that building a new armor should be faster. The issue that we were setting up here is that the client side rendering is slow. So what if we taught the framework how to build a page? Because well, ideally, the framework knows how to do it. On the server side, by using the framework, the server builds the new static HTML. And then, what is going to happen is that the client is going to get the static HTML.

Now, we set up another problem in the next part of the story, which is, now the server side rendered code is not interactive because we've got the armor, but the armor doesn't work. It's just there to show up. And this is what happens before hydration runs. So then, what we need to do is we're going to have the framework turn the static HTML into interactive HTML. So we need the framework to be downloaded into the page. So the client needs to wait for that to happen. After a bit, after the client gets the framework, the framework will go over the HTML and attach it backwards and all the logic needed to run every matching note. And, after a bit, congratulations, the page is now fully interactive.

And we just saw hydration with the help of Ironman, so let's just recap all the steps that we saw in this story and make sure we have the right mental model. So hydration is there to solve one problem, which is SSR code, server side rendered code, needs some sort of interactivity. The first step associated with this is usually when a client requests a page, using the framework the server builds new static HTML and sends it to the client and then the client gets this static HTML. But now there's one issue, which is the page is not interactive, so the client needs to wait for the framework to download. Once the framework downloads, the framework runs what is called the reconciliation process. So the framework will go over the HTML and attach event handlers and the logic needed to run every matching node. And after a while, the page is now fully interactive. And this was hydration. We just saw hydration with the help of Ironman. I hope you all enjoyed this story, because now we're going to jump for the next one, which is going to be Resumability. And Resumability is a different story, a different character. In this case we're going to use the same characters because we're going to pick up a bit after where we just left off. So we could pick from Ironman or from Lex Luthor, but like I said we're going the Marvel way for this talk, so let's go once again with Ironman. Now let's understand what Ironman has to tell us about Resumability. And now, once again, I'll put the narrator at and let's start this thing. So let's go.

6. Resumable Protocol and Building a New Suit

Short description:

After running out of armors, Tony Stark asks Friday to build him a new suit. However, he knows that the old process is not viable. He needs a suit that is ready to work. Tony instructs Friday to initiate the resumable protocol and build him a suit now.

After last saving the world against the fight against Kang, the Conqueror, Tony took a big hit. He completely ran out of armors, as they all got destroyed in this fight. Back home, as he was headed to bed, Tony asked Friday to remind him to build new suits tomorrow. And he fell asleep. Suddenly, an explosion happened. The Mandarin cannot let this slide. It's a vulnerable Tony Stark, after all. Tony woke up startled and shouted that he needed a new suit. But he also knew that he wouldn't survive the old process. The current process was not that good. Tony realized that he needed an armor that was ready to work. So he instructed Friday to initiate the resumable protocol and build him a suit now.

7. Resumable Protocol and the New Suit

Short description:

He knew he wouldn't survive the old process. Tony needed an armor that's ready to work, so he asked Friday to initiate the resumable protocol and build him a suit. Friday encoded information and instructions into each interactive part of the suit. When Tony was surrounded by the Mandarin and his goons, he jumped into his new suit, which had a small version of Friday uploaded. This allowed the suit to skip the boot/system check phase. Tony asked Friday to fire the rockets, and they successfully destroyed his house, allowing him to escape and call for backup. Stay tuned for the next issue!

He knew he wouldn't survive the old process. The current process, it's currently not that good. You could get the manufacturer running and have Friday building in Yharbor, but very much probably the time to download Friday to the suit would probably mean death or that he wouldn't survive. And this left Tony to think, OK, Tony, Tony, think, think, think.

And during this time, you could see some Hydra goons show up and chasing him. And this forced Tony to think, well, I need an armor that's ready to work. So probably Friday, do this thing, initiate resumable protocol, build me a suit now. And Friday started building the suit.

But now, the process changed. You see, for each specific part of the suit that would be interactive, Friday would encode this information there. Friday would also encode a pointer that would indicate itself where to find instructions to operate this part of the armor when the time arrives. Now, back to Tony, while he was running, he found himself surrounded by the Mandarin and his goons. And as you're usually used to in this type of movies or films or whatever, the Mandarin started this bad guy monologue. Stark, you don't think you'll make it out alive? At the end, he points his hand to Tony and ready to fire his disintegration beam. And as he does this, Tony jumps to his new billy suit and the suit catches him and saves him from a sure blast that would probably take him out.

Now, this made the Mandarin mad. You see, he knew about the weaknesses that the previous process had. He knew that there was no way that Tony would get an armor that fast and that ready to go. What happened? How? How did this work? You see, in the Resumable Protocol, when Friday created the armor, it already uploaded a very small version of itself to the suit. This small version of Friday was able to intercept any command from Tony and by using it and the encoded instructions, figure out on the fly how to execute its specific instruction. This would allow the armor to skip the boot slash system check phase. Now, back to Tony. Friday, fire the rockets, he asked. Well, inside of the helmet, as he asked this question, he heard Friday saying, Powering the rockets, Tony. Once the rockets were ready, and Friday let Tony know, Tony fired them up. Boom. And once he did so, the rockets collapsed Tony's house and everyone in the way. And this ensured that, well, Tony could escape and call for backup. What happened next, you might be thinking? Well, for that, you can wait for the next issue. Welcome to the world of comic books.

8. Resumability and QUIC Loader

Short description:

Resumability is there to solve the problem of the page not being immediately interactive. By encoding extra information into the HTML on the server side, we can resume execution from the server on the client, making the page immediately interactive. The client only downloads the specific JavaScript needed for each part of the code, allowing for a small and efficient download. The QUIC Loader intercepts events and downloads the necessary JavaScript for execution, making the page interactive. This is how resumability fits into our story.

Not everything gets solved in one week. So this was Resumability with the help of Tony Stark Iron Man. Now, let's just recap what we just saw. Resumability is there to solve one problem, which is the page is not immediately interactive. And during hydration, that what we just saw previously, we have to redo the work we did on the server. Ideally we could not have any hydration. No hydration is always better than having hydration. Ideally what we would do is, once we're building this HTML on the server side, we would encode some information, extra information there, that will allow us to resume our execution from the server on the client. This would mean that once we got the page on the client, the page would be immediately interactive.

Now, you might be thinking, okay, but if we don't download all the JavaScript and all the things that we need, how do we have the JavaScript to execute once we click on that button? Well, what we would do here is we would download only the specific JavaScript to do this, and only the JavaScript that would be responsible for this part of the code. Now, one of the frameworks that got very popular over using resumability, it's called QUIC, and there's a reason why I'm telling you this, because there's actually another part at Movilhood. Once we got the page or HTML, we would also get something called QUIC Loader, and this QUIC Loader would be responsible for intercepting this QUIC event, and would be responsible for downloading this specific JavaScript for that specific part. So it would just be a very, very small bit of JavaScript that would be able to allow us to do this thing.

So now, let's see how resumability fitted in our story. Well, first we had an issue, which was hydration is slow. So once the client requests a new page, we, using the framework, the server builds this new HTML, but it also serializes in all the information it needs to resume its execution in the new environment. Afterwards, once the client gets the page, it's immediately interactive. Now there's also something here, which is the client gets the QUIC Loader. Remember, I mentioned this thing called the QUIC Loader. The QUIC Loader will set up a global listener to all the events. So when an event happens, what the QUIC Loader will do is intercept it, get the JavaScript needing for executing that part, and runs it. And congratulations, we all just learned Resumability again with the help of our friend Ironman. So let's recap what we just saw. Resumability is there to set up, to fix one problem, which is the page is not immediately interactive and ideally there would be no iteration. So let's see the mental model steps. First one is once the client requests the page, using the framework the server builds the new HTML page and serializes in all the information that the page is going to need to resume its execution in the new environment. Once the client gets the page, it's immediately interactive. The client also gets this thing called the QUIC Loader, which is a very small bit of JavaScript. This QUIC Loader will set a global listener to all the events and because of what we just set up, once an event happens the QUIC Loader will intercept it and get the JavaScript needed for executing this event and run it. And well, this was pretty much resumability.

9. Conclusion and Call for Action

Short description:

We just covered the topics of iteration and resumability. If you enjoyed this talk, please suggest more topics for future nerdy guides. Thank you for watching and stay tuned for upcoming developments. This was a nerdy guide to web trending concepts. Thank you, React Summit. See you next time.

So let's go to the last slide here. So we just saw two topics, we just saw iteration, we just saw resumability and you might be thinking, okay, what is the next topic? Well, I would leave that out to you. That's the my call for action for everyone listening and watching this back at home. If you enjoyed this concept of this talk, please suggest me topics. I would love to build more nerdy guides for all of you. Because I have so much fun doing this thing and I had so much fun presenting it and hopefully all of you will enjoy it as well.

So without any further ado, thank you so much for watching this talk. Stay tuned for the next one because I'm pretty sure there's going to be developments from this, especially if you help me and contribute with new topics. Yeah, this was a nerdy guide to the web trending concepts. Thank you so much for having me, React Summit. See you next time.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a new web framework from the creators of React Router that helps you build better, faster websites through a solid understanding of web fundamentals. Remix takes care of the heavy lifting like server rendering, code splitting, prefetching, and navigation and leaves you with the fun part: building something awesome!
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Too much JavaScript is getting you down? New frameworks promising no JavaScript look interesting, but you have an existing React application to maintain. What if Qwik React is your answer for faster applications startup and better user experience? Qwik React allows you to easily turn your React application into a collection of islands, which can be SSRed and delayed hydrated, and in some instances, hydration skipped altogether. And all of this in an incremental way without a rewrite.
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
Interactive web-based tutorials have become a staple of front end frameworks, and it's easy to see why — developers love being able to try out new tools without the hassle of installing packages or cloning repos.But in the age of full stack meta-frameworks like Next, Remix and SvelteKit, these tutorials only go so far. In this talk, we'll look at how we on the Svelte team are using cutting edge web technology to rethink how we teach each other the tools of our trade.
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
We all love GraphQL, but it can be daunting to get a server up and running and keep your code organized, maintainable, and testable over the long term. No more! Come watch as I go from an empty directory to a fully fledged GraphQL API in minutes flat. Plus, see how easy it is to use and create directives to clean up your code even more. You're gonna love GraphQL even more once you make things Redwood Easy!
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Solid caught the eye of the frontend community by re-popularizing reactive programming with its compelling use of Signals to render without re-renders. We've seen them adopted in the past year in everything from Preact to Angular. Signals offer a powerful set of primitives that ensure that your UI is in sync with your state independent of components. A universal language for the frontend user interface.
But what about Async? How do we manage to orchestrate data loading and mutation, server rendering, and streaming? Ryan Carniato, creator of SolidJS, takes a look at a different primitive. One that is often misunderstood but is as powerful in its use. Join him as he shows what all the Suspense is about.
React Summit Remote Edition 2021React Summit Remote Edition 2021
43 min
RedwoodJS: The Full-Stack React App Framework of Your Dreams
Top Content
Tired of rebuilding your React-based web framework from scratch for every new project? You're in luck! RedwoodJS is a full-stack web application framework (think Rails but for JS/TS devs) based on React, Apollo GraphQL, and Prisma 2. We do the heavy integration work so you don't have to. We also beautifully integrate Jest and Storybook, and offer built-in solutions for declarative data fetching, authentication, pre-rendering, logging, a11y, and tons more. Deploy to Netlify, Vercel, or go oldschool on AWS or bare metal. In this talk you'll learn about the RedwoodJS architecture, see core features in action, and walk away with a sense of wonder and awe in your heart.

Workshops on related topic

JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Node Congress 2021Node Congress 2021
128 min
Learn Fastify One Plugin at a Time
Workshop
Fastify is an HTTP framework for Node.js that focuses on providing a good developer experience without compromising on performance metrics. What makes Fastify special are not its technical details, but its community which is wide open for contributions of any kind. Part of the secret sauce is Fastify plugin architecture that enabled developers to write more than a hundred plugins.This hands-on workshop is structured around a series of exercises that covers from basics "hello world", to how to structure a project, perform database access and authentication.

https://github.com/nearform/the-fastify-workshop
JSNation 2023JSNation 2023
66 min
Build a Universal Reactive Data Library with Starbeam
WorkshopFree
This session will focus on Starbeam's universal building blocks. We'll use Starbeam to build a data library that works in multiple frameworks.We'll write a library that caches and updates data, and supports relationships, sorting and filtering.Rather than fetching data directly, it will work with asynchronously fetched data, including data fetched after initial render. Data fetched and updated through web sockets will also work well.All of these features will be reactive, of course.Imagine you filter your data by its title, and then you update the title of a record to match the filter: any output relying on the filtered data will update to reflect the updated filter.In 90 minutes, you'll build an awesome reactive data library and learn a powerful new tool for building reactive systems. The best part: the library works in any framework, even though you don't think about (or depend on) any framework when you built it.
Table of contents- Storing a Fetched Record in a Cell- Storing multiple records in a reactive Map- Reactive iteration is normal iteration- Reactive filtering is normal filtering- Fetching more records and updating the Map- Reactive sorting is normal sorting (is this getting a bit repetitive?)- Modelling cache invalidation as data- Bonus: reactive relationships
React Advanced Conference 2022React Advanced Conference 2022
81 min
Build a Product Page with Shopify’s Hydrogen Framework
WorkshopFree
Get hands on with Hydrogen, a React-based framework for building headless storefronts. Hydrogen is built for Shopify commerce with all the features you need for a production-ready storefront. It provides a quick start, build-fast environment so you can focus on the fun stuff - building unique commerce experiences. In this workshop we’ll scaffold a new storefront and rapidly build a product page. We’ll cover how to get started, file-based routing, fetching data from the Storefront API, Hydrogen’s built-in components and how to apply styling with Tailwind.You will know:- Get started with the hello-world template on StackBlitz- File-based routing to create a /products/example route- Dynamic routing /products/:handle- Hit the Storefront API with GraphQL- Move the query into the Hydrogen app- Update the query to fetch a product by handle- Display title, price, image & description.- Tailwind styling- Variant picker and buy now button- Bonus if there’s time: Collections page
Prerequisites: - A Chromium-based browser (StackBlitz)- Ideally experience with React. A general web development background would be fine.