discussions-and-proposals icon indicating copy to clipboard operation
discussions-and-proposals copied to clipboard

Provide precompiled binary framework of React Native

Open dehlen opened this issue 3 years ago • 1 comments

Introduction

Currently react-native is provided with a CocoaPods integration which makes using ReactNative in iOS applications pretty easy. However there are two main drawbacks with this solution:

  1. We are forced to use at least CocoaPods as a dependency management solution. Adding other dependency managers for the rest of the 3rd. party dependencies creates unnecessary complexity to the project.
  2. The current react-native podspec provides react-native as source code which leads to building ReactNative on every clean build. Typically a clean build is done on CI which adds multiple minutes to every CI build.

We can live with the first drawback since CocoaPods at least is widely used in the iOS ecosystem and works okay for the most part. However the second point is what makes it really hard currently to achieve reasonable build times.

Details

I'd like to discuss whether it would be possible to use the already existing option of CocoaPods to provide ReactNative as a precompiled binary framework. As far as I can see CocoaPods has the option to add a vendored_framework to the podspec. Even a XCFramework is possible here which would allow for one framework available on iphonesimulator, iphoneos and other targets. This way one does not need to compile the whole dependency on every clean build.

Discussion points

I'd like to discuss whether it is possible to provide React Native as a precompiled binary frameworks and if not what roadblocks are currently blocking this or what your thoughts on this topic are.

dehlen avatar Apr 19 '21 15:04 dehlen

Seems like this issue in the main repo is related: https://github.com/facebook/react-native/issues/30196

dehlen avatar Apr 20 '21 20:04 dehlen