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 hook update not being applied when a forced context update was enqueued at the same time #3922

Merged
merged 5 commits into from
Mar 8, 2023

Conversation

marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Mar 1, 2023

Fix hook update not being applied when a forced context update was enqueued at the same time. This fixes a regression that was introduced in #3889 which was released as 10.12.1.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +3% (-2.54ms - +3.56ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -2% - +6% (-0.61ms - +1.91ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -1% - +0% (-8.71ms - +5.15ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -1% - +1% (-0.29ms - +0.31ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -1% - +3% (-0.90ms - +5.19ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -2% - +4% (-0.39ms - +0.85ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +3% (-0.04ms - +0.08ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -1% - +4% (-0.79ms - +3.55ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -4% - +5% (-0.45ms - +0.65ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master

Results

02_replace1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master139.52ms - 143.84ms-unsure 🔍
-2% - +2%
-3.56ms - +2.54ms
unsure 🔍
-2% - +2%
-3.25ms - +2.88ms
preact-local140.04ms - 144.34msunsure 🔍
-2% - +3%
-2.54ms - +3.56ms
-unsure 🔍
-2% - +2%
-2.74ms - +3.38ms
preact-hooks139.69ms - 144.04msunsure 🔍
-2% - +2%
-2.88ms - +3.25ms
unsure 🔍
-2% - +2%
-3.38ms - +2.74ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.38ms - 3.39ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
unsure 🔍
-9% - -0%
-0.33ms - +0.00ms
preact-local3.39ms - 3.39msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-unsure 🔍
-9% - -0%
-0.33ms - +0.01ms
preact-hooks3.38ms - 3.72msunsure 🔍
-0% - +10%
-0.00ms - +0.33ms
unsure 🔍
-0% - +10%
-0.01ms - +0.33ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master46.87ms - 48.83ms-unsure 🔍
-2% - +3%
-0.83ms - +1.61ms
faster ✔
2% - 8%
0.83ms - 3.91ms
preact-local46.74ms - 48.19msunsure 🔍
-3% - +2%
-1.61ms - +0.83ms
-faster ✔
3% - 8%
1.37ms - 4.15ms
preact-hooks49.03ms - 51.41msslower ❌
2% - 8%
0.83ms - 3.91ms
slower ❌
3% - 9%
1.37ms - 4.15ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master70.76ms - 73.08ms-unsure 🔍
-4% - +1%
-2.67ms - +0.91ms
unsure 🔍
-3% - +1%
-2.26ms - +1.05ms
preact-local71.44ms - 74.16msunsure 🔍
-1% - +4%
-0.91ms - +2.67ms
-unsure 🔍
-2% - +3%
-1.53ms - +2.08ms
preact-hooks71.34ms - 73.71msunsure 🔍
-1% - +3%
-1.05ms - +2.26ms
unsure 🔍
-3% - +2%
-2.08ms - +1.53ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master50.63ms - 54.72ms-unsure 🔍
-5% - +6%
-2.80ms - +2.96ms
unsure 🔍
-6% - +5%
-3.03ms - +2.80ms
preact-local50.56ms - 54.62msunsure 🔍
-6% - +5%
-2.96ms - +2.80ms
-unsure 🔍
-6% - +5%
-3.10ms - +2.70ms
preact-hooks50.71ms - 54.86msunsure 🔍
-5% - +6%
-2.80ms - +3.03ms
unsure 🔍
-5% - +6%
-2.70ms - +3.10ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master61.37ms - 66.19ms-unsure 🔍
-6% - +6%
-3.71ms - +3.77ms
unsure 🔍
-9% - +1%
-6.01ms - +0.77ms
preact-local60.89ms - 66.61msunsure 🔍
-6% - +6%
-3.77ms - +3.71ms
-unsure 🔍
-10% - +2%
-6.37ms - +1.07ms
preact-hooks64.02ms - 68.78msunsure 🔍
-1% - +10%
-0.77ms - +6.01ms
unsure 🔍
-2% - +10%
-1.07ms - +6.37ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master65.18ms - 67.34ms-unsure 🔍
-2% - +3%
-1.52ms - +1.89ms
unsure 🔍
-3% - +2%
-2.08ms - +1.07ms
preact-local64.75ms - 67.40msunsure 🔍
-3% - +2%
-1.89ms - +1.52ms
-unsure 🔍
-4% - +2%
-2.45ms - +1.06ms
preact-hooks65.61ms - 67.92msunsure 🔍
-2% - +3%
-1.07ms - +2.08ms
unsure 🔍
-2% - +4%
-1.06ms - +2.45ms
-

