Skip to content

Commit f517622

Browse files
amgleitmangrabbouMicha Reiserjanicduplessisfkgozali
authored
Merge from upstream 0.64-stable to v0.64.0 (#863)
* 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 [email protected] 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 [email protected]. 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 <[email protected]> * Update Android patches Co-authored-by: Mike Grabowski <[email protected]> Co-authored-by: Micha Reiser <[email protected]> Co-authored-by: Janic Duplessis <[email protected]> Co-authored-by: Kevin Gozali <[email protected]> Co-authored-by: Nick Gerleman <[email protected]> Co-authored-by: Dulmandakh <[email protected]> Co-authored-by: Héctor Ramos <[email protected]> Co-authored-by: Jesse Katsumata <[email protected]> Co-authored-by: Luke Walczak <[email protected]> Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Koichi Nagaoka <[email protected]> Co-authored-by: Dmitriy Shishkin <[email protected]> Co-authored-by: Steven Conaway <[email protected]> Co-authored-by: Xuan Huang (黄玄) <[email protected]> Co-authored-by: Samuel Susla <[email protected]> Co-authored-by: Jayme Deffenbaugh <[email protected]> Co-authored-by: Vladimir Morozov <[email protected]> Co-authored-by: empyrical <[email protected]> Co-authored-by: Ivan Moskalev <[email protected]> Co-authored-by: Anandraj <[email protected]> Co-authored-by: Mayuresh Gharpure <[email protected]> Co-authored-by: Mayuresh Gharpure <[email protected]>
1 parent 9e89136 commit f517622

File tree

113 files changed

+3371
-2952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3371
-2952
lines changed

.ado/android-pr.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,24 @@ jobs:
7474
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
7575
githubApiToken: $(githubApiToken)
7676

77-
- task: CmdLine@2
78-
displayName: gradlew clean
79-
inputs:
80-
script: ./gradlew clean
77+
# In RN64 "clean" task tries to run the build again. It is reproing in 0.64-stable branch but fixed in 0.65-stable.
78+
# I can't zero on the exact cause .. but turns out the issue is with rntester clean task.
79+
#
80+
# mganandraj@RNDroid:~/github/rnm-64$ ./gradlew :packages:rn-tester:android:app:clean --dry-run
81+
# :packages:react-native-codegen:android:buildCodegenCLI SKIPPED
82+
# :packages:rn-tester:android:app:generateCodegenSchemaFromJavaScript SKIPPED
83+
# :packages:rn-tester:android:app:generateCodegenArtifactsFromSchema SKIPPED
84+
# :ReactAndroid:extractAARHeaders SKIPPED
85+
# :ReactAndroid:extractJNIFiles SKIPPED
86+
# :ReactAndroid:generateCodegenSchemaFromJavaScript SKIPPED
87+
# :ReactAndroid:generateCodegenArtifactsFromSchema SKIPPED
88+
# :ReactAndroid:prepareBoost SKIPPED
89+
# :ReactAndroid:createNativeDepsDirectories SKIPPED
90+
# ..
91+
# - task: CmdLine@2
92+
# displayName: gradlew clean
93+
# inputs:
94+
# script: ./gradlew clean
8195

8296
- task: PublishBuildArtifacts@1
8397
displayName: 'Publish final artifacts'

.ado/templates/android-build-office.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,29 @@ steps:
3030
inputs:
3131
script: yarn install --frozen-lockfile
3232

33+
# scripts/bump-oss-version.js
34+
#
35+
# update the following files to the commit id.
36+
# package.json (-> npm package version)
37+
# gradle.properties (-> aar version)
38+
# gradle.properties (-> aar version)
39+
#
40+
# The following files are updated for runtime version checking.
41+
# ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java
42+
# React/Base/RCTVersion.m
43+
# ReactCommon/cxxreact/ReactNativeVersion.h
44+
# Libraries/Core/ReactNativeVersion.js
45+
#
46+
# --nightly => version = `0.0.0-${currentCommit.slice(0, 9)}`;
47+
# When on master branch or non-stable branch.
3348
- task: CmdLine@2
3449
displayName: Bump canary package version
3550
inputs:
3651
script: node scripts/bump-oss-version.js --nightly
37-
condition: eq(variables['Build.SourceBranchName'], 'master')
38-
52+
condition: or(eq(variables['Build.SourceBranchName'], 'master'), not(contains(variables['Build.SourceBranchName'], '-stable')))
53+
54+
# 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.
55+
3956
- task: CmdLine@2
4057
displayName: nuget restore
4158
inputs:

.ado/templates/apple-droid-node-patching.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ steps:
55
- task: CmdLine@2
66
displayName: Apply Android specific patches for Office consumption
77
inputs:
8-
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 }}
8+
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 }}

