Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fbjni-fb-split-2
Browse files Browse the repository at this point in the history
  • Loading branch information
passy committed Jan 7, 2020
2 parents 85a2e2a + e8f577e commit 0362ff1
Show file tree
Hide file tree
Showing 201 changed files with 5,626 additions and 3,770 deletions.
29 changes: 16 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ commands:
steps:
- run:
name: Initial Setup
command: mkdir -p ~/reports/{buck,build,junit,outputs}
command: mkdir -p ./reports/{buck,build,junit,outputs}

run_yarn:
steps:
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:

- run:
name: Lint code
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/reports/junit/eslint/results.xml
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
when: always

- run:
Expand All @@ -275,7 +275,7 @@ jobs:
when: always

- store_test_results:
path: ~/reports/junit
path: ./reports/junit

# -------------------------
# JOBS: Test JavaScript
Expand All @@ -298,7 +298,7 @@ jobs:
command: node ./scripts/run-ci-javascript-tests.js --maxWorkers 2

- store_test_results:
path: ~/reports/junit
path: ./reports/junit
# -------------------------
# JOBS: Test iOS
# -------------------------
Expand All @@ -310,7 +310,7 @@ jobs:
type: boolean
default: false
environment:
- REPORTS_DIR: "./reports"
- REPORTS_DIR: "./reports/junit"
steps:
- restore_cache_checkout:
checkout_type: ios
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:

- run: yarn test-ios
- store_test_results:
path: ~/reports/junit
path: ./reports/junit

# Runs iOS end-to-end tests
test_ios_e2e:
Expand Down Expand Up @@ -415,6 +415,9 @@ jobs:
- ~/.cocoapods/repos
key: v1-cocoapods-{{ checksum "template/ios/Podfile" }}

- store_test_results:
path: ./reports/junit

test_js_e2e:
executor: node8
steps:
Expand All @@ -429,7 +432,7 @@ jobs:
command: node ./scripts/run-ci-e2e-tests.js --js --retries 3

- store_test_results:
path: ~/reports/junit
path: ./reports/junit

# -------------------------
# JOBS: Test Android
Expand Down Expand Up @@ -494,7 +497,7 @@ jobs:
# Test Suite
- run:
name: Run Unit Tests
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS --xml ~/reports/buck/all-results-raw.xml
command: buck test ReactAndroid/src/test/... --config build.threads=$BUILD_THREADS --xml ./reports/buck/all-results-raw.xml

- run:
name: Run Instrumentation Tests
Expand All @@ -512,16 +515,16 @@ jobs:
- run:
name: Collect Test Results
command: |
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ~/reports/build/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ~/reports/outputs/ \;
find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ~/reports/buck/ \;
find . -type f -regex ".*/build/test-results/debug/.*xml" -exec cp {} ./reports/build/ \;
find . -type f -regex ".*/outputs/androidTest-results/connected/.*xml" -exec cp {} ./reports/outputs/ \;
find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} ./reports/buck/ \;
if [ -f ~/react-native/reports/buck/all-results-raw.xml ]; then
./tooling/junit/buck_to_junit.sh ~/react-native/reports/buck/all-results-raw.xml ~/react-native/reports/junit/all-results-junit.xml
./tooling/junit/buck_to_junit.sh ~/react-native/reports/buck/all-results-raw.xml ~/react-native/reports/junit/results.xml
fi
when: always

- store_test_results:
path: ~/reports/junit
path: ./reports/junit

# -------------------------
# JOBS: Test Docker
Expand Down
3 changes: 1 addition & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error
Expand All @@ -85,4 +84,4 @@ untyped-import
untyped-type-import

[version]
^0.114.0
^0.115.0
3 changes: 1 addition & 2 deletions .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error
Expand All @@ -85,4 +84,4 @@ untyped-import
untyped-type-import

[version]
^0.114.0
^0.115.0
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ Libraries/Text/* @shergin

# These should not be modified through a GitHub PR
LICENSE* @hramos @cpojer @yungsters

# The eslint-config-react-native-community package requires manual publishing after merging
/packages/eslint-config-react-native-community/* @matt-oakes
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ buck-out
/ReactAndroid/src/main/jni/prebuilt/lib/
/ReactAndroid/src/main/gen

# Android Studio
.project
.settings
.classpath

# Watchman
.watchmanconfig

Expand Down
3 changes: 3 additions & 0 deletions IntegrationTests/IntegrationTestsApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class IntegrationTestsApp extends React.Component<{...}, $FlowFixMeState> {
<View style={styles.separator} />
<ScrollView>
{TESTS.map(test => [
/* $FlowFixMe(>=0.115.0 site=react_native_fb) This comment
* suppresses an error found when Flow v0.115 was deployed. To see
* the error, delete this comment and run Flow. */
<TouchableOpacity
onPress={() => this.setState({test})}
style={styles.row}>
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ART/React-ART.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Pod::Spec.new do |s|
s.homepage = "http://facebook.github.io/react-native/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.source = source
s.source_files = "**/*.{m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ActionSheetIOS/React-RCTActionSheet.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pod::Spec.new do |s|
s.documentation_url = "https://facebook.github.io/react-native/docs/actionsheetios"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.source = source
s.source_files = "*.{m}"
s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
Expand Down
6 changes: 4 additions & 2 deletions Libraries/Animated/src/animations/SpringAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

