Skip to content

fix(compat): map imageRendering to image-rendering - #5270

Merged
JoviDeCroock merged 2 commits into
preactjs:mainfrom
kwy404:fix/compat-image-rendering
Sep 27, 2026
Merged

JoviDeCroock merged 2 commits into
preactjs:mainfrom
kwy404:fix/compat-image-rendering

Conversation

@kwy404

@kwy404 kwy404 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Root cause: #3995 changed image in the CAMEL_PROPS regex of compat/src/render.js to image(!S) so that imageSrcSet is no longer turned into image-src-set. The ? of the negative lookahead is missing, so (!S) is a capture group that matches the literal text !S. No real prop contains that, so every image* prop stopped being converted. As a result <svg imageRendering="pixelated" /> renders an imageRendering attribute, which the browser ignores, while React renders image-rendering.

Fix: use the intended lookahead image(?!S). imageRendering becomes image-rendering again, while imageSrcSet and imageSizes are still left alone.

Test: added should transform imageRendering to compat/test/browser/render.test.jsx. It fails on main (<svg imageRendering="pixelated"></svg>) and passes with the fix. The existing should not transform imageSrcSet test still passes, as does the rest of the compat suite.

The same typo is present on v10.x.

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -0% - +1% (-2.46ms - +6.15ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.02ms - +0.06ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -3% - +1% (-1.56ms - +0.67ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -2% - +1% (-0.36ms - +0.13ms)
    preact-local vs preact-main
  • replace1k: faster ✔ 0% - 2% (0.20ms - 1.73ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -7% - +1% (-0.12ms - +0.02ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +1% (-0.51ms - +0.17ms)
    preact-local vs preact-main
  • update10th1k: faster ✔ 1% - 10% (0.29ms - 2.35ms)
    preact-local vs preact-main

usedJSHeapSize

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

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local813.18ms - 819.32ms-unsure 🔍
-0% - +1%
-2.46ms - +6.15ms
preact-main811.38ms - 817.42msunsure 🔍
-1% - +0%
-6.15ms - +2.46ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.08ms - 19.08ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.08ms - 19.08msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.55ms - 16.62ms-unsure 🔍
-0% - +0%
-0.02ms - +0.06ms
preact-main16.55ms - 16.59msunsure 🔍
-0% - +0%
-0.06ms - +0.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.56ms - 1.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.56ms - 1.56msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local57.43ms - 59.04ms-unsure 🔍
-3% - +1%
-1.56ms - +0.67ms
preact-main57.91ms - 59.45msunsure 🔍
-1% - +3%
-0.67ms - +1.56ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local5.02ms - 5.37ms-unsure 🔍
-5% - +4%
-0.25ms - +0.21ms
preact-main5.07ms - 5.37msunsure 🔍
-4% - +5%
-0.21ms - +0.25ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.32ms - 16.58ms-unsure 🔍
-2% - +1%
-0.36ms - +0.13ms
preact-main16.36ms - 16.78msunsure 🔍
-1% - +2%
-0.13ms - +0.36ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.75ms - 3.75ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.75ms - 3.75msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5991
  • Commit: c1a364e

duration

VersionAvg timevs preact-localvs preact-main
preact-local82.48ms - 83.72ms-faster ✔
0% - 2%
0.20ms - 1.73ms
preact-main83.62ms - 84.51msslower ❌
0% - 2%
0.20ms - 1.73ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.01ms - 3.02ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.02ms - 3.02msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local26.81ms - 27.60ms-unsure 🔍
-3% - +2%
-0.71ms - +0.42ms
preact-main26.94ms - 27.75msunsure 🔍
-2% - +3%
-0.42ms - +0.71ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local32.17ms - 33.46ms-unsure 🔍
-3% - +2%
-1.12ms - +0.70ms
preact-main32.38ms - 33.66msunsure 🔍
-2% - +3%
-0.70ms - +1.12ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local30.88ms - 32.57ms-unsure 🔍
-4% - +4%
-1.12ms - +1.18ms
preact-main30.92ms - 32.48msunsure 🔍
-4% - +4%
-1.18ms - +1.12ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local28.19ms - 28.91ms-unsure 🔍
-3% - +0%
-0.98ms - +0.01ms
preact-main28.69ms - 29.38msunsure 🔍
-0% - +3%
-0.01ms - +0.98ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local20.18ms - 20.43ms-unsure 🔍
-1% - +1%
-0.16ms - +0.24ms
preact-main20.11ms - 20.42msunsure 🔍
-1% - +1%
-0.24ms - +0.16ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local25.94ms - 26.29ms-unsure 🔍
-2% - +1%
-0.42ms - +0.18ms
preact-main25.99ms - 26.47msunsure 🔍
-1% - +2%
-0.18ms - +0.42ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #5991
  • Commit: c1a364e

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.69ms - 1.79ms-unsure 🔍
-7% - +1%
-0.12ms - +0.02ms
preact-main1.74ms - 1.84msunsure 🔍
-1% - +7%
-0.02ms - +0.12ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.00ms - 1.04ms-unsure 🔍
-3% - +2%
-0.03ms - +0.02ms
preact-main1.01ms - 1.04msunsure 🔍
-2% - +3%
-0.02ms - +0.03ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.87ms - 32.25ms-unsure 🔍
-2% - +1%
-0.51ms - +0.17ms
preact-main31.95ms - 32.51msunsure 🔍
-1% - +2%
-0.17ms - +0.51ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.27ms - 1.27ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
preact-main1.27ms - 1.27msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-
update10th1k
  • Browser: chrome-headless
  • Sample size: 160
  • Built by: CI #5991
  • Commit: c1a364e

duration

VersionAvg timevs preact-localvs preact-main
preact-local21.72ms - 22.95ms-faster ✔
1% - 10%
0.29ms - 2.35ms
preact-main22.83ms - 24.49msslower ❌
1% - 11%
0.29ms - 2.35ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.97ms - 2.97ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-main2.97ms - 2.97msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-

tachometer-reporter-action v2 for CI

@coveralls

coveralls commented Sep 27, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 99.853%. remained the same — kwy404:fix/compat-image-rendering into preactjs:main

@JoviDeCroock
JoviDeCroock merged commit 8088105 into preactjs:main Sep 27, 2026
13 checks passed
kwy404 added a commit to kwy404/kwy404 that referenced this pull request Sep 27, 2026
@JoviDeCroock JoviDeCroock mentioned this pull request Sep 27, 2026
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