run-final

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master39.83ms - 43.65ms-unsure 🔍
-9% - +4%
-4.04ms - +1.59ms
unsure 🔍
-8% - +5%
-3.42ms - +2.02ms
preact-local40.89ms - 45.03msunsure 🔍
-4% - +10%
-1.59ms - +4.04ms
-unsure 🔍
-5% - +8%
-2.31ms - +3.36ms
preact-hooks40.50ms - 44.37msunsure 🔍
-5% - +8%
-2.02ms - +3.42ms
unsure 🔍
-8% - +5%
-3.36ms - +2.31ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master32.08ms - 33.77ms-unsure 🔍
-6% - +2%
-1.91ms - +0.61ms
unsure 🔍
-6% - +2%
-1.94ms - +0.62ms
preact-local32.64ms - 34.51msunsure 🔍
-2% - +6%
-0.61ms - +1.91ms
-unsure 🔍
-4% - +4%
-1.35ms - +1.34ms
preact-hooks32.62ms - 34.54msunsure 🔍
-2% - +6%
-0.62ms - +1.94ms
unsure 🔍
-4% - +4%
-1.34ms - +1.35ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master3.44ms - 3.45ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.44ms - 3.45msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-faster ✔
0% - 1%
0.01ms - 0.02ms
preact-hooks3.46ms - 3.47msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.02ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1211.14ms - 1222.21ms-unsure 🔍
-0% - +1%
-5.15ms - +8.71ms
unsure 🔍
-1% - +0%
-9.66ms - +4.93ms
preact-local1210.73ms - 1219.06msunsure 🔍
-1% - +0%
-8.71ms - +5.15ms
-unsure 🔍
-1% - +0%
-10.46ms - +2.17ms
preact-hooks1214.29ms - 1223.79msunsure 🔍
-0% - +1%
-4.93ms - +9.66ms
unsure 🔍
-0% - +1%
-2.17ms - +10.46ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master25.36ms - 25.36ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local25.36ms - 25.36msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks25.38ms - 25.38msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master23.17ms - 23.53ms-unsure 🔍
-1% - +1%
-0.31ms - +0.29ms
unsure 🔍
-2% - +1%
-0.38ms - +0.12ms
preact-local23.12ms - 23.61msunsure 🔍
-1% - +1%
-0.29ms - +0.31ms
-unsure 🔍
-2% - +1%
-0.42ms - +0.18ms
preact-hooks23.30ms - 23.66msunsure 🔍
-1% - +2%
-0.12ms - +0.38ms
unsure 🔍
-1% - +2%
-0.18ms - +0.42ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.58ms - 1.58ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
1% - 1%
0.02ms - 0.02ms
preact-local1.58ms - 1.58msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
1% - 1%
0.02ms - 0.02ms
preact-hooks1.60ms - 1.60msslower ❌
1% - 1%
0.02ms - 0.02ms
slower ❌
1% - 1%
0.02ms - 0.02ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master148.12ms - 152.66ms-unsure 🔍
-3% - +1%
-5.19ms - +0.90ms
unsure 🔍
-4% - +0%
-6.39ms - +0.16ms
preact-local150.51ms - 154.56msunsure 🔍
-1% - +3%
-0.90ms - +5.19ms
-unsure 🔍
-3% - +1%
-4.08ms - +2.14ms
preact-hooks151.15ms - 155.86msunsure 🔍
-0% - +4%
-0.16ms - +6.39ms
unsure 🔍
-1% - +3%
-2.14ms - +4.08ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master12.42ms - 13.18ms-unsure 🔍
-5% - +3%
-0.65ms - +0.45ms
unsure 🔍
-5% - +5%
-0.60ms - +0.59ms
preact-local12.51ms - 13.30msunsure 🔍
-4% - +5%
-0.45ms - +0.65ms
-unsure 🔍
-4% - +5%
-0.50ms - +0.70ms
preact-hooks12.35ms - 13.26msunsure 🔍
-5% - +5%
-0.59ms - +0.60ms
unsure 🔍
-5% - +4%
-0.70ms - +0.50ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master22.66ms - 23.39ms-unsure 🔍
-4% - +2%
-0.85ms - +0.39ms
unsure 🔍
-3% - +2%
-0.80ms - +0.36ms
preact-local22.76ms - 23.76msunsure 🔍
-2% - +4%
-0.39ms - +0.85ms
-unsure 🔍
-3% - +3%
-0.66ms - +0.68ms
preact-hooks22.80ms - 23.69msunsure 🔍
-2% - +3%
-0.36ms - +0.80ms
unsure 🔍
-3% - +3%
-0.68ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master4.62ms - 4.63ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
faster ✔
0% - 1%
0.02ms - 0.03ms
preact-local4.62ms - 4.63msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks4.65ms - 4.65msslower ❌
0% - 1%
0.02ms - 0.03ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master2.96ms - 3.04ms-unsure 🔍
-2% - +1%
-0.08ms - +0.04ms
faster ✔
3% - 6%
0.08ms - 0.20ms
preact-local2.97ms - 3.06msunsure 🔍
-1% - +3%
-0.04ms - +0.08ms
-faster ✔
2% - 6%
0.07ms - 0.18ms
preact-hooks3.10ms - 3.18msslower ❌
3% - 7%
0.08ms - 0.20ms
slower ❌
2% - 6%
0.07ms - 0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master0.81ms - 0.81ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
faster ✔
2% - 2%
0.01ms - 0.01ms
preact-local0.81ms - 0.81msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-faster ✔
2% - 2%
0.01ms - 0.01ms
preact-hooks0.82ms - 0.82msslower ❌
2% - 2%
0.01ms - 0.01ms
slower ❌
2% - 2%
0.01ms - 0.01ms
-
todo

