Skip to content

fix: preserve table-rooted hydration paths - #512

Merged
Mohamed Mansour (mohamedmansour) merged 1 commit into
mainfrom
mohamedmansour-webui-menu-hydration-repro
Sep 2, 2026
Merged

fix: preserve table-rooted hydration paths#512
Mohamed Mansour (mohamedmansour) merged 1 commit into
mainfrom
mohamedmansour-webui-menu-hydration-repro

Conversation

@mohamedmansour

Copy link
Copy Markdown
Contributor

SSR hydration parsed compiled template metadata through a temporary <div>, which strips table-only roots such as <tr> and corrupts parent-index ownership. In repeated table rows, a same-length reactive update could therefore duplicate conditional custom elements and reparent them directly under <tbody>.

This change makes hydration reuse the framework's existing WeakMap-cached <template>-parsed DocumentFragment, matching the context-preserving tree used for client creation while removing the duplicate parser and cache. The slot-shadow browser fixture now models the affected table/repeat/menu topology and verifies SSR ownership, hydration slot assignment, exact item counts, and reactive condition changes.

The regression also reproduces without custom-element definitions, confirming that slots expose the symptom but are not the cause.

Validation

  • Framework unit tests: 346 passed
  • Related Playwright suites: 58 passed, 2 skipped
  • Full framework Playwright suite: 276 passed, 2 skipped
  • cargo xtask check: passed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mohamedmansour
Mohamed Mansour (mohamedmansour) merged commit e6b4b47 into main Sep 2, 2026
35 checks passed
@mohamedmansour
Mohamed Mansour (mohamedmansour) deleted the mohamedmansour-webui-menu-hydration-repro branch September 2, 2026 20:15
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