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

The Remix Evolution: How React Router v7 Enable...

Aurora Scharff
February 21, 2025
4

The Remix Evolution: How React Router v7 Enables Fast and Resilient Apps

For 10 years, React Router has been a core part of the React ecosystem. Now, with Remix merging into React Router v7, millions of React Router apps can upgrade to powerful features like automatic code splitting, simplified data loading, form actions, server rendering, and static site generation. This allows React developers to enhance existing projects or build new ones easily.

In this session, we'll explore how Remix, now part of React Router, enables developers to build robust web applications that stand the test of time. Attendees will learn about the Remix build process using Vite and how Remix adapters enable flexible deployment on various platforms like Vercel, Netlify, and Cloudflare Workers.

We'll also explore how Remix reimagines the MVC architecture with Remix Route Modules, which streamline development by combining server-side data loading, UI rendering, and interactivity into a single, cohesive file. Additionally, we'll highlight how Remix's built-in features, like optimistic UI updates and intuitive form management, enable developers to create responsive and engaging user interfaces.

Aurora Scharff

February 21, 2025
Tweet

Transcript

  1. Exploring the World of Remix: A Guide to Building Resilient

    and Performant Web Apps Aurora Scharff @aurorascharff Exploring the World of Remix: A Guide to Building Resilient and Performant Web Apps Aurora Scharff @aurorascharff
  2. Introduction > Aurora Scharff > Consultant at Inmeta > Microsoft

    MVP > Norway, Oslo > Full-stack, web-focused: active Next.js developer - using Remix on the side
  3. > Full stack, React-based web framework/meta-framework > Released in 2020,

    acquired by Shopify in 2022 > Focuses on web standards to deliver fast, slick, resilient user experiences
  4. > Full stack, React-based web framework/meta-framework > Released in 2020,

    acquired by Shopify in 2022 > Focuses on web standards to deliver fast, slick, resilient user experiences > Written by the React-router team > Uses React Router as it’s largest dependency after React itself
  5. > 10 years old and going strong > The most

    widely used dependency in the React Ecosystem > Shopify itself heavily depends on React Router
  6. It’s clearly good, but we want features like: > Automatic

    code splitting > Simplified data loading > Form actions > Simplified pending states > Optimistic UI > Server rendering (SSR)
  7. Vite: Next Generation Frontend Tooling > Fast dev experience, optimized

    builds, rich plugin ecosystem > Risen substantially in popularity > Has replaced Create React App (CRA)
  8. > Remix bet on Vite in 2023 and deprecated classic

    compiler > Opened Remix to more users > SPA-mode for client-apps > remix.config.js -> vite.config.ts > plugins: [remix()]
  9. 2: HTTP Handler and Adapter > Remix runs on the

    server, but is not actually a server > Just a handler that is given to the actual JS server > Built on Web Fetch API instead of Node.js > Can be run in any Node.js server like Vercel, Netlify etc. + non-Node.js environments like Cloudflare Workers
  10. 3: Server framework > MVC-like framework, familiar to Rails/Laravel developers

    > Remix is the View and the Controller, model is up to you > Remix is UI-focused rather than model-focused > No split between View and Controller > Executed with “Remix Route Modules”
  11. 3: Server framework > Remix scales down > Not every

    page needs a bunch of JavaScript > Not every user interaction requires more than default behavior > Most Remix apps work before JS loads in the browser > Remix Route Modules: React components with their own API route, can load and submit data to themselves on the server
  12. 4: Browser framework > Assets don’t need to be re-downloaded

    > Assets don’t need to be parsed again > Data fetched is smaller than the entire document > Remix enhances HTML API’ like <a> and <form>, tends to work before JS
  13. pros √ Straightforward √ Inline with web standards √ Progressive

    enhancement out-of- the-box √ Can be upgraded to (rrv7) √ Deploy anywhere with adapters √ Some type-safe routing (rrv7) Remix
  14. pros √ Straightforward √ Inline with web standards √ Progressive

    enhancement out-of- the-box √ Can be upgraded to (rrv7) √ Deploy anywhere easily √ Some type-safe routing (rrv7) neutrals • Less opinionated • Fewer abstractions • Customizable routing • More HTML-y and less React-y Remix
  15. pros √ Straightforward √ Inline with web standards √ Progressive

    enhancement out-of- the-box √ Can be upgraded to (rrv7) √ Deploy anywhere easily √ Some type-safe routing (rrv7) neutrals • Less opinionated • Fewer abstractions • Customizable routing • More HTML-y and less React-y Remix cons × Less mature SSG-story (rrv7) × Early days of React Server Components (it’s coming soon) × Route bound (RRM) and less composable
  16. pros √ Mature React Server Component implementation √ Mature SSG-story

    (ISR, etc.) √ Innovative features (PPR, “use cache”) √ Familiar to React devs √ Optimized hosting on Vercel Next.js (App Router)
  17. pros √ Mature React Server Component implementation √ Mature SSG-story

    (ISR, etc.) √ Innovative features (PPR, “use cache”) √ Familiar to React devs √ Optimized hosting neutrals • Opinionated • Advanced file-based routing (i.e parallell routes) • More abstractions • More React-y and less HTML-y Next.js (App Router)
  18. pros √ Mature React Server Component implementation √ Mature SSG-story

    (ISR, etc.) √ Innovative features (PPR, “use cache”) √ Familiar to React devs √ Optimized hosting Next.js (App Router) cons × More complex, server-first with RSC × Harder to learn and understand × Deviates from web standards × Migration is a rewrite neutrals • Opinionated • Advanced file-based routing (i.e parallell routes) • More abstractions • More React-y and less HTML-y
  19. Further learning > Remix docs: https://remix.run/docs/en/main > React Router docs:

    https://reactrouter.com/start/framework/installation > Remix jokes tutorial: https://remix.run/docs/en/main/tutorials/jokes > Remix official tutorial: https://remix.run/docs/en/main/start/tutorial > Remix community example apps: https://github.com/remix-run/examples/
  20. Resources: Remix → React Router v7 > Blog by the

    Remix team: https://remix.run/blog/merging-remix-and-react-router > Upgrading from React Router v6: https://reactrouter.com/upgrading/v6 > Migrating from Remix: https://reactrouter.com/upgrading/remix