next.js
3204d86c - Unify hydration error tree details (#99008)

Commit
68 days ago
Unify hydration error tree details (#99008) ## Summary Unifies hydration error details in the development overlay: - renders invalid HTML as a compact `Rendered tree` and mismatches as a compact `client/server diff` - keeps the nearest relevant user component and affected rows visible by default, with a disclosure control to expand the complete React-rendered tree - keeps neutral markers for invalid HTML and the `+ Client` / `- Server` legend only for actual mismatches - uses the same frame, spacing, typography, and overflow behavior for both variants ## Visual changes ### Invalid HTML | Before | After | | --- | --- | | ![Invalid HTML shown with ambiguous diff styling](https://github.com/user-attachments/assets/3ab72f7a-beac-4081-a91b-c0ebfa37027e) | ![Invalid HTML shown as a compact, expandable rendered tree](https://github.com/user-attachments/assets/1fcaa5ad-bdb6-4082-ba00-71bab8ab4466) | ### Client/server mismatch | Before | After | | --- | --- | | ![Client/server mismatch with an oversized collapsed tree](https://github.com/user-attachments/assets/176b77a2-bad6-41d2-9f16-96d125f31048) | ![Client/server mismatch shown as a compact, expandable diff with a client and server legend](https://github.com/user-attachments/assets/8d163768-4899-47bb-8155-67934a1c3e98) | ## Verification - App Router hydration acceptance tests with Turbopack and webpack - Pages Router hydration acceptance tests with Turbopack and webpack - focused hydration error count tests with and without Cache Components - Next.js type checking, ESLint, and Prettier - manual verification of invalid HTML and client/server mismatch overlays <!-- NEXT_JS_LLM -->
Author
Parents
Loading