Skip to content

Commit

Permalink
Merge pull request #849 from amgleitman/amgleitman/0.64-merge-2020-11-03
Browse files Browse the repository at this point in the history
Merge from upstream through 2020-11-03
  • Loading branch information
amgleitman authored Oct 20, 2021
2 parents e877ebf + 12a83ca commit 9e89136
Show file tree
Hide file tree
Showing 401 changed files with 39,735 additions and 46,653 deletions.
7 changes: 4 additions & 3 deletions .circleci/Dockerfiles/Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# and build a Android application that can be used to run the
# tests specified in the scripts/ directory.
#
FROM reactnativecommunity/react-native-android:2019-10-18
FROM reactnativecommunity/react-native-android:2.1

LABEL Description="React Native Android Test Image"
LABEL maintainer="Héctor Ramos <[email protected]>"
Expand All @@ -26,11 +26,13 @@ ENV JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"

ADD .buckconfig /app/.buckconfig
ADD .buckjavaargs /app/.buckjavaargs
ADD tools /app/tools
ADD Libraries /app/Libraries
ADD ReactAndroid /app/ReactAndroid
ADD ReactCommon /app/ReactCommon
ADD React /app/React
ADD keystores /app/keystores
ADD packages/react-native-codegen /app/packages/react-native-codegen
ADD tools /app/tools

# add third party dependencies
ADD Folly /app/Folly
Expand Down Expand Up @@ -71,4 +73,3 @@ RUN yarn
RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog

RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mount -o remount,exec /dev/shm
AVD_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)

# create virtual device
echo no | android create avd -n "$AVD_UUID" -f -t android-19 --abi default/armeabi-v7a
echo no | android create avd -n "$AVD_UUID" -f -t android-21 --abi default/armeabi-v7a

# emulator setup
emulator64-arm -avd $AVD_UUID -no-skin -no-audio -no-window -no-boot-anim &
Expand Down
2 changes: 1 addition & 1 deletion .circleci/Dockerfiles/scripts/run-ci-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function e2e_suite() {

# create virtual device
if ! android list avd | grep "$AVD_UUID" > /dev/null; then
echo no | android create avd -n "$AVD_UUID" -f -t android-19 --abi default/armeabi-v7a
echo no | android create avd -n "$AVD_UUID" -f -t android-21 --abi default/armeabi-v7a
fi

# newline at end of adb devices call and first line is headers
Expand Down
79 changes: 46 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@ defaults: &defaults
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_A: &github_token_a "78a72af35445ca3f8180"
- PUBLIC_ANALYSISBOT_GITHUB_TOKEN_B: &github_token_b "b1a98e0bbd56ff1ccba1"


# -------------------------
# EXECUTORS
# -------------------------
executors:
nodelts:
<<: *defaults
docker:
- image: circleci/node:12
- image: circleci/node:14
nodeprevlts:
<<: *defaults
docker:
- image: circleci/node:10
- image: circleci/node:12
reactnativeandroid:
<<: *defaults
docker:
- image: reactnativecommunity/react-native-android:2019-10-18
- image: reactnativecommunity/react-native-android:2.1
resource_class: "large"
environment:
- TERM: "dumb"
Expand All @@ -50,7 +49,7 @@ executors:
reactnativeios:
<<: *defaults
macos:
xcode: &_XCODE_VERSION "11.6.0"
xcode: &_XCODE_VERSION "12.1.0"

# -------------------------
# COMMANDS
Expand Down Expand Up @@ -152,13 +151,13 @@ commands:
command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
- restore_cache:
keys:
- v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}
- v1-pods-{{ .Environment.CIRCLE_JOB }}-
- v3-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}
- v3-pods-{{ .Environment.CIRCLE_JOB }}-
- steps: << parameters.steps >>
- save_cache:
paths:
- packages/rn-tester/Pods
key: v1-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}
key: v3-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}

download_gradle_dependencies:
steps:
Expand Down Expand Up @@ -216,12 +215,12 @@ commands:
jobs:
setup:
parameters:
executor:
type: executor
default: nodelts
checkout_type:
type: string
default: node
executor:
type: executor
default: nodelts
checkout_type:
type: string
default: node
executor: << parameters.executor >>
steps:
- checkout
Expand Down Expand Up @@ -350,6 +349,9 @@ jobs:
use_frameworks:
type: boolean
default: false
use_hermes:
type: boolean
default: false
run_unit_tests:
description: Specifies whether unit tests should run.
type: boolean
Expand Down Expand Up @@ -380,15 +382,15 @@ jobs:
- run:
name: Configure Environment Variables
command: |
echo 'export PATH=/usr/local/opt/node@10/bin:$PATH' >> $BASH_ENV
echo 'export PATH=/usr/local/opt/node@12/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- with_brew_cache_span:
steps:
- brew_install:
package: watchman
- brew_install:
package: node@10
package: node@12
- run:
name: "Brew: Tap wix/brew"
command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
Expand All @@ -406,10 +408,13 @@ jobs:
name: Set USE_FRAMEWORKS=1
command: echo "export USE_FRAMEWORKS=1" >> $BASH_ENV