duration

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master79.66ms - 81.95ms-unsure 🔍
-4% - +1%
-3.55ms - +0.79ms
unsure 🔍
-4% - +0%
-3.19ms - +0.38ms
preact-local80.34ms - 84.04msunsure 🔍
-1% - +4%
-0.79ms - +3.55ms
-unsure 🔍
-3% - +3%
-2.32ms - +2.27ms
preact-hooks80.85ms - 83.58msunsure 🔍
-0% - +4%
-0.38ms - +3.19ms
unsure 🔍
-3% - +3%
-2.27ms - +2.32ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-localvs preact-hooks
preact-master1.06ms - 1.07ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
2% - 2%
0.02ms - 0.03ms
preact-local1.07ms - 1.07msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
2% - 2%
0.02ms - 0.03ms
preact-hooks1.09ms - 1.09msslower ❌
2% - 2%
0.02ms - 0.03ms
slower ❌
2% - 2%
0.02ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

coveralls commented Mar 1, 2023

Coverage Status

Coverage: 99.548% (+0.004%) from 99.543% when pulling 405c6d3 on formik-ctx into 15f0c96 on master.

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

Size Change: +129 B (0%)

Total Size: 54.3 kB

Filename Size Change
hooks/dist/hooks.js 1.53 kB +42 B (2%)
hooks/dist/hooks.module.js 1.56 kB +42 B (2%)
hooks/dist/hooks.umd.js 1.61 kB +45 B (2%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.89 kB 0 B
compat/dist/compat.module.js 3.82 kB 0 B
compat/dist/compat.umd.js 3.96 kB 0 B
debug/dist/debug.js 3 kB 0 B
debug/dist/debug.module.js 3.01 kB 0 B
debug/dist/debug.umd.js 3.08 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
dist/preact.js 4.21 kB 0 B
dist/preact.min.js 4.24 kB 0 B
dist/preact.min.module.js 4.24 kB 0 B
dist/preact.min.umd.js 4.27 kB 0 B
dist/preact.module.js 4.23 kB 0 B
dist/preact.umd.js 4.28 kB 0 B
jsx-runtime/dist/jsxRuntime.js 360 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 326 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 441 B 0 B
test-utils/dist/testUtils.js 442 B 0 B
test-utils/dist/testUtils.module.js 444 B 0 B
test-utils/dist/testUtils.umd.js 526 B 0 B

compressed-size-action

src/create-context.js Outdated Show resolved Hide resolved
@marvinhagemeister marvinhagemeister marked this pull request as draft March 1, 2023 19:34
Copy link
Contributor

@mdentremont mdentremont left a comment

Choose a reason for hiding this comment

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

The test seems reasonable but unfortunately I don't have enough context on the subject matter to be able to approve/deny - adding a tiny comment though

hooks/test/browser/combinations.test.js Outdated Show resolved Hide resolved
@marvinhagemeister
Copy link
Member Author

@mdentremont Thanks for the suggestions! Yeah it looks like we need to opt for a more elaborate fix, but I'm confident we can do it now that we know why the error occurred in the first place.

@marvinhagemeister
Copy link
Member Author

Ok I think I found a better fix.

@marvinhagemeister marvinhagemeister marked this pull request as ready for review March 2, 2023 17:57
hooks/src/index.js Outdated Show resolved Hide resolved
@marvinhagemeister marvinhagemeister merged commit 48f55a3 into master Mar 8, 2023
@marvinhagemeister marvinhagemeister deleted the formik-ctx branch March 8, 2023 22:23
JoviDeCroock added a commit that referenced this pull request Jan 16, 2024
JoviDeCroock added a commit that referenced this pull request Jan 16, 2024
* backport #3911

* backport #3906

* backport #3837

* backport #3908

* backport #3904

* backport #3905

* backport #3898

* backport #3910

* backport #3948

* backport #3941

* backport #3945

* backport #3919

* backport #3922

* backport #3921

* backport #3903

* fix lint

* update more

* debug
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.

5 participants