Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update master #2

Merged
merged 50 commits into from
Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3152e93
Converting Libraries/Components to not use var
elicwhite Mar 3, 2018
70a3ece
Tightening type for flattenStyle
elicwhite Mar 3, 2018
498cf7e
Reënable iOS and tvOS tests
hramos Mar 5, 2018
a1295e1
Fix Viewpager on Android when using native navigation.
ruiaraujo Mar 5, 2018
f389ad8
Move fb_xplat_cxx.bzl to xplat/build_defs
Mar 5, 2018
8769057
Remove log in JSDevSupportModule
mdvacca Mar 5, 2018
3f8a04b
Revert "Better Android Gradle Plugin 3.x integration"
janicduplessis Mar 5, 2018
9f239d7
Use react.gradle from repo root instead of copy in RNTester
janicduplessis Mar 5, 2018
4466b6f
Refactor BridgeListener into JSIModulesProvider
mdvacca Mar 5, 2018
19b9851
Update VirtualizedList to not throw with double constructor
sophiebits Mar 5, 2018
860fcd4
Update node-notifier (has mem leak fix)
rickhanlonii Mar 5, 2018
19a4a7d
Remove callFunctionSync experimental APIs
Mar 5, 2018
9366ce4
Update opacity when `disabled` prop is changed
maxkomarychev Mar 5, 2018
b4ce427
iOS: branch out Fabric handling into a separate RCTSurface-compatible…
fkgozali Mar 6, 2018
b98bf1e
Remove polymorphic types from StyleSheetTypes
elicwhite Mar 6, 2018
b6c7e55
Using ReadOnly and Exact types for StyleSheet
elicwhite Mar 6, 2018
52c7957
Fix lint in StyleSheet.compose
sahrens Mar 6, 2018
ac929ef
Fix subtle bugs in cloning and FabricUIManager
mdvacca Mar 6, 2018
e839c91
Generalize JavaOnlyMap's getMap
ayc1 Mar 6, 2018
6eef7de
Adding tests to cover regressions when upgrading to babel 7
Mar 6, 2018
d2f0574
Add support to FabricUIManger to handle Throwable
mdvacca Mar 6, 2018
b7bb2e5
Add support for Android TV devices
Mar 6, 2018
48c339d
Add `RCTJavaScriptWillStartExecutingNotification`
davidaurelio Mar 6, 2018
2e51fa5
iOS: RCTSurface needs to re-register its root view on bridge reload
fkgozali Mar 6, 2018
e7b8341
Add Fabric test for text nodes
ayc1 Mar 7, 2018
6fc4163
Clean up FabricUIManagerViewHierarchyTest
ayc1 Mar 7, 2018
d52569c
check for GET and Head in send request
samsafay Mar 7, 2018
d7b5b2e
Allow Inspector to handle 2 renderers
fkgozali Mar 7, 2018
c129457
Typing ViewProp, ImageProp
elicwhite Mar 7, 2018
321ba06
Type TextStyleProp
elicwhite Mar 7, 2018
135637c
Merging tests for flattenStyle
elicwhite Mar 7, 2018
b58e377
Remove Unused Exports from StyleSheetTypes
elicwhite Mar 7, 2018
ec88489
Fixing bugs in link and unlink
rozele Mar 7, 2018
cade297
iOS Surface: properly reset some internal states when JS reloads
fkgozali Mar 7, 2018
ee26d9b
Make StyleSheet.create type private
elicwhite Mar 7, 2018
49ffc9f
Rename StyleProp to DangerouslyImpreciseStyleProp
elicwhite Mar 7, 2018
a3c07c9
StyleObj -> DangerouslyImpreciseStyleProp
elicwhite Mar 7, 2018
3c23645
Bump metro@0.29.0
rafeca Mar 7, 2018
cf89a2c
Move __StyleProp to StyleSheet
elicwhite Mar 8, 2018
23e0f86
Mark more ObjC methods called from RN as dynamic
tgrlnc Mar 8, 2018
7bf3b20
iOS: create C++ <-> ObjC++ connector for FabricUIManager to do UI ope…
fkgozali Mar 8, 2018
a162dc8
Fix RefreshControl's dependency on AndroidSwipeRefreshLayout
ayc1 Mar 8, 2018
596bcb6
Initialize ReactChoreographer before creating the TimingModule
ayc1 Mar 8, 2018
8cdc7d3
Don't assume the SourceCode native module exists
ayc1 Mar 8, 2018
89757ed
Add eslint-plugin-react-native Yarn package and enable no-inline-styl…
SnowCoderAlex Mar 8, 2018
5f497ca
Convert constant with build flags to function
Mar 8, 2018
d89517d
Remove usage of Internal StyleSheet type
elicwhite Mar 8, 2018
852084a
Remove usage of Styles type
elicwhite Mar 8, 2018
5b32358
Prettier
elicwhite Mar 8, 2018
4895c64
Rename Style to DangerouslyImpreciseStyle
elicwhite Mar 8, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 18 additions & 69 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,27 @@ aliases:
mkdir -p ~/react-native/reports/junit/

