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

Prepare test code to be run in ES2015+ environments #2901

Merged
merged 2 commits into from
Jan 2, 2021

Conversation

marvinhagemeister
Copy link
Member

Today I played around a bit with running our test suite in native ES2015+ environments. That is to say that I skipped the transpilation step to ES5. By doing so I noticed that the prototype of a native class is not iterable. So calling Object.keys(MyClass.prototype) will always return an empty array. This breaks some of our tests.

Since we don't iterate over prototypes that often I just inlined our helper functions.

This is caused by the class properties not being marked as iterable.
They are typically downtranspiled to plain objects, which why calling
Object.keys(MyClass) worked before
@github-actions
Copy link

github-actions bot commented Jan 2, 2021

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +1% (-3.15ms - +1.93ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: faster ✔ 1% - 7% (0.44ms - 2.70ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +1% (-1.74ms - +24.59ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -1% - +5% (-0.37ms - +1.57ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -2% - +2% (-3.31ms - +3.18ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -5% - +9% (-1.92ms - +3.63ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -4% - +2% (-0.17ms - +0.07ms)
    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.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 🔍 -0% - +0% (-0.00ms - +0.01ms)
    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
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 80
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master160.40ms - 163.99ms-unsure 🔍
-1% - +2%
-1.93ms - +3.15ms
preact-local159.80ms - 163.38msunsure 🔍
-2% - +1%
-3.15ms - +1.93ms
-

usedJSHeapSize

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

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master62.07ms - 64.06ms-unsure 🔍
-3% - +1%
-1.95ms - +0.78ms
preact-local62.72ms - 64.59msunsure 🔍
-1% - +3%
-0.78ms - +1.95ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master95.39ms - 97.92ms-unsure 🔍
-2% - +2%
-1.69ms - +1.60ms
preact-local95.64ms - 97.75msunsure 🔍
-2% - +2%
-1.60ms - +1.69ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master110.64ms - 113.47ms-unsure 🔍
-1% - +3%
-0.76ms - +3.20ms
preact-local109.46ms - 112.22msunsure 🔍
-3% - +1%
-3.20ms - +0.76ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master64.38ms - 66.73ms-unsure 🔍
-2% - +3%
-1.53ms - +1.79ms
preact-local64.25ms - 66.60msunsure 🔍
-3% - +2%
-1.79ms - +1.53ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master116.85ms - 122.14ms-unsure 🔍
-5% - +1%
-6.02ms - +1.72ms
preact-local118.82ms - 124.47msunsure 🔍
-1% - +5%
-1.72ms - +6.02ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master65.33ms - 67.30ms-unsure 🔍
-1% - +4%
-0.47ms - +2.38ms
preact-local64.33ms - 66.38msunsure 🔍
-4% - +1%
-2.38ms - +0.47ms
-
03_update10th1k_x16
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 120
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master35.16ms - 36.92ms-slower ❌
1% - 8%
0.44ms - 2.70ms
preact-local33.76ms - 35.19msfaster ✔
1% - 7%
0.44ms - 2.70ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.52ms - 3.53ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-local3.51ms - 3.52msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
07_create10k
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1960.30ms - 1975.56ms-unsure 🔍
-1% - +0%
-24.59ms - +1.74ms
preact-local1968.62ms - 1990.08msunsure 🔍
-0% - +1%
-1.74ms - +24.59ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master25.99ms - 25.99ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local25.99ms - 25.99msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter_list
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master31.09ms - 32.33ms-unsure 🔍
-5% - +1%
-1.57ms - +0.37ms
preact-local31.56ms - 33.05msunsure 🔍
-1% - +5%
-0.37ms - +1.57ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.60ms - 1.60ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local1.60ms - 1.60msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master180.69ms - 185.18ms-unsure 🔍
-2% - +2%
-3.18ms - +3.31ms
preact-local180.53ms - 185.22msunsure 🔍
-2% - +2%
-3.31ms - +3.18ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.19ms - 6.19ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-local6.19ms - 6.21msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-
many_updates
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 80
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master38.02ms - 41.96ms-unsure 🔍
-9% - +5%
-3.63ms - +1.92ms
preact-local38.89ms - 42.80msunsure 🔍
-5% - +9%
-1.92ms - +3.63ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.85ms - 4.85ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local4.85ms - 4.85msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
text_update
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 160
  • Built by: CI #653
  • Commit: bf6b04a

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.75ms - 3.96ms-unsure 🔍
-2% - +4%
-0.07ms - +0.17ms
preact-local3.75ms - 3.87msunsure 🔍
-4% - +2%
-0.17ms - +0.07ms
-

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 CI

@coveralls
Copy link

coveralls commented Jan 2, 2021

Coverage Status

Coverage remained the same at 99.609% when pulling 90bfb18 on test-fixes into 51b46f6 on master.

@github-actions
Copy link

github-actions bot commented Jan 2, 2021

Size Change: 0 B

Total Size: 41.6 kB

ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.23 kB 0 B
compat/dist/compat.module.js 3.25 kB 0 B
compat/dist/compat.umd.js 3.29 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 185 B 0 B
devtools/dist/devtools.module.js 195 B 0 B
devtools/dist/devtools.umd.js 261 B 0 B
dist/preact.js 4.03 kB 0 B
dist/preact.min.js 4.06 kB 0 B
dist/preact.module.js 4.05 kB 0 B
dist/preact.umd.js 4.1 kB 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 327 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 335 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 405 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

@andrewiggins
Copy link
Member

Oooo running our tests using modern syntax would be really nice

@marvinhagemeister marvinhagemeister merged commit 6ea2d55 into master Jan 2, 2021
@marvinhagemeister marvinhagemeister deleted the test-fixes branch January 2, 2021 22:09
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.

3 participants