Commit Graph

26 Commits

Author SHA1 Message Date
Christian Falch 40e45f5366 add support for USE_FRAMEWORKS when using prebuilt React Native Core (#52489)
Summary:
When using prebuilts the USE_FRAMEWORKS setting is not really relevant for the React Native code, since there will not be any source code to build frameworks for - and because we already have a framework for the code in React.XCFramework.

This commit adds a new command to the React Native podspecs like we did with the ReactNativeDependencies framework. The method is called `add_rncore_dependency` and it does nothing when building from source - but when linking with the React.XCFramework it explicitly adds linking with the framework.

In addition there are a few places in the ruby code where we check for the USE_FRAMEWORK value and changes some settings - where needed this commit will add a separate check to ensure we're building from source when making these changes.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Added support for using USE_FRAMEWORKS with prebuilt React Native Core

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

Test Plan:
RNTester:

- Builds without USE_FRAMEWORKS as before with/without prebuilt
- Builds with USE_FRAMEWORKS=dynamic as before with source - and now also with prebuilt code.
- Same goes for the static variant.

Reviewed By: mdvacca

Differential Revision: D78012332

Pulled By: cipolleschi

fbshipit-source-id: ea942738ae52b9dceae48fb78a5026f04b7545b8
2025-07-10 03:04:07 -07:00
Christian Falch d8e00f0bb1 Added backwards compatible use of prebuild through cocoapods (#52252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52252

Instead of declaring two different sets of Pods for prebuilt and build from source, this commit now keeps the pod structure the same for both modes so that consuming libraries can expect to have the same pods and header files available - without this, libraries would have to be updated to take advantage of the prebuilds.

This PR does:
- Added React-Core-prebuilt as a pod in React-Core if prebuilt is enabled
- Simplified react_native_pods to keep pods structure and add React-Core-prebuilt pod if prebuilts are enabled
- Added function for selecting source sets based on prebuilt/build from source

To be able to function both in prebuilt and in regular build from source mode, all podspecs are now using the switch function podspec_sources so that they only include header files if we are in prebuild mode.

Also added React-Core-prebuilt as dependency on React-Core if we are in prebuilt mode so that we install the React.XCFramework.

## Changelog:

[IOS] [FIXED] - Added backwards compatible use of prebuild through cocoapods

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

Test Plan:
Tested in RN-Tester both with and without prebuild.

Rollback Plan:

Reviewed By: cortinico

Differential Revision: D77296047

Pulled By: cipolleschi

fbshipit-source-id: f3eb4d56b2a78bfc8e10ad852746be1ceaf828b2
2025-06-25 03:44:03 -07:00
Christian Falch 4c9431adda Update podspecs to use the ReactNativeDependencies or build from source (#49968)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49968

Updates all the core podspec to use the new `ReactNativeDependencies` podspec

## Changelog:

[INTERNAL] - Updates Modules in core to use the new dependencies.

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: cortinico

Differential Revision: D71032639

Pulled By: cipolleschi

fbshipit-source-id: e53179a8c1b47ee2b945f5cb5dfaf3f6f2755af2
2025-03-13 08:40:14 -07:00
Riccardo Cipolleschi 6e2ba742ff Factor out the CXX language standard in a separate const (#45374)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45374

This change factors out the language standard in a separate constant so we can easily control it from a single place.

There are only 2 exception to this:
1. hermes-engine: the podspec is used in CI and it has no access to the rct_cxx_language_standard variable
2. Yoga: it can be used as a separate pod, outside of React Native, so it makes sense to leave it alone.

This change also fixes a problem where, in some setup, the language was set to C++14

## Changelog
[Internal] - Refactor Cxx language standard in a single constant

Reviewed By: dmytrorykun, blakef

Differential Revision: D59629061

fbshipit-source-id: 41eac64e47c14e239d8ee78bd88ea30af244d695
2024-07-11 05:25:38 -07:00
Riccardo Cipolleschi a8aa96c8af Unify folly_version and compiler_flags in a single function (#42153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42153

This non functional change unifies Folly version and compiler flag in a single function, so that it would be easier to update it in the future.

## Changelog:
[Internal] - Unify folly version and compiler flags

Reviewed By: cortinico

Differential Revision: D52564771

fbshipit-source-id: 9b4b50560ddee05ce50465b6854666572148cb25
2024-01-09 02:43:52 -08:00
Kudo Chien cfeb43eaa2 Bump folly to 2024.01.01.00 (#42145)
Summary:
Bump folly version to 2024.01.01.00. Actually we need a version newer than v2023.08.14.00 with the https://github.com/facebook/folly/commit/c52d4490bf1e0cf117a71342b427984f9ffc316e fix. That will fix build error on Android:

```
  In file included from /Users/kudo/expo/expo/node_modules/react-native-reanimated/android/src/main/cpp/NativeProxy.cpp:3:
  In file included from /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/jsi/include/jsi/JSIDynamic.h:10:
  In file included from /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/dynamic.h:1310:
  In file included from /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/dynamic-inl.h:22:
  In file included from /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/Conv.h:124:
  In file included from /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/Demangle.h:19:
  /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/FBString.h:1721:19: error: no member named 'strong_ordering' in namespace 'std'
        return std::strong_ordering::equal;
               ~~~~~^
  /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/FBString.h:1723:19: error: no member named 'strong_ordering' in namespace 'std'
        return std::strong_ordering::less;
               ~~~~~^
  /Users/kudo/.gradle/caches/transforms-3/dd158a7d05d059a173ae31ca6d78ac49/transformed/jetified-react-android-0.74.0-nightly-20240103-0e533f308-SNAPSHOT-debug/prefab/modules/folly_runtime/include/folly/FBString.h:1725:19: error: no member named 'strong_ordering' in namespace 'std'
        return std::strong_ordering::greater;
               ~~~~~^
  3 errors generated.
```

## Changelog:

[GENERAL] [CHANGED] - Bump folly version to 2024.01.01.00

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

Test Plan: ci passed

Reviewed By: cortinico, cipolleschi

Differential Revision: D52546945

Pulled By: NickGerleman

fbshipit-source-id: 64aacb1d310062dddf987c7b95f10a477e293693
2024-01-05 04:09:50 -08:00
Nick Gerleman aefefdbbba Bump Folly to 2023.08.07.00 (#39798)
Summary:
This bumps folly, to absorb https://github.com/facebook/folly/commit/45fffa629d6bf7321391222d40613d75e8e067d7 which fixes warnings in XCode 15, and NDK 26 (treated as error bc we have better hygiene there). We then bump a little bit further to get past a new warning added, then fixed later.

Need to manually set `FOLLY_HAVE_GETTIME` on Apple because of the silliness described in https://github.com/facebook/folly/issues/1470#issuecomment-1746035194

There is not a combination of Folly, and Android libc++, that has fixes for warnings, but doesn't require the new libc++ in NDK 26. It is expected then that this commit will fail the build, but the next should succeed, and the two must be landed at the same time.

Changelog: [Internal]

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

Reviewed By: fkgozali

Differential Revision: D49897681

Pulled By: NickGerleman

fbshipit-source-id: 52b97ed5b302abf9e27f38dc655207827852dcc3
2023-10-04 19:57:14 -07:00
Nick Gerleman 17154a661f C++ 20 all the things (#39454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39454

1. Build with C++ 20 everywhere.
2. Update folly in OSS build to avoid a warning, and let us opt out of heavy bits required for supporting coroutines (we are still more than a year behind).
3. Update the folly podspec for the new version of folly
4. Update the many, many, copy/pasted header search paths for folly dependencies to be able to resolve fmt, now exposed to folly headers
4. Replaces a deprecated atomic usage with equivalent.
5. Fixes a deprecated implicit capturing `this` by value in lambda (same behavior, added a TODO because it seems sus)

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D49271685

fbshipit-source-id: 16610f7bcd1032d5796cc11f1cfa92a33d8c2593
2023-09-15 01:17:55 -07:00
Saad Najmi 1b78da8b43 min_ios_version_supported -> min_supported_versions (#39310)
Summary:
## Summary:

One of the most common diffs we have in React Native macOS is simply extending the `platforms` key Inside every pod spec to include macOS. React Native tvOS does the same to add tvOS. In the future, React Native may support visionOS, at which point we do the same thing again. Let's define a `min_supported_versions` hash that can be overridden at one place that is extensible to more platforms, instead of just specifying `min_ios_version_supported`.

Note: In doing this change, I have set it that `React-Hermes.podspec` doesn't build for macOS anymore. I think this is safe, since anyone using Hermes on macOS was probably using React Native macOS where we already have a diff to add macOS back?

## Changelog:

[IOS] [CHANGED] - Add min_supported_versions helper to cocoa pods scripts

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

Test Plan: CI should pass.

Reviewed By: NickGerleman

Differential Revision: D49014109

Pulled By: dmytrorykun

fbshipit-source-id: d44fc7b750c70cc263a2c89502c022a0db9a4771
2023-09-07 03:16:23 -07:00
Riccardo Cipolleschi 610b14e4f3 Move min ios version to 13.4 for OSS (#36795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36795

This change bump the min iOS version for React Native to 13.4, to align with company guidelines.

## Changelog:
[iOS][Changed] - Moved the min iOS version to 13.4

Reviewed By: cortinico

Differential Revision: D44634663

fbshipit-source-id: 035e8fcbb395f7394f8253e3ec485ad9937531c2
2023-04-06 12:07:26 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Christoph Purrer 089684ee56 Remove remaining TV_OS fragments (#35110)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35110

Changelog:
[General][Fixed] Remove remaining TV_OS fragments

Reviewed By: shwanton

Differential Revision: D40775881

fbshipit-source-id: 122ff8737de35689ee0951b068997ee546c7019c
2022-10-28 02:50:49 -07:00
Héctor Ramos a68c418082 Do not build JSI in React-jsi when Hermes is enabled, resolve JSI ODR violation (#35038)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35038

React-jsi provides JSI to allow React Native to interface with JavaScriptCore.
The hermes-engine Pod provides a second copy of JSI, as Hermes is built and linked statically with JSI.
This second copy of JSI would lead to an [ODR Violation](https://en.cppreference.com/w/cpp/language/definition).

To resolve this, when Hermes is enabled:
- React-hermes and hermes-engine are installed.
- React-jsc is not installed.
- React-jsi continues to be installed.
- React-jsi will not build JSI.
- React-jsi will declare a dependency on hermes-engine.

The result is that the JSI dependency for React Native is satisfied by hermes-engine, and there is no duplicate JSI library in the project.

When Hermes is disabled:
- React-jsi and React-jsc are installed.
- React-hermes and hermes-engine are not installed.
- React-jsi will build JSI.

Changelog:
[iOS][Changed] Resolve JSI ODR violation, make hermes-engine the JSI provider when Hermes is enabled

Reviewed By: cipolleschi

Differential Revision: D40334913

fbshipit-source-id: 409407a193a35cbd21b0e8778537b3627e4c54a2
2022-10-20 14:14:23 -07:00
Héctor Ramos 6b129d81ed CocoaPods: Split React-jsc out of React-jsi (#35031)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35031

The React-jsi Pod was serving two purposes: building JSI, and configuring JavaScriptCore as the JS engine.

By splitting the React-jsi Pod into React-jsi and React-jsi, we can start working towards de-coupling the JSI dependency from any particular JS engine.

Pods that depended on React-jsi, now depend on React-jsi and React-jsc.
One exception to this is React-hermes, which is only installed when Hermes is enabled, and thus does not require JavaScriptCore.
Upcoming commits should take care of removing the React-jsc dependency when Hermes is enabled, but it is out of scope for this commit.

Changelog:
[iOS][Changed] - The JSC Runtime is now provided by the React-jsc Pod instead of React-jsi. Libraries that declared a dependency on React-jsi in order to specifically create a JSC runtime (`makeJSCRuntime()`) will need to add React-jsc to their dependencies.

Reviewed By: dmytrorykun

Differential Revision: D40442603

fbshipit-source-id: b9b21146b9deb401f80cfef76a87c9867754a953
2022-10-20 14:14:23 -07:00
Luis Santana 68f3a42fc7 bump RTC-Folly to 2021.07.22 (#33841)
Summary:
Bumping RTC-Folly version used to address CVE-2022-24440.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General][Security] - Bump RTC-Folly to 2021-07-22

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

Reviewed By: Andjeliko, philIip

Differential Revision: D36425598

Pulled By: cortinico

fbshipit-source-id: d38c5f020dbecf794b10f12ed2da30e1825071af
2022-06-21 12:36:43 -07:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Samuel Susla c2e4ae39b8 Add support for C++17 in OSS
Summary: changelog: Add support for C++17

Reviewed By: cortinico

Differential Revision: D34612257

fbshipit-source-id: 88a0307a750f2e0793a639b7a2b670a4571332fe
2022-03-04 07:25:59 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Kevin Gozali b0c8a4eee8 Link RCT-Folly against libc++abi
Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

```
Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

See https://github.com/react-native-community/releases/issues/251

Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`.

Changelog: [Fixed][iOS] Unbreak Folly linker error

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
2021-09-16 22:24:10 -07:00
Kudo Chien b77948e33b Upgrade folly to 2021.06.28.00 and boost to 1.76.0 (#31840)
Summary:
1. [ios] upgrade folly to 2021.06.28.00 which aligned to android.
2. folly compile setting from c++14 -> c++17: _this folly requires c++17 for `std::unordered_map::insert_or_assign`._
3. boost 1.63.0 -> 1.76.0:  _the old boost does not support c++17._
4. deprecating react-native-community/boost-for-react-native: _by cocoapods installer, we could download the official target._

## Changelog

[iOS] [Changed] - Upgrade folly to 2021.06.28.00 and boost to 1.76.0

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

Test Plan: CI passed

Reviewed By: fkgozali

Differential Revision: D29668480

Pulled By: yungsters

fbshipit-source-id: 98eae9ca47f489dcea91974e6f5e9dcb4d66c40c
2021-07-16 15:13:12 -07:00
Peter Argany 36b58a824e Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00
Summary:
This fixes an error where folly fails to build on Xcode 12.5, by bumping the various folly deps in RN to builds with a fix.

Next step is to commit this to 0.64 release branch

allow-large-files

Changelog: [iOS] Fix builds on Xcode 12.5

Reviewed By: fkgozali

Differential Revision: D28071808

fbshipit-source-id: 236b66bf8294db0c76ff25b11632c1bf89525921
2021-04-29 10:39:25 -07:00
Héctor Ramos ae07c53d0b Resolve "fatal: not a git repository" error outside of git repositories
Summary:
CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash.

In these cases, the podspec is being consumed locally and the commit hash is unnecessary.

The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories).

Changelog:
[Internal] [iOS] - Remove CocoaPods error within Facebook's repository

Reviewed By: fkgozali

Differential Revision: D27750974

fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
2021-04-15 13:30:31 -07:00
Peter Argany a1d626739d Delete iOS10/tvOS10 support from React Native Libraries
Summary:
allow-large-files

Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19265731 (https://github.com/facebook/react-native/commit/674b591809cd1275b5f1c4d203c2f0ec52303396) for iOS9.

I just ran this command:
`find . -type f -exec sed -i '' 's/{ :ios => "10.0" }/{ :ios => "11.0" }/' {} +`
and then updated pods

Reviewed By: fkgozali

Differential Revision: D25693227

fbshipit-source-id: 0073d57ecbb268c52d21962cef202316857bcbd2
2021-01-11 16:46:16 -08:00
Eloy Durán 941bc0ec19 Upstream RN macOS Hermes integration bits (#29748)
Summary:
Microsoft’s RN for macOS fork supports the Hermes engine nowadays https://github.com/microsoft/react-native-macos/pull/473. As a longer term work item, we’ve started moving bits that are not invasive for iOS but _are_ a maintenance burden on us—mostly when merging—upstream. Seeing as this one is a recent addition, it seemed like a good candidate to start with.

As to the actual changes, these include:

* Sharing Android’s Hermes executor with the objc side of the codebase.
* Adding a CocoaPods subspec to build the Hermes inspector source and its dependencies (`Folly/Futures`, `libevent`).
* Adding the bits to the Xcode build phase script that creates the JS bundle for release builds to compile Hermes bytecode and source-maps…
* …coincidentally it turns out that the Xcode build phase script did _not_ by default output source-maps for iOS, which is now fixed too.

All of the Hermes bits are automatically enabled, on macOS, when providing the `hermes-engine-darwin` [npm package](https://www.npmjs.com/package/hermes-engine-darwin) and enabling the Hermes pods.

## Changelog

[General] [Added] - Upstream RN macOS Hermes integration bits

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

Test Plan:
Building RNTester for iOS and Android still works as before.

To test the actual changes themselves, you’ll have to use the macOS target in RNTester in the macOS fork, or create a new application from `master`:

<img width="812" alt="Screenshot 2020-08-18 at 16 55 06" src="https://user-images.githubusercontent.com/2320/90547606-160f6480-e18c-11ea-9a98-edbbaa755800.png">

Reviewed By: TheSavior

Differential Revision: D23304618

Pulled By: fkgozali

fbshipit-source-id: 4ef0e0f60d909f3c59f9cfc87c667189df656a3b
2020-08-27 01:18:33 -07:00
stealthanthrax 63992c0b96 Migrating RNTester to Packages Directory (#29567)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
This PR aims to migrate the RNTester App to `packages` directory. But is currently, open to inspect the CI issues and resolve the merge conflicts.

Currently done
 - Working on iOS
 - Working on Android
 - Detox Tests working on iOS

Need to work on
 - Errors generated by the CI builds

[General] [Changed] - Migrated the RNTester App to the packages directory.

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

Test Plan: It runs on both ios and android for now and the detox iOS builds are working.

Reviewed By: cpojer

Differential Revision: D23034761

Pulled By: rickhanlonii

fbshipit-source-id: e04bb06e1c7ef15d340206090d1575a871b9e6f5
2020-08-19 17:57:08 -07:00