- &build-objc-ios-test-app
name: Build Objective-C iOS Test App
name: Build iOS Test App
command: ./scripts/objc-test-ios.sh

- &run-objc-ios-tests
name: Objective-C iOS Test Suite
name: iOS Test Suite
command: ./scripts/objc-test-ios.sh test

- &build-objc-tvos-test-app
name: Build Objective-C tvOS Test App
name: Build tvOS Test App
command: ./scripts/objc-test-tvos.sh

- &run-objc-tvos-tests
name: Objective-C tvOS Test Suite
name: tvOS Test Suite
command: ./scripts/objc-test-tvos.sh test

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

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

defaults: &defaults
Expand Down Expand Up @@ -292,8 +292,6 @@ jobs:

- store_test_results:
path: ~/react-native/reports/junit
- store_artifacts:
path: ~/react-native/reports/junit
- store_artifacts:
path: ~/react-native/yarn.lock

Expand All @@ -308,8 +306,6 @@ jobs:

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

# Runs JavaScript tests on Node 6
test_javascript_node6_compatibility:
Expand All @@ -328,83 +324,47 @@ jobs:

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

# Builds iOS test app
build_objc_ios_test_app:
<<: *macos_defaults
dependencies:
pre:
- xcrun instruments -w "iPhone 5s (11.1)" || true
steps:
- attach_workspace:
at: ~/react-native

- run: *build-objc-ios-test-app

# Runs unit tests on iOS devices
test_objc_ios:
test_ios:
<<: *macos_defaults
dependencies:
pre:
- xcrun instruments -w "iPhone 5s (11.1)" || true
steps:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "iPhone 5s (11.1)" || true
- run: brew install watchman
- run: *run-objc-ios-tests

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

# Builds tvOS test app
build_objc_tvos_test_app:
<<: *macos_defaults
dependencies:
pre:
- xcrun instruments -w "Apple TV 1080p (11.1)" || true
steps:
- attach_workspace:
at: ~/react-native

- run: *build-objc-tvos-test-app

# Runs unit tests on tvOS devices
test_objc_tvos:
test_tvos:
<<: *macos_defaults
dependencies:
pre:
- xcrun instruments -w "Apple TV 1080p (11.1)" || true
steps:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "Apple TV 1080p (11.1)" || true
- run: brew install watchman
- run: *run-objc-tvos-tests

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

# Runs end to end tests
test_objc_ios_e2e:
test_ios_e2e:
<<: *macos_defaults
dependencies:
pre:
- xcrun instruments -w "iPhone 5s (11.1)" || true
steps:
- attach_workspace:
at: ~/react-native

- run: xcrun instruments -w "iPhone 5s (11.1)" || true
- run: *run-objc-ios-e2e-tests

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

# Checks podspec
test_podspec:
Expand Down Expand Up @@ -523,8 +483,6 @@ jobs:
- run: *collect-android-test-results
- store_test_results:
path: ~/react-native/reports/junit
- store_artifacts:
path: ~/react-native/reports/junit


# Analyze pull request and raise any lint/flow issues.
Expand Down Expand Up @@ -604,18 +562,18 @@ workflows:
requires:
- checkout_code

# Build iOS & tvOS test apps
- build_objc_ios_test_app:
# Test iOS & tvOS
- test_ios:
filters: *filter-ignore-gh-pages
requires:
- checkout_code
- build_objc_tvos_test_app:
- test_tvos:
filters: *filter-ignore-gh-pages
requires:
- checkout_code

# End-to-end tests
- test_objc_ios_e2e:
- test_ios_e2e:
filters: *filter-ignore-gh-pages
requires:
- checkout_code
Expand Down Expand Up @@ -657,15 +615,6 @@ workflows:

# # The following were DISABLED because they have not run since
# # the migration from Travis, and they have broken since then,
# # Test iOS & tvOS
# - test_objc_ios:
# filters: *filter-ignore-gh-pages
# requires:
# - checkout_code
# - test_objc_tvos:
# filters: *filter-ignore-gh-pages
# requires:
# - checkout_code
# # CocoaPods
# - test_podspec:
# filters: *filter-ignore-gh-pages
Expand Down
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"flowtype",
"prettier",
"react",
"react-native",
"jest"
],

Expand Down Expand Up @@ -252,6 +253,11 @@
"react/self-closing-comp": 1,
"react/wrap-multilines": 0,

// React-Native Plugin
// The following rules are made available via `eslint-plugin-react-native`

"react-native/no-inline-styles": 1,

// Jest Plugin
// The following rules are made available via `eslint-plugin-jest`.
"jest/no-disabled-tests": 1,
Expand Down
8 changes: 4 additions & 4 deletions Libraries/Animated/src/nodes/AnimatedTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const AnimatedWithChildren = require('./AnimatedWithChildren');
const NativeAnimatedHelper = require('../NativeAnimatedHelper');

