Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Bridgeless: Expose host delegate methods #44158

Closed

Conversation

zhongwuzw
Copy link
Contributor

Summary:

Expose host delegate methods that users can do some customize work.

Changelog:

[IOS] [ADDED] - Bridgeless: Expose host delegate methods

Test Plan:

Users can do some customized work by RCTRootViewFactory.

@facebook-github-bot facebook-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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Apr 19, 2024
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

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

Hi @zhongwuzw, thanks for the PR! I think that the basic idea is very good, but as it is right now, it is not generally usable.
The RCTRootViewFactory is an internal class and most users will not manipulate it directly, unless they are in a brownfield setup.

I think that a better approach would be to make it accept a HostDelegate object in the as init parameter (or as part of the configuration) and set that object as delegate for the the host (Also, this favors composability over inheritance, which is always good).

Then, we need to wire this up in the RCTAppDelegate, somehow.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,410,759 +15
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,784,271 +1
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 03a51da
Branch: main

@facebook-github-bot
Copy link
Contributor

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

@cipolleschi
Copy link
Contributor

/rebase - this comment automatically rebase on top of main

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 29, 2024
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in f500b47.

Copy link

This pull request was successfully merged by @zhongwuzw in f500b47.

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

kosmydel pushed a commit to kosmydel/react-native that referenced this pull request Jun 11, 2024
Summary:
Expose host delegate methods that users can do some customize work.

## Changelog:

[IOS] [ADDED] - Bridgeless: Expose host delegate methods

Pull Request resolved: facebook#44158

Test Plan: Users can do some customized work by `RCTRootViewFactory`.

Reviewed By: sammy-SC

Differential Revision: D56521470

Pulled By: cipolleschi

fbshipit-source-id: dd22d0978b9fd4385380945a514eb6596b7d874f
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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants