Skip to content

Deduplicate toObjCType function in struct serializers (#56050)#56050

Closed
christophpurrer wants to merge 1 commit intofacebook:mainfrom
christophpurrer:export-D95908134
Closed

Deduplicate toObjCType function in struct serializers (#56050)#56050
christophpurrer wants to merge 1 commit intofacebook:mainfrom
christophpurrer:export-D95908134

Conversation

@christophpurrer
Copy link
Contributor

@christophpurrer christophpurrer commented Mar 10, 2026

Summary:

Removes ~75 lines of duplicated toObjCType logic between serializeConstantsStruct.js and serializeRegularStruct.js by extracting it into a new shared module serializeStructUtils.js. The two implementations were identical except for array wrapper types (std::vector vs facebook::react::LazyVector) and type alias suffixes (::Builder vs none), which are now handled via a structContext parameter that distinguishes between CONSTANTS and REGULAR contexts.

Changelog: [internal]

Differential Revision: D95908134

@meta-codesync
Copy link

meta-codesync bot commented Mar 10, 2026

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

@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 Mar 10, 2026
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Mar 11, 2026
Summary:

Removes ~75 lines of duplicated `toObjCType` logic between `serializeConstantsStruct.js` and `serializeRegularStruct.js` by extracting it into a new shared module `serializeStructUtils.js`. The two implementations were identical except for array wrapper types (`std::vector` vs `facebook::react::LazyVector`) and type alias suffixes (`::Builder` vs none), which are now handled via a `structContext` parameter that distinguishes between `CONSTANTS` and `REGULAR` contexts.

Changelog: [internal]

Differential Revision: D95908134
@meta-codesync meta-codesync bot changed the title Deduplicate toObjCType function in struct serializers Deduplicate toObjCType function in struct serializers (#56050) Mar 15, 2026
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Mar 15, 2026
Summary:

Removes ~75 lines of duplicated `toObjCType` logic between `serializeConstantsStruct.js` and `serializeRegularStruct.js` by extracting it into a new shared module `serializeStructUtils.js`. The two implementations were identical except for array wrapper types (`std::vector` vs `facebook::react::LazyVector`) and type alias suffixes (`::Builder` vs none), which are now handled via a `structContext` parameter that distinguishes between `CONSTANTS` and `REGULAR` contexts.

Changelog: [internal]

Differential Revision: D95908134
Summary:

Removes ~75 lines of duplicated `toObjCType` logic between `serializeConstantsStruct.js` and `serializeRegularStruct.js` by extracting it into a new shared module `serializeStructUtils.js`. The two implementations were identical except for array wrapper types (`std::vector` vs `facebook::react::LazyVector`) and type alias suffixes (`::Builder` vs none), which are now handled via a `structContext` parameter that distinguishes between `CONSTANTS` and `REGULAR` contexts.

Changelog: [internal]

Differential Revision: D95908134
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @christophpurrer in e102592

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

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 17, 2026
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