Skip to content

Fix hydration replay with Next 16 - #602

Merged
NewWorldVenture merged 7 commits into
mainfrom
codex/framework-hydration-upgrade-20260927
Sep 27, 2026
Merged

NewWorldVenture merged 7 commits into
mainfrom
codex/framework-hydration-upgrade-20260927

Conversation

@NewWorldVenture

@NewWorldVenture NewWorldVenture commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Immediate replay of a suspended lazy child can produce React hydration error #418 even when the server and client trees match. Upgrade Next from 15.5.25 to 16.3.6, whose shipped renderer includes the upstream hydration-cursor fix, while retaining React 18.3.1 packages. The actual installed-renderer regression reproduces the old failure and passes on the candidate.

This branch includes PR601's current session, meal and page-control repairs and is based on main e96e745. Release PR601 first, then review this remaining framework delta. The combined candidate preserves every application route and current main navigation.

Changes:

  • Keep webpack for dev/build/E2E and the existing ESLint8/config-next15 policy (15 existing warnings). Migrate removed Next configuration and generated type settings.
  • Preserve immediate expiry at nine cache invalidations with { expire: 0 }; update the corresponding argument assertions.
  • Add a retained browser test using the actual production renderer, covering immediate replay and synchronous/delayed controls.
  • Require a default-false manual apply input and successful prior checks before any of the production migration workflow's five write steps. Dependency pushes retain read-only verification and cannot apply migrations/backfills. SQL, ledger safeguards, timeouts and production configuration are unchanged.
  • Update finalaudit.md and four supporting audit records, preserving all prior IDs and failures.

Validation:

  • Exact combined application source f9adfd7: 20,856 UTC tests / 1,638 files, production build, full generated types, lint, and four static audits pass. All 5,222 tracked files/modes remain exact. Production dependency audit reports zero vulnerabilities; the separate prior development-inclusive audit retains seven findings.
  • Thirteen controlled browser suites pass 278/278, including renderer, modal, media/session ownership, display and weekly meals. No application routes are removed compared with PR601.
  • Subsequent two-file workflow guard delta: 69 focused checks, actual YAML parse, typed-input cases, scoped types/lint pass. Removing a write guard causes the expected test failure.
  • The older PR602 hosted run passed with two retry-only flakes (recovery callback and the older meal test); it is not clean acceptance of this combined source. Fresh hosted checks on b7181cc remain required before merge.

No production SQL, provider action, local app-server run, or live authenticated route crawl is claimed. The controlled renderer proof does not close the outstanding production page findings.

References: upstream React fix, Next 16 migration guide, explicit immediate cache expiry.

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
bubaly Ignored Ignored Sep 27, 2026 9:16pm UTC

Request Review

NewWorldVenture pushed a commit that referenced this pull request Sep 27, 2026
… that has it alone

Review on #605 pointed out that Next 16 (#602) bundles a React that already
fixes react/react#37584, and that the loader would reject it. Reading that
React (Next 16.3.6's react-dom-client, 19.3.0-canary-cbb046ab) shows where
React put the fix: in the replay's HostComponent case, right after the hooks
reset, the replayed fiber that is the current hydration parent puts the
parent back on its host parent and the cursor back on its node, or resumes
hydration if it had been suspended for an insertion below it.

The loader now injects exactly that code at exactly that site in Next
15.5's React (production and development, stable and experimental). The
hydration helpers it calls (popToNextHostParent,
tryToClaimNextHydratableInstance, resetHydrationState, popHydrationState)
are identical in 19.2 and 19.3. A React whose site already carries the fix
is returned unchanged, so #602 can land after this without touching it; a
React without the site still fails the build.

The test adds Next 16's case verbatim as a fixture that must come back
unchanged, checks the injection sits between the hooks reset and the
default branch, and parses the patched React.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KP9rt5rVQ9jDMpZp2xBy3K
NewWorldVenture and others added 7 commits September 27, 2026 14:51
…260927

Brings the Next 16 upgrade onto current main so hosted CI verifies the
combined source; no conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01776xJyhVe8xJQvTGeNfT9T
Main's #605 test asserted the installed react-dom client did not already
carry react/react#37584's fix. Next 16.3.6 bundles React 19.3, which does,
so the test failed on this branch in CI. It now asserts the installed
React carries the fix and that the loader leaves it byte-identical, and
still exercises the backport on the same file with React's fix removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01776xJyhVe8xJQvTGeNfT9T
main's CI at fda9dcf failed in Typecheck with "Ineffective mark-compacts
near heap limit" (exit 134) at the 4,096 MB cap, after the same step had
passed at that cap on the heads before it. The step runs alone after the
build on a 16 GB runner, so it gets 6,144 MB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01776xJyhVe8xJQvTGeNfT9T
…ade-20260927

finalaudit.md: keeps this branch's Last Updated line and main's P-01…P-22 page-audit pointer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01776xJyhVe8xJQvTGeNfT9T
…n-upgrade-20260927

Audit docs keep this branch's CSP readiness checkpoint and its recount (13,830 NOT STARTED / 381 IN PROGRESS).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01776xJyhVe8xJQvTGeNfT9T
@NewWorldVenture
NewWorldVenture marked this pull request as ready for review September 27, 2026 21:50
@NewWorldVenture
NewWorldVenture merged commit ef4b89c into main Sep 27, 2026
7 checks passed
NewWorldVenture pushed a commit that referenced this pull request Sep 27, 2026
… branch; batch table keeps B12 done and B13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DXw2nu25BjyRfA6Fg3YiMS
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.

2 participants