Skip to content

fix: prepare the server router before document hydration - #350

Merged
g-kari merged 3 commits into
mainfrom
fix/react18-document-startup-20261106
Nov 6, 2026
Merged

g-kari merged 3 commits into
mainfrom
fix/react18-document-startup-20261106

Conversation

@g-kari

@g-kari g-kari commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Final GREEN verification (2026-11-06 11:08 UTC)

Exact head 118741e8db9baa574ca2c797e2bf2b3b98cd0fa5, base 290196672ec908485b65a0354ab930492e0a2eb5, test-merge 779018c280edfbccf3012ef1537ed3f6f7eead12 / tree 3119634af3b7ec27cae8448e2f56b3dd35aebc67.

  • All 8 check runs completed successfully. Quality: 385 files / 12,046 unit tests, including all 3 new startup tests. JSON Lines: 9 passed.
  • Hosted browser: core 169 (attempt 2) + generators 159 (attempt 1) = 328 unique cases, all single-pass / no test retries. Both native ZIPs were checked for exact bytes, SHA-256, CRC, checked-out source SHA, report union/disjointness and individual case results.
  • All 6 new cases passed: controlled root-registration input at both widths (phase armed/triggered once, visible editable SSR input, exact SQL), native early input/keyboard/navigation at both widths, and corrected no-JS SSR/input checks at both widths. ArrowLeft exercises keyboard behavior and value retention; caret position is not asserted.
  • First GREEN core attempt stopped before browser execution on an APT-index / Chromium setup 10-minute timeout, not a product assertion. One official failed-jobs rerun completed successfully without changing source, mirror, permissions, timeouts or guards. The old 194-byte artifact remains; the new core artifact has a different ID, with no overwrite or deletion.
  • The source-unchanged controlled browser RED and unit RED remain recorded below, including initial no-JS selector failures that were not product RED. The controlled synthetic condition is not proof of the original natural failure's exact causal chain.

Merge remains subject to the coordinator's fresh base/head, protection and review checks; no formal PR approval is claimed. #315 remains separate, and no denied #347 changes are included.


Current stage: minimal startup fix, runtime verification pending (118741e)

Source-unchanged unit RED completed at a723a8a after successful format/lint/type checks:384files/12043tests passed and all three new startup contracts failed. The first observed hydrateStart call0; the other two stopped because the old entry has no hydration Promise export, so their later success/rejection assertions were not reached. Raw results are retained separately from the earlier controlled browser RED2 and no-JS selector correction.

This commit changes only app/client.tsx relative to a723a8a: one public hydrateStart invocation completes before hydrateRoot receives the same RouterProvider and prepared router. The reviewed tests, corrected no-JS selector, all existing322 cases and guards are unchanged. Expected final385files/12046unit and328browser checks are now running; this PR is not ready to merge until they all succeed and the exact final tree is verified.

Current stage: source-unchanged RED unit (a723a8a)

Browser RED at3c94ba61 completed: all existing322 cases passed, native early input/keyboard/SPA2 passed, and the controlled phase at both widths reached React345 plus missing SQL (functional RED2). Two additional no-JS cases stopped at an incorrect exact accessible-heading selector because CSS adds '$ ' and '█'. Their later input checks were not reached, so they are not counted as product failures. Source, CSS and the actual visible SSR content were unchanged.

This commit corrects only that selector to a visible level1 heading with exact DOM text and adds the same three reviewed unit contracts intended for GREEN. Production source is still unchanged. A unit format/type/setup stop will not count as runtime RED. The corrected full six browser cases must pass in final GREEN; no expectations or guards are removed.

Current stage: source-unchanged RED browser regression

This ordinary PR is deliberately not merge-ready. It isolates a document-startup defect found while validating navigation PR315, without mixing a global startup fix into that PR. Application source, package/lock, existing322 browser cases and all their expectations are unchanged at this stage.

The identical controlled synthetic focus/input phase already reproduced React error345 and missing SQL output on both exact main29019667 and PR6df7 at1280/390. Native CSV input remained present. ReactDOM hydrateRoot stack and visible/editable SSR textarea establish the phase. This is controlled baseline evidence, not proof of the cause of the earlier natural failure or a navigation regression. Earlier invalid selectionchange probes and format stops remain recorded separately.

Staged validation

  1. Current commit3c94ba61: source-unchanged RED. Preserve the exact two controlled cases plus four separate native early-input/navigation/no-JS regression controls. Core169 + generators159 =328 browser cases. Format, setup or typecheck stops are not functional RED.
  2. Add three identical startup unit contracts while source remains unchanged and record real unit RED.
  3. Only after those results, apply the independently reviewed minimal client-entry candidate: await the existing public hydrateStart API once, then hydrate the document with its prepared router and the same RouterProvider. No StartClient second call, new router, Suspense/StrictMode wrapper, dependency upgrade or SSR markup change is proposed. Final target385files/12046unit +328browser and full checks.

Actual locked React startup/export modules are preserved from official CI. Matching version-tagged core1.167.9/router1.168.9 source shows SSR data preparation and the existing window.$_TSR.h order. Exact installed core dist has not yet been independently captured, and API availability is not described as an official recommendation of this initialization order. On preparation rejection, the proposed Promise rejects without retry/root creation, leaving the SSR document static rather than entering React recovery; this difference is explicitly tested/disclosed.

Preserved constraints

  • Existing guards, expectations, per-test limits, job20/setup10 budgets, mirrors, permissions and fail-closed aggregate remain unchanged. One core-only suite and three trigger paths are added; removing those additions restores the main workflow exactly.
  • Native ArrowLeft checks value retention, not caret position. Native early input is filled once before first-party scripts are released, then clear/re-edit and keyboard-activated same-document navigation are checked. No-JS retains SSR/native editing and does not claim conversion support.
  • No local runtime/install, rerun, forced update, formal approval, denied YAML347 source or auto-merge controller is involved. PR315 remains held. Merging requires completed review, exact final source/tree and all runtime checks, then post-merge verification.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@g-kari
g-kari merged commit 2d7cbc5 into main Nov 6, 2026
10 of 12 checks passed
@g-kari
g-kari deleted the fix/react18-document-startup-20261106 branch November 6, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant