docs(rfcs): record islands navigation before root hydration

Merged
KI
10d ago
+157-0

Problem

RFC 0010 (#3061) took React DOM off a first navigation whose page streams in. A route whose layout hydrates as one React root, such as a client provider around the pages, still waited for it. On benchmarks/server-components-payload at 150 ms latency and 1.6 Mbit/s, an 80 ms first tap on shop and guide took 788 and 837 ms, against 223 and 306 for the rsc engine. The router rendered the next page in a new React root over the old one, which needs React DOM, islx and the root's modules (about 70 KB br).

Change

Adds RFC 0011 to the index. Waiting-root navigation shipped in 0.1.80 (#3071), and reuse of page values shipped in 0.1.81 (#3073).

  • While no React root owns the page's root, a navigation asks for the next page whole and swaps it in, as for a page without such a layout. The root is then scheduled by the destination route's strategy, as a first load of it is.
  • Hovering a link no longer hydrates the root, and the boot preloads only the router for a link.
  • The first draft proposed marking server-rendered links so a client link's onClick could still prevent the navigation. That protected nothing: a tapped client link in a waiting root already navigated without its handler. The RFC keeps it as an alternative.
  • Results: 350 and 397 ms for that tap (from 788 and 837), and an instant tap at 50 ms 77 and 51 ms faster. docs and blog unchanged.
  • Cost: until the root hydrates, a navigation carries the page's HTML and values the browser already holds (shop: 6.0 KB br instead of 2.0), while its JavaScript falls from 9.7 to 2.7 KB. The follow-up in #3073 lets the server omit values already in the page. The measured shop response then fell to 4.4 KB br.

Safety and compatibility

No code changes here; the implementation and its tests are in #3071. No config added.

Verification

  • Four focused production Playwright tests passed on the published 0.1.87 packages. They cover first navigation before React DOM loads, value reuse before islx loads with and without a waiting root, and hover leaving the root unhydrated.

  • Verified all 13 RFC index entries resolve in numeric order.

  • oxfmt --check rfcs/README.md rfcs/0011-waiting-root-navigation.md: clean.

  • Results are #3071's interleaved first-navigation.mjs runs (rsc / df6c467af / #3071).

  • Response sizes come from requests against the bench's built islands server.

Documentation and release

The RFC itself. No package or release changes.


Summary by cubic

Updates RFC 0011 to record the implemented design for navigating out of a React root that has not hydrated: the router swaps the next page in like a streamed first load, keeping the root waiting to hydrate the destination. Shipped in 0.1.80, with value reuse in 0.1.81.

  • Drops the draft's server-link marking; a tapped client link in a waiting root already navigated without its handler, so the mark protected nothing. The design moves to the alternatives.
  • Removes hover hydration (hydrateForLink), React DOM and islx loading on entry start, and the tree-response branch for a root React never owned.
  • Records results: at 1.6 Mbit/s a first tap on shop and guide drops from 788 and 837 ms to 350 and 397 ms, within 91 and 127 ms of rsc; docs and blog are unchanged within noise.
  • Needs no server change: an F-Stream response already carries the page HTML, its tree, and the root attributes (6.7 vs 5.0 KB gzip).
  • Costs: until the root hydrates, a navigation carries the page HTML and its values. The follow-up (#3073, in 0.1.81) names the page's f/value scripts before islx runs and keeps them through the swap, bringing shop navigations from 6.0 to 4.4 KB br.

The RFC adds no configuration or public API.