Course map
Stage 1: App Router Foundations
Stage 2: The Rendering Model
Stage 3: Data, Caching and Mutations
Stage 4: Full-Stack Next.js
Stage 5: Production and Specialization

Part 05 / Topic 6 of 6

Proving this page ships zero client-side JavaScript of its own

"No useState, no event handlers" is a rule about what a Server Component's source code can contain. The stronger, more useful claim for this part's mini-build is about the output: does any of WholesalePage's own code end up inside a JavaScript file the browser has to download? This is checkable directly against the real build artifacts, not just inferred from the rule.

Next.js's own build output in this version doesn't print a per-route JS-size column (confirmed — npm run build's route table above only ever shows the ○/◐ symbols, nothing else), so the proof here reads the generated HTML's own script references instead. Every page in this harness shares the same framework chunks (React's runtime, the root layout, Tailwind's CSS), because those load on every route regardless of what any individual page does. What should differ between two pages is only the extra chunk a page's own Client Components pull in — and a page with none of its own should pull in none.

Comparing /store/wholesale's chunk list against /store/about (Part 2's page, which has never had a Client Component in it) shows zero difference:

$ grep -o 'chunks/[A-Za-z0-9_.-]*\.js' .next/server/app/store/wholesale.html | sort -u > /tmp/wholesale-chunks.txt
$ grep -o 'chunks/[A-Za-z0-9_.-]*\.js' .next/server/app/store/about.html | sort -u > /tmp/about-chunks.txt
$ diff /tmp/wholesale-chunks.txt /tmp/about-chunks.txt
(no output — the two files are identical)

Contrast this with Part 3's QuickJump button (a real Client Component, "use client" and all) on Apna Bazaar's home page: diffing the home page's chunk list against /store/about's shows exactly one extra chunk, and that chunk — and no other — contains the literal text from QuickJump's own button:

$ diff <(grep -o 'chunks/[A-Za-z0-9_.-]*\.js' .next/server/app/store.html | sort -u) /tmp/about-chunks.txt
2a3
> chunks/0woabm1x0sg0t.js
$ grep -c 'Surprise me' .next/static/chunks/0woabm1x0sg0t.js
1
$ grep -c 'Surprise me' .next/static/chunks/0cz1d0mv5g_q7.js .next/static/chunks/0wj0noag-9_fs.js .next/static/chunks/18o4tl3u8_wd4.js .next/static/chunks/1pcw6gskne7pf.js .next/static/chunks/2fuxlcqleg9x-.js .next/static/chunks/3iz8_hoapa1o_.js .next/static/chunks/3mwm0pfu8c8me.js
.next/static/chunks/0cz1d0mv5g_q7.js:0
.next/static/chunks/0cz1d0mv5g_q7.js:0
...all zero...

That one extra chunk's hash (0woabm1x0sg0t.js here) is itself a build artifact and will change on the next build (varies) — what matters, and what reproduces every time, is the shape of the result: a page with a Client Component gets one more chunk than a page without one, and that chunk — found by diffing, not guessed — is exactly where that component's code lives. /store/wholesale has none of its own, which is the whole claim this section set out to prove, not assume.

The same technique closes the loop on section 4's secret, from the other direction. SUPPLIER_HELPLINE is in the server-rendered HTML (section 2's curl output shows it, in plain text, because it is meant for Apna Bazaar's own staff reading that page) but it is in none of the JavaScript the browser downloads to run the page:

$ grep -rl "98xxxxxx01" .next/static/chunks/*.js
(no output — not found in any chunk)

Rendered server-side where a human reads it, absent from every script a browser executes — the two halves of "server-only" working together, proven against the same build.

Done here? The practice set for Part 5 — including the solutions — is on the part page.

Search the guide