Next.js & App Router (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
Deep Dive into the React Server Component (RSC) Wire Format.
senior LevelCode ExampleComponentsFormsSystem Design
In Simple Words: When a user navigates between pages in Next.js, the server does not send plain HTML or plain JSON. It streams the RSC Payload:
- A specialized streaming format:
text
M1:{"id":"./src/Button.client.tsx","name":"default"} J0:["$","div",null,{"children":[["$","h1",null,{"children":"Hello"}],["$","$L1",null,{"count":0}]]}] - How it works:
- HTML tags are serialized as virtual element arrays (
["$", "h1", null, ...]). - Client Components are serialized as module references (
$L1) with only their passed props. - The client React reconciler consumes this stream and surgically updates the DOM tree without wiping out client-side React state (e.g. form inputs or scroll position stay intact!).
- HTML tags are serialized as virtual element arrays (