Skip to content

Bug: Defer Disconnect Teardown#222

Merged
jlukic merged 1 commit into
mainfrom
bug/hydrate-disconnect
May 22, 2026
Merged

Bug: Defer Disconnect Teardown#222
jlukic merged 1 commit into
mainfrom
bug/hydrate-disconnect

Conversation

@jlukic
Copy link
Copy Markdown
Member

@jlukic jlukic commented May 22, 2026

Discovered while debugging icons in the docs sidebar appearing then disappearing ~500ms after page load.

A move (remove + reinsert in the same task) fires disconnect+connect on a custom element. Treating that as a removal destroys live nested components mid-move. Latent since the native renderer landed, observable after #201.

Changes

  • Nested components survive being reparented during block hydration

Risk

7/10. Disconnect teardown timing goes from synchronous to microtask-deferred for every component.
Failure modes:

  • Downstream tests that synchronously assert state after removeChild will need to await a microtask before the assertion.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
semantic-next Ready Ready Preview, Comment May 22, 2026 11:33pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mcp Ignored Ignored Preview May 22, 2026 11:33pm

Request Review

@jlukic jlukic force-pushed the bug/hydrate-disconnect branch from 41a02cc to 04b113b Compare May 22, 2026 23:31
@jlukic jlukic merged commit 1d280ef into main May 22, 2026
1 of 3 checks passed
@jlukic jlukic deleted the bug/hydrate-disconnect branch May 22, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component Component Rendering Tests Modifies tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant