Skip to content

Deduplicate toObjCType function in struct serializers#56050

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

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

Conversation

@christophpurrer
Copy link
Contributor

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.


AI generated Summary & Test Plan from DEV103167768

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
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
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 meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants