Skip to content

Add native polyfill for willChange#384

Closed
vincentriemer wants to merge 2 commits into
mainfrom
pr384
Closed

Add native polyfill for willChange#384
vincentriemer wants to merge 2 commits into
mainfrom
pr384

Conversation

@vincentriemer

Copy link
Copy Markdown
Contributor

Add native polyfill for willChange

At least on RN Android there's a specific prop, renderToHardwareTextureAndroid, that promotes an RN view to a GPU layer which is almost exactly the same responsibility of the web's will-change CSS property so this diff maps the two properties together.

@meta-cla meta-cla Bot added the cla signed label Sep 6, 2025
@vincentriemer vincentriemer marked this pull request as ready for review September 6, 2025 00:21
@github-actions

github-actions Bot commented Sep 6, 2025

Copy link
Copy Markdown

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

Results Base Patch Ratio
react-strict-dom/dist/dom/index.js
· compressed 2,477 2,490 1.01 +
· minified 8,667 8,653 1.00 -
react-strict-dom/dist/dom/runtime.js
· compressed 855 855 1.00
· minified 2,435 2,435 1.00
react-strict-dom/dist/native/index.js
· compressed 16,073 16,081 1.00 +
· minified 62,531 61,736 0.99 -

@github-actions

github-actions Bot commented Sep 6, 2025

Copy link
Copy Markdown

workflow: benchmarks/perf (native)

Comparison of performance test results, measured in operations per second. Larger is better.

Results Base Patch Ratio
css.create
· small 1,141,490 1,133,710 0.99 -
· small with units 484,529 492,303 1.02 +
· small with variables 678,662 681,842 1.00 +
· several small 347,662 353,636 1.02 +
· large 199,978 203,775 1.02 +
· large with polyfills 148,844 150,245 1.01 +
· complex 103,260 103,732 1.00 +
· unsupported 212,091 214,585 1.01 +
css.createTheme
· simple theme 229,327 229,708 1.00 +
· polyfill theme 214,160 215,112 1.00 +
css.props
· small 231,128 229,712 0.99 -
· small with units 189,959 188,926 0.99 -
· small with variables 113,937 114,174 1.00 +
· small with variables of units 83,616 83,686 1.00 +
· large 97,499 95,794 0.98 -
· large with polyfills 38,727 39,089 1.01 +
· complex 22,416 22,605 1.01 +
· unsupported 140,565 139,289 0.99 -
· simple merge 160,323 159,151 0.99 -
· wide merge 17,097 17,025 1.00 -
· deep merge 16,817 16,821 1.00 +
· themed merge 33,213 32,845 0.99 -

Use `renderToHardwareTextureAndroid` on React Native Android as an
equivalent to CSS `will-change`, as both serve the purpose of promoting
the element to a GPU layer.
Otherwise rollup inserts `import 'react'` in case the module has
side-effects.
@necolas

necolas commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Rebased and merged 9a85200

@necolas necolas closed this Sep 9, 2025
@necolas necolas deleted the pr384 branch October 2, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants