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 case where parent catches error and switches vnode return type #4182

Merged
merged 4 commits into from
Oct 31, 2023

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Oct 31, 2023

fixes #4178

When we throw in a child and the parent of that child catches the error it would have newVNode._dom and newVNode._children unset meaning we don't derive oldDom correctly. This lead to us just appending a new item. This is similar to what we do in Suspense

@github-actions
Copy link

github-actions bot commented Oct 31, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +3% (-2.23ms - +3.13ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -5% - +2% (-2.13ms - +0.96ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -1% - +1% (-20.86ms - +20.65ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -1% - +2% (-0.36ms - +0.65ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +1% (-0.43ms - +0.88ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -4% - +3% (-1.51ms - +1.24ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -9% - +3% (-0.43ms - +0.16ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +1% (-1.06ms - +0.53ms)
    preact-local vs preact-main

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    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
  • filter_list: unsure 🔍 -1% - +2% (-0.01ms - +0.02ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +0% (-0.02ms - +0.00ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -1% - +1% (-0.02ms - +0.02ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -2% - +4% (-0.01ms - +0.03ms)
    preact-local vs preact-main
  • todo: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main

Results

02_replace1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main104.73ms - 110.07ms-unsure 🔍
-3% - +4%
-3.20ms - +3.89ms
unsure 🔍
-3% - +4%
-3.12ms - +4.09ms
preact-local104.73ms - 109.38msunsure 🔍
-4% - +3%
-3.89ms - +3.20ms
-unsure 🔍
-3% - +3%
-3.22ms - +3.50ms
preact-hooks104.49ms - 109.34msunsure 🔍
-4% - +3%
-4.09ms - +3.12ms
unsure 🔍
-3% - +3%
-3.50ms - +3.22ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.32ms - 3.32ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
faster ✔
0% - 1%
0.02ms - 0.03ms
preact-local3.31ms - 3.32msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-faster ✔
1% - 1%
0.02ms - 0.03ms
preact-hooks3.33ms - 3.35msslower ❌
0% - 1%
0.02ms - 0.03ms
slower ❌
1% - 1%
0.02ms - 0.03ms
-

run-warmup-0

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main47.00ms - 50.07ms-unsure 🔍
-0% - +7%
-0.07ms - +3.40ms
unsure 🔍
-5% - +4%
-2.20ms - +1.83ms
preact-local46.07ms - 47.67msunsure 🔍
-7% - +0%
-3.40ms - +0.07ms
-faster ✔
1% - 7%
0.31ms - 3.38ms
preact-hooks47.41ms - 50.02msunsure 🔍
-4% - +5%
-1.83ms - +2.20ms
slower ❌
1% - 7%
0.31ms - 3.38ms
-

run-warmup-1

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main50.83ms - 52.56ms-unsure 🔍
-2% - +4%
-0.88ms - +2.06ms
faster ✔
1% - 7%
0.57ms - 3.69ms
preact-local49.92ms - 52.30msunsure 🔍
-4% - +2%
-2.06ms - +0.88ms
-faster ✔
2% - 8%
0.95ms - 4.48ms
preact-hooks52.52ms - 55.13msslower ❌
1% - 7%
0.57ms - 3.69ms
slower ❌
2% - 9%
0.95ms - 4.48ms
-

run-warmup-2

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main40.11ms - 41.52ms-unsure 🔍
-4% - +2%
-1.70ms - +0.92ms
unsure 🔍
-5% - +1%
-1.89ms - +0.42ms
preact-local40.11ms - 42.30msunsure 🔍
-2% - +4%
-0.92ms - +1.70ms
-unsure 🔍
-4% - +3%
-1.77ms - +1.08ms
preact-hooks40.64ms - 42.46msunsure 🔍
-1% - +5%
-0.42ms - +1.89ms
unsure 🔍
-3% - +4%
-1.08ms - +1.77ms
-

run-warmup-3

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main34.41ms - 35.84ms-unsure 🔍
-3% - +3%
-1.05ms - +1.03ms
faster ✔
1% - 7%
0.30ms - 2.41ms
preact-local34.38ms - 35.88msunsure 🔍
-3% - +3%
-1.03ms - +1.05ms
-faster ✔
1% - 7%
0.27ms - 2.42ms
preact-hooks35.71ms - 37.25msslower ❌
1% - 7%
0.30ms - 2.41ms
slower ❌
1% - 7%
0.27ms - 2.42ms
-

run-warmup-4

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main48.32ms - 52.28ms-unsure 🔍
-6% - +6%
-2.80ms - +2.93ms
unsure 🔍
-9% - +1%
-4.78ms - +0.59ms
preact-local48.16ms - 52.30msunsure 🔍
-6% - +6%
-2.93ms - +2.80ms
-unsure 🔍
-9% - +1%
-4.91ms - +0.59ms
preact-hooks50.58ms - 54.20msunsure 🔍
-1% - +10%
-0.59ms - +4.78ms
unsure 🔍
-1% - +10%
-0.59ms - +4.91ms
-

run-final

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main29.88ms - 34.23ms-unsure 🔍
-8% - +9%
-2.61ms - +2.92ms
unsure 🔍
-9% - +9%
-2.86ms - +2.86ms
preact-local30.19ms - 33.61msunsure 🔍
-9% - +8%
-2.92ms - +2.61ms
-unsure 🔍
-8% - +7%
-2.68ms - +2.37ms
preact-hooks30.20ms - 33.91msunsure 🔍
-9% - +9%
-2.86ms - +2.86ms
unsure 🔍
-7% - +8%
-2.37ms - +2.68ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main33.20ms - 34.93ms-unsure 🔍
-2% - +5%
-0.78ms - +1.65ms
unsure 🔍
-7% - +1%
-2.43ms - +0.22ms
preact-local32.77ms - 34.48msunsure 🔍
-5% - +2%
-1.65ms - +0.78ms
-faster ✔
1% - 8%
0.22ms - 2.86ms
preact-hooks34.17ms - 36.17msunsure 🔍
-1% - +7%
-0.22ms - +2.43ms
slower ❌
1% - 9%
0.22ms - 2.86ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.28ms - 3.28ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
1% - 1%
0.02ms - 0.03ms
preact-local3.28ms - 3.28msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-faster ✔
1% - 1%
0.02ms - 0.03ms
preact-hooks3.30ms - 3.31msslower ❌
1% - 1%
0.02ms - 0.03ms
slower ❌
1% - 1%
0.02ms - 0.03ms
-
07_create10k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1232.06ms - 1245.47ms-unsure 🔍
-0% - +1%
-4.27ms - +12.13ms
unsure 🔍
-1% - +1%
-9.46ms - +6.97ms
preact-local1230.12ms - 1239.55msunsure 🔍
-1% - +0%
-12.13ms - +4.27ms
-unsure 🔍
-1% - +0%
-11.87ms - +1.51ms
preact-hooks1235.26ms - 1244.75msunsure 🔍
-1% - +1%
-6.97ms - +9.46ms
unsure 🔍
-0% - +1%
-1.51ms - +11.87ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.32ms - 26.32ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local26.32ms - 26.32msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks26.34ms - 26.34msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main22.94ms - 23.47ms-unsure 🔍
-4% - +2%
-0.98ms - +0.42ms
unsure 🔍
-1% - +2%
-0.24ms - +0.49ms
preact-local22.84ms - 24.13msunsure 🔍
-2% - +4%
-0.42ms - +0.98ms
-unsure 🔍
-1% - +5%
-0.28ms - +1.10ms
preact-hooks22.83ms - 23.33msunsure 🔍
-2% - +1%
-0.49ms - +0.24ms
unsure 🔍
-5% - +1%
-1.10ms - +0.28ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1.33ms - 1.34ms-unsure 🔍
-1% - +1%
-0.01ms - +0.01ms
faster ✔
1% - 2%
0.01ms - 0.03ms
preact-local1.33ms - 1.34msunsure 🔍
-1% - +1%
-0.01ms - +0.01ms
-faster ✔
1% - 2%
0.01ms - 0.03ms
preact-hooks1.35ms - 1.36msslower ❌
1% - 2%
0.01ms - 0.03ms
slower ❌
1% - 2%
0.01ms - 0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main121.41ms - 122.59ms-unsure 🔍
-0% - +1%
-0.50ms - +1.06ms
unsure 🔍
-0% - +1%
-0.38ms - +1.05ms
preact-local121.21ms - 122.23msunsure 🔍
-1% - +0%
-1.06ms - +0.50ms
-unsure 🔍
-0% - +1%
-0.59ms - +0.71ms
preact-hooks121.27ms - 122.06msunsure 🔍
-1% - +0%
-1.05ms - +0.38ms
unsure 🔍
-1% - +0%
-0.71ms - +0.59ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main6.12ms - 6.12ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
0% - 1%
0.02ms - 0.03ms
preact-local6.12ms - 6.12msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-hooks6.14ms - 6.15msslower ❌
0% - 1%
0.02ms - 0.03ms
unsure 🔍
+0% - +0%
+0.02ms - +0.03ms
-
many_updates

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main27.52ms - 28.55ms-unsure 🔍
-1% - +3%
-0.41ms - +0.96ms
unsure 🔍
-5% - +1%
-1.45ms - +0.38ms
preact-local27.31ms - 28.21msunsure 🔍
-3% - +1%
-0.96ms - +0.41ms
-unsure 🔍
-6% - +0%
-1.69ms - +0.07ms
preact-hooks27.81ms - 29.33msunsure 🔍
-1% - +5%
-0.38ms - +1.45ms
unsure 🔍
-0% - +6%
-0.07ms - +1.69ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main4.51ms - 4.54ms-unsure 🔍
-0% - +1%
-0.01ms - +0.04ms
unsure 🔍
-1% - +0%
-0.03ms - +0.02ms
preact-local4.49ms - 4.53msunsure 🔍
-1% - +0%
-0.04ms - +0.01ms
-unsure 🔍
-1% - +0%
-0.05ms - +0.00ms
preact-hooks4.51ms - 4.55msunsure 🔍
-0% - +1%
-0.02ms - +0.03ms
unsure 🔍
-0% - +1%
-0.00ms - +0.05ms
-
text_update

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.67ms - 3.99ms-unsure 🔍
-6% - +6%
-0.23ms - +0.23ms
faster ✔
1% - 12%
0.01ms - 0.50ms
preact-local3.67ms - 4.00msunsure 🔍
-6% - +6%
-0.23ms - +0.23ms
-faster ✔
0% - 12%
0.01ms - 0.50ms
preact-hooks3.91ms - 4.27msslower ❌
0% - 13%
0.01ms - 0.50ms
slower ❌
0% - 13%
0.01ms - 0.50ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.64ms - 0.67ms-unsure 🔍
-3% - +3%
-0.02ms - +0.02ms
faster ✔
1% - 6%
0.00ms - 0.04ms
preact-local0.65ms - 0.67msunsure 🔍
-3% - +3%
-0.02ms - +0.02ms
-faster ✔
0% - 6%
0.00ms - 0.04ms
preact-hooks0.67ms - 0.69msslower ❌
1% - 7%
0.00ms - 0.04ms
slower ❌
0% - 6%
0.00ms - 0.04ms
-
todo

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main44.65ms - 46.33ms-unsure 🔍
-2% - +3%
-0.94ms - +1.39ms
unsure 🔍
-4% - +1%
-1.90ms - +0.44ms
preact-local44.46ms - 46.07msunsure 🔍
-3% - +2%
-1.39ms - +0.94ms
-unsure 🔍
-5% - +0%
-2.10ms - +0.19ms
preact-hooks45.41ms - 47.03msunsure 🔍
-1% - +4%
-0.44ms - +1.90ms
unsure 🔍
-0% - +5%
-0.19ms - +2.10ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.78ms - 0.78ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
faster ✔
3% - 3%
0.03ms - 0.03ms
preact-local0.78ms - 0.78msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-faster ✔
3% - 3%
0.02ms - 0.03ms
preact-hooks0.80ms - 0.80msslower ❌
3% - 3%
0.03ms - 0.03ms
slower ❌
3% - 3%
0.02ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@github-actions
Copy link

github-actions bot commented Oct 31, 2023

Size Change: +17 B (0%)

Total Size: 57.3 kB

Filename Size Change
dist/preact.js 4.42 kB +3 B (0%)
dist/preact.min.js 4.46 kB +3 B (0%)
dist/preact.min.module.js 4.45 kB +3 B (0%)
dist/preact.min.umd.js 4.48 kB +3 B (0%)
dist/preact.module.js 4.45 kB +2 B (0%)
dist/preact.umd.js 4.49 kB +3 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.97 kB 0 B
compat/dist/compat.module.js 3.9 kB 0 B
compat/dist/compat.umd.js 4.04 kB 0 B
debug/dist/debug.js 3.5 kB 0 B
debug/dist/debug.module.js 3.5 kB 0 B
debug/dist/debug.umd.js 3.58 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 315 B 0 B
hooks/dist/hooks.js 1.53 kB 0 B
hooks/dist/hooks.module.js 1.56 kB 0 B
hooks/dist/hooks.umd.js 1.62 kB 0 B
jsx-runtime/dist/jsxRuntime.js 365 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 331 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 445 B 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

Copy link
Member

@andrewiggins andrewiggins left a comment

Choose a reason for hiding this comment

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

Ah yes, good call!

src/diff/catch-error.js Outdated Show resolved Hide resolved
src/diff/catch-error.js Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Oct 31, 2023

Coverage Status

Changes unknown when pulling 0594993 on fix-errors into ** on main**.

@JoviDeCroock JoviDeCroock merged commit 4cad961 into main Oct 31, 2023
12 of 13 checks passed
@JoviDeCroock JoviDeCroock deleted the fix-errors branch October 31, 2023 10:22
@JoviDeCroock JoviDeCroock mentioned this pull request Nov 3, 2023
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.

useErrorBoundary causes double rendering of list item
3 participants