Skip to content

Wire native CSS parsing for transform#55677

Closed
NickGerleman wants to merge 3 commits intofacebook:mainfrom
NickGerleman:export-D94052735
Closed

Wire native CSS parsing for transform#55677
NickGerleman wants to merge 3 commits intofacebook:mainfrom
NickGerleman:export-D94052735

Conversation

@NickGerleman
Copy link
Copy Markdown
Contributor

Summary:
Gate processTransform behind enableNativeCSSParsing(). When the flag is on, CSS transform strings like "rotate(45deg) scale(2)" are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 23, 2026
@NickGerleman NickGerleman force-pushed the export-D94052735 branch 3 times, most recently from 48d626b to d535536 Compare February 23, 2026 11:16
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 23, 2026

@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94052735.

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Feb 23, 2026
Summary:
Pull Request resolved: facebook#55677

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Differential Revision: D94052735
facebook#55674)

Summary:

Centralize gated ViewConfig processor attributes into exported constants in `ReactNativeStyleAttributes.js`. This is a pure refactor — no new behavior. When `enableNativeCSSParsing()` is on, the JS processor is bypassed and the raw value is sent directly to native.

Exported attributes: `colorAttribute`, `filterAttribute`, `boxShadowAttribute`, `backgroundImageAttribute`, `backgroundSizeAttribute`, `backgroundPositionAttribute`, `backgroundRepeatAttribute`.

All ViewConfig files now import these constants instead of inlining `{process: require(...)}` or feature flag checks.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D94052734
Summary:

`filterTypeFromString()` throws `std::invalid_argument` on unknown filter names, which crashes in `parseFilterRawValue` where it's called without try/catch. Change the return type to `std::optional<FilterType>` and return `std::nullopt` instead of throwing. Update callers in `FilterPropsConversions.h` to check the optional and gracefully return empty results.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D94052729
Summary:

Gate `processTransform` behind `enableNativeCSSParsing()`. When the flag is on, CSS transform strings like `"rotate(45deg) scale(2)"` are parsed natively using the existing CSS transform parser instead of being preprocessed in JS.

Changelog: [Internal]

Reviewed By: jorge-cab

Differential Revision: D94052735
@meta-codesync meta-codesync Bot closed this in d0acce9 Feb 24, 2026
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 24, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Feb 24, 2026

This pull request has been merged in d0acce9.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @NickGerleman in d0acce9

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants