preact icon indicating copy to clipboard operation
preact copied to clipboard

fix(compat): don't leak class prop when using className

Open wardpeet opened this issue 5 years ago • 3 comments

When using preact-compat with className it leaks the class prop into a react component and breaks spreading props.

I might be missing some context here so this fix might not be 100% accurate.

Fixes #2582

wardpeet avatar Jun 14 '20 12:06 wardpeet

Size Change: +78 B (0%)

Total Size: 39.8 kB

Filename Size Change
compat/dist/compat.js 3.23 kB +27 B (0%)
compat/dist/compat.module.js 3.25 kB +24 B (0%)
compat/dist/compat.umd.js 3.28 kB +27 B (0%)
ℹ️ View Unchanged
Filename Size Change
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.08 kB 0 B
devtools/dist/devtools.js 184 B 0 B
devtools/dist/devtools.module.js 195 B 0 B
devtools/dist/devtools.umd.js 260 B 0 B
dist/preact.js 3.88 kB 0 B
dist/preact.min.js 3.88 kB 0 B
dist/preact.module.js 3.89 kB 0 B
dist/preact.umd.js 3.93 kB 0 B
hooks/dist/hooks.js 1.09 kB 0 B
hooks/dist/hooks.module.js 1.11 kB 0 B
hooks/dist/hooks.umd.js 1.17 kB 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

github-actions[bot] avatar Jun 14 '20 12:06 github-actions[bot]

Good catch! I think we just need a check around the normalization code that verifies that the current vnode is a component :+1:

marvinhagemeister avatar Jun 14 '20 13:06 marvinhagemeister

I could lower the bytes by using a function for the descriptor but gzip & brotli wise it would be bigger. Unsure what we optimize for here.

wardpeet avatar Jun 15 '20 20:06 wardpeet