SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Update RNDependencies podspec to fail fast if framework is missing (#52134)

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

Update RNDependencies podspec to fail fast if framework is missing

## 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] [CHANGED] - Fail fast when pod install i f using prebuild if frameworks are not present in the disk.

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: D76980282

Pulled By: cipolleschi

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