Upgrade to Pro — share decks privately, control downloads, hide ads and more …

🇳🇱 Frontmania 2024

🇳🇱 Frontmania 2024

Hydration, Islands, Streaming, Resumability… Oh My!

Our ecosystem can be overwhelming! First, we had the rise of SSR and SSG—and each had its own gigantic pile of frameworks and tools. Then partial hydration enabled us to hydrate only some of our components on the client, which we've seen in React Server Components.

But what about islands? Do they relate at all to Streaming SSR? Moreover, what is resumability, and why do I keep hearing about it? […] Oh, did anyone say rendering on the Edge?

Well… There are many approaches out there, and all of them argue that their philosophy is best. In this session, we’ll go over these architecture/rendering patterns, to help shed some light on how some are implemented and the concepts behind them.

Matheus Albuquerque

October 10, 2024
Tweet

More Decks by Matheus Albuquerque

Other Decks in Programming

Transcript

  1. HOW AND WHERE DO I WANT TO RENDER CONTENT? web

    server build server the client the Edge
  2. HOW AND WHERE DO I WANT TO RENDER CONTENT? web

    server build server the client the Edge all at once partially progressively
  3. HOW AND WHERE DO I WANT TO RENDER CONTENT? web

    server build server the client the Edge all at once partially progressively Where do you navigate? What is executed on load? When is data fetched? What do you bundle/serialize?
  4. CGI SCRIPTING LANGUAGES ↝ LANGUAGES LIKE PERL AND PHP ALLOWED

    DEVELOPERS TO RENDER BACKEND DATA SOURCES INTO HTML. ↝ DEVELOPERS WERE NOW ABLE TO BUILD DYNAMIC SITES AND SERVE REAL-TIME DATA, OR DATA FROM A DATABASE TO AN END USER.
  5. CGI SCRIPTING LANGUAGES ↝ THESE WORKED ON THE SERVER BECAUSE

    SERVERS WERE THE POWERFUL PART OF THE NETWORK. ↝ THE BROWSER'S JOB WAS LIMITED: INTERPRETING THE DOCUMENT AND SHOWING THE PAGE. ↝ THIS SOLUTION WAS ALL ABOUT SHOWING INFORMATION, NOT INTERACTING WITH IT.
  6. #eureka 💡 JavaScript and browsers got powerful = we could

    do a ton of fun things directly on the client.
  7. CSR: CLIENT SIDE RENDERING ↝ YOU DON’T HAVE TO GO

    BACK TO THE SERVER FOR MORE REQUESTS. ↝ YOU CAN CACHE THE CORE HTML AND JS BUNDLES ON A CDN. ↝ AS THE WEB GOT MORE INTERACTIVE, CSR AND SPAS BECAME DEFAULT.
  8. #gotcha 🥸 We now had to be mindful of how

    our apps would render on a phone on a bus in the city center. — THE FUTURE (AND THE PAST) OF THE WEB IS SERVER SIDE RENDERING, BY ANDY JIANG
  9. — THE FUTURE (AND THE PAST) OF THE WEB IS

    SERVER SIDE RENDERING, BY ANDY JIANG #eureka 💡 We now had to be mindful of how our apps would render on a phone on a bus in the city center. Back to the server! 🏃
  10. SSR: SERVER SIDE RENDERING ↝ HTML IS READY TO BE

    DISPLAYED WHEN THE PAGE IS LOADED = HIGHER PERFORMANCE. ↝ HTML IS NOT DEPENDENT ON THE END BROWSER = HIGHER COMPATIBILITY. ↝ FOR INTERACTIVE WEBSITES, WE STILL NEED TO SEND JS (HYDRATION).
  11. #definition 🧐 Hydration is the process of attaching behavior to

    declarative content to make it interactive. — WHY PROGRESSIVE HYDRATION IS HARDER THAN YOU THINK, BY MIŠKO HEVERY
  12. HYDRATION: CHALLENGES ↝ ASSOCIATE DOM ELEMENTS WITH THEIR CORRESPONDING EVENT

    HANDLERS. ↝ ONCE A USER EVENT TRIGGERS A HANDLER, WE NEED TO UPDATE THE STATE. ↝ ONCE THE STATE UPDATES, THE FRAMEWORK NEEDS TO RECREATE THE COMPONENT HIERARCHY. 🤯
  13. HYDRATION: QUESTIONS ↝ DO WE SEND ALL JS ON EVERY

    REQUEST? OR DO WE BASE IT ON THE ROUTE? ↝ IS HYDRATION DONE TOP-DOWN? AND HOW EXPENSIVE IS THAT? ↝ HOW DOES THE DEVELOPER ORGANIZE THE CODE BASE? 🤯
  14. HYDRATION: ISSUES INITIAL REQUEST HTML ARRIVES VIEW PAINTED JAVASCRIPT ARRIVES

    JAVASCRIPT IS PARSED — RESUMABILITY, WTF? • RYAN CARNIATO 0
  15. HYDRATION: ISSUES GET HTML DOWNLOAD JS PARSE + EXECUTE JS

    RECOVER STATE + BIND LISTENERS 🟢 FAST (USUALLY)
  16. HYDRATION: ISSUES GET HTML DOWNLOAD JS PARSE + EXECUTE JS

    RECOVER STATE + BIND LISTENERS 🔴 SLOW (ON BAD NETWORK CONDITIONS)
  17. HYDRATION: ISSUES GET HTML DOWNLOAD JS PARSE + EXECUTE JS

    RECOVER STATE + BIND LISTENERS 🔴 SLOW (DEPENDING ON THE DEVICE AND AMOUNT OF JAVASCRIPT)
  18. HYDRATION: ISSUES RECOVER STATE + BIND LISTENERS 🔴 SLOW (DEPENDING

    ON THE AMOUNT OF DOM NODES TO BE TRAVERSED AND REFERENCES TO BE RE-BOUND TO LISTENERS) GET HTML DOWNLOAD JS PARSE + EXECUTE JS
  19. Islands Architecture 1993 1998 2008 2017 2020 2021 2022 2023

    2024 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  20. #definition 🧐 Islands are a component-based architecture that suggests a

    compartmentalized view of the page with static and dynamic islands. — ISLANDS ARCHITECTURE, BY PATTERNS.DEV
  21. ISLANDS ARCHITECTURE ↝ SELECTIVELY, PROGRESSIVELY ENHANCING BITS OF SERVER-RENDERED HTML

    WITH CLIENT-SIDE JS. ↝ SMALL, FOCUSED, CHUNKS OF INTERACTIVITY WITHIN SERVER-RENDERED WEB PAGES. ↝ SINGLE APPLICATION IN CONTROL OF FULL-PAGE RENDERING → MULTIPLE ENTRY POINTS.
  22. ISLANDS ARCHITECTURE ↝ THE SCRIPT FOR THE ISLANDS CAN BE

    DELIVERED AND HYDRATED INDEPENDENTLY, ALLOWING THE REST OF THE PAGE TO BE JUST STATIC HTML. ↝ MORE SPECIFICITY AROUND HOW THE ENHANCEMENT OCCURS.
  23. HYDRATION vs. ISLANDS POST TITLE POST CONTENT COMMENTS SOCIAL CTA

    POST TITLE POST CONTENT COMMENTS SOCIAL CTA POST TITLE (STATIC HTML) POST CONTENT (STATIC HTML) COMMENTS SOCIAL CTA RENDER ALL COMPONENTS TOGETHER AND HYDRATE. RENDER ALL COMPONENTS, HYDRATE KEY ONES FIRST AND THEN PROGRESSIVELY HYDRATE THE OTHERS. STATIC COMPONENTS ARE SERVER-RENDERED HTML. SCRIPTS ARE REQUIRED ONLY FOR INTERACTIVE ONES. TRADITIONAL HYDRATION PROGRESSIVE HYDRATION ISLANDS
  24. HYDRATION vs. ISLANDS POST TITLE POST CONTENT COMMENTS SOCIAL CTA

    POST TITLE POST CONTENT COMMENTS SOCIAL CTA POST TITLE (STATIC HTML) POST CONTENT (STATIC HTML) COMMENTS SOCIAL CTA RENDER ALL COMPONENTS TOGETHER AND HYDRATE. RENDER ALL COMPONENTS, HYDRATE KEY ONES FIRST AND THEN PROGRESSIVELY HYDRATE THE OTHERS. STATIC COMPONENTS ARE SERVER-RENDERED HTML. SCRIPTS ARE REQUIRED ONLY FOR INTERACTIVE ONES. TRADITIONAL HYDRATION PROGRESSIVE HYDRATION ISLANDS
  25. HYDRATION vs. ISLANDS POST TITLE POST CONTENT COMMENTS SOCIAL CTA

    POST TITLE POST CONTENT COMMENTS SOCIAL CTA POST TITLE (STATIC HTML) POST CONTENT (STATIC HTML) COMMENTS SOCIAL CTA RENDER ALL COMPONENTS TOGETHER AND HYDRATE. RENDER ALL COMPONENTS, HYDRATE KEY ONES FIRST AND THEN PROGRESSIVELY HYDRATE THE OTHERS. STATIC COMPONENTS ARE SERVER-RENDERED HTML. SCRIPTS ARE REQUIRED ONLY FOR INTERACTIVE ONES. TRADITIONAL HYDRATION PROGRESSIVE HYDRATION ISLANDS
  26. ISLANDS ARCHITECTURE PAGE LAYOUT (SSR’D) POST TITLE (SSR'D) POST CONTENT

    (SSR’D) COMMENTS PLACEHOLDER (SSR) SOCIAL CTA PLACEHOLDER (SSR) COMMENTS “APP” (SSR’D + HYDRATION SCRIPT) SOCIAL CTA “APP” (SSR’D + HYDRATION SCRIPT)
  27. ISLANDS ARCHITECTURE PAGE LAYOUT (SSR’D) POST TITLE (SSR'D) POST CONTENT

    (SSR’D) COMMENTS PLACEHOLDER (SSR’D) SOCIAL CTA PLACEHOLDER (SSR’D) COMMENTS “APP” (SSR’D + HYDRATION SCRIPT) SOCIAL CTA “APP” (SSR’D + HYDRATION SCRIPT)
  28. ISLANDS ARCHITECTURE ↝ STANDALONE: Astro, Qwik, Marko, Iles, Capri. ↝

    PREACT: Fresh, preact-island, microsite. ↝ SOLIDJS: Solid Start, isolid. ↝ SVELTE: Elder.js.
  29. ISLANDS ARCHITECTURE: MARKO ↝ STREAMING RENDERING + AUTOMATIC PARTIAL HYDRATION

    + COMPILER. ↝ AUTOMATIC PARTIAL HYDRATION ALLOWS INTERACTIVE COMPONENTS TO HYDRATE THEMSELVES. ↝ HYDRATION CODE IS ONLY SHIPPED FOR INTERACTIVE COMPONENTS. 🤯
  30. ISLANDS ARCHITECTURE: ASTRO ↝ BY DEFAULT, SHIPS ZERO JAVASCRIPT. ↝

    EVERY ISLAND IS LOADED IN PARALLEL. ↝ MULTI-FRAMEWORK: BUILD ISLANDS WITH REACT, PREACT, SVELTE, VUE, AND OTHERS. ↝ YOU CAN SPECIFY THE LOADING STRATEGY FOR EACH ISLAND INDIVIDUALLY.
  31. ISLANDS ARCHITECTURE: ASTRO - - - import MyReactComponent from '

    . . /components/MyReactComponent.jsx'; - - - <MyReactComponent />
  32. ISLANDS ARCHITECTURE: ASTRO - - - import MyReactComponent from '

    . . /components/MyReactComponent.jsx'; - - - <MyComponent client:load /> <MyComponent client:idle /> <MyComponent client:visible /> <MyComponent client:media={string} /> <MyComponent client:only={string} />
  33. ISLANDS ARCHITECTURE 🟢 REDUCES THE AMOUNT OF JAVASCRIPT CODE SHIPPED

    TO THE CLIENT 🟢 FASTER PAGE LOADS AND TIME TO INTERACTIVE (TTI) 🟢 KEY CONTENT IS AVAILABLE ALMOST IMMEDIATELY TO THE USER 🟢 STATIC CONTENT IS RENDERED ON THE SERVER = PAGES ARE SEO-FRIENDLY GREAT 🟡 HIGHLY INTERACTIVE PAGES WOULD PROBABLY REQUIRE THOUSANDS OF ISLANDS NOT GREAT
  34. ISLANDS ARCHITECTURE 🟢 REDUCES THE AMOUNT OF JAVASCRIPT CODE SHIPPED

    TO THE CLIENT 🟢 FASTER PAGE LOADS AND TIME TO INTERACTIVE (TTI) 🟢 KEY CONTENT IS AVAILABLE ALMOST IMMEDIATELY TO THE USER 🟢 STATIC CONTENT IS RENDERED ON THE SERVER = PAGES ARE SEO-FRIENDLY GREAT 🟡 HIGHLY INTERACTIVE PAGES WOULD PROBABLY REQUIRE LOTS OF ISLANDS NOT GREAT
  35. Resumability 1993 1998 2008 2017 2020 2021 2022 2023 2024

    HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  36. #hotTake 🌶 A considerable part of the modern isomorphic landscape

    is built on the back of libraries that weren't initially created for server rendering.
  37. #definition 📖 Resumability is about pausing execution in the server

    and resuming execution in the client without having to replay and download all of the application logic. — RESUMABLE VS. HYDRATION, QWIK
  38. RESUMABILITY ↝ SOME WORK → PAUSE → RESUME. ↝ USE

    WHAT HAPPENED DURING THE EXECUTION ON THE SERVER AND AVOID EXTRA WORK WHEN THE APPLICATION STARTS IN THE BROWSER. ↝ ATTACHES GLOBAL EVENT HANDLERS AT STARTUP AND THEN ONLY RUNS THE NECESSARY CODE ON INTERACTION.
  39. HYDRATION vs. RESUMABILITY ↝ EVENT HANDLER CREATION HAPPENS BEFORE THE

    EVENT IS TRIGGERED (EAGER) ↝ ALL POSSIBLE EVENT HANDLERS ARE CREATED AND REGISTERED (SPECULATIVE) ↝ CLIENT REDOES WORK ↝ REQUIRES THE FRAMEWORK TO DOWNLOAD AND EXECUTE THE COMPONENTS TO FIGURE OUT HIERARCHY HYDRATION ↝ EVENT HANDLER CREATION HAPPENS AFTER THE EVENT IS TRIGGERED (LAZY) ↝ ONLY TRIGGERED EVENTS ARE CREATED AND REGISTERED (AS-NEEDED) ↝ CLIENT DOESN'T REDO WORK (VIA DESERIALIZATION) ↝ REQUIRES ALL THE INFORMATION TO BE SERIALIZED IN THE HTML RESUMABILITY
  40. HYDRATION vs. RESUMABILITY ↝ EVENT HANDLER CREATION HAPPENS BEFORE THE

    EVENT IS TRIGGERED (EAGER) ↝ ALL POSSIBLE EVENT HANDLERS ARE CREATED AND REGISTERED (SPECULATIVE) ↝ CLIENT REDOES WORK ↝ REQUIRES THE FRAMEWORK TO DOWNLOAD AND EXECUTE THE COMPONENTS TO FIGURE OUT HIERARCHY HYDRATION ↝ EVENT HANDLER CREATION HAPPENS AFTER THE EVENT IS TRIGGERED (LAZY) ↝ ONLY TRIGGERED EVENTS ARE CREATED AND REGISTERED (AS-NEEDED) ↝ CLIENT DOESN'T REDO WORK (VIA DESERIALIZATION) ↝ REQUIRES ALL THE INFORMATION TO BE SERIALIZED IN THE HTML RESUMABILITY
  41. ISLANDS VS. RESUMABILITY 🤯 ↝ CLIENT REDOES WORK ↝ ISLAND-LEVEL

    ISLANDS ↝ CLIENT DOESN'T REDO WORK ↝ SUB-COMPONENT LEVEL (SMALLER) RESUMABILITY
  42. RESUMABILITY 🟢 STARTUP PERFORMANCE 🟢 RENDERING PERFORMANCE (ONLY CHANGED COMPONENTS

    NEED TO BE RE-RENDERED) 🟢 FINE-GRAINED LAZY-LOADING 🟢 PROGRESSIVE INTERACTIVITY GREAT 🟡 *PRELOAD CRITICAL PAGE INTERACTIONS 🟡 THE ONLY OPTION FOR DEVELOPERS TO LEVERAGE RESUMABILITY IS TO USE QWIK 🟡 TOO LITTLE DISCUSSION AVAILABLE ON THE IDEA NOT GREAT
  43. RESUMABILITY 🟢 STARTUP PERFORMANCE 🟢 RENDERING PERFORMANCE (ONLY CHANGED COMPONENTS

    NEED TO BE RE-RENDERED) 🟢 FINE-GRAINED LAZY-LOADING 🟢 PROGRESSIVE INTERACTIVITY GREAT 🟡 *PRELOAD CRITICAL PAGE INTERACTIONS 🟡 THE ONLY* OPTION FOR DEVELOPERS TO LEVERAGE RESUMABILITY IS TO USE QWIK 🟡 TOO LITTLE DISCUSSION AVAILABLE ON THE IDEA NOT GREAT
  44. #hotTake 🌶 Qwik is an example of the outside of

    the box thinking that is sometimes required on the web.
  45. Streaming SSR + Selective Hydration 1993 1998 2008 2017 2020

    2021 2022 2023 2024 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  46. HYDRATION IN REACT: BEFORE ↝ HYDRATION COULD ONLY BEGIN AFTER

    THE ENTIRE DATA WAS FETCHED AND RENDERED. ↝ USERS COULDN’T INTERACT WITH THE PAGE UNTIL HYDRATION WAS COMPLETE FOR THE WHOLE PAGE. ↝ PARTS OF YOUR APP THAT LOAD FAST WOULD ALWAYS HAVE TO WAIT FOR THE SLOW ONES.
  47. HYDRATION IN REACT: BEFORE FETCHING DATA (SERVER) RENDERING HTML (SERVER)

    LOADING CODE (CLIENT) HYDRATING TIME TO FIRST BYTE FIRST CONTENTFUL PAINT TIME TO INTERACTIVE
  48. HYDRATION IN REACT: AFTER TIME TO FIRST BYTE FIRST CONTENTFUL

    PAINT TIME TO INTERACTIVE […] FETCHING DATA (SERVER) RENDERING HTML (SERVER) HYDRATING LOADING CODE (CLIENT) […] […] […] […] […] […]
  49. HYDRATION IN REACT: AFTER ↝ REACT PRIORITIZES HYDRATING THE PARTS

    THAT THE USER INTERACTED WITH BEFORE THE REST. ↝ COMPONENTS CAN BECOME INTERACTIVE FASTER BY ALLOWING THE BROWSER TO DO OTHER WORK AT THE SAME TIME AS HYDRATION.
  50. HYDRATION IN REACT: AFTER ↝ REACT WON'T WAIT FOR HUGE

    COMPONENTS TO LOAD TO CONTINUE STREAMING HTML FOR THE REST OF THE PAGE. ↝ WHEN THE HTML BECOMES AVAILABLE ON THE SERVER, IT WILL BE ADDED TO THE SAME STREAM ALONG WITH A SCRIPT TAG AND INSERTED IN THE RIGHT PLACE.
  51. React Server Components 1993 1998 2008 2017 2020 2021 2022

    2023 2024 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  52. RSC: SERVER COMPONENTS ↝ COMPONENTS THAT RUN EXCLUSIVELY ON THE

    SERVER. ↝ THEY RENDER ONCE ON THE SERVER TO GENERATE UI. THEY NEVER HYDRATE OR RE-RENDER. ↝ THEIR CODE ISN'T INCLUDED IN THE JS BUNDLE. ↝ THE RENDERED OUTPUT IS SENT TO THE CLIENT AND REMAINS IMMUTABLE.
  53. RSC: PARADIGM ↝ THE CLASSIC COMPONENTS WE KNOW ARE NOW

    CLIENT COMPONENTS. ↝ AHEAD-OF-TIME REACT RENDERING (DURING THE BUILD OR ON THE SERVER). ↝ A ROUTING PARADIGM INTEGRATED WITH DATA FETCHING AND BUNDLING. ↝ UNRELATED TO SSR/HYDRATION.
  54. RSC: PARADIGM ↝ ALMOST IDENTICAL TO HOW ISLANDS WORK. ↝

    “use client” MARKS A BOUNDARY BETWEEN TWO MODULE GRAPHS. ↝ EACH COMPONENT DECIDES WHETHER TO BE A SERVER COMPONENT OR TO STICK WITH BEING A SERVER + CLIENT COMPONENT.
  55. RSC: CLIENT COMPONENTS 'use client'; import React from 'react'; function

    Counter() { const [count, setCount] = React.useState(0); return ( <button onClick={() = > setCount(count + 1)}> Current value: {count} </button> ); } export default Counter;
  56. RSC: BOUNDARIES APP HEADER PAGE LAYOUT POST POST TITLE POST

    CONTENT COMMENTS SOCIAL CTA 'use client' 'use client'
  57. RSC: BOUNDARIES APP HEADER PAGE LAYOUT POST POST TITLE POST

    CONTENT COMMENTS SOCIAL CTA 'use client'
  58. RSC: BENEFITS ↝ THE CODE FOR SERVER COMPONENTS IS NEVER

    DELIVERED TO THE CLIENT. ↝ ACCESS TO THE BACK-END FROM THE TREE. ↝ MAY BE REFETCHED WHILE MAINTAINING CLIENT-SIDE STATE INSIDE OF THE TREE.
  59. REACT SERVER COMPONENTS 🟡 WHILE OUR JS BUNDLES GET SMALLER,

    THE HTML FILE GETS LARGER 🟡 MUCH MORE ORCHESTRATION NEEDED 🟡 STILL EXPERIMENTAL 🟡 THERE ISN'T MUCH TOOLING YET 🟡 ONLY FEW OPTIONS FOR DEVELOPERS TO LEVERAGE RSC NOT GREAT 🟢 THE CODE FOR SERVER COMPONENTS IS NEVER DELIVERED TO THE CLIENT 🟢 ACCESS TO THE BACK-END FROM THE TREE 🟢 MAY BE REFETCHED WHILE MAINTAINING CLIENT-SIDE STATE INSIDE OF THE TREE GREAT
  60. CODE EXTRACTION: PRIOR ART < ! - - Database, file,

    and socket access from JavaScript - - > <script runat="server"> var resultSet = Jaxer.DB.execute("SELECT * FROM myTable"); var newPrice = resultSet.rows[0].price; </script> < ! - - Directly call server-side functions from the browser - - > <script runat="server-proxy"> function getPriceFromServer() { return 42; } </script> <button onclick="alert(getPriceFromServer())">Price</button> < ! - - Share validation code on the browser and server - - > <script runat="both"> function validateCreditCard(number) {} </script>
  61. CODE EXTRACTION: PRIOR ART < ! - - Database, file,

    and socket access from JavaScript - - > <script runat="server"> var resultSet = Jaxer.DB.execute("SELECT * FROM myTable"); var newPrice = resultSet.rows[0].price; </script> < ! - - Directly call server-side functions from the browser - - > <script runat="server-proxy"> function getPriceFromServer() { return 42; } </script> <button onclick="alert(getPriceFromServer())">Price</button> < ! - - Share validation code on the browser and server - - > <script runat="both"> function validateCreditCard(number) {} </script>
  62. Partial Prerendering 1993 1998 2008 2017 2020 2021 2022 2023

    2024 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  63. PARTIAL PRERENDERING: NEXT experimental: { ppr: true } <Suspense fallback={<LoadingDots

    />}> <UserSpecificDetails productId={product.id} /> </Suspense>
  64. PARTIAL PRERENDERING ↝ AN EXPERIMENTAL FEATURE IN NEXT.JS. ↝ AIMS

    TO IMPROVE THE LOADING SPEED FOR PAGES WITH MOSTLY STATIC CONTENT + A FEW DYNAMIC PARTS. ↝ STATIC SHELL SERVED QUICKLY FROM THE EDGE. ↝ PLACEHOLDERS LEFT FOR DYNAMIC CONTENT.
  65. PARTIAL PRERENDERING PAGE LAYOUT NAVBAR PRODUCT INFORMATION RECOMMENDED PRODUCTS CART

    RENDERS ALL THE STATIC CONTENT INSTANTLY FROM THE EDGE
  66. PARTIAL PRERENDERING PAGE LAYOUT NAVBAR PRODUCT INFORMATION RECOMMENDED PRODUCTS CART

    WHILE THE PAGE LOADS (STYLES, SCRIPTS, ETC) RENDER THE REST FOR EACH USER, DYNAMICALLY
  67. PARTIAL PRERENDERING BUILD TIME STATIC SHELL CDN USER REQ EDGE

    SERVER BROWSER DYNAMIC CONTENT STATIC CONTENT VISIBLE FULLY RENDERED PAGE GENERATE DYNAMIC CONTENT GENERATE STATIC CONTENT DEPLOY ROUTE TO THE NEAREST SERVE STATIC SHELL STREAM
  68. PARTIAL PRERENDERING BUILD TIME STATIC SHELL CDN USER REQ EDGE

    SERVER BROWSER DYNAMIC CONTENT STATIC CONTENT VISIBLE FULLY RENDERED PAGE GENERATE DYNAMIC CONTENT GENERATE STATIC CONTENT DEPLOY ROUTE TO THE NEAREST SERVE STATIC SHELL STREAM
  69. Server Islands 1993 1998 2008 2017 2020 2021 2022 2023

    2024 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  70. HYDRATION STREAMING ISLANDS RESUMABILITY SELECTIVE HYDRATION RSC CSR SSR STATIC

    RENDERING INCREMENTAL STATIC GENERATION PROGRESSIVE HYDRATION VIEW TRANSITIONS EDGE RENDERING SPA MPA PARTIAL HYDRATION
  71. HYDRATION STREAMING ISLANDS RESUMABILITY SELECTIVE HYDRATION RSC CSR SSR STATIC

    RENDERING INCREMENTAL STATIC GENERATION PROGRESSIVE HYDRATION VIEW TRANSITIONS EDGE RENDERING SPA MPA PARTIAL HYDRATION
  72. CODE EXTRACTION import json from "./foo.json" with { type: "json"

    }; import ComponentA from "./A" with { type: "client" } import ComponentB from "./B" with { type: "both" }
  73. WHY SOMETHING IS THE FUTURE ROUTING MPAs vs. SPAs CODE

    EXTRACTION OKB JAVASCRIPT REACTIVITY HYDRATION COMPILERS
  74. THE SOLUTION TO THE PROBLEM ONLY CHANGES THE PROBLEM. #1

    of 8 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  75. WHILE SEEN AS COMPETITIVE, A LOT OF THESE ARE ACTUALLY

    COMPLEMENTARY! — RYAN CARNIATO #2 of 8 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  76. COMPETITIVE COMPLEMENTARY 🏝 ISLANDS 🏝 REDUCE JAVASCRIPT FOOTPRINT BY EXPLICITLY

    DENOTING WHAT GOES TO THE CLIENT. 🏝 INCREDIBLY OPTIMAL AT SOLVING FOR CODE AND DATA SERIALIZATION SIZE. ⚛ EXTE PROP ⚛ THE ACCO — ISLANDS & SERVER COMPONENTS & RESUMABILITY, OH MY! • RYAN CARNIATO
  77. COMPETITIVE COMPLEMENTARY ⚛ SERVER COMPONENTS ⚛ EXTEND ISLANDS WITH CLIENT-SIDE

    ROUTING AND PROPER STATE PRESERVATION. ⚛ THE ONLY ISLAND-LIKE SOLUTION THAT PROPERLY ACCOUNTS FOR THE STATE WHILE CLIENT-NAVIGATING. ▶ INST LOOK ▶ THE HYDR — ISLANDS & SERVER COMPONENTS & RESUMABILITY, OH MY! • RYAN CARNIATO
  78. COMPETITIVE COMPLEMENTARY ▶ RESUMABILITY ▶ INSTEAD OF REDUCING THE AMOUNT

    THAT IS HYDRATED, LOOKS TO REMOVE THE EXECUTION COST OF HYDRATION. ▶ THE ONLY APPROACH THAT REDUCES THE COST OF THE HYDRATION THAT REMAINS. — ISLANDS & SERVER COMPONENTS & RESUMABILITY, OH MY! • RYAN CARNIATO
  79. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / THE SAME PATTERN

    CAN BE BENEFICIAL AND DETRIMENTAL. IT IS ALSO QUITE LIKELY THAT DIFFERENT TYPES OF PAGES REQUIRE DIFFERENT RENDERING PATTERNS ON THE SAME WEBSITE. #3 of 8
  80. APPLICATION HOLOTYPES Portfolio Content Storefront Social Network I m m

    ersive Holotype Personal Blog CNN Amazon Facebook Figma Interactivity Minimal Linked Articles Purchase Multi-Point, Real-time Everything Session Depth Shallow Shallow Shallow - Medium Extended Deep Values Simplicity Discover-ability Load Performance Dynamicism I m m ersiveness Routing Server Server, HTML Swap HTML Swap, Hybrid Hybrid, Client Client Rendering Static Static, SSR Static, SSR SSR CSR Hydration None Progressive, Partial Partial, Resumable Any None (CSR) Frameworks 11ty Astro, Elder Marko, Qwik, Hydrogen Next, Remix Create React App — PATTERNS FOR BUILDING JAVASCRIPT WEBSITES IN 2022, BY RYAN CARNIATO
  81. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / IT'S EASY TO

    THINK WE'RE JUST GOING BACK TO RENDERING HTML ON THE SERVER. BUT THESE DAYS THE BOUNDARIES ARE VERY DIFFERENT! #4 of 8
  82. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / SOFTWARE DEVELOPMENT CONTINUALLY

    GOES THROUGH CYCLES. WHAT’S DIFFERENT NOW? WHAT’S TURNED INTO LOST ART? #5 of 8
  83. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / IT ALL SOUNDS

    INCREDIBLY COMPLEX! WE'RE ADDRESSING THE UNCERTAINTIES OF THE MODERN WEB WHEN IT COMES TO CONNECTION QUALITY AND CLIENT DEVICE COMPUTATIONAL CAPABILITY. #6 of 8
  84. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / #6 of 8

    IT ALL SOUNDS INCREDIBLY COMPLEX! YOU DON’T NEED TO KNOW ALL OF THAT TO BE PRODUCTIVE WHEN BUILDING USER INTERFACES.
  85. HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! / THERE'S NO SILVER

    BULLET. IDENTIFY YOUR CORE METRICS. ALWAYS TRY TO CORRELATE BUSINESS METRICS WITH PERFORMANCE. #7 of 8
  86. A PICTURE IS WORTH A THOUSAND WORDS! #8 of 8

    HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /
  87. This is me, ten years ago, presenting about Ionic at

    an iOS developers meetup telling them it'd be the future of mobile development!
  88. #8 of 8 HYDRATION, ISLANDS, STREAMING, RESUMABILITY… OH MY! /

    A PICTURE IS WORTH A THOUSAND WORDS! DON'T ALWAYS TRUST SPECULATIONS AND PREDICTIONS!
  89. Matheus Albuquerque ↝ 👨💻 Staff SWE @ Medallia ↝ ⚡

    Google Developer Expert ↝ 𝕏 ythecombinator