const AnimatedValue = require('../nodes/AnimatedValue');
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
const Animation = require('./Animation');
const SpringConfig = require('../SpringConfig');

Expand All @@ -30,7 +31,8 @@ export type SpringAnimationConfig = AnimationConfig & {
y: number,
...
}
| AnimatedValueXY,
| AnimatedValueXY
| AnimatedInterpolation,
overshootClamping?: boolean,
restDisplacementThreshold?: number,
restSpeedThreshold?: number,
Expand All @@ -53,7 +55,7 @@ export type SpringAnimationConfig = AnimationConfig & {
};

export type SpringAnimationConfigSingle = AnimationConfig & {
toValue: number | AnimatedValue,
toValue: number | AnimatedValue | AnimatedInterpolation,
overshootClamping?: boolean,
restDisplacementThreshold?: number,
restSpeedThreshold?: number,
Expand Down
6 changes: 4 additions & 2 deletions Libraries/Animated/src/animations/TimingAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

const AnimatedValue = require('../nodes/AnimatedValue');
const AnimatedValueXY = require('../nodes/AnimatedValueXY');
const AnimatedInterpolation = require('../nodes/AnimatedInterpolation');
const Animation = require('./Animation');

const {shouldUseNativeDriver} = require('../NativeAnimatedHelper');
Expand All @@ -27,15 +28,16 @@ export type TimingAnimationConfig = AnimationConfig & {
y: number,
...
}
| AnimatedValueXY,
| AnimatedValueXY
| AnimatedInterpolation,
easing?: (value: number) => number,
duration?: number,
delay?: number,
...
};

