An article that’s been making rounds on Twitter today is Second-guessing the modern web:
There is a sweet spot of React: in moderately interactive interfaces. Complex forms that require immediate feedback, UIs that need to move around and react instantly. That’s where it excels.
But there’s a lot on either side of that sweet spot.
The low performance parts don’t need to be React. Listing pages, static pages, blogs – these things are increasingly built in React, but the benefits they accrue are extremely narrow. A lot of the optimizations that are cropping up in these corners, things like bundle splitting, server-side rendering, and prerendering, are triangulating, essentially, what we had before the rise of React.
If you’re swinging the React hammer, everything looks like a <Nail />
. A smart developer knows when to use it, and when not to use it.
But what if you didn’t have to choose? As Dan Abramov from the React team tweeted (be sure to read the whole thread):
Imagine a CRUD React app with routes — but with no client-side router. Imagine the JS code for most of your components is never shipped to the client — but you can sprinkle some interactivity where you want to. Imagine there was no “backend” because it would be your components.
— Dan Abramov (@dan_abramov) May 10, 2020
This proposed approach goes beyond Zeit’s Vercel’s Next.js file based routing and hits more close to Inertia.js.