Skip to content

Make the interop-layer work with components with custom name - #41376

Merged
fortmarek merged 2 commits into
0.72-stablefrom
fortmarek/interop-layer
Nov 10, 2023
Merged

Make the interop-layer work with components with custom name#41376
fortmarek merged 2 commits into
0.72-stablefrom
fortmarek/interop-layer

Conversation

@fortmarek

Copy link
Copy Markdown
Contributor

Summary:

Cherry-pick of daedbe6.

Created a PR as the commit caused merge conflicts in the 0.72-stable branch.

Changelog:

[iOS][Fixed] - Add support for Components with custom names in the interop layer.

Test Plan:

See: #41207

@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Shopify Partner: Shopify Partner labels Nov 8, 2023

@cipolleschicipolleschi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good, there are two chunks of code that must be removed.

Comment on lines 106 to 110

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be removed. 0.72 does not have bridgeless and thus it can't leverage the RCTBridgeProxy class.

Comment on lines 89 to 91

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must be removed. 0.72 does not have bridgeless and thus it can't leverage the RCTBridgeProxy class.

Summary:
This should fix#37905 (comment)
When working on react-native-fast-image, we realized that the interop layer does not work for components where the exported name is different from the iOS class.
To fix this, we can use the Bridge to retrieve the actual view manager, given the component name.
This solution should be much more robust than making assumptions on the ViewManager name, given the ComponentName.
On top of that, we realized tha the interop layer was not calling `didSetProps` after setting the props, so we are invoking that.
bypass-github-export-checks
[iOS][Fixed] - Add support for Components with custom names in the interop layer.
Pull Request resolved: #41207
Test Plan: Tested locally on an app created in 0.72 and 0.73 in Bridge and Bridgeless mode.
Reviewed By: cortinico
Differential Revision: D50698172
Pulled By: cipolleschi
fbshipit-source-id: 49aee905418515b0204febbbe6a67c0114f37029
@fortmarek
fortmarekforce-pushed the fortmarek/interop-layer branch from e40af84 to 61bd291CompareNovember 8, 2023 10:58
@analysis-bot

analysis-bot commented Nov 8, 2023

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a8,492,330-9,149,517
androidhermesarmeabi-v7a7810352n/a
androidhermesx868962361n/a
androidhermesx86_648823753n/a
androidjscarm64-v8a9,151,475-11,870,134
androidjscarmeabi-v7a8341169n/a
androidjscx869204656n/a
androidjscx86_649463476n/a

Base commit: 47f773e
Branch: main

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

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.p: ShopifyPartner: ShopifyPartnerPick Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@fortmarek@analysis-bot@cipolleschi@facebook-github-bot