Skip to content

Conversation

@JoviDeCroock
Copy link
Member

I've been chasing a bug where a suspended VNode would get unmounted as well as re-rendered. My assumption is that this happens as two items in the re-render queue.

  • VNode suspends
  • SomeNode updates and schedules an unmount
  • VNode resolves and schedules an update
  • Flush happens
  • We handle SomeNode first
  • We start handling VNode
    • Due to how suspense works this Component will have _parentDom
    • This Component will have _vnode but the VNode is in an unmounted state meaning it has no _parent
  • We handle the diff and when we do vnode._parent._children[index] = foo we crash

We add a test that highlights this scenario as well as schedules cleanup in unmounting a suspense boundary as well as defensively diffs only when _parent is present.

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-6.97ms - +3.11ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +0% (-0.20ms - +0.07ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +1% (-0.90ms - +0.80ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -3% - +2% (-0.42ms - +0.41ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.76ms - +0.91ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +6% (-0.05ms - +0.11ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -3% - +1% (-1.05ms - +0.38ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -2% - +4% (-0.65ms - +1.15ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -5% - +5% (-0.37ms - +0.37ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +3% (-0.04ms - +0.03ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local981.73ms - 988.80ms-unsure 🔍
-1% - +0%
-6.97ms - +3.11ms
preact-main983.60ms - 990.79msunsure 🔍
-0% - +1%
-3.11ms - +6.97ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.19ms - 19.19ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.19ms - 19.19msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.42ms - 16.65ms-unsure 🔍
-1% - +0%
-0.20ms - +0.07ms
preact-main16.53ms - 16.67msunsure 🔍
-0% - +1%
-0.07ms - +0.20ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.55ms - 1.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.55ms - 1.56msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local68.39ms - 69.61ms-unsure 🔍
-1% - +1%
-0.90ms - +0.80ms
preact-main68.45ms - 69.65msunsure 🔍
-1% - +1%
-0.80ms - +0.90ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local7.18ms - 7.65ms-unsure 🔍
-5% - +5%
-0.37ms - +0.37ms
preact-main7.14ms - 7.69msunsure 🔍
-5% - +5%
-0.37ms - +0.37ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.41ms - 16.95ms-unsure 🔍
-3% - +2%
-0.42ms - +0.41ms
preact-main16.37ms - 17.00msunsure 🔍
-2% - +3%
-0.41ms - +0.42ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.72ms - 3.72ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.72ms - 3.73msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5224
  • Commit: 795868a

duration

VersionAvg timevs preact-localvs preact-main
preact-local63.22ms - 64.41ms-unsure 🔍
-1% - +1%
-0.76ms - +0.91ms
preact-main63.16ms - 64.32msunsure 🔍
-1% - +1%
-0.91ms - +0.76ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.00ms - 3.00ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.00ms - 3.00msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local26.31ms - 26.98ms-unsure 🔍
-0% - +3%
-0.08ms - +0.83ms
preact-main25.97ms - 26.58msunsure 🔍
-3% - +0%
-0.83ms - +0.08ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local33.81ms - 35.03ms-unsure 🔍
-3% - +2%
-0.92ms - +0.77ms
preact-main33.91ms - 35.08msunsure 🔍
-2% - +3%
-0.77ms - +0.92ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local33.07ms - 34.28ms-unsure 🔍
-2% - +3%
-0.71ms - +0.92ms
preact-main33.03ms - 34.11msunsure 🔍
-3% - +2%
-0.92ms - +0.71ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.23ms - 26.66ms-unsure 🔍
-1% - +1%
-0.31ms - +0.30ms
preact-main26.23ms - 26.67msunsure 🔍
-1% - +1%
-0.30ms - +0.31ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local25.21ms - 26.57ms-unsure 🔍
-4% - +4%
-0.99ms - +0.98ms
preact-main25.18ms - 26.60msunsure 🔍
-4% - +4%
-0.98ms - +0.99ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local22.00ms - 22.53ms-unsure 🔍
-0% - +3%
-0.04ms - +0.63ms
preact-main21.76ms - 22.18msunsure 🔍
-3% - +0%
-0.63ms - +0.04ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #5224
  • Commit: 795868a

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.93ms - 2.05ms-unsure 🔍
-2% - +6%
-0.05ms - +0.11ms
preact-main1.90ms - 2.01msunsure 🔍
-6% - +2%
-0.11ms - +0.05ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.01ms - 1.06ms-unsure 🔍
-4% - +3%
-0.04ms - +0.03ms
preact-main1.01ms - 1.06msunsure 🔍
-3% - +4%
-0.03ms - +0.04ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local32.95ms - 33.20ms-unsure 🔍
-3% - +1%
-1.05ms - +0.38ms
preact-main32.70ms - 34.12msunsure 🔍
-1% - +3%
-0.38ms - +1.05ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.26ms - 1.26ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.26ms - 1.26msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local29.35ms - 30.69ms-unsure 🔍
-2% - +4%
-0.65ms - +1.15ms
preact-main29.17ms - 30.37msunsure 🔍
-4% - +2%
-1.15ms - +0.65ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.96ms - 2.97ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main2.96ms - 2.96msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-

tachometer-reporter-action v2 for CI

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Size Change: +124 B (+0.16%)

Total Size: 79.3 kB

Filename Size Change
compat/dist/compat.js 4.19 kB +21 B (+0.5%)
compat/dist/compat.mjs 4.12 kB +20 B (+0.49%)
compat/dist/compat.module.js 4.12 kB +20 B (+0.49%)
compat/dist/compat.umd.js 4.26 kB +27 B (+0.64%)
dist/preact.js 4.78 kB +5 B (+0.1%)
dist/preact.min.js 4.81 kB +6 B (+0.12%)
dist/preact.min.module.js 4.81 kB +5 B (+0.1%)
dist/preact.min.umd.js 4.83 kB +6 B (+0.12%)
dist/preact.mjs 4.8 kB +5 B (+0.1%)
dist/preact.module.js 4.8 kB +5 B (+0.1%)
dist/preact.umd.js 4.83 kB +4 B (+0.08%)
ℹ️ View Unchanged
Filename Size
debug/dist/debug.js 3.85 kB
debug/dist/debug.mjs 3.85 kB
debug/dist/debug.module.js 3.85 kB
debug/dist/debug.umd.js 3.93 kB
devtools/dist/devtools.js 260 B
devtools/dist/devtools.mjs 274 B
devtools/dist/devtools.module.js 274 B
devtools/dist/devtools.umd.js 346 B
hooks/dist/hooks.js 1.54 kB
hooks/dist/hooks.mjs 1.57 kB
hooks/dist/hooks.module.js 1.57 kB
hooks/dist/hooks.umd.js 1.61 kB
jsx-runtime/dist/jsxRuntime.js 1.01 kB
jsx-runtime/dist/jsxRuntime.mjs 985 B
jsx-runtime/dist/jsxRuntime.module.js 985 B
jsx-runtime/dist/jsxRuntime.umd.js 1.08 kB
test-utils/dist/testUtils.js 473 B
test-utils/dist/testUtils.mjs 477 B
test-utils/dist/testUtils.module.js 477 B
test-utils/dist/testUtils.umd.js 555 B

compressed-size-action

@JoviDeCroock JoviDeCroock force-pushed the fix-suspense-crash branch 5 times, most recently from c404414 to 795868a Compare November 18, 2025 10:33
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.

4 participants