Skip to content

Comments

Fix crash where a synchronous effect render unmounts the tree#5026

Merged
JoviDeCroock merged 1 commit intov10.xfrom
fix-crash
Feb 18, 2026
Merged

Fix crash where a synchronous effect render unmounts the tree#5026
JoviDeCroock merged 1 commit intov10.xfrom
fix-crash

Conversation

@JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Feb 18, 2026

Summary

Prevent a crash when an effect unmounts its own vnode tree within an effect, this makes the currentComponent unmount and hence we can't reset the hooks array.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-6.20ms - +2.69ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.15ms - +0.09ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +1% (-1.25ms - +0.64ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -1% - +1% (-0.11ms - +0.09ms)
    preact-local vs preact-main
  • replace1k: faster ✔ 0% - 3% (0.06ms - 1.51ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +9% (-0.03ms - +0.17ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +1% (-0.07ms - +0.35ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +4% (-1.21ms - +1.16ms)
    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% - +3% (-0.45ms - +0.24ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +0% (-0.02ms - +0.01ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +1% (-0.06ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -3% - +3% (-0.03ms - +0.03ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +1% (-0.01ms - +0.03ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local912.30ms - 917.42ms-unsure 🔍
-1% - +0%
-6.20ms - +2.69ms
preact-main912.98ms - 920.25msunsure 🔍
-0% - +1%
-2.69ms - +6.20ms
-

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.52ms - 16.64ms-unsure 🔍
-1% - +1%
-0.15ms - +0.09ms
preact-main16.51ms - 16.71msunsure 🔍
-1% - +1%
-0.09ms - +0.15ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.56ms - 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-local59.77ms - 61.07ms-unsure 🔍
-2% - +1%
-1.25ms - +0.64ms
preact-main60.04ms - 61.40msunsure 🔍
-1% - +2%
-0.64ms - +1.25ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local7.87ms - 8.33ms-unsure 🔍
-5% - +3%
-0.45ms - +0.24ms
preact-main7.95ms - 8.47msunsure 🔍
-3% - +6%
-0.24ms - +0.45ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.45ms - 16.54ms-unsure 🔍
-1% - +1%
-0.11ms - +0.09ms
preact-main16.42ms - 16.59msunsure 🔍
-1% - +1%
-0.09ms - +0.11ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.71ms - 3.72ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.71ms - 3.72msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5382
  • Commit: 15e6f29

duration

VersionAvg timevs preact-localvs preact-main
preact-local57.36ms - 58.34ms-faster ✔
0% - 3%
0.06ms - 1.51ms
preact-main58.09ms - 59.17msslower ❌
0% - 3%
0.06ms - 1.51ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.02ms - 3.04ms-unsure 🔍
-1% - +0%
-0.02ms - +0.01ms
preact-main3.02ms - 3.04msunsure 🔍
-0% - +1%
-0.01ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local26.36ms - 27.16ms-unsure 🔍
-3% - +1%
-0.91ms - +0.15ms
preact-main26.79ms - 27.49msunsure 🔍
-1% - +3%
-0.15ms - +0.91ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local33.51ms - 35.02ms-unsure 🔍
-2% - +4%
-0.66ms - +1.40ms
preact-main33.20ms - 34.59msunsure 🔍
-4% - +2%
-1.40ms - +0.66ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local33.35ms - 34.50ms-unsure 🔍
-1% - +4%
-0.37ms - +1.22ms
preact-main32.95ms - 34.04msunsure 🔍
-4% - +1%
-1.22ms - +0.37ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.37ms - 26.77ms-unsure 🔍
-1% - +1%
-0.29ms - +0.29ms
preact-main26.36ms - 26.78msunsure 🔍
-1% - +1%
-0.29ms - +0.29ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local24.06ms - 25.22ms-unsure 🔍
-5% - +2%
-1.34ms - +0.50ms
preact-main24.34ms - 25.77msunsure 🔍
-2% - +5%
-0.50ms - +1.34ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local21.85ms - 22.28ms-unsure 🔍
-3% - +0%
-0.70ms - +0.05ms
preact-main22.09ms - 22.69msunsure 🔍
-0% - +3%
-0.05ms - +0.70ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 230
  • Built by: CI #5382
  • Commit: 15e6f29

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.96ms - 2.11ms-unsure 🔍
-2% - +9%
-0.03ms - +0.17ms
preact-main1.90ms - 2.03msunsure 🔍
-8% - +1%
-0.17ms - +0.03ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.00ms - 1.04ms-unsure 🔍
-5% - +1%
-0.06ms - +0.01ms
preact-main1.01ms - 1.07msunsure 🔍
-1% - +6%
-0.01ms - +0.06ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local33.09ms - 33.45ms-unsure 🔍
-0% - +1%
-0.07ms - +0.35ms
preact-main33.01ms - 33.24msunsure 🔍
-1% - +0%
-0.35ms - +0.07ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.28ms - 1.33ms-unsure 🔍
-3% - +3%
-0.03ms - +0.03ms
preact-main1.28ms - 1.33msunsure 🔍
-3% - +3%
-0.03ms - +0.03ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local27.04ms - 28.64ms-unsure 🔍
-4% - +4%
-1.21ms - +1.16ms
preact-main26.99ms - 28.74msunsure 🔍
-4% - +4%
-1.16ms - +1.21ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.98ms - 3.01ms-unsure 🔍
-0% - +1%
-0.01ms - +0.03ms
preact-main2.97ms - 3.00msunsure 🔍
-1% - +0%
-0.03ms - +0.01ms
-

tachometer-reporter-action v2 for CI

@github-actions
Copy link

Size Change: -22 B (-0.03%)

Total Size: 78.7 kB

Filename Size Change
hooks/dist/hooks.js 1.52 kB -3 B (-0.2%)
hooks/dist/hooks.mjs 1.56 kB -5 B (-0.32%)
hooks/dist/hooks.module.js 1.56 kB -5 B (-0.32%)
hooks/dist/hooks.umd.js 1.59 kB -9 B (-0.56%)
ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 4.18 kB
compat/dist/compat.mjs 4.11 kB
compat/dist/compat.module.js 4.11 kB
compat/dist/compat.umd.js 4.25 kB
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
dist/preact.js 4.72 kB
dist/preact.min.js 4.73 kB
dist/preact.min.module.js 4.74 kB
dist/preact.min.umd.js 4.75 kB
dist/preact.mjs 4.73 kB
dist/preact.module.js 4.73 kB
dist/preact.umd.js 4.76 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

Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JoviDeCroock JoviDeCroock merged commit 8cbed5f into v10.x Feb 18, 2026
14 checks passed
@JoviDeCroock JoviDeCroock deleted the fix-crash branch February 18, 2026 19:37
@JoviDeCroock JoviDeCroock mentioned this pull request Feb 18, 2026
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