- run:
name: Fetch CocoaPods Specs
command: |
curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
- when:
condition: << parameters.use_hermes >>
steps:
- run:
name: Set USE_HERMES=1
command: echo "export USE_HERMES=1" >> $BASH_ENV

- run:
name: Setup the CocoaPods environment
command: pod setup
Expand All @@ -418,11 +423,7 @@ jobs:
steps:
- run:
name: Generate RNTesterPods Workspace
command: cd packages/rn-tester && pod install --verbose

- run:
name: Generate RNTesterPods Xcode Workspace
command: pushd packages/rn-tester && pod install --verbose && popd
command: cd packages/rn-tester && bundle exec pod install --verbose

# -------------------------
# Runs iOS unit tests
Expand Down Expand Up @@ -542,12 +543,13 @@ jobs:
name: "Run Tests: Android Unit Tests"
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS --xml ./reports/buck/all-results-raw.xml
- run:
name: "Run Tests: Android Instrumentation Tests"
name: "Build Tests: Android Instrumentation Tests"
# Here, just build the instrumentation tests. There is a known issue with installing the APK to android-21+ emulator.
command: |
if [[ ! -e ReactAndroid/src/androidTest/assets/AndroidTestBundle.js ]]; then
echo "JavaScript bundle missing, cannot run instrumentation tests. Verify Build JavaScript Bundle step completed successfully."; exit 1;
fi
source scripts/android-setup.sh && NO_BUCKD=1 retry3 timeout 300 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
source scripts/android-setup.sh && NO_BUCKD=1 retry3 timeout 300 buck build ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=$BUILD_THREADS
# Optionally, run disabled tests
- when:
Expand Down Expand Up @@ -588,7 +590,7 @@ jobs:
source ~/.bashrc
nvm i node
npm i -g yarn
npx envinfo@latest
echo y | npx envinfo@latest
yarn run docker-setup-android
yarn run docker-build-android
Expand Down Expand Up @@ -641,7 +643,7 @@ jobs:
name: Setup Android SDKs
command: |
sdkmanager --licenses
sdkmanager "system-images;android-19;google_apis;armeabi-v7a"
sdkmanager "system-images;android-21;google_apis;armeabi-v7a"
sdkmanager "platforms;android-%ANDROID_BUILD_VERSION%"
sdkmanager "build-tools;%ANDROID_TOOLS_VERSION%"
sdkmanager "add-ons;addon-google_apis-google-23"
Expand Down Expand Up @@ -772,20 +774,31 @@ workflows:
requires:
- setup_android
- test_ios:
name: test_ios_unit
run_disabled_tests: false
name: test_ios_unit_jsc
run_unit_tests: true
requires:
- setup_ios
- test_ios:
name: test_ios_unit_frameworks_jsc
use_frameworks: true
run_unit_tests: true
requires:
- setup_ios
- test_ios:
name: test_ios_unit_hermes
use_hermes: true
run_unit_tests: true
requires:
- setup_ios
- test_ios:
name: test_ios_unit_frameworks
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_disabled_tests: false
# run_detox_tests: true
# requires:
# - setup_ios
Expand Down
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ node_modules/
packages/*/node_modules
packages/*/lib
packages/*/lib-commonjs
pr-inactivity-bookmarklet.js
question-bookmarklet.js
bots/node_modules
android-patches/
packages/react-native-codegen/lib
Expand Down
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ untyped-import
untyped-type-import

[version]
^0.135.0
^0.137.0
2 changes: 1 addition & 1 deletion .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ untyped-import
untyped-type-import

[version]
^0.135.0
^0.137.0
2 changes: 1 addition & 1 deletion .flowconfig.macos
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ untyped-import
untyped-type-import

[version]
^0.135.0
^0.137.0
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ 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-native-modules.json
/schema-rncore.json

# Visual studio
Expand Down
2 changes: 1 addition & 1 deletion ECOSYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ React Native's current set of partners include Callstack, Expo, Facebook, Infini
* **[Callstack](https://callstack.com/):** Manages releases, maintains the [React Native CLI](https://github.com/react-native-community/react-native-cli) and organizes [React Native EU](https://react-native.eu/)
* **[Expo](https://expo.io/):** Builds [expo](https://github.com/expo/expo) on top of React Native to simplify app development
* **[Facebook](https://opensource.facebook.com):** Oversees the React Native product and maintains the [React Native core repo](https://reactnative.dev/)
* **[Infinite Red](https://infinite.red/):** Maintains the [ignite cli/boilerplate](https://github.com/infinitered/ignite), organizes [Chain React Conf](https://infinite.red/ChainReactConf)
* **[Infinite Red](https://infinite.red/):** Maintains the [ignite cli/boilerplate](https://github.com/infinitered/ignite), organizes [Chain React Conf](https://cr.infinite.red/)
* **[Microsoft](http://aka.ms/reactnative):** Develops [React Native Windows](https://github.com/Microsoft/react-native-windows) and [React Native macOS](https://github.com/microsoft/react-native-macos) for building apps that target Windows and macOS
* **[Software Mansion](https://swmansion.com/):** Maintain core infrastructure including JSC, Animated, and other popular third-party plugins.

Expand Down
11 changes: 9 additions & 2 deletions IntegrationTests/GlobalEvalWithSourceUrlTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

'use strict';

import type {ExtendedError} from 'react-native/Libraries/Core/Devtools/parseErrorStack';

const React = require('react');
const ReactNative = require('react-native');
const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
Expand All @@ -31,7 +33,7 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> {
'Expected globalEvalWithSourceUrl(expression) to return a value',
);
}
let syntaxError;
let syntaxError: ?ExtendedError;
try {
global.globalEvalWithSourceUrl('{');
} catch (e) {
Expand All @@ -42,7 +44,12 @@ class GlobalEvalWithSourceUrlTest extends React.Component<{...}> {
'Expected globalEvalWithSourceUrl to throw on a syntax error',
);
}
if (!(syntaxError instanceof SyntaxError)) {
// Hermes throws an Error instead of a SyntaxError
// https://github.com/facebook/hermes/issues/400
if (
syntaxError.jsEngine !== 'hermes' &&
!(syntaxError instanceof SyntaxError)
) {
throw new Error(
'Expected globalEvalWithSourceUrl to throw SyntaxError on a syntax error',
);
Expand Down
11 changes: 2 additions & 9 deletions Libraries/ActionSheetIOS/NativeActionSheetManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,18 @@

import type {TurboModule} from '../TurboModule/RCTExport';
import * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';
import type {ProcessedColorValue} from '../StyleSheet/processColor'; // TODO(macOS GH#774)

export interface Spec extends TurboModule {
+getConstants: () => {||};
+showActionSheetWithOptions: (
// TODO(macOS GH#774) - For some reason, yarn lint complains here with this error:
// "Unsupported type 'object' for Spec interface. See https://fburl.com/rn-nativemodules for more details"
// The link in the error is restricted to Facebook employees, so we can't access this info.
// 3a6327a5d9ebfd0de56c37009ab7de1d0e6bdf85 apparently solves this in other places by disabling the error,
// so we might as well do the same thing here.
// eslint-disable-next-line @react-native/codegen/react-native-modules
options: {|
+title?: ?string,
+message?: ?string,
+options: ?Array<string>,
+destructiveButtonIndices?: ?Array<number>,
+cancelButtonIndex?: ?number,
+anchor?: ?number,
+tintColor?: ?ProcessedColorValue, // TODO(macOS GH#774)
+tintColor?: ?number,
+userInterfaceStyle?: ?string,
|},
callback: (buttonIndex: number) => void,
Expand All @@ -41,7 +34,7 @@ export interface Spec extends TurboModule {
+url?: ?string,
+subject?: ?string,
+anchor?: ?number,
+tintColor?: ?ProcessedColorValue, // TODO(macOS GH#774)
+tintColor?: ?number,
+excludedActivityTypes?: ?Array<string>,
+userInterfaceStyle?: ?string,
|},
Expand Down
20 changes: 18 additions & 2 deletions Libraries/Alert/NativeAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,26 @@ export type Args = {|
// ]TODO(macOS GH#774)
|};

// TODO(macOS GH#774): stand-in for Args to make codegen happy
type NativeArgs = {|
title?: string,
message?: string,
buttons?: Array<Object>, // TODO(T67565166): have a better type
type?: string,
defaultValue?: string,
cancelButtonKey?: string,
destructiveButtonKey?: string,
keyboardType?: string,
// [TODO(macOS GH#774)
defaultInputs?: Array<Object>,
modal?: ?boolean,
critical?: ?boolean,
// ]TODO(macOS GH#774)
|};

export interface Spec extends TurboModule {
+alertWithArgs: (
// eslint-disable-next-line @react-native/codegen/react-native-modules
args: Args,
args: NativeArgs, // TODO(macOS GH#774): Args -> NativeArgs
callback: (id: number, value: string) => void,
) => void;
}
Expand Down
Loading

0 comments on commit 9e89136

Please sign in to comment.