.circleci/config.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ jobs:
423423
steps:
424424
- run:
425425
name: Generate RNTesterPods Workspace
426-
command: cd packages/rn-tester && bundle exec pod install --verbose
426+
command: cd packages/rn-tester && USE_FABRIC=1 bundle exec pod install --verbose
427427

428428
# -------------------------
429429
# Runs iOS unit tests
@@ -790,13 +790,15 @@ workflows:
790790
run_unit_tests: true
791791
requires:
792792
- setup_ios
793-
- test_ios:
794-
name: test_ios_unit_frameworks_hermes
795-
use_hermes: true
796-
use_frameworks: true
797-
run_unit_tests: true
798-
requires:
799-
- setup_ios
793+
# Hermes doesn't support dynamic frameworks right now.
794+
# The following configuration will fail.
795+
# - test_ios:
796+
# name: test_ios_unit_frameworks_hermes
797+
# use_hermes: true
798+
# use_frameworks: true
799+
# run_unit_tests: true
800+
# requires:
801+
# - setup_ios
800802
# - test_ios:
801803
# name: test_ios_detox
802804
# run_detox_tests: true

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ indent_size = 4
1515

1616
[BUCK]
1717
indent_size = 4
18+
19+
# Windows files
20+
[*.bat]
21+
end_of_line = crlf

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ package-lock.json
9494

9595
# Libs that shouldn't have Xcode project
9696
/Libraries/FBLazyVector/**/*.xcodeproj
97-
/Libraries/FBReactNativeSpec/**/*.xcodeproj
9897
/Libraries/RCTRequired/**/*.xcodeproj
9998
/React/CoreModules/**/*.xcodeproj
99+
/React/FBReactNativeSpec/**/*.xcodeproj
100100
/packages/react-native-codegen/**/*.xcodeproj
101101

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

111111
# react-native-codegen
112-
/Libraries/FBReactNativeSpec/FBReactNativeSpec
113112
/packages/react-native-codegen/lib
114-
/ReactCommon/fabric/components/rncore/
115-
/schema-rncore.json
113+
/ReactCommon/react/renderer/components/rncore/
116114

117115
# Visual studio
118116
.vscode

Libraries/ActionSheetIOS/ActionSheetIOS.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const ActionSheetIOS = {
3333
* - `destructiveButtonIndex` (int or array of ints) - index or indices of destructive buttons in `options`
3434
* - `title` (string) - a title to show above the action sheet
3535
* - `message` (string) - a message to show below the title
36+
* - `disabledButtonIndices` (array of numbers) - a list of button indices which should be disabled
3637
*
3738
* The 'callback' function takes one parameter, the zero-based index
3839
* of the selected item.
@@ -49,6 +50,7 @@ const ActionSheetIOS = {
4950
+anchor?: ?number,
5051
+tintColor?: ColorValue | ProcessedColorValue,
5152
+userInterfaceStyle?: string,
53+
+disabledButtonIndices?: Array<number>,
5254
|},
5355
callback: (buttonIndex: number) => void,
5456
) {

Libraries/ActionSheetIOS/NativeActionSheetManager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface Spec extends TurboModule {
2525
+anchor?: ?number,
2626
+tintColor?: ?number,
2727
+userInterfaceStyle?: ?string,
28+
+disabledButtonIndices?: Array<number>,
2829
|},
2930
callback: (buttonIndex: number) => void,
3031
) => void;

Libraries/Components/Keyboard/KeyboardAvoidingView.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,16 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
9797
};
9898

9999
_onLayout = (event: ViewLayoutEvent) => {
100+
const wasFrameNull = this._frame == null;
100101
this._frame = event.nativeEvent.layout;
101102
if (!this._initialFrameHeight) {
102103
// save the initial frame height, before the keyboard is visible
103104
this._initialFrameHeight = this._frame.height;
104105
}
105106

106-
this._updateBottomIfNecesarry();
107+
if (wasFrameNull) {
108+
this._updateBottomIfNecesarry();
109+
}
107110
};
108111

