notes on the "webs next transition" post by kent dodds

Kent writes about the webs next transition (Oct '22)

Tech which powers the web (http, html, js, css) were all developed over 25 years ago (eek!)

Major architectural patterns over that time

  1. multi page apps (MPA); the era of html pages, java server pages
    1. all code (persistence, data fetching & mutation, rendering, routing) runs on server except UI interaction in browser 
    2. cons: full page refreshes and ui feedback control
    3. pro: simple architecture and code management
  2. progressively enhanced multi page apps (PEMPAs); the era of jquery, mootools etc
    1. code including rendering runs on server and UI both (if no js then fallback to MPA mode
    2. pro: improved UI interaction, more control on FE
    3. con: more complex architecture, code management, code duplication
  3. single page apps; era of backbone, angular, ember, react, vue
    1. routing, data fetching & mutation code is on both server and FE but only rendering and UI Feedback on the FE
    2. pro: less code on server (most all routing on FE, rendering on FE), more FE control
    3. con: exploding bundle size, fetch waterfalls, runtime performance (lots of js to run), complex state mgt 
  4. ...the next transition...  <- guessing this is what Kent will blog about


Kent introduces the new architectural pattern #4: Progressively Enhanced Single Page Apps (PESPA) - a mix of SPA and MPA
  • "The primary benefit of Progressive Enhancement is not that "your app works without JavaScript" (though that's a nice side-benefit) but rather that the mental model is drastically simpler."
  • BE code and FE code are the exact same, shared enabled by using a library which supports this (...ok Kent I see where this is going...)
  • FE mutates data and sends as a form submission to the action listed on the form which is sent to the BE code which does persistence etc. and sends back success/fail response which triggers a redirect or re-render
"What distinguishes a PESPA:

  • Functional is the baseline - JS used to enhance not enable
  • Lazy loading + intelligent pre-fetching (more than just JS code)
  • Pushes code to the server
  • No manual duplication of UI code (as in PEMPAs)
  • Transparent browser emulation (#useThePlatform)"

Kent writes that Remix is leading the charge for PESPAs, the first framework out of the box to offer full support for Kents vision of PESPA. Remix is a bridge across the network.

I'm thinking Remix will be big. It's a powerful model which addresses challenges with SPAs. 
It's also built by the guys who brought us react-router which has been downloaded over 1bn times. That is significant because react-router v6.4 now provides implementations of Remix concepts like loaders and actions and use of form element for for submissions (but without the Remix server side support). The developers who did all those 1bn download is a big ready audience who could be easily migrated to the newest react-router as a "gateway" to remix.


Kent also includes an interesting looking reference to an analysis of "the new wave of javascript web frameworks"


Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more