Skip to content

Remove 'content-box' and most logical CSS polyfills from native #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

necolas
Copy link
Contributor

@necolas necolas commented Aug 4, 2025

Rely on React Native's recent built-in support for these capabilities

e2e benchmark comparison

image

@meta-cla meta-cla bot added the cla signed label Aug 4, 2025
Copy link

github-actions bot commented Aug 4, 2025

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,514 2,514 1.00
· minified 8,691 8,691 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,445 15,872 0.97 -
· minified 63,057 60,943 0.97 -

Copy link

github-actions bot commented Aug 4, 2025

workflow: benchmarks/perf (native)

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

Results Base Patch Ratio
css.create
· small 971,723 1,138,962 1.17 !!
· small with units 466,015 500,821 1.07 !!
· small with variables 596,406 653,398 1.10 !!
· several small 323,351 356,707 1.10 !!
· large 183,597 203,491 1.11 !!
· large with polyfills 135,066 148,809 1.10 !!
· complex 94,475 102,850 1.09 !!
· unsupported 194,180 213,773 1.10 !!
css.createTheme
· simple theme 227,413 226,869 1.00 -
· polyfill theme 212,901 211,785 0.99 -
css.props
· small 228,948 272,308 1.19 !!
· small with units 188,002 218,614 1.16 !!
· small with variables 113,199 123,469 1.09 !!
· small with variables of units 82,998 88,982 1.07 !!
· large 96,258 115,759 1.20 !!
· large with polyfills 38,282 43,833 1.15 !!
· complex 22,172 24,196 1.09 !!
· unsupported 142,048 175,531 1.24 !!
· simple merge 157,565 180,583 1.15 !!
· wide merge 16,803 18,396 1.09 !!
· deep merge 16,550 17,989 1.09 !!
· themed merge 32,594 37,636 1.15 !!

@necolas necolas force-pushed the native/remove-css-polyfills branch from b1da050 to 0559b5b Compare August 4, 2025 20:02
necolas added 2 commits August 7, 2025 13:54
React Native has built-in support for content-box now
Replace the polyfills with the built-in support for `marginInline`, etc.
@necolas necolas force-pushed the native/remove-css-polyfills branch from 0559b5b to 9f87934 Compare August 7, 2025 20:54
@necolas
Copy link
Contributor Author

necolas commented Aug 11, 2025

Closing because the removal of the logical styles polyfill causes a regression to some inline margins in FBVR. There was almost no e2e perf benefit to this change so it can wait until we understand the cause.

@necolas necolas closed this Aug 11, 2025
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.

1 participant