Building a Zero-JavaScript Blog with Island Architecture: What Next.js 15 Actually Ships

••7 min read
architecturenextjsperformancewebdev

This blog runs on Next.js 15.5 and React 19.2. The plan I wrote for it on November 9 set a 0 KB JavaScript baseline: pages render on the server, and the three interactive features (a reading progress bar, footnote popovers, and copy buttons on code blocks) load only on posts that ask for them in frontmatter. The third of those landed today, so I built the site and measured what a browser actually downloads.

The short answer: the islands work as designed and cost 1.2 to 1.9 KB each, but the baseline is about 108 KB, not zero. Every page, including one with no interactive features at all, loads React DOM and the Next.js App Router runtime. On the App Router, "zero JavaScript" works as a budget for your own code, and the page carries the framework's runtime on top.

The goal

The plan had three rules:

  • A post made of prose and code blocks should need no client JavaScript.
  • Interactive features enhance a page that already works. With JavaScript disabled, the post is complete.
  • A post pays only for the features it declares.

The second and third hold up. The first is what this post is about.

What a page actually loads

I built the site with next build, served it with next start, and loaded each page in headless Chromium through Playwright. After scrolling to trigger anything lazy, I summed transferSize for every script in the Resource Timing API:

const scripts = performance
  .getEntriesByType('resource')
  .filter((r) => r.initiatorType === 'script' || r.name.endsWith('.js'))
 
const transferred = scripts.reduce((sum, r) => sum + r.transferSize, 0)
const uncompressed = scripts.reduce((sum, r) => sum + r.decodedBodySize, 0)

That is compressed bytes on a cold cache, one run per page, on localhost:

PageIslandsScriptsTransferredUncompressed
/aboutnone7108.4 KB355.8 KB
/ (post list)none8110.1 KB359.9 KB
A postprogress9111.3 KB360.8 KB
A postprogress, copy-button10113.1 KB364.1 KB

The build output agrees. next build reports "First Load JS shared by all: 103 kB", nearly all of it in two chunks of 45.9 kB and 54.4 kB, which are React DOM and the App Router's client runtime. The remaining few KB are webpack's chunk loader, the root layout, and the navigation bar, which is a client component because of its mobile menu.

Why Server Components don't get you to zero

Server Components keep component code off the client. A server component's code never ships; only its rendered output does. What they don't remove is the runtime that receives that output.

An App Router page arrives as HTML plus a serialized React Server Components payload. React on the client hydrates against it so that any client component in the tree can attach, and <Link> uses the same machinery to navigate by fetching payloads instead of full documents. That runtime loads whether or not the page contains a client component. I didn't find a supported way to turn it off in the App Router.

So on the App Router, a 0 KB target can only apply to your own code. If a literal zero matters, pick a framework that makes it the default (Astro ships no client JavaScript unless a component opts in) or give up client-side navigation. I'm staying on Next.js for now and treating 108 KB as the floor. The shared chunks are cached after the first page view, so a reader who opens several posts pays it once; I haven't measured repeat visits.

How islands opt in

A post lists its islands in frontmatter:

---
title: "Post Title"
islands: [progress, sidenotes, copy-button]
---

The Zod schema restricts islands to those three names, so a typo fails the build. The post page renders a small loader for each declared island:

'use client'
 
import dynamic from 'next/dynamic'
 
// Lazy-load ProgressBar island (client-only)
const ProgressBar = dynamic(
  () => import('./ProgressBar').then((mod) => mod.ProgressBar),
  { ssr: false }
)
 
export function ProgressBarLoader() {
  return <ProgressBar />
}

next/dynamic gives the island its own chunk, and ssr: false means the server renders nothing for it. The browser requests the chunk after hydration, and a post that doesn't declare the island never requests it. Copy buttons work the same way, with one loader per code block, rendered only when copy-button is in the list.

What each island costs

Measured the same way, as the size of the island's own chunk:

IslandTransferredWithout JavaScript
progress1.2 KBNo bar; nothing else changes
copy-button1.9 KBNo button; select the code and copy it
sidenotes1.5 KBFootnote markers are anchor links to the notes at the bottom

No published post uses sidenotes yet, so that row comes from a draft test post. All three are inside the plan's budget of about 2 KB per island. On a page with all three, they add under 5 KB to the 108 KB floor, about 4% of what the page loads.

The progress bar needed one fix for mobile. Updating its width from a scroll listener with a CSS transition stuttered on iOS Safari and Chrome on Android. It now updates inside requestAnimationFrame with a passive listener and no transition, and the fixed-position bar gets transform: translate3d(0, 0, 0) to keep it on its own compositor layer. I don't have a measurement for the difference.

Moving work to the build

Most of what a content site might do in the browser happens once, during static generation:

  • MDX. The post page compiles each post with @mdx-js/mdx (compile, then run) inside a server component. @next/mdx is configured in next.config.mjs too, but it only handles .mdx files imported as pages, and the posts don't go through it.
  • Syntax highlighting. Shiki, through rehype-pretty-code with the github-dark theme, emits plain spans with inline colours. It uses TextMate grammars, the same ones VS Code uses. It replaced highlight.js (via rehype-highlight), which also ran on the server, so the switch was for output quality and changed nothing on the client.
  • Frontmatter. A Zod 4 schema validates every post at build time, and a bad field fails the build. The test suite post covers how that schema is tested.

Keeping it true

The Playwright suite checks three things:

  • With JavaScript disabled, the post renders and the progress bar is absent.
  • On a post that doesn't declare sidenotes, no sidenote chunk is requested.
  • On a post with two islands, the island chunks together stay under 20 KB.

These run in the test suite; next build itself doesn't check budgets. No test looks at total script bytes either, so a change in the framework floor would go unnoticed.

So what?

GoalResultVerdict
0 KB JavaScript baselineAbout 108 KB of framework runtime on every pageNot achievable on the App Router
Readable without JavaScriptEvery island falls back to plain HTML behaviourMet
Pay only for declared features1.2 to 1.9 KB per island, loaded only when listedMet
Budget enforcementE2E test on island chunks; framework floor untestedPartial

If you're planning a server-first site on the App Router:

  • Measure the floor first. Build an empty page and read "First Load JS shared by all" before you write a budget.
  • Budget your code and the framework separately. The island budget is useful. A page budget that pretends the runtime isn't there is not.
  • Test the total. A test that sums every script on a page shows the floor and catches it when it moves.
  • Pick the framework for the requirement. If zero is a hard requirement, choose a framework that makes zero the default.

Next on my list is that total-bytes test, so the floor is visible when it moves.