Skip to main content
CodeOath
← All posts

Next.js75 min total · 12 parts

Next.js Fundamentals: The App Router, Server Components, and the Caching Rules That Just Flipped

Part 2 of 12 · ~2 min

What Problem Next.js Actually Solves

Nothing about the plain-React version above is wrong — it's just silent on three questions that every app past a certain size eventually has to answer for itself:

  • Routing. Something has to decide that /jobs/senior-backend-engineer-remote renders a job, and without a framework that "something" is code you write and maintain by hand, living outside your components, that you're responsible for keeping in sync with them.
  • Rendering. Is there real content in the very first response the browser gets, or does the page start as an empty shell that only becomes something once a script finishes running? For a job board, that single answer decides how findable a listing realistically is.
  • Bundling. Once OpenRoles has a dashboard, a text editor, a charting library, does every visitor's browser download all of that, or only the slice relevant to the page they're actually looking at?

What Next.js does, concretely, is give you a consistent default answer to all three instead of three separate architectural decisions you'd otherwise make (and re-make) on every project: a file on disk defines a route, the server produces HTML unless you deliberately tell it not to, and code splits itself along route boundaries automatically. That's most of the pitch. It's also why "just use React" isn't really in competition with "use Next.js" — they're not solving the same problem. React is an answer to "how do I turn state into a screen." Next.js is an answer to "how do I ship that screen as an actual product, with routing, a fast first paint, and a bundle that doesn't grow without limit, without building all three of those myself." Building your own router, your own server-render pipeline, and your own bundle-splitting strategy from scratch is a perfectly fine choice for a tiny embeddable widget. For a product with more than a handful of routes, used by actual people on actual connections that aren't always fast, it's a surprising amount of plumbing to own just to end up roughly where a framework already stands.