SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Integrate React Core prebuilds with apps (#52138)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52138

Integrate React Core prebuilds with apps

## Context
This PR introduces the first working version of building React Native apps on iOS using prebuilt RNCore and cocoapods.

- Added React-Core-prebuilt.podspec for installing/consuming XCFrameworks
- Added logic in react_native_pods.rb for switching between build from source and using prebuilts
- Added rncore.rb - utilities for the ReactCore prebuilts
- Updated rndependencies with some extra error handling modelled after rncode.rb
- Added support for hard linking headers and modules in each inner framework in the XCFramework in xcframework.js

## Swift:
To enable support for the objective-c types from swift, the swift compiler uses a module map to gather exports from the framework (module.modulemap). This file basically points to an umbrella header file that exports the valid objective-c types (non c++) to Swift. In addition these files are read from the DerivedData and not the project source - so it is a bit hard to control everyting.

I was initially not able to use cocoapods own module definitions (module_name, module_file props) to use a custom module map. I finally found that these files are expected in the deriveddata (build folder) where only the active inner framework is copied - so then I had to hard link both module map and header files for each arch.

## Changelog:

[IOS] [ADDED] - Added support for using prebuilt RNCore with Cocoapods

Pull Request resolved: https://github.com/facebook/react-native/pull/52109

Test Plan:
Run with RN Tester. We need to remove all extra pods from RNTester pod file since none of them are yet compatible with prebuilt (they reference non-prebuilt pods)

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D76980286

Pulled By: cipolleschi

fbshipit-source-id: 0ef34599cf7a60e54f799708bce93bcf6fb9d950
C
Christian Falch committed
90654e4ba2f3cc2f6b0d8f08769ce58b4e5d1b51
Parent: 60c01b4
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 6/23/2025, 3:13:56 PM