Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check whether oldDom is present in the DOM #4318

Merged
merged 6 commits into from
Apr 5, 2024
Merged

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Mar 22, 2024

Fixes #4194

This was a bit of a tricky one and haven't been able to reproduce this in tests but the base case looks like the following

Suspense
  Component --> Fragment-like
    Component --> Fragment-like
      some-dom-node
  LazyComponent --> Fragment-like
    LazyComponent --> Fragment-like
      some-dom-node

The main issue is that in nested fragment-like children we can have a very deep chain of components where the last one eventually resolves to unmounting the children. This is problematic because we bubble back up to the _parent where the _nextDom/oldDom is already set but can be unmounted by a later Fragment-like child.

This effectively means that _nextDom on all parents is going to be invalid, we however can't course-correct as we've already higher-up in the stack assigned oldDom which now in-turn can become invalid by the first call to diff.

My naive solution for this is to check isConnected and get a new DOM-Sibling, this re-checks the children and shouldn't come up with an old-node as we are post-diff. Open to any other solutions here.

For debugging I copied the sandbox attached in the issue in our demo and logged that way.

@JoviDeCroock JoviDeCroock marked this pull request as draft March 22, 2024 07:14
Copy link

github-actions bot commented Mar 22, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -1% - +3% (-1.12ms - +2.37ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -4% - +2% (-1.38ms - +0.72ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -0% - +2% (-1.93ms - +18.69ms)
    preact-local vs preact-main
  • create10k: unsure 🔍 -1% - +1% (-5.35ms - +7.26ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.14ms - +0.10ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -1% - +3% (-0.19ms - +0.54ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +2% (-0.25ms - +1.35ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +3% (-0.93ms - +2.28ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -2% - +2% (-0.34ms - +0.36ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -1% - +3% (-0.21ms - +0.53ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -2% - +1% (-1.30ms - +0.59ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -3% - +4% (-0.05ms - +0.07ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -2% - +4% (-0.04ms - +0.09ms)
    preact-local vs preact-main
  • todo: slower ❌ 2% - 5% (0.56ms - 1.44ms)
    preact-local vs preact-main
  • todo: slower ❌ 2% - 5% (0.67ms - 1.31ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -5% - +4% (-1.88ms - +1.39ms)
    preact-local vs preact-main

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-main
  • 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
  • filter_list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -2% - +0% (-0.02ms - +0.00ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -2% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    preact-local vs preact-main

Results

02_replace1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main74.83ms - 77.53ms-unsure 🔍
-3% - +1%
-2.37ms - +1.12ms
unsure 🔍
-3% - +1%
-2.63ms - +0.52ms
preact-local75.69ms - 77.92msunsure 🔍
-1% - +3%
-1.12ms - +2.37ms
-unsure 🔍
-2% - +1%
-1.81ms - +0.95ms
preact-hooks76.42ms - 78.05msunsure 🔍
-1% - +3%
-0.52ms - +2.63ms
unsure 🔍
-1% - +2%
-0.95ms - +1.81ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.38ms - 3.39ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
0% - 1%
0.02ms - 0.02ms
preact-local3.38ms - 3.39msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.02ms
preact-hooks3.40ms - 3.40msslower ❌
0% - 1%
0.02ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.02ms
-

run-warmup-0

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main29.61ms - 30.44ms-unsure 🔍
-2% - +2%
-0.45ms - +0.61ms
faster ✔
1% - 4%
0.18ms - 1.38ms
preact-local29.62ms - 30.27msunsure 🔍
-2% - +1%
-0.61ms - +0.45ms
-faster ✔
1% - 5%
0.32ms - 1.41ms
preact-hooks30.37ms - 31.24msslower ❌
1% - 5%
0.18ms - 1.38ms
slower ❌
1% - 5%
0.32ms - 1.41ms
-

run-warmup-1

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main39.67ms - 41.27ms-unsure 🔍
-4% - +2%
-1.46ms - +0.69ms
faster ✔
1% - 5%
0.43ms - 2.23ms
preact-local40.14ms - 41.57msunsure 🔍
-2% - +4%
-0.69ms - +1.46ms
-faster ✔
0% - 4%
0.12ms - 1.77ms
preact-hooks41.39ms - 42.21msslower ❌
1% - 6%
0.43ms - 2.23ms
slower ❌
0% - 4%
0.12ms - 1.77ms
-

run-warmup-2

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.90ms - 27.28ms-unsure 🔍
-2% - +0%
-0.45ms - +0.13ms
unsure 🔍
-0% - +1%
-0.13ms - +0.38ms
preact-local27.02ms - 27.47msunsure 🔍
-0% - +2%
-0.13ms - +0.45ms
-slower ❌
0% - 2%
0.00ms - 0.57ms
preact-hooks26.79ms - 27.13msunsure 🔍
-1% - +0%
-0.38ms - +0.13ms
faster ✔
0% - 2%
0.00ms - 0.57ms
-

run-warmup-3

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main25.18ms - 26.11ms-unsure 🔍
-3% - +2%
-0.83ms - +0.59ms
unsure 🔍
-2% - +4%
-0.60ms - +0.91ms
preact-local25.23ms - 26.30msunsure 🔍
-2% - +3%
-0.59ms - +0.83ms
-unsure 🔍
-2% - +4%
-0.53ms - +1.07ms
preact-hooks24.90ms - 26.09msunsure 🔍
-4% - +2%
-0.91ms - +0.60ms
unsure 🔍
-4% - +2%
-1.07ms - +0.53ms
-

run-warmup-4

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main25.57ms - 26.73ms-unsure 🔍
-3% - +3%
-0.75ms - +0.79ms
faster ✔
3% - 8%
0.75ms - 2.26ms
preact-local25.63ms - 26.63msunsure 🔍
-3% - +3%
-0.79ms - +0.75ms
-faster ✔
3% - 8%
0.83ms - 2.22ms
preact-hooks27.18ms - 28.13msslower ❌
3% - 9%
0.75ms - 2.26ms
slower ❌
3% - 9%
0.83ms - 2.22ms
-

run-final

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main22.21ms - 23.09ms-unsure 🔍
-2% - +3%
-0.54ms - +0.62ms
faster ✔
5% - 10%
1.11ms - 2.48ms
preact-local22.22ms - 22.99msunsure 🔍
-3% - +2%
-0.62ms - +0.54ms
-faster ✔
5% - 10%
1.19ms - 2.48ms
preact-hooks23.92ms - 24.96msslower ❌
5% - 11%
1.11ms - 2.48ms
slower ❌
5% - 11%
1.19ms - 2.48ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main33.82ms - 35.47ms-unsure 🔍
-2% - +4%
-0.72ms - +1.38ms
unsure 🔍
-3% - +5%
-0.91ms - +1.58ms
preact-local33.66ms - 34.97msunsure 🔍
-4% - +2%
-1.38ms - +0.72ms
-unsure 🔍
-3% - +3%
-1.14ms - +1.15ms
preact-hooks33.37ms - 35.25msunsure 🔍
-5% - +3%
-1.58ms - +0.91ms
unsure 🔍
-3% - +3%
-1.15ms - +1.14ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.35ms - 3.36ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
faster ✔
0% - 1%
0.01ms - 0.03ms
preact-local3.35ms - 3.36msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.03ms
preact-hooks3.37ms - 3.38msslower ❌
0% - 1%
0.01ms - 0.03ms
slower ❌
0% - 1%
0.01ms - 0.03ms
-
07_create10k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main897.94ms - 902.96ms-unsure 🔍
-2% - +0%
-18.69ms - +1.93ms
unsure 🔍
-1% - +0%
-9.92ms - +0.34ms
preact-local898.82ms - 918.83msunsure 🔍
-0% - +2%
-1.93ms - +18.69ms
-unsure 🔍
-1% - +2%
-7.37ms - +14.55ms
preact-hooks900.76ms - 909.71msunsure 🔍
-0% - +1%
-0.34ms - +9.92ms
unsure 🔍
-2% - +1%
-14.55ms - +7.37ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.16ms - 26.16ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local26.16ms - 26.16msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks26.18ms - 26.18msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local883.81ms - 894.39ms-unsure 🔍
-1% - +1%
-5.35ms - +7.26ms
preact-main884.72ms - 891.58msunsure 🔍
-1% - +1%
-7.26ms - +5.35ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local26.79ms - 26.79ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main26.79ms - 26.79msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.57ms - 16.66ms-unsure 🔍
-1% - +1%
-0.14ms - +0.10ms
preact-main16.53ms - 16.75msunsure 🔍
-1% - +1%
-0.10ms - +0.14ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.64ms - 1.64ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.63ms - 1.64msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter_list

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main16.56ms - 16.61ms-unsure 🔍
-3% - +1%
-0.54ms - +0.19ms
unsure 🔍
-1% - +0%
-0.11ms - +0.03ms
preact-local16.40ms - 17.12msunsure 🔍
-1% - +3%
-0.19ms - +0.54ms
-unsure 🔍
-1% - +3%
-0.23ms - +0.51ms
preact-hooks16.56ms - 16.69msunsure 🔍
-0% - +1%
-0.03ms - +0.11ms
unsure 🔍
-3% - +1%
-0.51ms - +0.23ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1.42ms - 1.42ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
2% - 2%
0.02ms - 0.03ms
preact-local1.42ms - 1.42msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
2% - 2%
0.02ms - 0.03ms
preact-hooks1.44ms - 1.45msslower ❌
2% - 2%
0.02ms - 0.03ms
slower ❌
2% - 2%
0.02ms - 0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main74.31ms - 75.12ms-unsure 🔍
-2% - +0%
-1.35ms - +0.25ms
unsure 🔍
-1% - +0%
-1.01ms - +0.21ms
preact-local74.57ms - 75.96msunsure 🔍
-0% - +2%
-0.25ms - +1.35ms
-unsure 🔍
-1% - +1%
-0.68ms - +0.97ms
preact-hooks74.66ms - 75.58msunsure 🔍
-0% - +1%
-0.21ms - +1.01ms
unsure 🔍
-1% - +1%
-0.97ms - +0.68ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main6.05ms - 6.05ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local6.04ms - 6.05msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-hooks6.07ms - 6.07msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local68.61ms - 71.51ms-unsure 🔍
-1% - +3%
-0.93ms - +2.28ms
preact-main68.69ms - 70.08msunsure 🔍
-3% - +1%
-2.28ms - +0.93ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local6.46ms - 6.47ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main6.46ms - 6.47msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.44ms - 17.00ms-unsure 🔍
-2% - +2%
-0.34ms - +0.36ms
preact-main16.51ms - 16.92msunsure 🔍
-2% - +2%
-0.36ms - +0.34ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.74ms - 4.74ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main4.74ms - 4.74msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
many_updates

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main16.56ms - 17.09ms-unsure 🔍
-3% - +1%
-0.53ms - +0.21ms
unsure 🔍
-4% - +1%
-0.65ms - +0.11ms
preact-local16.73ms - 17.24msunsure 🔍
-1% - +3%
-0.21ms - +0.53ms
-unsure 🔍
-3% - +2%
-0.48ms - +0.26ms
preact-hooks16.83ms - 17.36msunsure 🔍
-1% - +4%
-0.11ms - +0.65ms
unsure 🔍
-2% - +3%
-0.26ms - +0.48ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main4.52ms - 4.52ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
0% - 1%
0.02ms - 0.02ms
preact-local4.52ms - 4.52msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
0% - 1%
0.02ms - 0.02ms
preact-hooks4.54ms - 4.55msslower ❌
0% - 1%
0.02ms - 0.02ms
slower ❌
0% - 1%
0.02ms - 0.02ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local69.16ms - 70.51ms-unsure 🔍
-2% - +1%
-1.30ms - +0.59ms
preact-main69.53ms - 70.85msunsure 🔍
-1% - +2%
-0.59ms - +1.30ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.66ms - 3.67ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-main3.66ms - 3.67msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local27.97ms - 28.46ms-unsure 🔍
-2% - +0%
-0.58ms - +0.13ms
preact-main28.19ms - 28.69msunsure 🔍
-0% - +2%
-0.13ms - +0.58ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local35.48ms - 37.38ms-unsure 🔍
-3% - +5%
-0.90ms - +1.64ms
preact-main35.22ms - 36.90msunsure 🔍
-4% - +2%
-1.64ms - +0.90ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local25.69ms - 26.01ms-faster ✔
0% - 3%
0.07ms - 0.89ms
preact-main25.96ms - 26.71msslower ❌
0% - 3%
0.07ms - 0.89ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local23.82ms - 24.58ms-unsure 🔍
-4% - +1%
-1.02ms - +0.24ms
preact-main24.09ms - 25.09msunsure 🔍
-1% - +4%
-0.24ms - +1.02ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local29.55ms - 31.26ms-unsure 🔍
-4% - +5%
-1.07ms - +1.48ms
preact-main29.26ms - 31.14msunsure 🔍
-5% - +4%
-1.48ms - +1.07ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local21.74ms - 22.31ms-unsure 🔍
-2% - +2%
-0.48ms - +0.35ms
preact-main21.79ms - 22.40msunsure 🔍
-2% - +2%
-0.35ms - +0.48ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.78ms-unsure 🔍
-3% - +4%
-0.05ms - +0.07ms
preact-main1.68ms - 1.78msunsure 🔍
-4% - +3%
-0.07ms - +0.05ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.01ms - 1.01ms-unsure 🔍
-2% - +0%
-0.02ms - +0.00ms
preact-main1.01ms - 1.03msunsure 🔍
-0% - +2%
-0.00ms - +0.02ms
-
text_update

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main2.39ms - 2.48ms-unsure 🔍
-3% - +2%
-0.09ms - +0.04ms
faster ✔
6% - 11%
0.16ms - 0.28ms
preact-local2.41ms - 2.50msunsure 🔍
-2% - +4%
-0.04ms - +0.09ms
-faster ✔
5% - 10%
0.13ms - 0.26ms
preact-hooks2.61ms - 2.70msslower ❌
6% - 12%
0.16ms - 0.28ms
slower ❌
5% - 11%
0.13ms - 0.26ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.80ms - 0.82ms-unsure 🔍
-0% - +2%
-0.00ms - +0.01ms
faster ✔
2% - 4%
0.01ms - 0.03ms
preact-local0.80ms - 0.80msunsure 🔍
-2% - +0%
-0.01ms - +0.00ms
-faster ✔
3% - 3%
0.02ms - 0.03ms
preact-hooks0.83ms - 0.83msslower ❌
2% - 4%
0.01ms - 0.03ms
slower ❌
3% - 3%
0.02ms - 0.03ms
-
todo

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.05ms - 26.79ms-faster ✔
2% - 5%
0.56ms - 1.44ms
faster ✔
5% - 7%
1.32ms - 2.08ms
preact-local27.19ms - 27.66msslower ❌
2% - 5%
0.56ms - 1.44ms
-faster ✔
2% - 3%
0.45ms - 0.95ms
preact-hooks28.04ms - 28.21msslower ❌
5% - 8%
1.32ms - 2.08ms
slower ❌
2% - 4%
0.45ms - 0.95ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.88ms - 0.88ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
faster ✔
3% - 3%
0.03ms - 0.03ms
preact-local0.88ms - 0.88msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-faster ✔
3% - 3%
0.03ms - 0.03ms
preact-hooks0.91ms - 0.91msslower ❌
3% - 3%
0.03ms - 0.03ms
slower ❌
3% - 3%
0.03ms - 0.03ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local27.50ms - 28.05ms-slower ❌
2% - 5%
0.67ms - 1.31ms
preact-main26.61ms - 26.95msfaster ✔
2% - 5%
0.67ms - 1.31ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-localvs preact-main
preact-local37.79ms - 40.35ms-unsure 🔍
-5% - +4%
-1.88ms - +1.39ms
preact-main38.30ms - 40.33msunsure 🔍
-4% - +5%
-1.39ms - +1.88ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.58ms - 3.59ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-main3.58ms - 3.60msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link

github-actions bot commented Mar 22, 2024

Size Change: +42 B (0%)

Total Size: 60.3 kB

Filename Size Change
dist/preact.js 4.56 kB +7 B (0%)
dist/preact.min.js 4.6 kB +7 B (0%)
dist/preact.min.module.js 4.59 kB +6 B (0%)
dist/preact.min.umd.js 4.62 kB +7 B (0%)
dist/preact.module.js 4.58 kB +7 B (0%)
dist/preact.umd.js 4.63 kB +8 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 4.05 kB 0 B
compat/dist/compat.module.js 3.98 kB 0 B
compat/dist/compat.umd.js 4.11 kB 0 B
debug/dist/debug.js 3.52 kB 0 B
debug/dist/debug.module.js 3.52 kB 0 B
debug/dist/debug.umd.js 3.6 kB 0 B
devtools/dist/devtools.js 231 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 314 B 0 B
hooks/dist/hooks.js 1.55 kB 0 B
hooks/dist/hooks.module.js 1.59 kB 0 B
hooks/dist/hooks.umd.js 1.63 kB 0 B
jsx-runtime/dist/jsxRuntime.js 963 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 938 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 1.04 kB 0 B
test-utils/dist/testUtils.js 453 B 0 B
test-utils/dist/testUtils.module.js 454 B 0 B
test-utils/dist/testUtils.umd.js 536 B 0 B

compressed-size-action

@coveralls
Copy link

Coverage Status

coverage: 99.601%. remained the same
when pulling 5a86be1 on add-is-connected
into a59a78c on main.

@coveralls
Copy link

coveralls commented Mar 22, 2024

Coverage Status

coverage: 99.601%. remained the same
when pulling fa8e138 on add-is-connected
into 3a1b19a on main.

@JoviDeCroock JoviDeCroock marked this pull request as ready for review March 31, 2024 11:56
@bagratinho
Copy link

@JoviDeCroock I'm experiencing the insertBefore error on the latest preact on a list that gets frequently changed. Unfortunately I cant provide a stable reproduction steps.
I have seen your description of this fix and I'm curious what type of structures of component should I avoid to get a workaround on that error, particularly what you refer under Fragment-like?
Is having nested fragments inside my list item components can be the reason I have this error thrown sometimes?

@JoviDeCroock
Copy link
Member Author

@bagratinho I'd love to have a reproduction but yes, nested fragments or components that just return children are fragment-like.

@andrewburgess
Copy link

andrewburgess commented Jun 14, 2024

I started seeing errors similar to what @bagratinho is mentioning as well, and in my case is related to Google Chrome's auto translation.

I put together a minimal reproduction that seems to trigger in the REPL env as well. This doesn't throw an error with 10.20.1, but does when using >=10.20.2

import { render, h } from 'preact';
import { useState, useEffect } from 'preact/hooks';

const Button = (props) => {
    return (
        <div>
            <p>hello {props.label} there</p>
        </div>
    );
};

function App() {
    const [, setValue] = useState(0);

    useEffect(() => {
        const interval = setInterval(() => setValue((v) => v + 1), 1000);

        return () => clearInterval(interval);
    }, []);

    return (
        <>
            <h1>Hello</h1>
            <Button label="Next" />
        </>
    );
}

render(<App />, document.getElementById('app'));

preact

I narrowed it down to this tag for when the issue started happening https://github.com/preactjs/preact/releases/tag/10.20.2 so that's why I'm assuming this commit is related.

Let me know if you want me to migrate this to an issue for better tracking

@JoviDeCroock
Copy link
Member Author

Thank you both for the input, I will try and look at the translate example. If you find one without it as the first message here implies please share 🙏

@JoviDeCroock
Copy link
Member Author

@andrewburgess I would encourage you to try out #4409 if possible

@andrewburgess
Copy link

@JoviDeCroock checked it out and seems to solve the issue, thanks for looking into it!

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.

10.18.2 regression: Cannot read properties of undefined
5 participants