Skip to content

[RN][iOS] Make the interop-layer work with components with custom name - #41207

Closed
cipolleschi wants to merge 2 commits into
mainfrom
cipolleschi/improve_interop_layer
Closed

[RN][iOS] Make the interop-layer work with components with custom name#41207
cipolleschi wants to merge 2 commits into
mainfrom
cipolleschi/improve_interop_layer

Conversation

@cipolleschi

@cipolleschicipolleschi commented Oct 26, 2023

Copy link
Copy Markdown
Contributor

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.

Changelog:

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

Test Plan:

Tested locally on an app created in 0.72 and 0.73.
Tested also in bridgeless mode, but it crashing.

We will work on bridgeless support in a separate PR.

@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: Facebook Partner: Facebook Partner labels Oct 26, 2023
@cipolleschi
cipolleschiforce-pushed the cipolleschi/improve_interop_layer branch from c45845d to 367256cCompareOctober 26, 2023 15:56
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot

analysis-bot commented Oct 26, 2023

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a17,653,242-5
androidhermesarmeabi-v7an/a--
androidhermesx86n/a--
androidhermesx86_64n/a--
androidjscarm64-v8a21,030,914-4,102
androidjscarmeabi-v7an/a--
androidjscx86n/a--
androidjscx86_64n/a--

Base commit: 3648886
Branch: main

@javache
javache self-requested a review October 27, 2023 12:24
@cipolleschi
cipolleschiforce-pushed the cipolleschi/improve_interop_layer branch from 367256c to 1a39d86CompareOctober 27, 2023 13:18
@cipolleschi
cipolleschi marked this pull request as ready for review October 27, 2023 13:19
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@javache
javache removed their request for review October 27, 2023 13:35
@github-actions

Copy link
Copy Markdown

This pull request was successfully merged by @cipolleschi in daedbe6.

When will my fix make it into a release? | Upcoming Releases

@github-actionsgithub-actionsBot added the Merged This PR has been merged. label Oct 27, 2023
lunaleaps pushed a commit that referenced this pull request Nov 3, 2023
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 pushed a commit that referenced this pull request Nov 8, 2023
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 added a commit that referenced this pull request Nov 10, 2023
* Make the interop-layer work with components with custom name (#41207)
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
* Remove references to RCTBridgeProxy
---------
Co-authored-by: Riccardo Cipolleschi <riccardo.cipolleschi@gmail.com>
Co-authored-by: Riccardo Cipolleschi <cipolleschi@meta.com>
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.MergedThis PR has been merged.p: FacebookPartner: FacebookPartner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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