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 tests in IE11 #3264

Merged
merged 5 commits into from Nov 20, 2021
Merged

Fix tests in IE11 #3264

merged 5 commits into from Nov 20, 2021

Conversation

@developit
Copy link
Member

@developit developit commented Sep 15, 2021

No description provided.

@coveralls
Copy link

@coveralls coveralls commented Sep 15, 2021

Coverage Status

Coverage remained the same at 99.624% when pulling a5a2eb0 on tests-fix-ie11 into 78f1518 on master.

@developit developit marked this pull request as ready for review Sep 15, 2021
@marvinhagemeister
Copy link
Member

@marvinhagemeister marvinhagemeister commented Sep 15, 2021

@developit Executing tests locally prints the following warnings:

marvinhagemeister ~/dev/github/preact (tests-fix-ie11*) $ yarn test:karma:watch
yarn run v1.22.11
$ cross-env BABEL_NO_MODULES=true karma start karma.conf.js --no-single-run
15 09 2021 22:14:10.573:INFO [esbuild]: Compiling...
 > node_modules/chai/index.mjs:3:7: error: Transforming const to the configured target environment ("es5") is not supported yet
    3 │ export const expect = chai.expect;~~~~~

 > node_modules/chai/index.mjs:4:7: error: Transforming const to the configured target environment ("es5") is not supported yet
    4 │ export const version = chai.version;~~~~~

Maybe we need to downtranspile chai manually before passing it to esbuild?

@github-actions
Copy link

