Skip to content

Commit

Permalink
Merge from upstream 0.64-stable to v0.64.0 (#863)
Browse files Browse the repository at this point in the history
* chore: ignore broken Hermes job

* Upgrade metro to 0.64.0

Summary:
Upgrade metro to 0.64.0

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D24753886

fbshipit-source-id: af679ec912c5cd8049a998d045ce8a75bf30e5d3

* Build rn-codegen in a temporary directory (facebook#30292)

Summary:
When running yarn install from the codegen directory it will reinstall all dependencies for the react-native workspace inside the react-native package. In my case this caused issues with metro because it would now have 2 copies of it (node_modules/metro and node_modules/react-native/node_modules/metro).

To avoid this copy the react-native-codegen source in a temporary directory and yarn install from there, then copy the built files back.

## Changelog

[Internal] - Build rn-codegen in a temporary directory

Pull Request resolved: facebook#30292

Test Plan: Tested the script in an app with codegen enabled. Fresh install with rn-codegen not built, made sure no extra modules are installed under node_modules/react-native/node_modules.

Reviewed By: yungsters

Differential Revision: D24893216

Pulled By: fkgozali

fbshipit-source-id: 2c372b755632ea6f50ad5d4562248612b349a9a6

* Android OSS: fixed unbound variable error for codegen build script

Summary:
If $FBSOURCE_ENV isn't set, this failed with `/root/react-native/packages/react-native-codegen/android/../scripts/oss/build.sh: line 20: FBSOURCE_ENV: unbound variable`.

This commit fixes https://app.circleci.com/pipelines/github/facebook/react-native/7080/workflows/5cf18a1f-e6d2-4648-8217-d42e9a61fef1/jobs/176451

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24912950

fbshipit-source-id: 113e3dd7f78c75fc3adea0b21c9e38910be8c065

* Use codegen from source in default iOS template apps

Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.

Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template

Reviewed By: TheSavior

Differential Revision: D24904655

fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea

* Fix :ReactAndroid:androidJavadoc task (facebook#30417)

Summary:
Fixes facebook#30415

This is a quick and dirty fix to unblock publish, of excluding a class from Javadoc generation that is importing a class current build logic cannot handle. This is not a long-term fix for the issue.

## 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] [Fixed] - Fix :ReactAndroid:androidJavadoc task

Pull Request resolved: facebook#30417

Test Plan: Tested that the task now completes locally.

Reviewed By: lunaleaps

Differential Revision: D25041282

Pulled By: fkgozali

fbshipit-source-id: f774ab30a09db473178e2a51c77860e4985dd8e3

* fix android npm (facebook#30452)

* fix: pin hermes-engine to 0.7.x

* Use react-native-codegen@0.0.6 in new app template

Summary:
Use pre-built react-native-codegen library from npm in the iOS app template.
Built react-native-codegen from source when used with RNTester.
Published react-native-codegen@0.0.6.

Changelog:
[iOS][Added] - Use react-native-codegen in iOS app template
[Internal] - Bump react-native-codegen: 0.0.6

Reviewed By: fkgozali

Differential Revision: D25128036

fbshipit-source-id: f294c23b9b911aae6f404edc01b62426fb578477

* chore: updated url of deprecated modules (facebook#30422)

Summary:
Part of react-native-community/releases#207

Migrate warnings in index.js to point to new lean core repos

NOTE: some npm modules has been transferred to new nom namespace, such as `react-native-picker/picker` `react-native-async-storage/async-storage` `react-native-masked-view/masked-view`.
Some lean core repo has been transferred to new repo, but its npm namespace remains the same. ex: clipboard module exists in react-native-clipboard/clipboard repo, but npm package name is still `react-native-community/clipboard` (they're planned to be migrated in the future)

## 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] [Changed] - Migrate warnings in index.js to point to new lean core repos

Pull Request resolved: facebook#30422

Test Plan:
- Updated repo URL can be accessed
- Updated npm package can be installed

Reviewed By: rickhanlonii

Differential Revision: D25077750

Pulled By: cpojer

fbshipit-source-id: b736ea449835bdf3d2a2f85e5c86e5253b90db78

* Add possibility to disable buttons in action sheet ios (facebook#28979)

Summary:
_**Fixed**_ version of [the previous PR](facebook#28792) after reverting [changes](facebook@c8d678a#commitcomment-39299254)

----

I've noticed that currently there is no option to disable button within the `ActionSheetIOS`. It can be really useful and decided to extend the API to support that functionality.

I added a new option called `disabledButtonsIndices` to `ActionSheetIOS` which is an array of button indices which should be disabled.

`ActionSheetIOS` documentation - PR facebook/react-native-website#1898

## Changelog

[iOS] [Added] - Add disableButtonsIndices option to ActionSheetIOS component

Pull Request resolved: facebook#28979

Test Plan:
1. Run the `RNTester`
2. Choose `ActionSheetIOS`
3. Check the fourth example `Show Action Sheet with disabled buttons`
4. `Option 1` and `Option 2` should be disabled

screenshot | gif
 --- | ---
<img width="493" alt="Screenshot 2020-04-30 at 15 16 22" src="https://user-images.githubusercontent.com/22746080/80739025-1ec52780-8b16-11ea-8b1c-30bb40ad8c99.png"> | <img src="https://user-images.githubusercontent.com/22746080/80739043-24227200-8b16-11ea-8bcb-af25eb57baac.gif" width="493" />

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368

* [0.64.0-rc.0] Bump version numbers

* chore: revert changes to test-manual-e2e.sh

* fix: android artifacts in publish-npm.js

* chore: Bump CLI to ^5.0.1-alpha.0 (facebook#30420)

Summary:
Upgrading CLI to latest. This diff is intended to be cherry-picked to 0.64.

cc grabbou kelset alloy

[Internal] [Changed] - Bump CLI to ^5.0.1-alpha.0

Pull Request resolved: facebook#30420

Test Plan: None

Reviewed By: MichaReiser

Differential Revision: D25063261

Pulled By: cpojer

fbshipit-source-id: e1788fd40db2b00daaf888e7b2afaf708ade5451

* [0.64.0-rc.1] Bump version numbers

* Fix cannot working Modal's onDismiss. (facebook#29882)

Summary:
Fixes: facebook#29455

Modal's onDismiss is not called on iOS.
This issue occurred the commit facebook@bd2b7d6 and was fixed the commit facebook@27a3248.
However, the master and stable-0.63 branches do not have this modified commit applied to them.

## 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] [Fixed] - Modal's onDismiss prop will now be called successfully.

Pull Request resolved: facebook#29882

Test Plan:
Tested on iOS with this change:

1. Set function Modal's onDismiss prop.
1. Set Modal's visible props is true. (show Modal)
1. Set Modal's visible props is false. (close Modal)
1. The set function in onDismiss is called.

Reviewed By: shergin

Differential Revision: D24648412

Pulled By: hramos

fbshipit-source-id: acf28fef21420117c845d3aed97e47b5dd4e9390

* Integrate Native Module codegen into Xcode build pipeline (facebook#30449)

Summary:
Move the codegen invocation out of Podfiles and into the FBReactNativeSpec Pod itself. With this change, developers do not need to modify their existing project's Podfiles, and yet the codegen will be integrated into their projects automatically by way of the FBReactNativeSpec Pod.

This is accomplished in part by injecting a script build phase into the Pods Xcode project that is generated by CocoaPods. The build phase will save the output of the codegen script to a log in the derived files directory. The codegen will be executed if the codegen log file is not present, or if the contents of the Libraries directory has changed.

The codegen will thus be invoked in these situations:

**RNTester:**
* When `packages/rn-tester/RNTesterPods.xcworkspace` is built, if the codegen output logfile is not present or if the input files have changed.

**OSS React Native apps:**
* When `ios/AwesomeProject.xcworkspace` is built, if the codegen output file is not present or if the input files have changed. Normally, this should not happen, as we do not expect folks to update the contents of `node_modules/react-native/Libraries`.

Pull Request resolved: facebook#30449

Changelog: [Internal] - Moved codegen invocation out of Podfile and into FBReactNativeSpec Pod

Reviewed By: fkgozali

Differential Revision: D25138896

fbshipit-source-id: 4779f822459cea2c30fd544eee19a49e8d80153d

* Fix Circle CI iOS Tests: Make FBReactNativeSpec dir as needed

Summary:
Quick fix for Circle CI: Ensure FBReactNativeSpec dir exists before touching files.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25285573

fbshipit-source-id: 8dec496856c90accc687648d7068aadfea24d72b

* Fix path to react-native-codegen

Summary:
The wrong value for the path to react-native-codegen was being used. The issue was introduced during the refactoring of this script for use in FBReactNativeSpec.podspec.

Changelog: [Internal]

Motivation:

Reviewed By: fkgozali

Differential Revision: D25290355

fbshipit-source-id: 5a46c680e7ea41157b03cf54a640a8816fb682b3

* Update template devDependencies (facebook#30489)

Summary:
Update template devDependencies before 0.64.0 release

[JavaScript] [Changed] - Update devDependencies (`babel/core` to `7.12.9`, `babel/runtime` to `7.12.5`, `react-native-community/eslint-config` to `2.0.0`, `babel-jest` to `26.6.3`, `eslint` to `7.14.0` and `jest` to `26.6.3`)

Pull Request resolved: facebook#30489

Test Plan:
- [ ] Check babel
- [ ] Check eslint
- [ ] Check jest

Reviewed By: lunaleaps

Differential Revision: D25377357

Pulled By: TheSavior

fbshipit-source-id: fd8e1992860a7fbae710898fbee249e9c36d2229

* Add instructions to template/ios/Podfile for enabling hermes (facebook#30461)

Summary:
Just thought I'd add these instructions so devs don't have to check the docs. Also, it makes iOS match Android with instructions in the configuration files
## Changelog
N/A (in my opinion)

Pull Request resolved: facebook#30461

Test Plan: N/A (because not a code change)

Reviewed By: hramos

Differential Revision: D25309687

Pulled By: TheSavior

fbshipit-source-id: a1907089b9d2e7fe6f2498ce27129c3ae65f7c9a

* Bump Hermes to 0.7.2

https://github.com/facebook/hermes/releases/tag/v0.7.2 is out so we can bump the pod version 🎉

Question:
Is `~> 0.7.2` too strict? Would `>= 0.7.2` be better?
Also, It doesn't look like we are restricting any version on the trunk?

* fix: default template on iOS (facebook#30571)

Summary:
Recently introduced steps to run Hermes accidentally removed `!` from the `use_react_native`, causing `pod install` to fail with an error.

## Changelog

[INTERNAL] [iOS] - Fix Podfle in default template

Pull Request resolved: facebook#30571

Test Plan: Run `pod install` with this file and it should work.

Reviewed By: appden

Differential Revision: D25537263

Pulled By: TheSavior

fbshipit-source-id: da7f21775cbe641e34aded87a92c696539f4d5c3

* fix: building in release mode for simulator (facebook#30543)

Summary:
Fixes facebook#29984

Right now, running a React Native application with Xcode 12 in Release mode on an iPhone Simulator will fail with something like below:

> [some file path], building for iOS Simulator, but linking in object file built for iOS, file '[some file path]' for architecture arm64

The best explanation of this issue has been provided by alloy in facebook#29984:

> This issue has started coming up with Xcode 12 and support for the new ARM based Macs, as `arm64` now no longer can be assumed to _only_ be for iOS devices. This means Xcode 12 will now also build for `arm64` simulator SDKs and it has become ambiguous if an arch slice in a prebuilt binary is meant for a simulator or device.
>
> In any case, for now this means that you can configure your Xcode project to exclude `arm64` when building for any iOS simulator SDK.

This PR implements aforementioned workaround.

## Changelog

[FIX] [IOS] - Fix running React Native project with Xcode 12 in Release on iPhone Simulator

Pull Request resolved: facebook#30543

Test Plan: Switch your scheme to Release and run the app on simulator. Will complete w/o issues.

Reviewed By: appden

Differential Revision: D25537295

Pulled By: TheSavior

fbshipit-source-id: 2dc05cb80e59f1d95d2a84ab55ed6a5b5446411c

* Exclude `i386` from valid architectures when building with Hermes on iOS (facebook#30592)

Summary:
When building React Native application in Release mode for an iPhone Simulator _and_ targeting `armv7`, Xcode will build all architectures (due to `ONLY_ACTIVE_ARCH` set to `false`, unlike in Debug mode). As a result, Xcode will try building for `i386` (32-bit iPhone Simulator), which fails as we don’t build Hermes binaries for `i386`.

Fix is to disable `i386`, since it is not supported by `Hermes` and certain `Folly` features.

## Changelog

[IOS] [BREAKING] - `i386` architecture will be automatically disabled when Hermes is being used. This might be potentially breaking for your workflow if you target `armv7` devices, as you will no longer be able to test on the simulator.
[IOS] [FEATURE] - Replace `flipper_post_install` with `react_native_post_install` hook. Will automatically detect if Flipper is enabled.

Pull Request resolved: facebook#30592

Test Plan: Run React Native application with Hermes enabled (or Flipper) in Release mode and it should work just fine.

Reviewed By: appden

Differential Revision: D25564738

Pulled By: TheSavior

fbshipit-source-id: e786ab73fb0a77de5869cf9e5999726c7d29f1d4

* Fix infinite loop in KeyboardAvoidingView

Summary:
Changelog: [General][Fixed] Fix stalling UI due to a bug in KeyboardAvoidingView

I introduced this bug in D22764192 (facebook@b08fff6).

The stalling was caused by onLayout in JavaScript triggering native layout which called onLayout in JavaScript without terminating condition.

The fix is to only cause native layout once from JavaScript's onLayout function. This makes sure both Fabric and Paper works correctly and UI stall isn't caused.

Resolves:
facebook#30495
facebook#30532

Reviewed By: TheSavior

Differential Revision: D25522362

fbshipit-source-id: 602e540bb1c40ae4f421b3e6ebc5a047cd920c17

* [0.64.0-rc.2] Bump version numbers

* Expose the testID to black-box testing frameworks on Android (facebook#29610)

Summary:
There has been a long-standing issue where black-box testing frameworks like Appium and Xamarin UITest have not been able to access the `testID` view prop for Android (see facebook#7135). A natural place for this to be exposed is via a view's `resource-id`. The `resource-id` is what I have used when working on UIAutomator-based tests for native Android apps and is a non-localized, development-only identifier. As mentioned in the linked ticket, you can dynamically set the resource-id using the view's AccessibilityNodeInfo. This change simply checks to see if a testID is provided for a view and then exposes it through the view's accessibility node delegate.

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

[Android] [Fixed] - Fixes facebook#7135,  facebook#9942, and facebook#16137. Display the `testID` as the `resource-id` for black-box testing frameworks

Pull Request resolved: facebook#29610

Test Plan:
I used the `uiautomatorviewer` tool to verify that the resource-id is populated with the `testID` of a few different views of the RNTester app.
<img width="912" alt="Screen Shot 2020-08-10 at 3 38 27 PM" src="https://user-images.githubusercontent.com/875498/89838534-55044100-db20-11ea-9be2-ba507a81f6fb.png">
<img width="1096" alt="Screen Shot 2020-08-10 at 3 40 41 PM" src="https://user-images.githubusercontent.com/875498/89838542-5897c800-db20-11ea-9895-462c6fea1130.png">

Reviewed By: JoshuaGross

Differential Revision: D25799550

Pulled By: fkgozali

fbshipit-source-id: e64ff1b90fb66b427fce7af533aa94792cfbcad3

* Remove dependency on Folly in TurboModuleUtils.h (facebook#30672)

Summary:
The TurboModuleUtils.h includes "folly/Optional.h" which is not used and creates an unnecessary dependency on Folly.
In this PR we remove this unnecessary include.

It is required for the microsoft/react-native-windows#6804 where we add an experimental support for the C++ TurboModules. While the C++ TurboModules use the same JSI and TurboModule code defined in react-native, we provide a layer that let them to work over the ABI-safe Microsoft.ReactNative.dll boundary. The RNW Nuget distribution with DLL files includes a few source files to create native/turbo modules that work through the ABI-safe API. The TurboModuleUtils.h is one of such files. By removing the dependency on Folly we reduce requirements for the native module code. After this PR is merged we will remove the fork of the TurboModuleUtils.h  added in microsoft/react-native-windows#6804.

## Changelog

[Internal] [Fixed] - Remove dependency on Folly in TurboModuleUtils.h

Pull Request resolved: facebook#30672

Test Plan:
The change does not bring any functional changes. It may only affect code compilation where some code may depend on TurboModuleUtils.h when it needs the "folly/Optional.h". The fix is add the `#include <folly/Optional.h>` there explicitly.

I had run the iOS tests and they passed:
```
yarn
pod install in packages\rn-tester
./scripts/objc-test.sh test
```

Reviewed By: mdvacca

Differential Revision: D25758927

Pulled By: fkgozali

fbshipit-source-id: 347d8f6bc333a3df67095ea0dc7221c818432fab

* Avoid eating clicks/taps into ScrollView when using physical keyboard (facebook#30374)

Summary:
This is an extension of facebook#29798 which was reverted due to cases where the soft keyboard could not be dismissed.

## 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] [Fixed] - Avoid eating clicks/taps into ScrollView when using physical keyboard

Pull Request resolved: facebook#30374

Test Plan: Validated with iOS simulator that taps on default ScrollView will dismiss soft keyboard and be eaten if open, but taps are not eaten when emulating a connected physical keyboard.

Reviewed By: kacieb

Differential Revision: D24935077

Pulled By: lyahdav

fbshipit-source-id: 19d9cf64547e40a35f9363896e3abbdccb95b546

* Update iOS Fabric-related files to compile on OSS (facebook#29810)

Summary:
Original PR contents:

This pull request updates the Podspecs and associated build scripts, and some source files so they build on OSS. RNTester now compiles with `fabric_enabled` again.

The following changes have been made:

 * Various spots that were pointing to the old `ReactCommon/fabric` location have now been updated to `ReactCommon/react/renderer`
 * Files that were attempting to use internal FB header `FBRCTFabricComponentsPlugins.h` were changed to use `RCTFabricComponentsPlugins.h`
 * `RCTFabricComponentsPlugins` in OSS was updated to include the `Image` fabric component (thanks tsapeta)
 * Replaced old `generate-rncore.sh` build script with new `generate-rncore.js` script which does not require `flow-node` and uses the `react-native-codegen` API directly, so there is no longer any need for an interim `schema-rncore.json` file.
 * Updated Yoga podspec which wasn't fully synced with changes from the main Yoga repo
 * Updated Fabric podspec with additional needed subspecs

Additions to PR by hramos:
* Replaced use of generate-rncore scripts with the original generate-native-modules-specs.sh script, which is now generate-specs.sh and supports both codegen for Native Modules and Components now (TurboModules/Fabric).
* Codegen now runs at build time as part of the Xcode build pipeline instead of as part of `pod install`. The build script is injected by the FBReactNativeSpec pod, as the pod is part of both Fabric and non-Fabric builds.

[General] [Fixed] - RNTester compiles with `fabric_enabled` again

Pull Request resolved: facebook#29810

Test Plan:
RNTester now compiles and runs in the simulator again when `fabric_enabled` is set to `true`.

```
cd xplat/js/react-native-github/packages/rn-tester
USE_FABRIC=1 pod install
open RNTesterPods.xcworkspace
```

Reviewed By: fkgozali

Differential Revision: D24058507

Pulled By: hramos

fbshipit-source-id: 8b2ea3694e6cb9aa23f83f087e2995fd4320e2bb

* Use Fabric builds in iOS tests (facebook#30639)

Summary:
Pull Request resolved: facebook#30639

# Changelog:
[Internal] Enable Fabric builds in iOS tests on Circle CI and Sandcastle.

Reviewed By: fkgozali

Differential Revision: D25700257

fbshipit-source-id: a250dbc9904efec9ded130912a993638f0992373

* Add use_react_native_codegen!

Summary:
Consolidate CocoaPods codegen scripts under a single `use_react_native_codegen!` method in `react_native_pods.rb`.

This is the first step towards making the codegen scripts library-agnostic. There are still a handful of hardcoded assumptions in place (e.g. the output directory structure, the use of a separate directory for components), but with some work one would be able to add codegen support to arbitrary CocoaPods podspecs.

The codegen script no longer takes a CODEGEN_PATH argument, and will instead attempt to use the local react-native-codegen package if available, and fallback to using the node_modules/react-native-codegen package if not.

## Usage

The `use_react_native_codegen!` method has two arguments:

- `spec`, a pod [Specification](https://www.rubydoc.info/github/CocoaPods/Core/Pod/Specification) object.
- `options`, an optional object. Supported keys:
  - `:srcs_dir`, the path to your JavaScript sources. Your native module or component specs should be located somewhere in this directory.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25728053

fbshipit-source-id: feec587b656d5b220598ce6196ea6bb34a9580a9

* Optionally override codegen script defaults via envvars

Summary:
The codegen helper script, `generate-specs.sh`, is being used to generate code for the FBReactNativeSpec and React-Fabric/rncore pods. The script now supports overriding several defaults by setting the following environment variables:

- SRCS_DIR: Path to JavaScript sources, defaults to $RN_DIR/Libraries/
- LIBRARY_NAME: Defaults to FBReactNativeSpec
- MODULES_OUTPUT_DIR: Defaults to Libraries/$LIBRARY_NAME/$LIBRARY_NAME
- COMPONENTS_LIBRARY_NAME: Defaults to rncore
- COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$COMPONENTS_LIBRARY_NAME

The CocoaPods codegen integration has been updated to take advantage of these.

**Example CocoaPods usage:**

```
# packages/rn-tester/NativeModuleExample/RNTesterSpecs.podspec
Pod::Spec.new do |s|
  s.name = "RNTesterSpec"
  # ...
  use_react_native_codegen!(s, { :srcs_dir => __dir__, :modules_output_dir => __dir__ })
end
```

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25738466

fbshipit-source-id: c68f5a3cd0996283a7af287e992e2f973024f44c

* Make codegen more reliable on iOS (facebook#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.

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

Pull Request resolved: facebook#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

* Invoke `node` directly in generate-specs.sh (facebook#30781)

Summary:
Currently, Codegen bash wrapper (`generate-specs.sh`) for Xcode invokes JS-based Codegen tooling via `yarn --silent node <...>`. This breaks both:

- when Yarn is not installed (if NPM is used), for obvious reasons
- when Yarn v2 ("Berry") is active

This PR changes the way `generate-specs.sh` locates `node` executable to the following algorithm:

- use the path provided in the `NODE_BINARY` env var
- if `NODE_BINARY` env var is not defined, find `node` with `command -v node`

## Changelog

[iOS] [Fixed] - Fix Codegen silently failing when Yarn is not installed, or when Yarn v2 is active.

Pull Request resolved: facebook#30781

Test Plan:
### Case 1 (no Yarn installed)

1. Ensure `yarn` is not present in PATH
2. Run Xcode build
3. Check that Codegen artifacts are produced

### Case 2 (Yarn v2 is used)

1. Ensure `yarn` is running in the v2 ("Berry") mode
2. Run Xcode build
3. Check that Codegen artifacts are produced

Reviewed By: fkgozali

Differential Revision: D26187081

Pulled By: hramos

fbshipit-source-id: 77d3089f523b8c976d8223b77ff9553cb6cf68a5

* chore: bump codegen script

* [0.64.0-rc.3] Bump version numbers

* Update flipper in RNTester and template (facebook#31010)

Summary:
allow-large-files

RN Tester is using an old version of Flipper. This will help testing regressions in the latest version (which is installed when starting a new project). This also fixes an issue where libevent is incompatible between the one in flipper and when using hermes on iOS. To fix it I changed to use the version published on cocoapods instead of using a local podspec (see facebook/flipper#1916).

[General] [Changed] - Update flipper

Pull Request resolved: facebook#31010

Test Plan:
- Tested that RN tester builds and flipper works with hermes enabled / disabled and fabric on iOS
- Tested that RN tester builds and flipper works on Android

Reviewed By: fkgozali

Differential Revision: D26592317

Pulled By: PeteTheHeat

fbshipit-source-id: 2cd278c7a51b1859dab0465846b061221f07d3f6

* Generalize node search logic

* fix: React Native CodeGen integration for 0.64-stable (facebook#31027)

* fix: disable fabric

* chore: fix conflict in Podfile.lock

* [0.64.0-rc.4] Bump version numbers

* Fix RefreshControl layout when removed from window (facebook#31024)

Summary:
Since iOS 14 refresh control is sometimes visible when it shouldn't. It seems to happen when it is removed and added back to the window. This repros easily when using react-native-screens with react-navigation tabs. Inactive tabs are detached from the window to save resources.

Calling endRefreshing when refresh control is added to the window fixes the layout. It will also be called on first mount where it is not necessary, but should be a no-op and didn't cause any issues. I also decided to call it for all ios versions, although it is only needed on iOS 14+ to avoid forking behavior more.

## Changelog

[iOS] [Fixed] - Fix RefreshControl layout when removed from window

Pull Request resolved: facebook#31024

Test Plan:
Before:

https://user-images.githubusercontent.com/2677334/108666197-93ea5a80-74a4-11eb-839b-8a4916967bf8.mov

After:

https://user-images.githubusercontent.com/2677334/108666223-9ea4ef80-74a4-11eb-8489-4e5d257299c8.mov

Reviewed By: shergin

Differential Revision: D26590759

Pulled By: PeteTheHeat

fbshipit-source-id: b8c06068a24446b261cbeb88ff166289724031f1

* fix: restore refresh control fix

* chore: Update React.podspec to require cocoapods >= 1.10.1

* Fixing the git attrs for all the people and all the files and all future 🙌

* [0.64.0] Bump version numbers

* Upgrade react-hooks rules

Summary:
Upgrades the `react-hooks` eslint-rules to `4.2.0`

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D26366235

fbshipit-source-id: 04628e8f2a6c56eacba516d877df143c6c81adb8

* Some more changes for bringing up RN64 in devmain Android (#861)

* Build & Packaging changes for bringing up RN64 in devmain

* Fixing gradle clean

* Disable gradle clean in PR builds

* Add explicit dependency on fbjs to RNTester

This is needed after upgrading to v5.0.1-alpha.0 of the CLI tools.

* Fix for submit button disappearing bug in comments (#862)

* Add the missing android folder to files in package.json

* Fix for submit button disappear bug in comments

Co-authored-by: Mayuresh Gharpure <Mayuresh.Gharpure@microsoft.com>

* Update Android patches

Co-authored-by: Mike Grabowski <grabbou@gmail.com>
Co-authored-by: Micha Reiser <mreiser@fb.com>
Co-authored-by: Janic Duplessis <janicduplessis@gmail.com>
Co-authored-by: Kevin Gozali <fkg@fb.com>
Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
Co-authored-by: Dulmandakh <dulmandakh@gmail.com>
Co-authored-by: Héctor Ramos <hramos@fb.com>
Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Koichi Nagaoka <emmeleia@me.com>
Co-authored-by: Dmitriy Shishkin <6ast3r@gmail.com>
Co-authored-by: Steven Conaway <steven.conaway@icloud.com>
Co-authored-by: Xuan Huang (黄玄) <jsx@fb.com>
Co-authored-by: Samuel Susla <samuelsusla@fb.com>
Co-authored-by: Jayme Deffenbaugh <jdeffenbaugh@me.com>
Co-authored-by: Vladimir Morozov <vmorozov@microsoft.com>
Co-authored-by: empyrical <empyrical@outlook.com>
Co-authored-by: Ivan Moskalev <ivan.moskalev@gmail.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Mayuresh Gharpure <gharpuremayuresh@gmail.com>
Co-authored-by: Mayuresh Gharpure <Mayuresh.Gharpure@microsoft.com>
  • Loading branch information
1 parent 9e89136 commit f517622
Show file tree
Hide file tree
Showing 113 changed files with 3,371 additions and 2,952 deletions.
22 changes: 18 additions & 4 deletions .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,24 @@ jobs:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)

- task: CmdLine@2
displayName: gradlew clean
inputs:
script: ./gradlew clean
# In RN64 "clean" task tries to run the build again. It is reproing in 0.64-stable branch but fixed in 0.65-stable.
# I can't zero on the exact cause .. but turns out the issue is with rntester clean task.
#
# mganandraj@RNDroid:~/github/rnm-64$ ./gradlew :packages:rn-tester:android:app:clean --dry-run
# :packages:react-native-codegen:android:buildCodegenCLI SKIPPED
# :packages:rn-tester:android:app:generateCodegenSchemaFromJavaScript SKIPPED
# :packages:rn-tester:android:app:generateCodegenArtifactsFromSchema SKIPPED
# :ReactAndroid:extractAARHeaders SKIPPED
# :ReactAndroid:extractJNIFiles SKIPPED
# :ReactAndroid:generateCodegenSchemaFromJavaScript SKIPPED
# :ReactAndroid:generateCodegenArtifactsFromSchema SKIPPED
# :ReactAndroid:prepareBoost SKIPPED
# :ReactAndroid:createNativeDepsDirectories SKIPPED
# ..
# - task: CmdLine@2
# displayName: gradlew clean
# inputs:
# script: ./gradlew clean

- task: PublishBuildArtifacts@1
displayName: 'Publish final artifacts'
Expand Down
21 changes: 19 additions & 2 deletions .ado/templates/android-build-office.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,29 @@ steps:
inputs:
script: yarn install --frozen-lockfile

# scripts/bump-oss-version.js
#
# update the following files to the commit id.
# package.json (-> npm package version)
# gradle.properties (-> aar version)
# gradle.properties (-> aar version)
#
# The following files are updated for runtime version checking.
# ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java
# React/Base/RCTVersion.m
# ReactCommon/cxxreact/ReactNativeVersion.h
# Libraries/Core/ReactNativeVersion.js
#
# --nightly => version = `0.0.0-${currentCommit.slice(0, 9)}`;
# When on master branch or non-stable branch.
- task: CmdLine@2
displayName: Bump canary package version
inputs:
script: node scripts/bump-oss-version.js --nightly
condition: eq(variables['Build.SourceBranchName'], 'master')

condition: or(eq(variables['Build.SourceBranchName'], 'master'), not(contains(variables['Build.SourceBranchName'], '-stable')))

# TODO: We don't seem to be running bump-oss-version.js for stable branches, hence we would end up publishing using the values in the repository.

- task: CmdLine@2
displayName: nuget restore
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .ado/templates/apple-droid-node-patching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ steps:
- task: CmdLine@2
displayName: Apply Android specific patches for Office consumption
inputs:
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus MAC ImageColor --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
18 changes: 10 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ jobs:
steps:
- run:
name: Generate RNTesterPods Workspace
command: cd packages/rn-tester && bundle exec pod install --verbose
command: cd packages/rn-tester && USE_FABRIC=1 bundle exec pod install --verbose

# -------------------------
# Runs iOS unit tests
Expand Down Expand Up @@ -790,13 +790,15 @@ workflows:
run_unit_tests: true
requires:
- setup_ios
- test_ios:
name: test_ios_unit_frameworks_hermes
use_hermes: true
use_frameworks: true
run_unit_tests: true
requires:
- setup_ios
# Hermes doesn't support dynamic frameworks right now.
# The following configuration will fail.
# - test_ios:
# name: test_ios_unit_frameworks_hermes
# use_hermes: true
# use_frameworks: true
# run_unit_tests: true
# requires:
# - setup_ios
# - test_ios:
# name: test_ios_detox
# run_detox_tests: true
Expand Down
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ indent_size = 4

[BUCK]
indent_size = 4

# Windows files
[*.bat]
end_of_line = crlf
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Windows files should use crlf line endings
# https://help.github.com/articles/dealing-with-line-endings/
*.bat text eol=crlf
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ package-lock.json

# Libs that shouldn't have Xcode project
/Libraries/FBLazyVector/**/*.xcodeproj
/Libraries/FBReactNativeSpec/**/*.xcodeproj
/Libraries/RCTRequired/**/*.xcodeproj
/React/CoreModules/**/*.xcodeproj
/React/FBReactNativeSpec/**/*.xcodeproj
/packages/react-native-codegen/**/*.xcodeproj

# CocoaPods
Expand All @@ -109,10 +109,8 @@ package-lock.json
!/packages/rn-tester/Pods/__offline_mirrors__

# react-native-codegen
/Libraries/FBReactNativeSpec/FBReactNativeSpec
/packages/react-native-codegen/lib
/ReactCommon/fabric/components/rncore/
/schema-rncore.json
/ReactCommon/react/renderer/components/rncore/

# Visual studio
.vscode
Expand Down
2 changes: 2 additions & 0 deletions Libraries/ActionSheetIOS/ActionSheetIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ActionSheetIOS = {
* - `destructiveButtonIndex` (int or array of ints) - index or indices of destructive buttons in `options`
* - `title` (string) - a title to show above the action sheet
* - `message` (string) - a message to show below the title
* - `disabledButtonIndices` (array of numbers) - a list of button indices which should be disabled
*
* The 'callback' function takes one parameter, the zero-based index
* of the selected item.
Expand All @@ -49,6 +50,7 @@ const ActionSheetIOS = {
+anchor?: ?number,
+tintColor?: ColorValue | ProcessedColorValue,
+userInterfaceStyle?: string,
+disabledButtonIndices?: Array<number>,
|},
callback: (buttonIndex: number) => void,
) {
Expand Down
1 change: 1 addition & 0 deletions Libraries/ActionSheetIOS/NativeActionSheetManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface Spec extends TurboModule {
+anchor?: ?number,
+tintColor?: ?number,
+userInterfaceStyle?: ?string,
+disabledButtonIndices?: Array<number>,
|},
callback: (buttonIndex: number) => void,
) => void;
Expand Down
5 changes: 4 additions & 1 deletion Libraries/Components/Keyboard/KeyboardAvoidingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,16 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
};

_onLayout = (event: ViewLayoutEvent) => {
const wasFrameNull = this._frame == null;
this._frame = event.nativeEvent.layout;
if (!this._initialFrameHeight) {
// save the initial frame height, before the keyboard is visible
this._initialFrameHeight = this._frame.height;
}

this._updateBottomIfNecesarry();
if (wasFrameNull) {
this._updateBottomIfNecesarry();
}
};

_updateBottomIfNecesarry = () => {
Expand Down
32 changes: 28 additions & 4 deletions Libraries/Components/ScrollResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const ScrollResponderMixin = {

if (
this.props.keyboardShouldPersistTaps === 'handled' &&
currentlyFocusedInput != null &&
this.scrollResponderKeyboardIsDismissible() &&
e.target !== currentlyFocusedInput
) {
return true;
Expand Down Expand Up @@ -223,7 +223,6 @@ const ScrollResponderMixin = {
// and a new touch starts with a non-textinput target (in which case the
// first tap should be sent to the scroll view and dismiss the keyboard,
// then the second tap goes to the actual interior view)
const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput();
const {keyboardShouldPersistTaps} = this.props;
const keyboardNeverPersistTaps =
!keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never';
Expand All @@ -240,7 +239,7 @@ const ScrollResponderMixin = {

if (
keyboardNeverPersistTaps &&
currentlyFocusedTextInput != null &&
this.scrollResponderKeyboardIsDismissible() &&
e.target != null &&
!TextInputState.isTextInput(e.target)
) {
Expand All @@ -250,6 +249,31 @@ const ScrollResponderMixin = {
return false;
},

/**
* Do we consider there to be a dismissible soft-keyboard open?
*/
scrollResponderKeyboardIsDismissible: function(): boolean {
const currentlyFocusedInput = TextInputState.currentlyFocusedInput();

// We cannot dismiss the keyboard without an input to blur, even if a soft
// keyboard is open (e.g. when keyboard is open due to a native component
// not participating in TextInputState). It's also possible that the
// currently focused input isn't a TextInput (such as by calling ref.focus
// on a non-TextInput).
const hasFocusedTextInput =
currentlyFocusedInput != null &&
TextInputState.isTextInput(currentlyFocusedInput);

// Even if an input is focused, we may not have a keyboard to dismiss. E.g
// when using a physical keyboard. Ensure we have an event for an opened
// keyboard, except on Android where setting windowSoftInputMode to
// adjustNone leads to missing keyboard events.
const softKeyboardMayBeOpen =
this.keyboardWillOpenTo != null || Platform.OS === 'android';

return hasFocusedTextInput && softKeyboardMayBeOpen;
},

/**
* Invoke this from an `onResponderReject` event.
*
Expand Down Expand Up @@ -324,7 +348,7 @@ const ScrollResponderMixin = {
if (
this.props.keyboardShouldPersistTaps !== true &&
this.props.keyboardShouldPersistTaps !== 'always' &&
currentlyFocusedTextInput != null &&
this.scrollResponderKeyboardIsDismissible() &&
e.target !== currentlyFocusedTextInput &&
!this.state.observedScrollSinceBecomingResponder &&
!this.state.becameResponderWhileAnimating
Expand Down
2 changes: 2 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ function InternalTextInput(props: Props): React.Node {
// Therefore, we ignore selections and pass them through until the selection event has
// been sent.
// Note that this mitigation is NOT needed for Fabric.
// discovered when upgrading react-hooks
// eslint-disable-next-line react-hooks/exhaustive-deps
let selection: ?Selection =
props.selection == null
? null
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Core/ReactNativeVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

exports.version = {
major: 0,
minor: 63,
patch: 3,
minor: 64,
patch: 0,
prerelease: null,
};
2 changes: 1 addition & 1 deletion Libraries/Modal/RCTModalHostViewNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type NativeProps = $ReadOnly<{|
* The `onDismiss` prop allows passing a function that will be called once
* the modal has been dismissed.
*
* See https://facebook.github.io/react-native/docs/modal.html#ondismiss
* See https://reactnative.dev/docs/modal.html#ondismiss
*/
onDismiss?: ?BubblingEventHandler<null>,

Expand Down
1 change: 1 addition & 0 deletions React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Pod::Spec.new do |s|
ss.exclude_files = "React/CoreModules/**/*",
"React/DevSupport/**/*",
"React/Fabric/**/*",
"React/FBReactNativeSpec/**/*",
"React/Inspector/**/*",
"React/Tests/**/*",
"React/CxxBridge/HermesExecutorFactory.*" # TODO(macOS GH#214)
Expand Down
2 changes: 1 addition & 1 deletion React.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "10.0", :osx => "10.14" } # TODO(macOS GH#214)
s.source = source
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
s.cocoapods_version = ">= 1.2.0"
s.cocoapods_version = ">= 1.10.1"

s.dependency "React-Core", version
s.dependency "React-Core/DevSupport", version
Expand Down
4 changes: 2 additions & 2 deletions React/Base/RCTVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
dispatch_once(&onceToken, ^(void){
__rnVersion = @{
RCTVersionMajor: @(0),
RCTVersionMinor: @(63),
RCTVersionPatch: @(3),
RCTVersionMinor: @(64),
RCTVersionPatch: @(0),
RCTVersionPrerelease: [NSNull null],
};
});
Expand Down
18 changes: 18 additions & 0 deletions React/CoreModules/RCTActionSheetManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,15 @@ - (void)presentViewController:(UIViewController *)alertController
NSArray<NSString *> *buttons = RCTConvertOptionalVecToArray(options.options(), ^id(NSString *element) {
return element;
});
NSArray<NSNumber *> *disabledButtonIndices;
NSInteger cancelButtonIndex =
options.cancelButtonIndex() ? [RCTConvert NSInteger:@(*options.cancelButtonIndex())] : -1;
NSArray<NSNumber *> *destructiveButtonIndices;
if (options.disabledButtonIndices()) {
disabledButtonIndices = RCTConvertVecToArray(*options.disabledButtonIndices(), ^id(double element) {
return @(element);
});
}
if (options.destructiveButtonIndices()) {
destructiveButtonIndices = RCTConvertVecToArray(*options.destructiveButtonIndices(), ^id(double element) {
return @(element);
Expand All @@ -120,6 +126,7 @@ - (void)presentViewController:(UIViewController *)alertController
@"destructiveButtonIndices" : destructiveButtonIndices,
@"anchor" : anchor,
@"tintColor" : tintColor,
@"disabledButtonIndices" : disabledButtonIndices,
});
return;
}
Expand Down Expand Up @@ -155,6 +162,17 @@ - (void)presentViewController:(UIViewController *)alertController
index++;
}

if (disabledButtonIndices) {
for (NSNumber *disabledButtonIndex in disabledButtonIndices) {
if ([disabledButtonIndex integerValue] < buttons.count) {
[alertController.actions[[disabledButtonIndex integerValue]] setEnabled:false];
} else {
RCTLogError(@"Index %@ from `disabledButtonIndices` is out of bounds. Maximum index value is %@.", @([disabledButtonIndex integerValue]), @(buttons.count - 1));
return;
}
}
}

alertController.view.tintColor = tintColor;
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,13 @@ package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
version = package['version']

source = { :git => 'https://github.com/facebook/react-native.git' }
codegen_path_prefix = ".."
if version == '1000.0.0'
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
source[:commit] = `git rev-parse HEAD`.strip
codegen_path_prefix = "packages"
else
source[:tag] = "v#{version}"
end

react_native_path = File.join(__dir__, "..", "..")
srcs_dir = File.join(__dir__, "..")
codegen_script_path = File.join(react_native_path, "scripts", "generate-native-modules-specs.sh")
codegen_path = File.join(react_native_path, codegen_path_prefix, "react-native-codegen")
output_dir = File.join(__dir__, "FBReactNativeSpec")
generated_files = [File.join(output_dir, "FBReactNativeSpec.h"), File.join(output_dir, "FBReactNativeSpec-generated.mm")]
codegen_command = "CODEGEN_PATH=#{codegen_path} sh '#{codegen_script_path}' | tee \"${SCRIPT_OUTPUT_FILE_0}\""

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
folly_version = '2020.01.13.00'

Expand All @@ -46,7 +36,7 @@ Pod::Spec.new do |s|
s.pod_target_xcconfig = {
"USE_HEADERMAP" => "YES",
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/Libraries/FBReactNativeSpec\" \"$(PODS_ROOT)/RCT-Folly\""
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/React/FBReactNativeSpec\" \"$(PODS_ROOT)/RCT-Folly\""
}

s.dependency "RCT-Folly", folly_version
Expand All @@ -56,12 +46,5 @@ Pod::Spec.new do |s|
s.dependency "React-jsi", version
s.dependency "ReactCommon/turbomodule/core", version

s.prepare_command = "mkdir -p #{output_dir} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
s.script_phase = {
:name => 'Generate Native Modules Code',
:input_files => [srcs_dir],
:output_files => ["$(DERIVED_FILE_DIR)/FBReactNativeSpec-codegen.log"],
:script => codegen_command,
:execution_position => :before_compile
}
use_react_native_codegen! (s)
end
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#import <react/renderer/components/rncore/EventEmitters.h>
#import <react/renderer/components/rncore/Props.h>

#import "FBRCTFabricComponentsPlugins.h"
#import "RCTFabricComponentsPlugins.h"

using namespace facebook::react;

Expand Down
Loading

0 comments on commit f517622

Please sign in to comment.