docs(rfcs): propose a smaller islands runtime for pages that hydrate at load
Problem
Islands mode beats rsc on the payload benchmark's four sections, where islands wait. It loses on a page where every island hydrates at load. On a probe page of 24 widgets, with scripts served at brotli 11, 150 ms of latency and 1.6 Mbit/s, islands hydrates them all 53 to 64 ms after rsc. It loads 15 KB more JavaScript (81.6 KB against 66.6 KB), and 13 KB of that is the engine's code, not React.
Change
Adds RFC 0013, "A smaller islands runtime for pages that hydrate at load". It's a draft, and there's no code change. It records:
- The probe's bytes and timings for both engines, and where islands' 30 KB of engine code goes, by source (from a source-mapped build).
- A separate cost found on the way: Farm writes an empty
farm-client.cssfor a style-free app and links it from every document. That link blocks the first paint and the module scripts for a round trip: 130 to 160 ms of first paint on the probe. It proposes fixing that in its own change.
It proposes three changes, with no config and no public API:
- The server-action call path loads on the first call. That covers Farm's action interceptor and query cache, and islx's call transport and encoder.
- A page that renders an action reference preloads the call path, so its first call waits on no extra round trip.
- Page and layout root hydration and route slots move out of the generated entry, into a chunk that loads with the routes that use them.
Estimated savings: about 7 KB of the 15 KB. The RFC says plainly that this is half the gap. Open questions name where the rest may be: islx's server-tree helpers, and untraced task time.
Verification
Docs-only. The measurements are in the RFC, with their environment. Apple M1, macOS 26.2, Chrome 157, 4x CPU, HTTP/2 proxy, interleaved medians of 7 or 9, on 17605bd07.
- The probe builds and the probe script were local and aren't committed. The RFC's verification plan adds a
dashsection and a hydration measure tobenchmarks/server-components-payloadbefore any change lands. - Savings are estimates: I removed the mapped bytes from a built bundle and compressed the rest. They are not builds of the change.
- One run at 1.6 Mbit/s timed out waiting for hydration, mode unknown. It did not recur in 176 later loads, 88 of them at 1.6 Mbit/s.
Commands:
pnpm exec oxfmt --check rfcs/0013-smaller-islands-runtime.md rfcs/README.md: clean.pnpm docs:check-navigation: passed.
Documentation and release
rfcs/0013-smaller-islands-runtime.md and the rfcs/README.md index. RFCs 0011 (#3064) and 0012 (#3132) are open in their own PRs, so the index may need a merge with them.
Summary by cubic
Adds RFC 0013, proposing a smaller islands runtime for pages that hydrate at load. On a probe page of 24 widgets that all hydrate at load, islands mode loads 15 KB more JavaScript (brotli 11) than rsc and hydrates 53 to 64 ms later at 1.6 Mbit/s with 150 ms of latency.
The RFC records what the proposed changes measured on the probe:
- Loading the server-action call path on the first call trims the islands runtime from 15.4 KB to 13.1 KB and the hydration gap to
rscfrom 75 to 59 ms at 1.6 Mbit/s. - Moving root hydration and route slots out of the generated entry trims it from 13.2 KB to 11.4 KB, plus a 2.5 KB root chunk.
- With the stylesheet fix, the three changes together close the hydration gap to 47 ms (down from 76), and restore first paint, which Farm's empty linked
farm-client.csshad blocked by 130 to 160 ms in style-free apps. - islx's remaining splits measured 235 bytes for the server tree helpers, 370 bytes for the call path, and 454 bytes for dropping the hydration runtime's hot update, island carry-over and action result reviver; none is worth an islx release.
The changes need no config or public API; the untraced task time remains an open question. Docs-only; measurements and a verification plan are in the RFC.