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 bug in chrome where select values continuously rerender #3226

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Jul 14, 2021

Resolves #3171

If this poses issues in IE11:

import { options } from 'preact';
options.diffed = vnode => {
  if (vnode.type === 'option') {
    const props = vnode.props;
    if (!('value' in props)) {
      vnode.dom.value = vnode.dom.textContent;
    }
  }
}

Demo: https://jsfiddle.net/developit/s7uq9yhd/

@github-actions
Copy link

github-actions bot commented Jul 14, 2021

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -0% - +3% (-0.04ms - +4.98ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -1% - +9% (-0.15ms - +2.20ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -2% - +0% (-30.26ms - +5.50ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -3% - +4% (-0.73ms - +1.16ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -2% - +3% (-3.48ms - +4.76ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -4% - +3% (-1.34ms - +1.18ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +1% (-0.04ms - +0.04ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: faster ✔ 0% - 1% (0.00ms - 0.02ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.01ms - +0.00ms)
    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 🔍 -1% - +2% (-0.04ms - +0.11ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    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-master157.75ms - 161.02ms-unsure 🔍
-3% - +0%
-4.98ms - +0.04ms
preact-local159.96ms - 163.76msunsure 🔍
-0% - +3%
-0.04ms - +4.98ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.53ms - 3.54ms-slower ❌
0% - 1%
0.00ms - 0.02ms
preact-local3.52ms - 3.53msfaster ✔
0% - 1%
0.00ms - 0.02ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master58.60ms - 59.93ms-slower ❌
0% - 3%
0.04ms - 1.74ms
preact-local57.85ms - 58.90msfaster ✔
0% - 3%
0.04ms - 1.74ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master99.84ms - 101.81ms-unsure 🔍
-0% - +2%
-0.18ms - +2.25ms
preact-local99.08ms - 100.51msunsure 🔍
-2% - +0%
-2.25ms - +0.18ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master90.41ms - 100.03ms-unsure 🔍
-3% - +13%
-2.17ms - +11.69ms
preact-local85.47ms - 95.44msunsure 🔍
-12% - +2%
-11.69ms - +2.17ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master66.36ms - 73.58ms-unsure 🔍
-11% - +3%
-7.73ms - +2.47ms
preact-local69.00ms - 76.20msunsure 🔍
-4% - +11%
-2.47ms - +7.73ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master98.06ms - 100.89ms-unsure 🔍
-2% - +3%
-1.74ms - +2.59ms
preact-local97.42ms - 100.69msunsure 🔍
-3% - +2%
-2.59ms - +1.74ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master58.09ms - 60.86ms-faster ✔
1% - 7%
0.42ms - 4.61ms
preact-local60.42ms - 63.57msslower ❌
1% - 8%
0.42ms - 4.61ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-local
preact-master24.58ms - 26.14ms-unsure 🔍
-8% - +0%
-2.20ms - +0.15ms
preact-local25.50ms - 27.27msunsure 🔍
-1% - +9%
-0.15ms - +2.20ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.58ms - 3.59ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-local3.58ms - 3.59msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1656.77ms - 1681.56ms-unsure 🔍
-0% - +2%
-5.50ms - +30.26ms
preact-local1643.90ms - 1669.67msunsure 🔍
-2% - +0%
-30.26ms - +5.50ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-mastervs preact-local
preact-master28.51ms - 29.89ms-unsure 🔍
-4% - +2%
-1.16ms - +0.73ms
preact-local28.77ms - 30.06msunsure 🔍
-3% - +4%
-0.73ms - +1.16ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.59ms - 1.59ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local1.59ms - 1.59msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master183.67ms - 188.65ms-unsure 🔍
-3% - +2%
-4.76ms - +3.48ms
preact-local183.52ms - 190.09msunsure 🔍
-2% - +3%
-3.48ms - +4.76ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.18ms - 6.28ms-unsure 🔍
-2% - +1%
-0.11ms - +0.04ms
preact-local6.21ms - 6.32msunsure 🔍
-1% - +2%
-0.04ms - +0.11ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-local
preact-master33.86ms - 35.65ms-unsure 🔍
-3% - +4%
-1.18ms - +1.34ms
preact-local33.78ms - 35.57msunsure 🔍
-4% - +3%
-1.34ms - +1.18ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.65ms - 4.65ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-local4.65ms - 4.65msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.41ms - 3.47ms-unsure 🔍
-1% - +1%
-0.04ms - +0.04ms
preact-local3.41ms - 3.47msunsure 🔍
-1% - +1%
-0.04ms - +0.04ms
-

usedJSHeapSize

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

tachometer-reporter-action v2 for Benchmarks

@github-actions
Copy link

Size Change: -66 B (0%)

Total Size: 41.9 kB

Filename Size Change
dist/preact.js 3.96 kB -15 B (0%)
dist/preact.min.js 3.98 kB -15 B (0%)
dist/preact.module.js 3.99 kB -19 B (0%)
dist/preact.umd.js 4.03 kB -17 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.39 kB 0 B
compat/dist/compat.module.js 3.38 kB 0 B
compat/dist/compat.umd.js 3.44 kB 0 B
debug/dist/debug.js 2.99 kB 0 B
debug/dist/debug.module.js 2.98 kB 0 B
debug/dist/debug.umd.js 3.07 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.module.js 241 B 0 B
devtools/dist/devtools.umd.js 308 B 0 B
hooks/dist/hooks.js 1.13 kB 0 B
hooks/dist/hooks.module.js 1.15 kB 0 B
hooks/dist/hooks.umd.js 1.2 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

@developit
Copy link
Member

Let's make sure to release this as a minor and include the patch/workaround in release notes.

@marvinhagemeister marvinhagemeister merged commit 7e33abd into master Jul 14, 2021
@marvinhagemeister marvinhagemeister deleted the JoviDeCroock-patch-1 branch July 14, 2021 15:53
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.622% when pulling c8c9b1c on JoviDeCroock-patch-1 into ba8353c on master.

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.

Preact 10.x unnecessarily updates DOM for <select> options
4 participants