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

Enhancing the Development Experience of iOS Hybrid Integration #835

Open
zhenghuawei-mobile opened this issue Nov 28, 2024 · 2 comments
Open

Comments

@zhenghuawei-mobile
Copy link

Introduction

Is it possible to improve the experience of integrating React Native into existing native iOS projects by directly managing versions through CocoaPods?

Details

I hope React Native can offer a more streamlined way to integrate into existing iOS projects while keeping native code and JavaScript code separated for better management. For example, something like
pod "React", "0.76.0"

and the current integration script is too complex; is it possible to simplify it?

Discussion points

1、Provide a simpler integration method, such as: pod 'React', '0.76.0'.
2、Reduce the integration ruby script.

@cortinico
Copy link
Member

and the current integration script is too complex; is it possible to simplify it?

both @cipolleschi and @okwasniewski (and other folks at Callstack) have been working on simplifying the brownfield integration for iOS in the last months/years and can tell you more about what's the current status

@cipolleschi
Copy link

@zhenghuawei-mobile Sadly, it will never be possible to just have a pod "React" instruction for Cocoapods, because you'll always need a bunch of other things that we ship in the NPM package.
So, there will always be a requirement to modify the project structure and to create a package.json files.

We are exploring ways to simplify this, through pre-building iOS and distributing an XCFramework via SPM and Cocoapods.
We are also exploring ways to simplify the code so that you can just call something like:

// In a view controller
self.reactNative = RCTReactNativeFactory.createReactNative(with: reactNativeConfiguration);
let view = reactNative.createView(with: reactNativeView);
self.view = view

but we are not there yet. Also, the code can be dramatically different from what shown above, but it is to show you what's the goal we have with this.

This work requires a lot of time, because we need to explore various alternatives to find the right path, plus we had to change the internal structure to make React Native compatible with Swift and to support this configuration.

We want to thank the whole community for the understanding and the patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants