Skip to content

Commit

Permalink
Merge branch 'master' into muhammad/arch-64-fb-submit-master
Browse files Browse the repository at this point in the history
* master: (22 commits)
  Add back deprecated getParent methods for non-breaking API change (facebook#775)
  Open source Flow definition for Jest
  Upgrade to Flow v0.74.0
  Fix iOS e2e tests: bump react-native-babel-preset to ^5 (facebook#19625)
  Don't pass additional args to requireNativeComponent in .android.js files
  Enable Flow for bezier
  Passing forwardedRef to Slider
  Switch to Platform.isTV to pass Android Flow
  iOS: fix fabric core test
  Fix some typos in dumpReactTree.js (facebook#19636)
  Migrate PickerIOS to ES6 Class
  Add MIT License Header
  Fabric: All *EventHandlers were renamed to *EventEmitter
  Disallow requiring from invariant/warning (facebook#19634)
  have circle ci use xcode 9.4 (facebook#19629)
  Bump eslint-plugin-react in FBSource
  Fabric: `convertRawProp` was extended to accept an optional default value
  Fabric: Introducing RCTSurfaceTouchHandler
  Fabric: Data model of Touch Events
  Fabric: Using exact UIFontWeight* constants instead of CGFloat
  ...
  • Loading branch information
marafat committed Jun 11, 2018
2 parents 7e2282f + c3c5c3c commit fe68728
Show file tree
Hide file tree
Showing 85 changed files with 1,266 additions and 498 deletions.
54 changes: 34 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ aliases:
# eslint sometimes runs into trouble generating the reports
- &run-lint-checks
name: Lint code
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/js-lint-results.xml
command: scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ~/react-native/reports/junit/eslint/results.xml
when: always

- &run-flow-checks
Expand Down Expand Up @@ -274,6 +274,14 @@ aliases:
mkdir -p ~/react-native/reports/junit/
mkdir -p ~/react-native/reports/outputs/
- &boot-simulator-iphone
name: Boot iPhone Simulator
command: xcrun simctl boot "iPhone 5s" || true

- &boot-simulator-appletv
name: Boot Apple TV Simulator
command: xcrun simctl boot "Apple TV" || true

- &run-objc-ios-tests
name: iOS Test Suite
command: ./scripts/objc-test-ios.sh test
Expand All @@ -282,9 +290,13 @@ aliases:
name: tvOS Test Suite
command: ./scripts/objc-test-tvos.sh test

- &run-e2e-tests
name: End-to-End Test Suite
command: node ./scripts/run-ci-e2e-tests.js --ios --tvos --js --retries 3;

- &run-objc-ios-e2e-tests
name: iOS End-to-End Test Suite
command: node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3;
command: node ./scripts/run-ci-e2e-tests.js --ios --retries 3;

- &run-objc-tvos-e2e-tests
name: tvOS End-to-End Test Suite
Expand Down Expand Up @@ -316,7 +328,7 @@ android_defaults: &android_defaults
macos_defaults: &macos_defaults
<<: *defaults
macos:
xcode: "9.2.0"
xcode: "9.4.0"

version: 2
jobs:
Expand Down Expand Up @@ -374,9 +386,7 @@ jobs:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "iPhone 5s (11.2)" || true
# See https://github.com/Homebrew/homebrew-core/issues/26358.
- run: brew upgrade python > /dev/null
- run: *boot-simulator-iphone
- run: brew install watchman
- run: *run-objc-ios-tests

Expand All @@ -390,23 +400,35 @@ jobs:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "Apple TV 1080p (11.2)" || true
# See https://github.com/Homebrew/homebrew-core/issues/26358.
- run: brew upgrade python > /dev/null
- run: *boot-simulator-appletv
- run: brew install watchman
- run: *run-objc-tvos-tests

- store_test_results:
path: ~/react-native/reports/junit

# Runs end to end tests
test_ios_e2e:
test_end_to_end:
<<: *macos_defaults
steps:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "iPhone 5s (11.2)" || true
- run: *boot-simulator-iphone

- run:
name: Configure Environment Variables
command: |
echo 'export PATH=/usr/local/opt/node@8/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
- run:
name: Install Node 8
command: |
brew install node@8
brew link node@8
node -v
- run: *run-objc-ios-e2e-tests

- store_test_results:
Expand Down Expand Up @@ -625,7 +647,7 @@ workflows:
- checkout_code

# End-to-end tests
- test_ios_e2e:
- test_end_to_end:
filters: *filter-ignore-gh-pages
requires:
- checkout_code
Expand Down Expand Up @@ -672,11 +694,3 @@ workflows:
# filters: *filter-ignore-gh-pages
# requires:
# - checkout_code

experimental:
notify:
webhooks:
- url: https://code.facebook.com/circle/webhook/
branches:
only:
- master
7 changes: 6 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
; Ignore metro
.*/node_modules/metro/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/invariant')
.*/node_modules/invariant/.*
.*/node_modules/warning/.*

[include]

[libs]
Expand Down Expand Up @@ -69,4 +74,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.73.0
^0.74.0
8 changes: 4 additions & 4 deletions ContainerShip/scripts/run-android-ci-instrumentation-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const path = require('path');
const colors = {
GREEN: '\x1b[32m',
RED: '\x1b[31m',
RESET: '\x1b[0m'
RESET: '\x1b[0m',
};

const test_opts = {
Expand All @@ -41,7 +41,7 @@ const test_opts = {
TEST_TIMEOUT: parseInt(argv['test-timeout'] || 1000 * 60 * 10),

OFFSET: argv.offset,
COUNT: argv.count
COUNT: argv.count,
};

let max_test_class_length = Number.NEGATIVE_INFINITY;
Expand Down Expand Up @@ -88,7 +88,7 @@ return async.mapSeries(testClasses, (clazz, callback) => {

return async.retry(test_opts.RETRIES, (retryCb) => {
const test_process = child_process.spawn('./ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh', [test_opts.PACKAGE, clazz], {
stdio: 'inherit'
stdio: 'inherit',
});

const timeout = setTimeout(() => {
Expand All @@ -112,7 +112,7 @@ return async.mapSeries(testClasses, (clazz, callback) => {
}, (err) => {
return callback(null, {
name: clazz,
status: err ? 'failure' : 'success'
status: err ? 'failure' : 'success',
});
});
}, (err, results) => {
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Animated/src/__tests__/bezier-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* https://github.com/gre/bezier-easing
*
* @copyright 2014-2015 Gaetan Renaudeau. MIT License.
* @noflow
* @emails oncall+react_native
* @flow
* @format
*/

Expand Down Expand Up @@ -39,7 +39,7 @@ function allEquals(be1, be2, samples, assertion) {
function repeat(n) {
return function(f) {
for (let i = 0; i < n; ++i) {
f(i);
f();
}
};
}
Expand Down
12 changes: 8 additions & 4 deletions Libraries/Animated/src/bezier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* BezierEasing - use bezier curve for transition easing function
* https://github.com/gre/bezier-easing
*
* @flow
* @format
* @copyright 2014-2015 Gaëtan Renaudeau. MIT License.
* @noflow
*/

'use strict';
Expand Down Expand Up @@ -71,9 +71,13 @@ function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
return aGuessT;
}

module.exports = function bezier(mX1, mY1, mX2, mY2) {
module.exports = function bezier(
mX1: number,
mY1: number,
mX2: number,
mY2: number,
) {
if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
// eslint-disable-line yoda
throw new Error('bezier x values must be in [0, 1] range');
}

Expand Down Expand Up @@ -123,7 +127,7 @@ module.exports = function bezier(mX1, mY1, mX2, mY2) {
}
}

return function BezierEasing(x) {
return function BezierEasing(x: number): number {
if (mX1 === mY1 && mX2 === mY2) {
return x; // linear
}
Expand Down
10 changes: 5 additions & 5 deletions Libraries/BugReporting/dumpReactTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ function getReactTree() {
}

/*
function dumpNode(node: Object, identation: number) {
function dumpNode(node: Object, indentation: number) {
const data = getReactData(node);
if (data.nodeType === 'Text') {
return indent(identation) + data.text + '\n';
return indent(indentation) + data.text + '\n';
} else if (data.nodeType === 'Empty') {
return '';
}
let output = indent(identation) + `<${data.name}`;
let output = indent(indentation) + `<${data.name}`;
if (data.nodeType === 'Composite') {
for (const propName of Object.getOwnPropertyNames(data.props || {})) {
if (isNormalProp(propName)) {
Expand All @@ -76,11 +76,11 @@ function dumpNode(node: Object, identation: number) {
}
let childOutput = '';
for (const child of data.children || []) {
childOutput += dumpNode(child, identation + 1);
childOutput += dumpNode(child, indentation + 1);
}
if (childOutput) {
output += '>\n' + childOutput + indent(identation) + `</${data.name}>\n`;
output += '>\n' + childOutput + indent(indentation) + `</${data.name}>\n`;
} else {
output += ' />\n';
}
Expand Down
10 changes: 2 additions & 8 deletions Libraries/Components/CheckBox/CheckBox.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const requireNativeComponent = require('requireNativeComponent');

const RCTCheckBox = requireNativeComponent('AndroidCheckBox');

type DefaultProps = {
value: boolean,
disabled: boolean,
Expand Down Expand Up @@ -155,12 +157,4 @@ let styles = StyleSheet.create({
},
});

let RCTCheckBox = requireNativeComponent('AndroidCheckBox', CheckBox, {
nativeOnly: {
onChange: true,
on: true,
enabled: true,
},
});

module.exports = CheckBox;
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,6 @@ const styles = StyleSheet.create({
});

// The View that contains both the actual drawer and the main view
const AndroidDrawerLayout = requireNativeComponent(
'AndroidDrawerLayout',
DrawerLayoutAndroid,
);
const AndroidDrawerLayout = requireNativeComponent('AndroidDrawerLayout');

module.exports = DrawerLayoutAndroid;
21 changes: 3 additions & 18 deletions Libraries/Components/Picker/PickerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const ViewStylePropTypes = require('ViewStylePropTypes');
const processColor = require('processColor');
const requireNativeComponent = require('requireNativeComponent');

const DropdownPicker = requireNativeComponent('AndroidDropdownPicker');
const DialogPicker = requireNativeComponent('AndroidDialogPicker');

const REF_PICKER = 'picker';
const MODE_DROPDOWN = 'dropdown';

Expand Down Expand Up @@ -158,22 +161,4 @@ const styles = StyleSheet.create({
},
});

const cfg = {
nativeOnly: {
items: true,
selected: true,
},
};

const DropdownPicker = requireNativeComponent(
'AndroidDropdownPicker',
PickerAndroid,
cfg,
);
const DialogPicker = requireNativeComponent(
'AndroidDialogPicker',
PickerAndroid,
cfg,
);

module.exports = PickerAndroid;
Loading

0 comments on commit fe68728

Please sign in to comment.