Repository navigation
Only drop the insertion cursor when it's detached - #5273
Merged
Merged
Conversation
The #5251 fix dropped the cursor whenever its parentNode wasn't the container. Containers that aren't the real parent of their children, like createRootFragment() from preact-root-fragment, are never that parentNode, so every insert appended: prepends and reorders came out in the wrong order and hydration re-inserted every root node. Only a cursor that a parked Suspense subtree detached needs dropping.
📊 Tachometer Benchmark ResultsSummary⏳ Benchmarks are currently running. Results below are out of date. duration
usedJSHeapSize
Results⏳ Benchmarks are currently running. Results below are out of date. create10kduration
usedJSHeapSize
filter-listduration
usedJSHeapSize
hydrate1kduration
usedJSHeapSize
many-updatesduration
usedJSHeapSize
replace1kduration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
text-updateduration
usedJSHeapSize
tododuration
usedJSHeapSize
update10th1kduration
usedJSHeapSize
|
|
Size Change: -4 B (-0.03%) Total Size: 15.9 kB 📦 View Changed
ℹ️ View Unchanged
|
marvinhagemeister
approved these changes
Sep 28, 2026
Merged
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.
Note
Co-Authored with Claude
The #5251 fix (b3ea099) drops the insertion cursor whenever
oldDom.parentNode != parentDom. Containers that aren't the real parent of their children never pass that check:createRootFragment()from preact-root-fragment (the upgrade guide's replacement forreplaceNode), Fresh islands and partials, and WordPress Interactivity regions. Every insert then appends to the end, so prepends, middle inserts and keyed reorders come out in the wrong order, and hydration removes and re-inserts every root node (iframes reload, focus is lost).The only cursor #5251 needs to drop is one that a parked Suspense subtree detached (
parentNode == null), so this checks for that inside the existinggetDomSibling()retry instead. The #5251 test stays green, and a root-fragment style container gets its own test.-5 B brotli on
preact.mjs.Fake containers still need to implement
moveBefore()in browsers that support it; preactjs/preact-root-fragment#4 adds that.