Skip to content
New issue

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

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

Already on GitHub? # to your account

Add support for errorInfo #3452

Merged
merged 1 commit into from
Feb 20, 2022
Merged

Add support for errorInfo #3452

merged 1 commit into from
Feb 20, 2022

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Feb 14, 2022

This PR adds support for the errorInfo argument which is the second to componentDidCatch. In React it's used to pass the owner tree along. This is often used in combination with error logging. Note that we'll only collect component traces if preact/debug is loaded.

Fixes #2835, fixes #3118 .
Replaces #2836 .

@github-actions
Copy link

github-actions bot commented Feb 14, 2022

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -1% - +3% (-1.50ms - +5.50ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -4% - +5% (-1.27ms - +1.51ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -1% - +1% (-11.21ms - +18.53ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -3% - +4% (-0.95ms - +1.32ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -3% - +4% (-6.57ms - +8.94ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -3% - +5% (-0.84ms - +1.52ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -4% - +3% (-0.13ms - +0.11ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -1% - +1% (-0.02ms - +0.02ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -1% - +0% (-0.02ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -1% - +3% (-0.01ms - +0.05ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -1% - +0% (-0.05ms - +0.01ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -1% - +0% (-0.03ms - +0.02ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master177.89ms - 182.06ms-unsure 🔍
-3% - +1%
-5.50ms - +1.50ms
preact-local179.16ms - 184.78msunsure 🔍
-1% - +3%
-1.50ms - +5.50ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.61ms - 3.63ms-unsure 🔍
-1% - +1%
-0.02ms - +0.02ms
preact-local3.61ms - 3.64msunsure 🔍
-1% - +1%
-0.02ms - +0.02ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master59.09ms - 61.16ms-unsure 🔍
-1% - +3%
-0.79ms - +1.98ms
preact-local58.60ms - 60.46msunsure 🔍
-3% - +1%
-1.98ms - +0.79ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master86.93ms - 90.63ms-unsure 🔍
-3% - +2%
-2.96ms - +2.03ms
preact-local87.58ms - 90.93msunsure 🔍
-2% - +3%
-2.03ms - +2.96ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master74.47ms - 80.91ms-unsure 🔍
-8% - +3%
-6.39ms - +2.63ms
preact-local76.42ms - 82.72msunsure 🔍
-3% - +8%
-2.63ms - +6.39ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master71.33ms - 78.24ms-unsure 🔍
-0% - +13%
-0.20ms - +8.96ms
preact-local67.39ms - 73.42msunsure 🔍
-12% - +0%
-8.96ms - +0.20ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master87.83ms - 92.01ms-unsure 🔍
-5% - +1%
-4.70ms - +0.89ms
preact-local89.96ms - 93.68msunsure 🔍
-1% - +5%
-0.89ms - +4.70ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master64.82ms - 67.50ms-unsure 🔍
-4% - +2%
-2.52ms - +1.66ms
preact-local64.99ms - 68.19msunsure 🔍
-3% - +4%
-1.66ms - +2.52ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-local
preact-master32.18ms - 34.10ms-unsure 🔍
-5% - +4%
-1.51ms - +1.27ms
preact-local32.25ms - 34.27msunsure 🔍
-4% - +5%
-1.27ms - +1.51ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.44ms - 3.46ms-unsure 🔍
-0% - +1%
-0.01ms - +0.02ms
preact-local3.44ms - 3.46msunsure 🔍
-1% - +0%
-0.02ms - +0.01ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1544.17ms - 1564.27ms-unsure 🔍
-1% - +1%
-18.53ms - +11.21ms
preact-local1546.92ms - 1568.85msunsure 🔍
-1% - +1%
-11.21ms - +18.53ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master25.36ms - 25.36ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local25.36ms - 25.36msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-local
preact-master32.88ms - 34.34ms-unsure 🔍
-4% - +3%
-1.32ms - +0.95ms
preact-local32.92ms - 34.67msunsure 🔍
-3% - +4%
-0.95ms - +1.32ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.60ms - 1.63ms-unsure 🔍
-3% - +0%
-0.05ms - +0.01ms
preact-local1.61ms - 1.65msunsure 🔍
-1% - +3%
-0.01ms - +0.05ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master193.62ms - 204.70ms-unsure 🔍
-4% - +3%
-8.94ms - +6.57ms
preact-local194.92ms - 205.77msunsure 🔍
-3% - +4%
-6.57ms - +8.94ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.23ms - 6.27ms-unsure 🔍
-0% - +1%
-0.01ms - +0.05ms
preact-local6.21ms - 6.25msunsure 🔍
-1% - +0%
-0.05ms - +0.01ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-local
preact-master30.79ms - 32.49ms-unsure 🔍
-5% - +3%
-1.52ms - +0.84ms
preact-local31.16ms - 32.80msunsure 🔍
-3% - +5%
-0.84ms - +1.52ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.67ms - 4.70ms-unsure 🔍
-0% - +1%
-0.02ms - +0.03ms
preact-local4.66ms - 4.69msunsure 🔍
-1% - +0%
-0.03ms - +0.02ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.33ms - 3.53ms-unsure 🔍
-3% - +4%
-0.11ms - +0.13ms
preact-local3.36ms - 3.49msunsure 🔍
-4% - +3%
-0.13ms - +0.11ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master0.82ms - 0.82ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-local0.82ms - 0.82msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Feb 14, 2022

Coverage Status

Coverage decreased (-0.0007%) to 99.625% when pulling 0b35b2f on error-info-2 into df2dbd8 on master.

@github-actions
Copy link

github-actions bot commented Feb 14, 2022

Size Change: +106 B (0%)

Total Size: 42.3 kB

Filename Size Change
compat/dist/compat.js 3.46 kB +2 B (0%)
compat/dist/compat.module.js 3.45 kB +5 B (0%)
compat/dist/compat.umd.js 3.52 kB +5 B (0%)
debug/dist/debug.js 3.01 kB +22 B (0%)
debug/dist/debug.module.js 3 kB +18 B (0%)
debug/dist/debug.umd.js 3.09 kB +18 B (0%)
dist/preact.js 3.98 kB +12 B (0%)
dist/preact.min.js 4.01 kB +9 B (0%)
dist/preact.module.js 4 kB +9 B (0%)
dist/preact.umd.js 4.04 kB +6 B (0%)
ℹ️ View Unchanged
Filename Size Change
devtools/dist/devtools.js 231 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 307 B 0 B
hooks/dist/hooks.js 1.15 kB 0 B
hooks/dist/hooks.module.js 1.17 kB 0 B
hooks/dist/hooks.umd.js 1.23 kB 0 B
jsx-runtime/dist/jsxRuntime.js 317 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 327 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 395 B 0 B
test-utils/dist/testUtils.js 437 B 0 B
test-utils/dist/testUtils.module.js 439 B 0 B
test-utils/dist/testUtils.umd.js 515 B 0 B

compressed-size-action

@marvinhagemeister marvinhagemeister marked this pull request as draft February 14, 2022 14:34
@marvinhagemeister marvinhagemeister force-pushed the error-info-2 branch 3 times, most recently from 50aa879 to 312479a Compare February 19, 2022 20:33
@marvinhagemeister marvinhagemeister marked this pull request as ready for review February 19, 2022 20:39
@adit-hotstar
Copy link

When will this fix be released?

@marvinhagemeister
Copy link
Member Author

@adit-hotstar just published 10.7.0 which includes this PR 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

componentDidCatch should pass the errorInfo parameter. componentDidCatch and errorInfo
4 participants