@github-actions github-actions bot commented Nov 20, 2021

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +2% (-2.49ms - +2.17ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -3% - +6% (-1.24ms - +2.08ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -1% - +2% (-17.22ms - +25.38ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -2% - +2% (-0.41ms - +0.42ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -4% - +6% (-6.99ms - +9.70ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -3% - +5% (-0.97ms - +1.51ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -1% - +5% (-0.05ms - +0.17ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.02ms - +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% - +1% (-0.05ms - +0.04ms)
    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-master127.52ms - 130.82ms-unsure 🔍
-2% - +2%
-2.17ms - +2.49ms
preact-local127.37ms - 130.65msunsure 🔍
-2% - +2%
-2.49ms - +2.17ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.47ms - 3.49ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-local3.47ms - 3.49msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master51.85ms - 53.39ms-unsure 🔍
-2% - +2%
-0.92ms - +1.11ms
preact-local51.87ms - 53.18msunsure 🔍
-2% - +2%
-1.11ms - +0.92ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master80.58ms - 83.36ms-unsure 🔍
-2% - +3%
-1.77ms - +2.24ms
preact-local80.28ms - 83.18msunsure 🔍
-3% - +2%
-2.24ms - +1.77ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master67.22ms - 75.03ms-unsure 🔍
-9% - +6%
-6.31ms - +4.56ms
preact-local68.21ms - 75.77msunsure 🔍
-6% - +9%
-4.56ms - +6.31ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master50.45ms - 57.25ms-unsure 🔍
-11% - +8%
-5.96ms - +4.39ms
preact-local50.73ms - 58.53msunsure 🔍
-8% - +11%
-4.39ms - +5.96ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master76.15ms - 78.98ms-unsure 🔍
-3% - +3%
-2.47ms - +2.09ms
preact-local75.97ms - 79.54msunsure 🔍
-3% - +3%
-2.09ms - +2.47ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master43.32ms - 46.08ms-unsure 🔍
-3% - +6%
-1.34ms - +2.52ms
preact-local42.76ms - 45.46msunsure 🔍
-6% - +3%
-2.52ms - +1.34ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-local
preact-master34.98ms - 37.30ms-unsure 🔍
-6% - +3%
-2.08ms - +1.24ms
preact-local35.37ms - 37.75msunsure 🔍
-3% - +6%
-1.24ms - +2.08ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.55ms - 3.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.02ms
preact-local3.54ms - 3.56msunsure 🔍
-0% - +0%
-0.02ms - +0.00ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1646.22ms - 1672.96ms-unsure 🔍
-2% - +1%
-25.38ms - +17.22ms
preact-local1647.09ms - 1680.25msunsure 🔍
-1% - +2%
-17.22ms - +25.38ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-mastervs preact-local
preact-master23.01ms - 23.61ms-unsure 🔍
-2% - +2%
-0.42ms - +0.41ms
preact-local23.03ms - 23.61msunsure 🔍
-2% - +2%
-0.41ms - +0.42ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-mastervs preact-local
preact-master161.71ms - 173.59ms-unsure 🔍
-6% - +4%
-9.70ms - +6.99ms
preact-local163.14ms - 174.87msunsure 🔍
-4% - +6%
-6.99ms - +9.70ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.15ms - 6.21ms-unsure 🔍
-1% - +1%
-0.04ms - +0.05ms
preact-local6.15ms - 6.21msunsure 🔍
-1% - +1%
-0.05ms - +0.04ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-local
preact-master29.68ms - 31.45ms-unsure 🔍
-5% - +3%
-1.51ms - +0.97ms
preact-local29.97ms - 31.70msunsure 🔍
-3% - +5%
-0.97ms - +1.51ms
-

usedJSHeapSize

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

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.50ms - 3.62ms-unsure 🔍
-5% - +1%
-0.17ms - +0.05ms
preact-local3.52ms - 3.71msunsure 🔍
-1% - +5%
-0.05ms - +0.17ms
-

usedJSHeapSize

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

tachometer-reporter-action v2 for Benchmarks

@github-actions
Copy link

@github-actions github-actions bot commented Nov 20, 2021

Size Change: +19 B (0%)

Total Size: 42 kB

Filename Size Change
dist/preact.js 3.96 kB +5 B (0%)
dist/preact.min.js 3.98 kB +5 B (0%)
dist/preact.module.js 3.99 kB +7 B (0%)
dist/preact.umd.js 4.03 kB +2 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.44 kB 0 B
compat/dist/compat.module.js 3.42 kB 0 B
compat/dist/compat.umd.js 3.49 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.14 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

@@ -326,7 +342,7 @@ module.exports = function(config) {
singleBundle: false,

// esbuild options
target: 'es2015',
target: 'es5',
Copy link
Member Author

@developit developit Nov 20, 2021

Choose a reason for hiding this comment

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

This no longer complains about const because it is being fed var (due to Babel running on all JS files). Setting it to es5 here just prevents ESbuild from generating ES2015 glue code (for module bindings etc).

@@ -433,7 +433,9 @@ function diffElementNodes(
// despite the attribute not being present. When the attribute
// is missing the progress bar is treated as indeterminate.
// To fix that we'll always update it when it is 0 for progress elements
(i !== dom.value || (nodeType === 'progress' && !i))
(i !== oldProps.value ||
Copy link
Member Author

@developit developit Nov 20, 2021

Choose a reason for hiding this comment

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

This fixes a bug in IE11 where we never apply the value prop for <option value="X">X<option>. In that browser, option.value is X as inferred from the option's text content, however inferred option values can't be selected via select.value, so we need to assign to it manually.

This also fixes a potential issue where the text content of an <option> is initially some value, but then later changes - if we skip assigning option.value, the value-to-text binding remains live instead of being correctly locked to the value prop from VDOM.

@JoviDeCroock JoviDeCroock merged commit 09c3006 into master Nov 20, 2021
12 checks passed
@JoviDeCroock JoviDeCroock deleted the tests-fix-ie11 branch Nov 20, 2021
developit added a commit that referenced this issue Nov 23, 2021
This fixes an issue I introduced in #3264.
JoviDeCroock pushed a commit that referenced this issue Nov 23, 2021
This fixes an issue I introduced in #3264.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants