Skip to content

Commit

Permalink
RN: Update React (2/2)
Browse files Browse the repository at this point in the history
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
  • Loading branch information
davidaurelio authored and Facebook Github Bot committed Nov 4, 2016
1 parent b76ab8e commit 3683beb
Show file tree
Hide file tree
Showing 147 changed files with 13,563 additions and 56 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

# Ignore unexpected extra @providesModule
.*/node_modules/commoner/test/source/widget/share.js
.*/node_modules/.*/node_modules/fbjs/.*

# Ignore duplicate module providers
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
Expand Down
4 changes: 3 additions & 1 deletion IntegrationTests/AppEventsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class AppEventsTest extends React.Component {
throw new Error('Received wrong event: ' + JSON.stringify(event));
}
var elapsed = (Date.now() - event.ts) + 'ms';
this.setState({received: event, elapsed}, TestModule.markTestCompleted);
this.setState({received: event, elapsed}, () => {
TestModule.markTestCompleted();
});
};

render() {
Expand Down
4 changes: 3 additions & 1 deletion IntegrationTests/AsyncStorageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ class AsyncStorageTest extends React.Component {
};

componentDidMount() {
done = () => this.setState({done: true}, TestModule.markTestCompleted);
done = () => this.setState({done: true}, () => {
TestModule.markTestCompleted();
});
updateMessage = (msg) => {
this.setState({messages: this.state.messages.concat('\n' + msg)});
DEBUG && console.log(msg);
Expand Down
4 changes: 3 additions & 1 deletion IntegrationTests/IntegrationTestHarnessTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class IntegrationTestHarnessTest extends React.Component {
} else if (!TestModule.markTestCompleted) {
throw new Error('RCTTestModule.markTestCompleted not defined.');
}
this.setState({done: true}, TestModule.markTestCompleted);
this.setState({done: true}, () => {
TestModule.markTestCompleted();
});
};

render() {
Expand Down
4 changes: 3 additions & 1 deletion IntegrationTests/TimersTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ var TimersTest = React.createClass({
},

done() {
this.setState({done: true}, TestModule.markTestCompleted);
this.setState({done: true}, () => {
TestModule.markTestCompleted();
});
},

render() {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ART/ReactNativeART.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var Transform = require('art/core/transform');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');

var createReactNativeComponentClass = require('react/lib/createReactNativeComponentClass');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var merge = require('merge');

// Diff Helpers
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Animated/src/AnimatedImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var Set = require('Set');
var SpringConfig = require('SpringConfig');
var ViewStylePropTypes = require('ViewStylePropTypes');

var findNodeHandle = require('react/lib/findNodeHandle');
var findNodeHandle = require('findNodeHandle');
var flattenStyle = require('flattenStyle');
var invariant = require('fbjs/lib/invariant');
var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/BugReporting/dumpReactTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

const ReactNativeMount = require('react/lib/ReactNativeMount');
const ReactNativeMount = require('ReactNativeMount');
const getReactData = require('getReactData');

const INDENTATION_SIZE = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/DatePicker/DatePickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
'use strict';

const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var ReactNative = require('ReactNative');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/MapView/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const ColorPropType = require('ColorPropType');
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Image = require('Image');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Picker/PickerIOS.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
'use strict';

var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
'use strict';

var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var View = require('View');
var ColorPropType = require('ColorPropType');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

var Image = require('Image');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/RefreshControl/RefreshControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const View = require('View');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

var Image = require('Image');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var Platform = require('Platform');
var React = require('React');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var StyleSheet = require('StyleSheet');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
const ColorPropType = require('ColorPropType');
const DocumentSelectionState = require('DocumentSelectionState');
const EventEmitter = require('EventEmitter');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const ReactNative = require('ReactNative');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

var Image = require('Image');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var UIManager = require('UIManager');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableBounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

var Animated = require('Animated');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var Touchable = require('Touchable');

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Note (avik): add @flow when Flow supports spread properties in propTypes

var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Note (avik): add @flow when Flow supports spread properties in propTypes

var Animated = require('Animated');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
jest.disableAutomock();

const React = require('React');
const ReactTestRenderer = require('react/lib/ReactTestRenderer');
const ReactTestRenderer = require('react-test-renderer');
const Text = require('Text');
const TouchableHighlight = require('TouchableHighlight');

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/View/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

const EdgeInsetsPropType = require('EdgeInsetsPropType');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeModules = require('NativeModules');
const React = require('React');
const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Core/Devtools/setupDevtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function setupDevtools() {
return;
}
// This is breaking encapsulation of the React package. Move plz.
var ReactNativeComponentTree = require('react/lib/ReactNativeComponentTree');
var ReactNativeComponentTree = require('ReactNativeComponentTree');
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
ComponentTree: {
getClosestInstanceFromNode: function (node) {
Expand All @@ -90,8 +90,8 @@ function setupDevtools() {
}
}
},
Mount: require('react/lib/ReactNativeMount'),
Reconciler: require('react/lib/ReactReconciler')
Mount: require('ReactNativeMount'),
Reconciler: require('ReactReconciler')
});
ws.onmessage = handleMessage;
}
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/Image.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
'use strict';

var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModules = require('NativeModules');
var ImageResizeMode = require('ImageResizeMode');
var ImageStylePropTypes = require('ImageStylePropTypes');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/Image.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const EdgeInsetsPropType = require('EdgeInsetsPropType');
const ImageResizeMode = require('ImageResizeMode');
const ImageSourcePropType = require('ImageSourcePropType');
const ImageStylePropTypes = require('ImageStylePropTypes');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeModules = require('NativeModules');
const React = require('React');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Inspector/InspectorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
'use strict';

var ReactNativeComponentTree = require('react/lib/ReactNativeComponentTree');
var ReactNativeComponentTree = require('ReactNativeComponentTree');

function traverseOwnerTreeUp(hierarchy, instance) {
if (instance) {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Interaction/PanResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';

const InteractionManager = require('./InteractionManager');
const TouchHistoryMath = require('react/lib/TouchHistoryMath');
const TouchHistoryMath = require('TouchHistoryMath');

const currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;
const currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Performance/RCTRenderingPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/
'use strict';

var ReactDebugTool = require('react/lib/ReactDebugTool');
var ReactPerf = require('react/lib/ReactPerf');
var ReactDebugTool = require('ReactDebugTool');
var ReactPerf = require('ReactPerf');

var invariant = require('fbjs/lib/invariant');
var performanceNow = require('fbjs/lib/performanceNow');
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Performance/Systrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ const Systrace = {
if (__DEV__) {
if (enabled) {
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);
require('react/lib/ReactDebugTool').addDevtool(ReactSystraceDevtool);
require('ReactDebugTool').addDevtool(ReactSystraceDevtool);
} else {
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);
require('react/lib/ReactDebugTool').removeDevtool(ReactSystraceDevtool);
require('ReactDebugTool').removeDevtool(ReactSystraceDevtool);
}
}
_enabled = enabled;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactNative/UIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NativeModules = require('NativeModules');
const Platform = require('Platform');

const defineLazyObjectProperty = require('defineLazyObjectProperty');
const findNodeHandle = require('react/lib/findNodeHandle');
const findNodeHandle = require('findNodeHandle');
const invariant = require('fbjs/lib/invariant');

import type React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion Libraries/ReactNative/requireNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
const UIManager = require('UIManager');
const UnimplementedView = require('UnimplementedView');

const createReactNativeComponentClass = require('react/lib/createReactNativeComponentClass');
const createReactNativeComponentClass = require('createReactNativeComponentClass');
const insetsDiffer = require('insetsDiffer');
const matricesDiffer = require('matricesDiffer');
const pointsDiffer = require('pointsDiffer');
Expand Down
5 changes: 5 additions & 0 deletions Libraries/Renderer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# React Native Renderer

This is a downstream copy of React's renderer code to render into React Native.
The source of truth is the React repo. Please submit any changes upstream to
the [React Core GitHub repository](https://github.com/facebook/react).
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/**
* Copyright (c) 2016-present, Facebook, Inc.
* Copyright 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
* @providesModule ReactNative
* @providesModule ReactVersion
*/
'use strict';
module.exports = require('react/lib/ReactNative');

'use strict';

module.exports = '16.0.0-alpha';
Loading

0 comments on commit 3683beb

Please sign in to comment.