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

🇨🇿 PragueJS 2024 #3

🇨🇿 PragueJS 2024 #3

A Decade: React’s Rhapsody of Life

Join me in celebrating the decade-long journey of React—a framework that has revolutionized front-end development.

Despite all the initial skepticism around aspects like JSX, it became one of our favorite tools. We'll explore this and other "trouble in paradise” moments!

Looking ahead, we'll discuss ongoing efforts like the Activity component, optimistic state updates, and more advanced stuff, like the optimization compiler and the recent improvements to React Native's JS engine.

Let's embrace a decade of React and the endless possibilities it holds!

Matheus Albuquerque

March 26, 2024
Tweet

More Decks by Matheus Albuquerque

Other Decks in Programming

Transcript

  1. A DECADE: REACT’S RHAPSODY OF LIFE / Matheus Albuquerque ↝

    𝕏 ythecombinator ↝ 👨💻 Sr. SWE @ Medallia ↝ ⚡ Google Developer Expert ↝ ⚛ PC @ React Su m m it NYC ↝ 🧑🏫 Mentor @ TechLabs
  2. THIS TALK IS ABOUT… OUR STORY WITH REACT DIVERGING PATHS

    THE PAST MODERN REACT THE FUTURE EARLY YEARS TROUBLE IN PARADISE JSX VS. SEPARATION OF CONCERNS PERF GOLDEN YEARS
  3. This talk is about… ↝ THE FUTURE ↝ THE PAST

    ↝ TROUBLE IN PARADISE ↝ CLOSING THOUGHTS
  4. REACT STRICT DOM ↝ POWERED BY STYLEX. ↝ OPPOSITE APPROACH

    TO REACT NATIVE FOR WEB. ↝ UTILISES WEB APIS TO RENDER COMPONENTS. ↝ SMALL POLYFILLS RESPONSIBLE FOR TRANSLATING ITS APIS TO REACT-NATIVE AND REACT-DOM PRIMITIVES. ↝ LESS OVERHEAD WHEN RUNNING IN BROWSERS.
  5. REACT STRICT DOM — RFC: REACT DOM FOR NATIVE (REDUCE

    API FRAGMENTATION) #496 • NICOLAS GALLAGHER
  6. REACT STRICT DOM — RFC: REACT DOM FOR NATIVE (REDUCE

    API FRAGMENTATION) #496 • NICOLAS GALLAGHER
  7. REACT STRICT DOM — RFC: REACT DOM FOR NATIVE (REDUCE

    API FRAGMENTATION) #496 • NICOLAS GALLAGHER
  8. STATIC HERMES ↝ MODIFIES SOME JS SEMANTICS TO ALLOW EFFICIENT

    SOUND TYPING. ↝ BRIDGES PREDICTABLE C PERFORMANCE WITH JS USABILITY VIA NATIVE AOT COMPILATION. ↝ MIX AND MATCH BYTE-CODE AND NATIVE CODE BASED ON YOUR NEEDS.
  9. CPU SUSPENSE ↝ FORCES A FALLBACK ON THE INITIAL RENDER

    REGARDLESS OF WHETHER SOMETHING IS SUSPENDED. ↝ DURING THE INITIAL MOUNT, REACT WILL SKIP OVER EXPENSIVE TREES BY RENDERING A PLACEHOLDER. ↝ IT HELPS UNBLOCK THE INITIAL SKELETON FOR THE NEW SCREEN.
  10. THE FUTURE PRESENT ↝ REACT FORGET COMPILER ↝ OFFSCREEN ACTIVITY

    COMPONENT ↝ OPTIMISTIC STATE UPDATES ↝ RESOURCE PRELOADING ↝ TRANSITION TRACING
  11. THE PAST: BOLTJS ↝ CLIENT-SIDE MVC FRAMEWORK. ↝ COMBINED EXISTING

    TOOLS TO HANDLE THE COMPLEX INTERACTIVITY OF PRIMITIVE FACEBOOK TIMELINES, CHAT, NEWS FEEDS, AND OTHER ADVANCED APPLICATIONS. ↝ INTRODUCED SOME APIS AND FEATURES THAT WOULD EVENTUALLY MAKE THEIR WAY INTO REACT INCLUDING render, createClass, AND refs.
  12. THE PAST: BOLTJS var CarView = require('javelin/core').createClass({ name: 'CarView', extend:

    require('container').Container, properties: { wheels: 4, }, declare: function() { return { childViews: [ { content: 'I have ' }, { ref: 'wheelView' }, { content: ' wheels' } ] }; }, setWheels: function(wheels) { this.findRef('wheelView').setContent(wheels); }, getWheels: function() { return this.findRef('wheelView').getContent(); }, }); var car = new CarView(); car.setWheels(3); car.placeIn(document.body); — OUR FIRST 50,000 STARS • CHRISTOPHER CHEDEAU
  13. THE PAST: FAXJS ↝ SOLVED THE SAME PROBLEMS IN A

    VERY DIFFERENT WAY. ↝ MUCH MORE FUNCTIONAL; WITH NO MVC ARCHITECTURE AND INTRODUCED THE CONCEPT OF RE-RENDERING WHEN SOMETHING IN THE UI HAS CHANGED. ↝ FUNDAMENTALS WERE BORN, INCLUDING PROPS, STATE, RE-EVALUATING LARGE PORTIONS OF THE TREE TO DIFF THE UI AND THE BASIC CONCEPT OF COMPONENTS.
  14. Guillermo Rauch (2015) “With this model in place, the programmer

    is thus relieved from the burden of specifying the transition between states (or transformation) of the UI over time. No need to specify how to go from A to B: just describe what A looks like and what B looks like, in a discrete way.”
  15.  Dan Abramov (2015) “I’ve seen React misunderstood by smart people

    more often than any other JavaScript library. React is packed with ideas that were radical at the time of its introduction. This created an air of controversy that still hasn’t quite dissolved.”
  16.  Dan Abramov (2015) “After a year of using React and

    observing people learning it, I can say that the best parts of React are not the ones that made it famous. They’re not virtual DOM, custom event system, server rendering or JSX. Rather, they are a few boring, old and powerful ideas.”
  17. A DECADE: REACT’S RHAPSODY OF LIFE / TROUBLE IN PARADISE

    #0 of 5 SOFTWARE DEVELOPMENT CONTINUALLY GOES THROUGH CYCLES.
  18. A DECADE: REACT’S RHAPSODY OF LIFE / TROUBLE IN PARADISE

    #0 of 5 SOFTWARE DEVELOPMENT CONTINUALLY GOES THROUGH CYCLES.
  19. A DECADE: REACT’S RHAPSODY OF LIFE / TROUBLE IN PARADISE

    #0 of 5 AND SO DO TROUBLE IN PARADISE MOMENTS. WHAT’S DIFFERENT NOW? THROUGH CYCLES.
  20. REACT PUSHED US TO THE FUTURE OTHER FRAMEWORKS JSX /

    VIRTUAL DOM / HMR + FAST REFRESH 📱 OTHER PLATFORMS FLUTTER / JETPACK COMPOSE / LITHO / COMPONENTKIT / SWIFTUI / YOGA LAYOUT / RESWIFT 🌐 OUR PLATFORM SCHEDULER API / EFFECT HANDLERS *
  21. REACT PUSHED US TO THE FUTURE OTHER FRAMEWORKS JSX /

    VIRTUAL DOM / HMR + FAST REFRESH 📱 OTHER PLATFORMS FLUTTER / JETPACK COMPOSE / LITHO / COMPONENTKIT / SWIFTUI / YOGA LAYOUT / RESWIFT 🌐 OUR PLATFORM SCHEDULER API / EFFECT HANDLERS *
  22. REACT PUSHED US TO THE FUTURE OTHER FRAMEWORKS JSX /

    VIRTUAL DOM / HMR + FAST REFRESH 📱 OTHER PLATFORMS FLUTTER / JETPACK COMPOSE / LITHO / COMPONENTKIT / SWIFTUI / YOGA LAYOUT / RESWIFT 🌐 OUR PLATFORM SCHEDULER API / EFFECT HANDLERS *
  23. A DECADE: REACT’S RHAPSODY OF LIFE / CLOSING THOUGHTS #2

    of 5 JSX CREATED A SIMILAR FEELING AMONG DEVELOPERS WORLDWIDE. …IT WAS GOING AGAINST SO MANY BEST PRACTICES THAT IT COULDN'T BE CONSIDERED A GOOD IDEA.
  24. A DECADE: REACT’S RHAPSODY OF LIFE / CLOSING THOUGHTS #3

    of 5 A DOESN'T NECESSARILY IMPLY B. THERE'S NO SILVER BULLET. IDENTIFY YOUR CORE METRICS.
  25. A DECADE: REACT’S RHAPSODY OF LIFE / CLOSING THOUGHTS #4

    of 5 REACT IS STILL GOOD ENOUGH FOR MOST OF US. NOTHING IS INHERENTLY BROKEN ABOUT IT. ALSO, IT WILL NEED SOMETHING A LOT BETTER THAN REACT TO REPLACE IT. AND WE’RE NOT THERE (YET).
  26. Guillermo Rauch (2015) “In general, comparing libraries or frameworks in

    terms of features seems inferior to examining the model it imposes on the programmer. The latter will inform you about how well the code will fare over time as the product matures and the team grows, but the former won’t. It will also empower you to foresee what the evolutionary path of the technology looks like.”
  27.  Dan Abramov (2015) “Now that we’re not surprised by virtual

    DOM anymore and it is being adopted by other frameworks and libraries, we can focus on examining React’s true strengths: composition, unidirectional data fl ow, freedom from DSLs, explicit mutation and static mental model.”
  28. A DECADE: REACT’S RHAPSODY OF LIFE / CLOSING THOUGHTS REPORTS

    OF A CERTAIN TOOL'S DEATH ARE MOSTLY EXAGGERATED. OUTRAGEOUS CLAIMS, ANECDOTAL REFERENCES, LACKING EVIDENCE AND JUSTIFICATIONS, AND MUCH MORE! #5 of 5
  29. — REACT I LOVE YOU, BUT YOU'RE BRINGING ME DOWN

    • FRANÇOIS ZANINOTTO “REACT IS DYING”