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

feat: Add support for `prop:` & `attr:` directives #4419

Open rschristian opened 1 week ago

rschristian commented 1 week ago

First-pass impl of #4416

github-actions[bot] commented 1 week ago

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +1% (-6.25ms - +11.17ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -1% - +1% (-0.12ms - +0.23ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +5% (-1.37ms - +3.26ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -1% - +1% (-0.18ms - +0.21ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -2% - +3% (-1.12ms - +2.58ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +2% (-0.09ms - +0.04ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -1% - +2% (-0.28ms - +0.61ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -3% - +3% (-0.90ms - +0.92ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +2% (-0.12ms - +0.26ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 +0% - +0% (+0.00ms - +0.01ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +1% (-0.01ms - +0.04ms)
    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 #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local875.02ms - 888.63ms-unsure 🔍
-1% - +1%
-6.25ms - +11.17ms
preact-main873.93ms - 884.80msunsure 🔍
-1% - +1%
-11.17ms - +6.25ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local25.15ms - 25.15ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-main25.15ms - 25.16msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-
filter-list
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.61ms - 16.88ms-unsure 🔍
-1% - +1%
-0.12ms - +0.23ms
preact-main16.58ms - 16.80msunsure 🔍
-1% - +1%
-0.23ms - +0.12ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.70ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.69ms - 1.70msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless
  • Sample size: 70
  • Built by: Benchmarks #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local69.45ms - 73.34ms-unsure 🔍
-2% - +5%
-1.37ms - +3.26ms
preact-main69.19ms - 71.71msunsure 🔍
-5% - +2%
-3.26ms - +1.37ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local13.19ms - 13.49ms-unsure 🔍
-1% - +2%
-0.12ms - +0.26ms
preact-main13.15ms - 13.38msunsure 🔍
-2% - +1%
-0.26ms - +0.12ms
-
many-updates
  • Browser: chrome-headless
  • Sample size: 50
  • Built by: Benchmarks #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.42ms - 16.75ms-unsure 🔍
-1% - +1%
-0.18ms - +0.21ms
preact-main16.47ms - 16.67msunsure 🔍
-1% - +1%
-0.21ms - +0.18ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.62ms - 4.62ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-main4.61ms - 4.62msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: Benchmarks #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local74.43ms - 76.86ms-unsure 🔍
-2% - +3%
-1.12ms - +2.58ms
preact-main73.52ms - 76.30msunsure 🔍
-3% - +1%
-2.58ms - +1.12ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.53ms - 3.56ms-unsure 🔍
-0% - +1%
-0.01ms - +0.04ms
preact-main3.52ms - 3.55msunsure 🔍
-1% - +0%
-0.04ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local29.35ms - 30.06ms-slower ❌
1% - 4%
0.21ms - 1.10ms
preact-main28.78ms - 29.32msfaster ✔
1% - 4%
0.21ms - 1.10ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local33.76ms - 35.73ms-unsure 🔍
-3% - +5%
-1.00ms - +1.71ms
preact-main33.46ms - 35.32msunsure 🔍
-5% - +3%
-1.71ms - +1.00ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local25.01ms - 25.40ms-unsure 🔍
-2% - +1%
-0.42ms - +0.25ms
preact-main25.02ms - 25.56msunsure 🔍
-1% - +2%
-0.25ms - +0.42ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local29.89ms - 31.28ms-unsure 🔍
-4% - +3%
-1.19ms - +0.87ms
preact-main29.98ms - 31.50msunsure 🔍
-3% - +4%
-0.87ms - +1.19ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local21.88ms - 23.20ms-unsure 🔍
-11% - -0%
-2.59ms - +0.02ms
preact-main22.70ms - 24.95msunsure 🔍
-0% - +12%
-0.02ms - +2.59ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local23.31ms - 24.27ms-unsure 🔍
-1% - +5%
-0.33ms - +1.09ms
preact-main22.88ms - 23.94msunsure 🔍
-5% - +1%
-1.09ms - +0.33ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 170
  • Built by: Benchmarks #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.90ms - 2.00ms-unsure 🔍
-5% - +2%
-0.09ms - +0.04ms
preact-main1.92ms - 2.02msunsure 🔍
-2% - +5%
-0.04ms - +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 #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local25.73ms - 26.42ms-unsure 🔍
-1% - +2%
-0.28ms - +0.61ms
preact-main25.63ms - 26.19msunsure 🔍
-2% - +1%
-0.61ms - +0.28ms
-

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 #1560
  • Commit: 806e605

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.09ms - 32.07ms-unsure 🔍
-3% - +3%
-0.90ms - +0.92ms
preact-main30.80ms - 32.34msunsure 🔍
-3% - +3%
-0.92ms - +0.90ms
-

usedJSHeapSize

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

tachometer-reporter-action v2 for Benchmarks

github-actions[bot] commented 1 week ago

Size Change: +297 B (+0.48%)

Total Size: 62.1 kB

Filename Size Change
dist/preact.js 4.73 kB +49 B (+1.05%)
dist/preact.min.js 4.76 kB +51 B (+1.08%)
dist/preact.min.module.js 4.76 kB +50 B (+1.06%)
dist/preact.min.umd.js 4.79 kB +51 B (+1.08%)
dist/preact.module.js 4.75 kB +48 B (+1.02%)
dist/preact.umd.js 4.8 kB +48 B (+1.01%)
ℹī¸ View Unchanged | Filename | Size | | :--- | :---: | | `compat/dist/compat.js` | 4.1 kB | | `compat/dist/compat.module.js` | 4.03 kB | | `compat/dist/compat.umd.js` | 4.17 kB | | `debug/dist/debug.js` | 3.7 kB | | `debug/dist/debug.module.js` | 3.71 kB | | `debug/dist/debug.umd.js` | 3.78 kB | | `devtools/dist/devtools.js` | 259 B | | `devtools/dist/devtools.module.js` | 273 B | | `devtools/dist/devtools.umd.js` | 345 B | | `hooks/dist/hooks.js` | 1.53 kB | | `hooks/dist/hooks.module.js` | 1.56 kB | | `hooks/dist/hooks.umd.js` | 1.6 kB | | `jsx-runtime/dist/jsxRuntime.js` | 981 B | | `jsx-runtime/dist/jsxRuntime.module.js` | 956 B | | `jsx-runtime/dist/jsxRuntime.umd.js` | 1.06 kB | | `test-utils/dist/testUtils.js` | 451 B | | `test-utils/dist/testUtils.module.js` | 456 B | | `test-utils/dist/testUtils.umd.js` | 536 B |

compressed-size-action

coveralls commented 1 week ago

Coverage Status

coverage: 99.611%. remained the same when pulling 17fee0233349e1798835806e76819aa3ce19e90e on feat/prop-attr-directives into 4c20c23c16dd60f380ce9fe98afc93041a7e1562 on main.

coveralls commented 1 week ago

Coverage Status

coverage: 99.611%. remained the same when pulling 17fee0233349e1798835806e76819aa3ce19e90e on feat/prop-attr-directives into 4c20c23c16dd60f380ce9fe98afc93041a7e1562 on main.

rschristian commented 4 days ago

I'll mark this as "ready", though I'm happy to still discuss whether we even want to do this and how it should interact with other things like RTS.

IMO, it is a nice bit of power to give users though it is a bit of a deviation and might confuse some.

Edit: What in the world is up with Coveralls

coveralls commented 4 days ago

Coverage Status

coverage: 99.611%. remained the same when pulling 806e605fa53f74abac84f2567e50c7f9ad73d25d on feat/prop-attr-directives into 16aeb9f77edaa5015bc7ffc9237149e1502e1e73 on main.

coveralls commented 4 days ago

Coverage Status

coverage: 99.611%. remained the same when pulling 806e605fa53f74abac84f2567e50c7f9ad73d25d on feat/prop-attr-directives into 16aeb9f77edaa5015bc7ffc9237149e1502e1e73 on main.