Skip to content

fix(vue): prevent void-element hydration mismatches in UI 0.0.2 - #168

Merged
elonehoo merged 1 commit into
mainfrom
fix/vue-void-hydration-002
Nov 5, 2026
Merged

elonehoo merged 1 commit into
mainfrom
fix/vue-void-hydration-002

Conversation

@elonehoo

@elonehoo elonehoo commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Prevent default slot children from reaching native HTML void elements in the Vue factory. Forwarded empty fragments previously caused SSR hydration mismatches and invalid child anchors under inputs and separators.
  • Preserve asChild, dynamic component selection, custom components, SVG and non-void children; add 27 focused regressions.
  • Prepare synchronized 0.0.2 versions and explicit upgrade notes. React, Solid and Svelte have version-only changes. Core remains ^0.3.3; lockfile, workflows and publish scope are unchanged.

Validation

  • 383 offline publish-guard tests; 291 Vue unit tests (including 27 new regressions); 170 Vue SSR tests.
  • Vue typecheck, source/release-document lint, build and git diff checks passed on Node 22.22.3.
  • Independently reproduced published Vue 0.0.1 hydration warnings. Focused retained identity, focus, callbacks, reactive updates and cleanup; no broader functional failure was demonstrated.
  • Isolated candidate built against all 46 frozen Vue design examples: 46/46 SSR and 46/46 hydration, zero diagnostics, on Vue 3.5.22.
  • Independent source/release review passed. Normal full CI, browser, packed-consumer and release gates remain required. No local browser launch was retried.

Release

  • 0.0.2 was absent from all four npm package histories and the Git tag when checked.
  • ^0.0.1 does not include 0.0.2; consumers must explicitly update. See release notes.
  • This PR does not publish. After successful review and exact-head gates, use the existing authorized release workflow. No Steps/core changes are included.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
The fix touches the shared Vue factory used by many primitives; incorrect void detection could drop slot content, though tests and boundaries limit scope to native void tags.

Overview
UI 0.0.2 fixes Vue SSR hydration mismatches by stopping the polymorphic ui factory from forwarding default slot children to native HTML void elements (input, hr, etc.). Empty forwarded slots previously became client-side fragments that SSR omitted, triggering children-mismatch warnings and invalid DOM under many components (hidden inputs, separators, and similar).

The change is scoped to string native void tags; asChild, dynamic tags, custom components named like input, and non-void elements keep existing slot behavior. A large new factory test suite covers hydration, all void tags, and reactive edge cases.

All four public packages and the monorepo are bumped to 0.0.2 (React/Solid/Svelte are version-only); core stays ^0.0.3. Release and upgrade docs stress that ^0.0.1 does not pick up 0.0.2 and link new docs/releases/0.0.2.md, plus Vue README guidance on SSR/hydration.

Reviewed by Cursor Bugbot for commit 7d0c8f0. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
destyler-ui Ready Ready Preview Nov 5, 2026 6:50am UTC
destyler-ui-dev Ready Ready Preview Nov 5, 2026 6:50am UTC

@elonehoo
elonehoo marked this pull request as ready for review November 5, 2026 07:04
@elonehoo
elonehoo merged commit c2fb947 into main Nov 5, 2026
14 checks passed
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.

1 participant