109112
_updateBottomIfNecesarry = () => {

Libraries/Components/ScrollResponder.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const ScrollResponderMixin = {
186186

187187
if (
188188
this.props.keyboardShouldPersistTaps === 'handled' &&
189-
currentlyFocusedInput != null &&
189+
this.scrollResponderKeyboardIsDismissible() &&
190190
e.target !== currentlyFocusedInput
191191
) {
192192
return true;
@@ -223,7 +223,6 @@ const ScrollResponderMixin = {
223223
// and a new touch starts with a non-textinput target (in which case the
224224
// first tap should be sent to the scroll view and dismiss the keyboard,
225225
// then the second tap goes to the actual interior view)
226-
const currentlyFocusedTextInput = TextInputState.currentlyFocusedInput();
227226
const {keyboardShouldPersistTaps} = this.props;
228227
const keyboardNeverPersistTaps =
229228
!keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never';
@@ -240,7 +239,7 @@ const ScrollResponderMixin = {
240239

241240
if (
242241
keyboardNeverPersistTaps &&
243-
currentlyFocusedTextInput != null &&
242+
this.scrollResponderKeyboardIsDismissible() &&
244243
e.target != null &&
245244
!TextInputState.isTextInput(e.target)
246245
) {
@@ -250,6 +249,31 @@ const ScrollResponderMixin = {
250249
return false;
251250
},
252251

252+
/**
253+
* Do we consider there to be a dismissible soft-keyboard open?
254+
*/
255+
scrollResponderKeyboardIsDismissible: function(): boolean {
256+
const currentlyFocusedInput = TextInputState.currentlyFocusedInput();
257+
258+
// We cannot dismiss the keyboard without an input to blur, even if a soft
259+
// keyboard is open (e.g. when keyboard is open due to a native component
260+
// not participating in TextInputState). It's also possible that the
261+
// currently focused input isn't a TextInput (such as by calling ref.focus
262+
// on a non-TextInput).
263+
const hasFocusedTextInput =
264+
currentlyFocusedInput != null &&
265+
TextInputState.isTextInput(currentlyFocusedInput);
266+
267+
// Even if an input is focused, we may not have a keyboard to dismiss. E.g
268+
// when using a physical keyboard. Ensure we have an event for an opened
269+
// keyboard, except on Android where setting windowSoftInputMode to
270+
// adjustNone leads to missing keyboard events.
271+
const softKeyboardMayBeOpen =
272+
this.keyboardWillOpenTo != null || Platform.OS === 'android';
273+
274+
return hasFocusedTextInput && softKeyboardMayBeOpen;
275+
},
276+
253277
/**
254278
* Invoke this from an `onResponderReject` event.
255279
*
@@ -324,7 +348,7 @@ const ScrollResponderMixin = {
324348
if (
325349
this.props.keyboardShouldPersistTaps !== true &&
326350
this.props.keyboardShouldPersistTaps !== 'always' &&
327-
currentlyFocusedTextInput != null &&
351+
this.scrollResponderKeyboardIsDismissible() &&
328352
e.target !== currentlyFocusedTextInput &&
329353
!this.state.observedScrollSinceBecomingResponder &&
330354
!this.state.becameResponderWhileAnimating

Libraries/Components/TextInput/TextInput.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,8 @@ function InternalTextInput(props: Props): React.Node {
874874
// Therefore, we ignore selections and pass them through until the selection event has
875875
// been sent.
876876
// Note that this mitigation is NOT needed for Fabric.
877+
// discovered when upgrading react-hooks
878+
// eslint-disable-next-line react-hooks/exhaustive-deps
877879
let selection: ?Selection =
878880
props.selection == null
879881
? null

Libraries/Core/ReactNativeVersion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
exports.version = {
1313
major: 0,
14-
minor: 63,
15-
patch: 3,
14+
minor: 64,
15+
patch: 0,
1616
prerelease: null,
1717
};

Libraries/Modal/RCTModalHostViewNativeComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ type NativeProps = $ReadOnly<{|
9191
* The `onDismiss` prop allows passing a function that will be called once
9292
* the modal has been dismissed.
9393
*
94-
* See https://facebook.github.io/react-native/docs/modal.html#ondismiss
94+
* See https://reactnative.dev/docs/modal.html#ondismiss
9595
*/
9696
onDismiss?: ?BubblingEventHandler<null>,
9797

React-Core.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Pod::Spec.new do |s|
5757
ss.exclude_files = "React/CoreModules/**/*",
5858
"React/DevSupport/**/*",
5959
"React/Fabric/**/*",
60+
"React/FBReactNativeSpec/**/*",
6061
"React/Inspector/**/*",
6162
"React/Tests/**/*",
6263
"React/CxxBridge/HermesExecutorFactory.*" # TODO(macOS GH#214)

React.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Pod::Spec.new do |s|
3939
s.platforms = { :ios => "10.0", :osx => "10.14" } # TODO(macOS GH#214)
4040
s.source = source
4141
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
42-
s.cocoapods_version = ">= 1.2.0"
42+
s.cocoapods_version = ">= 1.10.1"
4343

4444
s.dependency "React-Core", version
4545
s.dependency "React-Core/DevSupport", version

React/Base/RCTVersion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
dispatch_once(&onceToken, ^(void){
2323
__rnVersion = @{
2424
RCTVersionMajor: @(0),
25-
RCTVersionMinor: @(63),
26-
RCTVersionPatch: @(3),
25+
RCTVersionMinor: @(64),
26+
RCTVersionPatch: @(0),
2727
RCTVersionPrerelease: [NSNull null],
2828
};
2929
});

React/CoreModules/RCTActionSheetManager.mm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ - (void)presentViewController:(UIViewController *)alertController
9191
NSArray<NSString *> *buttons = RCTConvertOptionalVecToArray(options.options(), ^id(NSString *element) {
9292
return element;
9393
});
94+
NSArray<NSNumber *> *disabledButtonIndices;
9495
NSInteger cancelButtonIndex =
9596
options.cancelButtonIndex() ? [RCTConvert NSInteger:@(*options.cancelButtonIndex())] : -1;
9697
NSArray<NSNumber *> *destructiveButtonIndices;
98+
if (options.disabledButtonIndices()) {
99+
disabledButtonIndices = RCTConvertVecToArray(*options.disabledButtonIndices(), ^id(double element) {
100+
return @(element);
101+
});
102+
}
97103
if (options.destructiveButtonIndices()) {
98104
destructiveButtonIndices = RCTConvertVecToArray(*options.destructiveButtonIndices(), ^id(double element) {
99105
return @(element);
@@ -120,6 +126,7 @@ - (void)presentViewController:(UIViewController *)alertController
120126
@"destructiveButtonIndices" : destructiveButtonIndices,
121127
@"anchor" : anchor,
122128
@"tintColor" : tintColor,
129+
@"disabledButtonIndices" : disabledButtonIndices,
123130
});
124131
return;
125132
}
@@ -155,6 +162,17 @@ - (void)presentViewController:(UIViewController *)alertController
155162
index++;
156163
}
157164

165+
if (disabledButtonIndices) {
166+
for (NSNumber *disabledButtonIndex in disabledButtonIndices) {
167+
if ([disabledButtonIndex integerValue] < buttons.count) {
168+
[alertController.actions[[disabledButtonIndex integerValue]] setEnabled:false];
169+
} else {
170+
RCTLogError(@"Index %@ from `disabledButtonIndices` is out of bounds. Maximum index value is %@.", @([disabledButtonIndex integerValue]), @(buttons.count - 1));
171+
return;
172+
}
173+
}
174+
}
175+
158176
alertController.view.tintColor = tintColor;
159177
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
160178
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0

Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec renamed to React/FBReactNativeSpec/FBReactNativeSpec.podspec

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,13 @@ package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
1010
version = package['version']
1111

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

22-
react_native_path = File.join(__dir__, "..", "..")
23-
srcs_dir = File.join(__dir__, "..")
24-
codegen_script_path = File.join(react_native_path, "scripts", "generate-native-modules-specs.sh")
25-
codegen_path = File.join(react_native_path, codegen_path_prefix, "react-native-codegen")
26-
output_dir = File.join(__dir__, "FBReactNativeSpec")
27-
generated_files = [File.join(output_dir, "FBReactNativeSpec.h"), File.join(output_dir, "FBReactNativeSpec-generated.mm")]
28-
codegen_command = "CODEGEN_PATH=#{codegen_path} sh '#{codegen_script_path}' | tee \"${SCRIPT_OUTPUT_FILE_0}\""
29-
3020
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
3121
folly_version = '2020.01.13.00'
3222

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

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

59-
s.prepare_command = "mkdir -p #{output_dir} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
60-
s.script_phase = {
61-
:name => 'Generate Native Modules Code',
62-
:input_files => [srcs_dir],
63-
:output_files => ["$(DERIVED_FILE_DIR)/FBReactNativeSpec-codegen.log"],
64-
:script => codegen_command,
65-
:execution_position => :before_compile
66-
}
49+
use_react_native_codegen! (s)
6750
end

React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm

Whitespace-only changes.

React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h

Whitespace-only changes.

React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#import <react/renderer/components/rncore/EventEmitters.h>
1414
#import <react/renderer/components/rncore/Props.h>
1515

16-
#import "FBRCTFabricComponentsPlugins.h"
16+
#import "RCTFabricComponentsPlugins.h"
1717

1818
using namespace facebook::react;
1919

0 commit comments

Comments
 (0)