Граф коммитов

43 Коммитов

Автор SHA1 Сообщение Дата
Riccardo Cipolleschi 21d530208f Extracting Platform Specific TM code to break dependency cycle between ReactCommon and React-Core (#36461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36461

This change breaks a dependency cycle between `ReactCommon` and `React-Core`.

`React-Core` depends on `ReactCommon` to have access to the various `TurboModule` native files.

`ReactCommon` depends on `React-Core` because the content of the `core/platform/ios` folder and the `samples` folder needs to access the `RCTBridge` and other files in Core.

To break the circular dependency, we introduced two new `podspecs`:

* `React-NativeModulesApple` for the content of `core/platform/ios`.
* `ReactCommon-Samples` for the content of the `samples` folder.

In this way, the new dependencies are linear as `React-NativeModulesApple` and `ReactCommon-Samples` depends on `React-Core` and `ReactCommon` and `React-Core` only depends on  `ReactCommon`.

While doing this, we also make sure that all the include path are aligned, to limit the amount of breaking changes.

## Changelog:
[iOS][Breaking] - Split the `ReactCommon/react/nativemodule/core/platform/ios` and `ReactCommon/react/nativemodule/samples` in two separate pods to break circular dependencies.

Reviewed By: mdvacca

Differential Revision: D44023865

fbshipit-source-id: a97569506350db5735ac5534b1592471de196cbe
2023-03-14 05:31:16 -07:00
Riccardo Cipolleschi b1b2b8baaf Update podspecs with the right search paths
Summary:
Update podspecs with the right search paths to include the required framework by every module.

## Changelog:
[iOS][Changed] - Update search paths to support `use_frameworks!` with Fabric

Reviewed By: sammy-SC, dmytrorykun

Differential Revision: D43089372

fbshipit-source-id: 4bbfc4b98bd289d66ce4015429d581856d9c05b3
2023-02-20 11:50:10 -08:00
Riccardo Cipolleschi b3040ec624 Restore Dynamic framework with Hermes in the Old Architecture
Summary:
I discovered that 0.69 could run React Native as Dynamic framework with Hermes and starting from 0.70 that's not possible anymore.
This diff restore that possibility.

Notice that now Hermes provisdes JSI and Dynamic Frameworks requires that all the dependencies are explicitly defined, therefore, whenever we have a pod that depended on `React-jsi`, now it also has to explicitly depends on `hermes-engine`

## Changelog
[iOS][Fixed] - Add Back dynamic framework support for the Old Architecture with Hermes

Reviewed By: cortinico

Differential Revision: D42829728

fbshipit-source-id: a660e3b1e346ec6cf3ceb8771dd8bceb0dbcb13a
2023-01-30 04:25:26 -08:00
Riccardo Cipolleschi da270d038c Restore Dynamic framework with JSC in the Old Architecture
Summary:
I discovered that 0.69 and 0.70 could run React Native as Dynamic framework with JSC and starting from 0.71 that's not possible anymore.
This diff restore that possibility.

## Changelog
[iOS][Fixed] - Add Back dynamic framework support for the old architecture

Reviewed By: cortinico

Differential Revision: D42829137

fbshipit-source-id: 848672f714d8bab133e42f5e3b80202b350d5261
2023-01-30 04:25:26 -08: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
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 5aeb99e774 CocoaPods: Do not configure Hermes search paths if Hermes is disabled
Summary:
The React-Hermes and hermes-engine headers are only needed when Hermes is enabled.

Changelog: [internal]

Reviewed By: cipolleschi

Differential Revision: D40451162

fbshipit-source-id: d38830f8abe57a91798e216d7930bb7add483899
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
Kudo Chien 88b7b640a7 Fix hermes executor not available when use_frameworks is enabled (#34222)
Summary:
When in `use_frameworks!` + `hermes_enabled` mode, the React podspecs have not dependency to the `React-hermes` podspec. the `HermesExecutorFactory.h` is not available [here](1d997ce6d6/React/AppSetup/RCTAppSetupUtils.h (L15)) and [here](1d997ce6d6/React/CxxBridge/RCTCxxBridge.mm (L44)). The app will fallback to JSCRuntime and crash in release build because the JSCRuntime cannot evaluate Hermes bundles.

The pr tries to add `React-hermes` to Framework Search Paths and make the `HermesExecutorFactory.h` reachable when in use_frameworks mode.

This pr should fix the problem mentioned in [0.70 release discussion](https://github.com/reactwg/react-native-releases/discussions/26#discussioncomment-3166350).

## Changelog

[iOS] [Fixed] - Fix Hermes executor not available when `use_frameworks` is enabled

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

Test Plan:
use patch-package to apply the change to a RN 0.69.1 project with the following test cases:

- old architecture + jsc
- new architecture + hermes
- old architecture + `use_frameworks! :linkage => :static` + hermes
- old architecture +`use_frameworks! :linkage => :static` + hermes + release build

Reviewed By: sammy-SC

Differential Revision: D38112717

Pulled By: cipolleschi

fbshipit-source-id: ee78527f4686400856ab9a055cf30b20900afc17
2022-07-27 07:12:16 -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
Franco Meloni ca8174e15f Create script to automatically set CLANG_CXX_LANGUAGE_STANDARD on the client project (#33863)
Summary:
Currently this [section](https://reactnative.dev/docs/next/new-architecture-app-intro#ios-enable-c17-language-feature-support) of the Playbook tells us to set CLANG_CXX_LANGUAGE_STANDARD = "c++17" in the main app target for the new architecture to work.
Would be nice to be able to automate that instead

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

[iOS] [Added] - Cocoapods function to add the `CLANG_CXX_LANGUAGE_STANDARD` to all the targets if needed

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

Test Plan:
I've created some unit tests for the newly added function.
I've executed pod install and the ruby tests locally.

Reviewed By: cipolleschi

Differential Revision: D36484366

Pulled By: f-meloni

fbshipit-source-id: 553b092e747bef11d82195619ae1058985fdc325
2022-05-19 14:57:04 -07:00
Lizzi Lindboe 7dc0b5153e Restore ability to change JS bundle port via CLI (#33726)
Summary:
Fixes https://github.com/facebook/react-native/issues/30708.

When given the `--port` option to the `npx react-native run-ios` command, [the React Native CLI passes the `RCT_METRO_PORT` variable when calling `xcodebuild`](ada951606e/packages/platform-ios/src/commands/runIOS/index.ts (L552)).

This used to adjust the port used when building on iOS, but this appears to have stopped working when the xcodeproj configuration was removed in favor of CocoaPods ([link, load the diff for React.xcodeproj](79a7828b91 (diff-43a2b2682727878049c3283b9361d9ad94964b63105fda6a834ba23baa5b471bL5199-L5205))).

This change re-adds the preprocessor definition that was used to pull the environment variable in, and now the `--port` flag works again.

## Changelog

[iOS] [Fixed] - Fixed the ability to pass the port to use for Metro when running `react-native run-ios --port <port>`.

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

Test Plan:
1. Using an example project generated from the 0.68.1 template, I modified `node_modules/react-native/React-Core.podspec` to have the same changes.
2. Deleted my project's `ios/Pods` folder and re-ran `bundle exec pod install`
3. Ran `yarn ios --port=9900` and verified that the app is connected to Metro, and check again with a refresh of the app.
4. Verified that I saw traffic on port 9900 when refreshing the app with `sudo lsof -i :9900`
5. Stopped the app and tested `yarn ios` without a port, and used `lsof` again to ensure it was using the default port `8081` again

I also ran the iOS tests locally and they passed.

Reviewed By: dmitryrykun

Differential Revision: D36097840

Pulled By: cipolleschi

fbshipit-source-id: c3f31789e15f6cd3386350e917cfa715b2d7fd58
2022-05-11 06:00:28 -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
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
Sota Ogo 41cad354e5 Fix the default template when RCT_NEW_ARCH_ENABLE=1 (#32775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32775

Changelog: [Internal] Fix build issues for the new app template with the new architecture enabled

Reviewed By: philIip

Differential Revision: D33157325

fbshipit-source-id: ee63f38fbfc088ca193dfa1b48f4b6611257b787
2021-12-16 15:10:49 -08:00
Sota Ogo 8ec0e6919c Add turbo module support in the default app template (#32752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32752

Changelog: [internal] Add an optional support for Turbomodule. Define RCT_TM_FABRIC_ENABLED to enable the new architecture.

Reviewed By: philIip

Differential Revision: D33052777

fbshipit-source-id: 6d32790586bb51f9c9244344522c95245c912114
2021-12-15 18:14:35 -08:00
Sota Ogo 73a04d1452 Refactor the iOS app template to move setups to a helper class
Summary:
Changelog: [internal] Move initital setups in AppDelegate to util classes.

This will make it easy to apply the new architecture changes in the future.

Reviewed By: cortinico

Differential Revision: D33051517

fbshipit-source-id: 16e326b7816fae83df65450c545e7dce1a93b9d0
2021-12-13 23:13:32 -08:00
Neil Dhar aae93553d0 Remove libstdc++ dependency (#32247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32247

I don't think we need both libc++ and libstdc++.

allow-large-files

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30950943

fbshipit-source-id: d0669815ff59c3e9ac45954a4a11930d1bc3959f
2021-10-08 14:16:54 -07: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
Thibault Malbranche 59abb5f378 fix(hermes): fixed hermes build on iOS (#31559)
Summary:
While testing 0.65, we noticed issues with hermes on iOS in the template projects
These changes create a subspec to the react-core pod so that it can access hermes header correctly.

## Changelog

Not applicable

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

Test Plan: I've ran e2e manual test. Tested RNTester manually also. Then tested a project inited with hermes and the default template

Reviewed By: mhorowitz

Differential Revision: D28564642

Pulled By: Huxpro

fbshipit-source-id: cfcb3363254f62a0e514ec99159b32f841ee4463
2021-05-20 15:23:07 -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 f0faa7843c Remove iOS10/tvOS10 support from remaining podfiles
Summary: Changelog: [iOS] Remove iOS10/tvOS10 support from remaining podfiles

Reviewed By: shergin

Differential Revision: D26410811

fbshipit-source-id: 9050346def5070338e709ff102a284a828821586
2021-02-19 13:47:25 -08:00
Janic Duplessis 12fccdeea3 Make codegen more reliable on iOS (#30792)
Summary:
This addesses a few issues I noticed while migrating my app to the new build-time codegen on iOS.

1. I noticed random failures because of codegen on iOS. This is mostly due to the fact the codegen output files are not specified in the xcode script. The only reason it works relatively fine currently is because the codegen output is inside the input files directory. This has the side effect of causing files to be regenerated every build, then causes all core modules to be recompiled which adds up a significant amount of time to rebuilds. To fix this I added the generated files to the script phase output and moved the FBReactNativeSpec dir outside of the codegen source (Libraries). I moved it to the React directory as this seemed to make sense and is where a lot of iOS files are as well as the core modules. Note this might require internal changes. This removes the circular dependency between our build phase input and output so consecutive builds can be cached properly.

2. Add `set -o pipefail` to the xcode script, this helped propagate errors properly to xcode because of the `| tee` pipe so it fails at the script phase and not later with a header not found error. Also add `2>&1` to pipe stderr to stdout so errors are also captured in the log file.

3. Add the `-l` flag to the bash invocation to help finding the yarn binary. With my setup yarn is added to the system PATH in my user .profile. Adding this file will cause bash to source the user environment which xcode scripts does not by default. I think this will help with most setups.

4. If yarn is not found the `command -v yarn` would make the script exit without any output because of the -e flag. I made a change to ignore the return code and check later if YARN_BINARY is set and have an explicit error message if not.

## Changelog

[iOS] [Fixed] - Make codegen more reliable on iOS

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

Test Plan:
Tested various project states to make sure the build always succeeds in RN tester:

- Simulate fresh clone, remove all ignored files, install pods, build
- Build, delete FBReactNativeSpec generated files, build again
- Build, build again, make sure FBReactNativeSpec is cached and not rebuilt
- Make the script fail and check that xcode shows the script error logs properly

![image](https://user-images.githubusercontent.com/2677334/105891571-c8badd00-5fde-11eb-839c-259d8e448523.png)

Note: Did not test fabric

Reviewed By: fkgozali

Differential Revision: D26104213

Pulled By: hramos

fbshipit-source-id: e18d9a0b9ada7c0c2e608d29ffe88087f04605b4
2021-02-01 14:39:25 -08:00
Janic Duplessis 0959ff36d1 Move hermes to a separate podspec (#30478)
Summary:
Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon.

## Changelog

[iOS] [Fixed] - Move hermes to a separate podspec

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

Test Plan: Test that it builds and run properly in an app

Reviewed By: fkgozali

Differential Revision: D25308237

Pulled By: hramos

fbshipit-source-id: b4cc44ea2b1b854831e881dbbf9a2f30f6704001
2020-12-03 20:08:00 -08:00
Mike Grabowski c95ee5ac18 feat: Enable Hermes to work on iOS (#29914)
Summary:
This PR makes it possible to build iOS applications with Hermes. Note that it doesn't work with `use_frameworks!` just yet.

Fixes https://github.com/facebook/react-native/issues/27845 (by downgrading iOS deployment target for RCT-Folly to 9.0)
Fixes https://github.com/facebook/react-native/issues/28810 (as above)

Checklist:
- [x] Adjust release scripts to create Hermes bytecode bundle
- [x] Release new Hermes npm package that includes iOS files (unreleased right now, if you want to try locally, you have to clone Hermes and `yarn link` its master to this project)
- [x] Test on a new React Native application in both Debug and Release (Device)
- [x] Test on an RNTester application in both Debug and Release (Device)
- [x] Add missing `i386` to Hermes framework and enable Bitcode
- [x] Inspect CI failures for possible regressions
- [x] Resolve Folly issue as reported https://github.com/facebook/react-native/issues/27845 and https://github.com/facebook/react-native/issues/28810
- [x] Release new Hermes and test against it that everything works

## Changelog

[IOS] [FEATURE] - Enable Hermes on iOS
[INTERNAL] - Upgrade to CocoaPods 1.10.0 to resolve Xcode 12.0 issues
[INTERNAL] - Upgrade to Xcode 12.0 on the CircleCI
[INTERNAL] - Fix building RNTester in Release mode
[INTERNAL] - Fix build-time errors of `libevent` with `use_frameworks!`
[INTERNAL] - Introduce `USE_HERMES` variable and test all RNTester configurations on the CI
[INTERNAL] - Do not fetch CocoaPods repository since we're using CDN anyway

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

Test Plan:
Turn on `hermes_enabled` to true in your `Podfile`, install pods, and run the iOS application. Your app should be running Hermes now.

Preview: (note "Engine: Hermes")

<img width="395" alt="Screenshot 2020-09-09 at 19 22 32" src="https://user-images.githubusercontent.com/2464966/92631584-d7c01d80-f2d1-11ea-9b40-33d73db96a53.png">

Reviewed By: hramos

Differential Revision: D24684845

Pulled By: cpojer

fbshipit-source-id: 900cbe3bf9398a6fd4a773d552899a001bf5146b
2020-11-03 01:14:38 -08:00
simek 2160377574 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

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

* **[Internal] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:41 -07:00
Eloy Durán 6e08f84719 Make React-Core compatible with Swift modules (#29995)
Summary:
Related to https://github.com/facebook/react-native/issues/29633

Support Swift based libraries using Xcode 12’s build system.

## Changelog

[iOS] [Fixed] - Support Swift based libraries using Xcode 12’s build system.

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

Test Plan:
* Building RNTester still works
* Swift based pod tested in https://github.com/mrousavy/react-native-blurhash/issues/58

Reviewed By: fkgozali

Differential Revision: D23824438

Pulled By: appden

fbshipit-source-id: 418caf9808cb6326e3d6efdc8b37131a5705e7f6
2020-09-23 08:17:33 -07: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
Jiayan Zhuang c03a6aba49 Setup the ShadowNode tree for RCTParagraphComponentViewTests (#29470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29470

Changelog:
[Internal] - Build the framework of the RCTParagraphComponentViewTests and do some setup.

I built a shadowNode tree here for future tests.

Reviewed By: shergin

Differential Revision: D22536626

fbshipit-source-id: c74b63b3319693b90c9d64b7f782a1a922b0d499
2020-07-27 15:37:31 -07:00
Jayesh Kawli b78d7051e5 Moved ART iOS files to FB internal
Summary:
As a part of the "Lean Core" effort we are moving many React Native open source modules into React Native. Through this task, we reduced the app size of all React Native applications!

For this task, I moved the ART iOS files to Facebook internal.

Changelog:
[iOS][Changed] - Moved ART iOS files from React Native to Facebook internal

Reviewed By: PeteTheHeat

Differential Revision: D22560856

fbshipit-source-id: 4ed982b0361fef3e875374b6c3df0204037c2bfa
2020-07-19 13:59:06 -07:00
Ramanpreet Nara 0486640571 Introduce NativeModulePerfLogger
Summary:
## Description
This diff introduces `NativeModulePerfLogger`, its BUCK, Cocoapod, android-ndk targets. This diff also wires up those targets into the React Native bridge and TurboModules targets, so that we get signal on if the code compiles.

This diff also introduces `TurboModulePerfLogger`, which is a namespace that holds the `NativeModulePerfLogger` that'll do perf-logging for TurboModules.

## How will perflogging work on iOS?
1. Each application will, during React Native initialization, create a NativeModule perf logger.
2. If TurboModules are enabled, we'll call `TurboModulePerfLogger::setInstance(perfLogger)`. If TurboModules are disabled, we'll call `NativeModulePerfLogger::setInstance(perfLogger)`.
3. TurboModules, when they're created and used, will log events via `TurboModulePerfLogger::getInstance()`. NativeModules (i.e: bridge modules), when they're created and used, will log events via the `NativeModulePerfLogger::getInstance()`.

> **Note:** The NativeModule system will log events for non-TurboModules as well. Maybe we should log events for only NativeModules that conform to the `TurboModule` interface, when TurboModules are disabled. This'll ensure a fair comparison between the two systems.

## How will perflogging work on Android?
Please see the subsequent diff.

allow-large-files

Changelog:
[Both][Added] - Introduce `NativeModulePerfLogger`

Reviewed By: PeteTheHeat

Differential Revision: D21318053

fbshipit-source-id: 6ddf5b5a80bdc4076d2dd6588067e2b0ec8c2c6b
2020-05-13 20:28:15 -07:00
Rachel Nabors c0d8c1db90 Updating the URLs to point at new domain name reactnative.dev
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code

CHANGELOG:
[INTERNAL]

Reviewed By: hramos

Differential Revision: D20072842

fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
2020-02-24 13:09:11 -08:00
Sharon Gong aebf54aee4 Add localized accessibility strings to React Core pod (#27995)
Summary:
The accessibility roles and states description strings are not able to be localized on iOS platform. Those strings are exposed to the end users so it should be localized. This PR is to add localized strings as a resource bundle to the React Core Pod so that any React Native app integrating the React Native dependencies using CocoaPods can get the localized accessibility roles and states description.

## Changelog

[iOS] [Added] - Add localized accessibility strings to React Core pod
Pull Request resolved: https://github.com/facebook/react-native/pull/27995

Test Plan: Verified with RNTester app.

Differential Revision: D19975587

Pulled By: PeteTheHeat

fbshipit-source-id: f8eb4e25194f0cd603c98a6221ec87503a2826ed
2020-02-20 14:31:03 -08:00
Kudo Chien a27e31c059 Upgrade Folly to v2020.01.13.00 (#27810)
Summary:
Upgrade Folly to v2020.01.13.00. Fixes https://github.com/facebook/react-native/issues/27640

## Changelog

[iOS] [Changed] - Upgrade Folly to v2020.01.13.00
Pull Request resolved: https://github.com/facebook/react-native/pull/27810

Test Plan: Test by building and running RNTester

Reviewed By: mdvacca

Differential Revision: D19483115

Pulled By: fkgozali

fbshipit-source-id: 4a85325a95b5f7857da75995d587218740d8b077
2020-01-21 12:44:00 -08:00
Kevin Gozali 674b591809 iOS: Deprecate iOS 9 / tvOS 9 SDK support
Summary:
It is time to target SDK version 10.0+.

Changelog: [iOS] [Deprecated] - Deprecating support for iOS/tvOS SDK 9.x, 10.0+ is now required

Reviewed By: mdvacca

Differential Revision: D19265731

fbshipit-source-id: 93b6f9e8f61c5b36ff69e80d3f18256aa96cc2c0
2020-01-02 12:52:12 -08:00
Ramanpreet Nara 3f50f57b3d Back out "Fixes Fabric related podspec"
Summary:
Original commit changeset: 4b18a931a2e4

The original PR wherein these changes were introduced was problematic. When you expose headers that use C++ from the Yoga podspec, they get automatically imported in the Yoga umbrella file. This causes compilation errors, most likely because it's possible for non-c++ files to import these headers (i.e: RCTConvert.m).

I didn't dig into this too much, but since Fabric still doesn't fully compile in OSS, I think it's reasonable to revert this PR for now. cc Kevin Gozali.

Changelog:
[iOS][Fixed] - Undo Fabric-related podspec change

Reviewed By: fkgozali

Differential Revision: D18284536

fbshipit-source-id: a90454b945af0235424dc56408400cd35efd4e7a
2019-11-01 19:34:46 -07:00
Andres Suarez e1cfeaddd4 Move non-license comments out of license header
Summary: Changelog: [General] [Fixed] - License header cleanup

Reviewed By: cpojer

Differential Revision: D17749100

fbshipit-source-id: edca9c73a065e9fc311109cd6efeb1f75451a55a
2019-10-15 20:12:12 -07:00
zhongwuzw 4203d24b83 Fixes Fabric related podspec (#26805)
Summary:
1. Add missing podspec like `safeareaview` and `legacyviewmanagerinterop`.
2. Expose `YGNode,YGStyle.h` to public, fabric uses it, ex. `YogaStylableProps.h`.
3. Make `React-Core`'s Cxx header public, because `RCTLegacyViewManagerInteropCoordinator.m` uses it.

## Changelog

[iOS] [Fixed] - Fixes Fabric related podspec
Pull Request resolved: https://github.com/facebook/react-native/pull/26805

Test Plan: Fabric RNTester can run.

Reviewed By: shergin

Differential Revision: D17872379

Pulled By: mdvacca

fbshipit-source-id: 4b18a931a2e403237a96d5cc3505b99c7253c710
2019-10-14 22:34:40 -07:00
Ram N 82a8080f07 Change podspec name of yoga to Yoga
Summary:
Needed to capitalize the name, since this is the convention used elsewhere too

## Changelog:

[iOS] [Changed] - Renamed yoga podspec to Yoga

Reviewed By: shergin

Differential Revision: D17127104

fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b
2019-08-30 07:12:34 -07:00
James Treanor ca9e108110 Remove 's.static_framework = true' requirement for podspec (#25816)
Summary:
As part of the fix for https://github.com/facebook/react-native/issues/25349 I added `s.static_framework = true` to each podspec in repo (see https://github.com/facebook/react-native/pull/25619#discussion_r306993309 for more context).

This was required to ensure the existing conditional compilation with `#if RCT_DEV` and `__has_include` still worked correctly when `use_frameworks!` is enabled.

However, fkgozali pointed out that it would be ideal if we didn't have this requirement as it could make life difficult for third-party libraries.

This removes the requirement by moving `React-DevSupport.podspec` and `React-RCTWebSocket.podspec` into `React-Core.podspec` as subspecs. This means the symbols are present when `React-Core.podspec` is built dynamically so `s.static_framework = true` isn't required.

This means that any `Podfile` that refers to `React-DevSupport` or `React-RCTWebSocket` will need to be updated to avoid errors.

## Changelog

I don't think this needs a changelog entry since its just a refinement of https://github.com/facebook/react-native/pull/25619.
Pull Request resolved: https://github.com/facebook/react-native/pull/25816

Test Plan:
Check `RNTesterPods` still works both with and without `use_frameworks!`:

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: hramos

Differential Revision: D16495030

Pulled By: fkgozali

fbshipit-source-id: 2708ac9fd20cd04cb0aea61b2e8ab0d931dfb6d5
2019-07-25 11:46:43 -07:00
James Treanor 8131b7bb7b CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.

It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.

The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .

There are still a few breaking changes which I hope will be acceptable:

- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.

Still to do:

- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �

## Changelog

[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619

Test Plan:
### FB

```
buck build catalyst
```

### Sample Project

Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.

### RNTesterPods

`RNTesterPodsPods` can now work with or without `use_frameworks!`.

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: PeteTheHeat

Differential Revision: D16465247

Pulled By: PeteTheHeat

fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-24 23:27:09 -07:00