class AnimatedTransform extends AnimatedWithChildren {
_transforms: Array<Object>;
_transforms: $ReadOnlyArray<Object>;

constructor(transforms: Array<Object>) {
constructor(transforms: $ReadOnlyArray<Object>) {
super();
this._transforms = transforms;
}
Expand All @@ -34,7 +34,7 @@ class AnimatedTransform extends AnimatedWithChildren {
});
}

__getValue(): Array<Object> {
__getValue(): $ReadOnlyArray<Object> {
return this._transforms.map(transform => {
const result = {};
for (const key in transform) {
Expand All @@ -49,7 +49,7 @@ class AnimatedTransform extends AnimatedWithChildren {
});
}

__getAnimatedValue(): Array<Object> {
__getAnimatedValue(): $ReadOnlyArray<Object> {
return this._transforms.map(transform => {
const result = {};
for (const key in transform) {
Expand Down
31 changes: 31 additions & 0 deletions Libraries/Blob/__tests__/File-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,39 @@ jest.setMock('NativeModules', {
BlobModule: require('../__mocks__/BlobModule'),
});

const Blob = require('Blob');
const File = require('File');

describe('babel 7 smoke test', function() {
it('should be able to extend a class with native name', function() {
let called = false;
class Array {
constructor() {
called = true;
return {foo: 'PASS'};
}
}
class A extends Array {
constructor() {
super();
}
}

// there is/was a regression in Babel where this would break and super()
// would not actually invoke the constructor of the parent class if the
// parent class had a name matching a built-in class (like Blob)
expect(new A().foo).toBe('PASS');
expect(called).toBe(true);
});
});

describe('Blob', function() {
it('regression caused by circular dep && babel 7', function() {
const blob = new Blob([], {type: 'image/jpeg'});
expect(blob).toBeInstanceOf(Blob);
});
});

describe('File', function() {
it('should create empty file', () => {
const file = new File([], 'test.jpg');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
*/
'use strict';

var NativeModules = require('NativeModules');
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
const NativeModules = require('NativeModules');
const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');

var RCTAccessibilityInfo = NativeModules.AccessibilityInfo;
const RCTAccessibilityInfo = NativeModules.AccessibilityInfo;

var TOUCH_EXPLORATION_EVENT = 'touchExplorationDidChange';
const TOUCH_EXPLORATION_EVENT = 'touchExplorationDidChange';

type ChangeEventName = $Enum<{
change: string,
}>;

var _subscriptions = new Map();
const _subscriptions = new Map();

/**
* Sometimes it's useful to know whether or not the device has a screen reader
Expand All @@ -32,7 +32,7 @@ var _subscriptions = new Map();
* See http://facebook.github.io/react-native/docs/accessibilityinfo.html
*/

var AccessibilityInfo = {
const AccessibilityInfo = {

fetch: function(): Promise {
return new Promise((resolve, reject) => {
Expand All @@ -48,7 +48,7 @@ var AccessibilityInfo = {
eventName: ChangeEventName,
handler: Function
): void {
var listener = RCTDeviceEventEmitter.addListener(
const listener = RCTDeviceEventEmitter.addListener(
TOUCH_EXPLORATION_EVENT,
(enabled) => {
handler(enabled);
Expand All @@ -61,7 +61,7 @@ var AccessibilityInfo = {
eventName: ChangeEventName,
handler: Function
): void {
var listener = _subscriptions.get(handler);
const listener = _subscriptions.get(handler);
if (!listener) {
return;
}
Expand Down
20 changes: 10 additions & 10 deletions Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
*/
'use strict';

var NativeModules = require('NativeModules');
var Promise = require('Promise');
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
const NativeModules = require('NativeModules');
const Promise = require('Promise');
const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');

var AccessibilityManager = NativeModules.AccessibilityManager;
const AccessibilityManager = NativeModules.AccessibilityManager;

var VOICE_OVER_EVENT = 'voiceOverDidChange';
var ANNOUNCEMENT_DID_FINISH_EVENT = 'announcementDidFinish';
const VOICE_OVER_EVENT = 'voiceOverDidChange';
const ANNOUNCEMENT_DID_FINISH_EVENT = 'announcementDidFinish';

type ChangeEventName = $Enum<{
change: string,
announcementFinished: string
}>;

var _subscriptions = new Map();
const _subscriptions = new Map();

/**
* Sometimes it's useful to know whether or not the device has a screen reader
Expand All @@ -34,7 +34,7 @@ var _subscriptions = new Map();
*
* See http://facebook.github.io/react-native/docs/accessibilityinfo.html
*/
var AccessibilityInfo = {
const AccessibilityInfo = {

/**
* Query whether a screen reader is currently enabled.
Expand Down Expand Up @@ -72,7 +72,7 @@ var AccessibilityInfo = {
eventName: ChangeEventName,
handler: Function
): Object {
var listener;
let listener;

if (eventName === 'change') {
listener = RCTDeviceEventEmitter.addListener(
Expand Down Expand Up @@ -127,7 +127,7 @@ var AccessibilityInfo = {
eventName: ChangeEventName,
handler: Function
): void {
var listener = _subscriptions.get(handler);
const listener = _subscriptions.get(handler);
if (!listener) {
return;
}
Expand Down
Loading