fix: preserve ids across server hydration - #166
Merged
Merged
Conversation
KyleJune
pushed a commit
that referenced
this pull request
Sep 28, 2026
## [0.17.3](0.17.2...0.17.3) (2026-09-28) ### Bug Fixes * preserve ids across server hydration ([#166](#166)) ([ba8c77b](ba8c77b))
|
🎉 This PR is included in version 0.17.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server-rendered pages could hydrate with different React
useIdvalues because the server added a hydration-script sibling beside the route tree while the browser rendered one child. Form labels and menu references retained server IDs while React generated different client IDs.Reserve the script slot in the shared document component so both render paths have the same structure. Existing script order, Suspense, and nonce handling remain unchanged.
Testing
The regression hydrates actual
createServerHTML throughClient.hydrate, compares the committed hook ID to the original server ID, checks DOM reuse and label association, and rejects hydration diagnostics. It failed with_R_6_versus_R_m_before the fix and passes afterwards.deno task checkand the full suite pass: 61 tests, 852 steps. Four independent source reviews found no outstanding issues.Closes
Nothing. Related to the starter readiness work in udibo/udibo#1505.