export type TimingAnimationConfigSingle = AnimationConfig & {
toValue: number | AnimatedValue,
toValue: number | AnimatedValue | AnimatedInterpolation,
easing?: (value: number) => number,
duration?: number,
delay?: number,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Blob/React-RCTBlob.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Pod::Spec.new do |s|
s.homepage = "http://facebook.github.io/react-native/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source
s.source_files = "*.{m,mm}"
Expand Down
3 changes: 3 additions & 0 deletions Libraries/CameraRoll/RCTImagePickerManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ - (void)_dismissPicker:(UIImagePickerController *)picker args:(NSArray *)args
- (void)cameraChanged:(NSNotification *)notification
{
for (UIImagePickerController *picker in _pickers) {
if (picker.sourceType != UIImagePickerControllerSourceTypeCamera) {
continue;
}
if ([picker isKindOfClass:[RCTImagePickerController class]]
&& ((RCTImagePickerController *)picker).unmirrorFrontFacingCamera
&& picker.cameraDevice == UIImagePickerControllerCameraDeviceFront) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({

export default (codegenNativeComponent<NativeProps>('PullToRefreshView', {
paperComponentName: 'RCTRefreshControl',
excludedPlatform: 'android',
}): HostComponent<NativeProps>);
27 changes: 21 additions & 6 deletions Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const React = require('react');
import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import type {ViewProps} from '../View/ViewPropTypes';
import AndroidSwipeRefreshLayoutNativeComponent from './AndroidSwipeRefreshLayoutNativeComponent';
import PullToRefreshViewNativeComponent from './PullToRefreshViewNativeComponent';

import PullToRefreshViewNativeComponent, {
Commands as PullToRefreshCommands,
} from './PullToRefreshViewNativeComponent';

let RefreshLayoutConsts: any;
if (Platform.OS === 'android') {
Expand Down Expand Up @@ -138,6 +141,8 @@ class RefreshControl extends React.Component<RefreshControlProps> {
_setNativePropsOnRef: ?({refreshing: boolean, ...}) => void;
_lastNativeRefreshing = false;

_nativeRef: ?React.ElementRef<typeof PullToRefreshViewNativeComponent>;

componentDidMount() {
this._lastNativeRefreshing = this.props.refreshing;
}
Expand All @@ -152,16 +157,26 @@ class RefreshControl extends React.Component<RefreshControlProps> {
this.props.refreshing !== this._lastNativeRefreshing &&
this._setNativePropsOnRef
) {
this._setNativePropsOnRef({
refreshing: this.props.refreshing,
});
if (Platform.OS === 'android') {
this._setNativePropsOnRef({
refreshing: this.props.refreshing,
});
} else if (this._nativeRef) {
PullToRefreshCommands.setNativeRefreshing(
this._nativeRef,
this.props.refreshing,
);
}
this._lastNativeRefreshing = this.props.refreshing;
}
}

render(): React.Node {
const setRef = ref =>
(this._setNativePropsOnRef = ref ? ref.setNativeProps.bind(ref) : null);
const setRef = ref => {
this._setNativePropsOnRef = ref ? ref.setNativeProps.bind(ref) : null;
this._nativeRef = ref;
};

if (Platform.OS === 'ios') {
const {
enabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type NativeProps = $ReadOnly<{|
selectedIndex?: WithDefault<Int32, 0>,
enabled?: WithDefault<boolean, true>,
tintColor?: ?ColorValue,
textColor?: ?ColorValue,
backgroundColor?: ?ColorValue,
momentary?: WithDefault<boolean, false>,

// Events
Expand Down
9 changes: 7 additions & 2 deletions Libraries/Components/View/ReactNativeViewViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

'use strict';
import ReactNativeViewViewConfigAndroid from './ReactNativeViewViewConfigAndroid';
import {Platform} from 'react-native';

const ReactNativeViewConfig = {
uiViewClassName: 'RCTView',
Expand Down Expand Up @@ -321,7 +322,9 @@ const ReactNativeViewConfig = {
textTransform: true,
tintColor: {process: require('../../StyleSheet/processColor')},
top: true,
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
transform: ((Platform.OS === 'ios'
? {diff: require('../../Utilities/differ/matricesDiffer')}
: {process: require('../../StyleSheet/processTransform')}): any),
transformMatrix: true,
translateX: true,
translateY: true,
Expand All @@ -331,7 +334,9 @@ const ReactNativeViewConfig = {
},
testID: true,
top: true,
transform: {diff: require('../../Utilities/differ/matricesDiffer')},
transform: ((Platform.OS === 'ios'
? {diff: require('../../Utilities/differ/matricesDiffer')}
: {process: require('../../StyleSheet/processTransform')}): any),
translateX: true,
translateY: true,
width: true,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/FBLazyVector/FBLazyVector.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Pod::Spec.new do |s|
s.homepage = "http://facebook.github.io/react-native/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.source = source
s.source_files = "**/*.{c,h,m,mm,cpp}"
s.header_dir = "FBLazyVector"
Expand Down
2 changes: 1 addition & 1 deletion Libraries/FBReactNativeSpec/FBReactNativeSpec.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Pod::Spec.new do |s|
s.homepage = "http://facebook.github.io/react-native/"
s.license = package["license"]
s.author = "Facebook, Inc. and its affiliates"
s.platforms = { :ios => "9.0", :tvos => "9.2" }
s.platforms = { :ios => "10.0", :tvos => "10.0" }
s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness'
s.source = source
s.source_files = "**/*.{c,h,m,mm,cpp}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,7 @@ namespace JS {
RCTRequired<NSString *> Serial;
RCTRequired<NSString *> Fingerprint;
RCTRequired<NSString *> Model;
RCTRequired<NSString *> ServerHost;
NSString *ServerHost;
RCTRequired<NSString *> uiMode;
};

Expand Down Expand Up @@ -3633,7 +3633,7 @@ inline JS::NativePlatformConstantsAndroid::Constants::Builder::Builder(const Inp
d[@"Fingerprint"] = Fingerprint;
auto Model = i.Model.get();
d[@"Model"] = Model;
auto ServerHost = i.ServerHost.get();
auto ServerHost = i.ServerHost;
d[@"ServerHost"] = ServerHost;
auto uiMode = i.uiMode.get();
d[@"uiMode"] = uiMode;
Expand Down
4 changes: 0 additions & 4 deletions Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,8 @@ let Image = (props: ImagePropsType, forwardedRef) => {
let style;
let sources;
if (source?.uri != null) {
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
* when making Flow check .android.js files. */
const {width, height} = source;
style = flattenStyle([{width, height}, styles.base, props.style]);
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was found
* when making Flow check .android.js files. */
sources = [{uri: source.uri}];
} else {
style = flattenStyle([styles.base, props.style]);
Expand Down

0 comments on commit 0362ff1

Please sign in to comment.