preactjs / preact

⚛ī¸ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
https://preactjs.com
MIT License
36.35k stars 1.93k forks source link

devtools: prefer `globalThis` over `window` if available #4401

Closed marvinhagemeister closed 1 month ago

marvinhagemeister commented 1 month ago

This makes it easier to potentially include devtools on server-side.

github-actions[bot] commented 1 month ago

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-10.79ms - +4.55ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.18ms - +0.13ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +0% (-1.15ms - +0.23ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -4% - +5% (-0.63ms - +0.67ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -2% - +1% (-1.82ms - +0.82ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +5% (-0.09ms - +0.10ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +3% (-0.21ms - +0.88ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -5% - +4% (-1.43ms - +1.13ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -3% - +2% (-0.36ms - +0.36ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +1% (-0.03ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 +0% - +0% (+0.00ms - +0.00ms)
    preact-local vs preact-main

Results

create10k
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local905.85ms - 914.79ms-unsure 🔍
-1% - +0%
-10.79ms - +4.55ms
preact-main907.21ms - 919.67msunsure 🔍
-1% - +1%
-4.55ms - +10.79ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local26.91ms - 26.91ms-unsure 🔍
-0% - +0%
-0.00ms - +0.01ms
preact-main26.90ms - 26.91msunsure 🔍
-0% - +0%
-0.01ms - +0.00ms
-
filter-list
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.83ms - 17.00ms-unsure 🔍
-1% - +1%
-0.18ms - +0.13ms
preact-main16.81ms - 17.07msunsure 🔍
-1% - +1%
-0.13ms - +0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.72ms - 1.72ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.72ms - 1.73msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local77.11ms - 77.87ms-unsure 🔍
-1% - +0%
-1.15ms - +0.23ms
preact-main77.38ms - 78.52msunsure 🔍
-0% - +1%
-0.23ms - +1.15ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local14.13ms - 14.64ms-unsure 🔍
-3% - +2%
-0.36ms - +0.36ms
preact-main14.13ms - 14.64msunsure 🔍
-2% - +3%
-0.36ms - +0.36ms
-
many-updates
  • Browser: chrome-headless
  • Sample size: 70
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local13.93ms - 14.91ms-unsure 🔍
-4% - +5%
-0.63ms - +0.67ms
preact-main13.98ms - 14.83msunsure 🔍
-5% - +4%
-0.67ms - +0.63ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.94ms - 4.95ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main4.95ms - 4.95msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local74.29ms - 75.74ms-unsure 🔍
-2% - +1%
-1.82ms - +0.82ms
preact-main74.41ms - 76.62msunsure 🔍
-1% - +2%
-0.82ms - +1.82ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.73ms - 3.77ms-unsure 🔍
-1% - +1%
-0.03ms - +0.02ms
preact-main3.74ms - 3.77msunsure 🔍
-1% - +1%
-0.02ms - +0.03ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.88ms - 30.51ms-unsure 🔍
-3% - +0%
-0.94ms - +0.12ms
preact-main30.18ms - 31.03msunsure 🔍
-0% - +3%
-0.12ms - +0.94ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local35.26ms - 37.08ms-unsure 🔍
-4% - +4%
-1.26ms - +1.36ms
preact-main35.18ms - 37.07msunsure 🔍
-4% - +3%
-1.36ms - +1.26ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local27.73ms - 28.47ms-unsure 🔍
-2% - +2%
-0.63ms - +0.49ms
preact-main27.75ms - 28.60msunsure 🔍
-2% - +2%
-0.49ms - +0.63ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local25.61ms - 26.36ms-unsure 🔍
-2% - +2%
-0.60ms - +0.49ms
preact-main25.65ms - 26.43msunsure 🔍
-2% - +2%
-0.49ms - +0.60ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local27.48ms - 28.95ms-unsure 🔍
-1% - +6%
-0.39ms - +1.69ms
preact-main26.83ms - 28.30msunsure 🔍
-6% - +1%
-1.69ms - +0.39ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local24.67ms - 25.72ms-unsure 🔍
-4% - +3%
-0.89ms - +0.67ms
preact-main24.73ms - 25.89msunsure 🔍
-3% - +4%
-0.67ms - +0.89ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 70
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.02ms - 2.13ms-unsure 🔍
-4% - +5%
-0.09ms - +0.10ms
preact-main1.99ms - 2.14msunsure 🔍
-5% - +4%
-0.10ms - +0.09ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local0.98ms - 0.98ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main0.98ms - 0.98msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
todo
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local28.74ms - 29.62ms-unsure 🔍
-1% - +3%
-0.21ms - +0.88ms
preact-main28.53ms - 29.17msunsure 🔍
-3% - +1%
-0.88ms - +0.21ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.25ms - 1.25ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.25ms - 1.25msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1519
  • Commit: eb3fb62

duration

VersionAvg timevs preact-localvs preact-main
preact-local29.54ms - 31.70ms-unsure 🔍
-5% - +4%
-1.43ms - +1.13ms
preact-main30.09ms - 31.46msunsure 🔍
-4% - +5%
-1.13ms - +1.43ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.71ms - 3.71ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main3.71ms - 3.71msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-

tachometer-reporter-action v2 for Benchmarks

github-actions[bot] commented 1 month ago

Size Change: +91 B (+0.15%)

Total Size: 61.7 kB

Filename Size Change
devtools/dist/devtools.js 260 B +29 B (+12.55%) ⚠ī¸
devtools/dist/devtools.module.js 271 B +31 B (+12.92%) ⚠ī¸
devtools/dist/devtools.umd.js 345 B +31 B (+9.87%) ⚠ī¸
ℹī¸ View Unchanged | Filename | Size | | :--- | :---: | | `compat/dist/compat.js` | 4.09 kB | | `compat/dist/compat.module.js` | 4.01 kB | | `compat/dist/compat.umd.js` | 4.14 kB | | `debug/dist/debug.js` | 3.71 kB | | `debug/dist/debug.module.js` | 3.71 kB | | `debug/dist/debug.umd.js` | 3.79 kB | | `dist/preact.js` | 4.67 kB | | `dist/preact.min.js` | 4.7 kB | | `dist/preact.min.module.js` | 4.69 kB | | `dist/preact.min.umd.js` | 4.72 kB | | `dist/preact.module.js` | 4.68 kB | | `dist/preact.umd.js` | 4.74 kB | | `hooks/dist/hooks.js` | 1.55 kB | | `hooks/dist/hooks.module.js` | 1.59 kB | | `hooks/dist/hooks.umd.js` | 1.63 kB | | `jsx-runtime/dist/jsxRuntime.js` | 976 B | | `jsx-runtime/dist/jsxRuntime.module.js` | 949 B | | `jsx-runtime/dist/jsxRuntime.umd.js` | 1.06 kB | | `test-utils/dist/testUtils.js` | 453 B | | `test-utils/dist/testUtils.module.js` | 454 B | | `test-utils/dist/testUtils.umd.js` | 536 B |

compressed-size-action

coveralls commented 1 month ago

Coverage Status

coverage: 99.611%. remained the same when pulling eb3fb622fe4080e45eee298a6627531ab13ce4b8 on devtools-global-check into a2631303ceae9ecdbc3f67f4b81a37b897b5a040 on main.

coveralls commented 1 month ago

Coverage Status

coverage: 99.611%. remained the same when pulling eb3fb622fe4080e45eee298a6627531ab13ce4b8 on devtools-global-check into a2631303ceae9ecdbc3f67f4b81a37b897b5a040 on main.