SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Introduce rncore.rb to manage the core prebuilds (#52109)

Summary:
Introduce rncore.rb to manage the prebuilds of RNCore.

## 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.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Added script to handle React Core prebuilds

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, rshest

Differential Revision: D76979549

Pulled By: cipolleschi

fbshipit-source-id: 7a2b1809bf58b600293cc33ca2dcff0060f3fab0
C
Christian Falch committed
8888cf9a2d6597549550f36c869303841af07bd3
Parent: 27c97ac
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 6/23/2025, 3:13:56 PM