fix(manifest): deterministic element ID generation for Turbopack#4
Merged
fix(manifest): deterministic element ID generation for Turbopack#4
Conversation
…ydration mismatches Next.js 16 with Turbopack runs server and client compilations in separate worker contexts, each with independent IDStabilizer singletons. Random IDs from nanoid caused every data-ds attribute to mismatch during hydration. Replace generateEntryId() (nanoid) with a deterministic derivation: hash(fileContentHash + positionKey) → base58 alphabet mapping. Two independent processes with identical inputs now produce identical IDs.
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run domscribe-test-fixtures:install-fixture-... |
✅ Succeeded | 41s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-03-19 05:46:05 UTC
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.

Summary
nanoid-based ID generation inIDStabilizerwith deterministic derivation:hash(fileContentHash + positionKey)mapped to base58 alphabetdata-dsIDs, eliminating React hydration mismatches in Next.js 16 Turbopack (which runs server/client compilations in separate worker contexts)IDStabilizeris affectedTest plan
nx test domscribe-manifest -- --testPathPattern=id-stabilizer— all 171 tests pass (55 in id-stabilizer suite)nx test domscribe-core -- --testPathPattern=id-generator— unaffected, all 119 tests passnx build domscribe-manifest— compiles cleanlynext dev --turbopackon cal.com demo — confirm no hydration mismatch errors