Remove `node_modules/react` from the list of discoverable haste modules

Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.

Reviewed By: astreet

Differential Revision: D3509863

fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
This commit is contained in:
David Aurelio 2016-07-05 06:34:00 -07:00 committed by Facebook Github Bot 7
parent 4ac4f86bf5
commit bd60d828c5
80 changed files with 195 additions and 171 deletions

View File

@ -17,7 +17,7 @@ var Transform = require('art/core/transform');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var createReactNativeComponentClass = require('react/lib/createReactNativeComponentClass');
var merge = require('merge');
// Diff Helpers

View File

@ -19,7 +19,7 @@ var SpringConfig = require('SpringConfig');
var ViewStylePropTypes = require('ViewStylePropTypes');
var NativeAnimatedHelper = require('NativeAnimatedHelper');
var findNodeHandle = require('findNodeHandle');
var findNodeHandle = require('react/lib/findNodeHandle');
var flattenStyle = require('flattenStyle');
var invariant = require('fbjs/lib/invariant');
var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame');

View File

@ -13,7 +13,7 @@
var BatchedBridge = require('BatchedBridge');
var BugReporting = require('BugReporting');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var invariant = require('fbjs/lib/invariant');
var renderApplication = require('renderApplication');

View File

@ -11,7 +11,7 @@
*/
'use strict';
const ReactNativeMount = require('ReactNativeMount');
const ReactNativeMount = require('react/lib/ReactNativeMount');
const getReactData = require('getReactData');
const INDENTATION_SIZE = 2;

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var RCTCameraRollManager = require('NativeModules').CameraRollManager;
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');

View File

@ -12,9 +12,9 @@
'use strict';
const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const Platform = require('Platform');
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');

View File

@ -11,8 +11,8 @@
'use strict';
var ActivityIndicator = require('ActivityIndicator');
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var View = require('View');

View File

@ -13,8 +13,8 @@
*/
'use strict';
const NativeMethodsMixin = require('NativeMethodsMixin');
const PropTypes = require('ReactPropTypes');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');

View File

@ -11,11 +11,11 @@
'use strict';
var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactPropTypes = require('ReactPropTypes');
var ReactNative = require('react/lib/ReactNative');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var StatusBar = require('StatusBar');
var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');

View File

@ -14,7 +14,7 @@
const Keyboard = require('Keyboard');
const LayoutAnimation = require('LayoutAnimation');
const Platform = require('Platform');
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const TimerMixin = require('react-timer-mixin');
const View = require('View');

View File

@ -14,7 +14,7 @@
const ColorPropType = require('ColorPropType');
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Image = require('Image');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');
@ -128,21 +128,21 @@ const MapView = React.createClass({
/**
* When this property is set to `true` and a valid camera is associated with
* the map, the cameras heading angle is used to rotate the plane of the
* the map, the camera's heading angle is used to rotate the plane of the
* map around its center point.
*
* When this property is set to `false`, the
* cameras heading angle is ignored and the map is always oriented so
* camera's heading angle is ignored and the map is always oriented so
* that true north is situated at the top of the map view
*/
rotateEnabled: React.PropTypes.bool,
/**
* When this property is set to `true` and a valid camera is associated
* with the map, the cameras pitch angle is used to tilt the plane
* with the map, the camera's pitch angle is used to tilt the plane
* of the map.
*
* When this property is set to `false`, the cameras pitch
* When this property is set to `false`, the camera's pitch
* angle is ignored and the map is always displayed as if the user
* is looking straight down onto it.
*/

View File

@ -16,7 +16,7 @@ var Image = require('Image');
var NavigationContext = require('NavigationContext');
var RCTNavigatorManager = require('NativeModules').NavigatorManager;
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var StaticContainer = require('StaticContainer.react');
var StyleSheet = require('StyleSheet');
var View = require('View');

View File

@ -14,8 +14,8 @@
var ColorPropType = require('ColorPropType');
var React = require('React');
var ReactChildren = require('ReactChildren');
var ReactPropTypes = require('ReactPropTypes');
var ReactChildren = require('react/lib/ReactChildren');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var View = require('View');

View File

@ -12,9 +12,9 @@
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var ReactChildren = require('ReactChildren');
var ReactChildren = require('react/lib/ReactChildren');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var TextStylePropTypes = require('TextStylePropTypes');

View File

@ -10,9 +10,9 @@
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var View = require('View');
var ColorPropType = require('ColorPropType');

View File

@ -12,8 +12,8 @@
'use strict';
var Image = require('Image');
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');

View File

@ -12,7 +12,7 @@
'use strict';
const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const View = require('View');

View File

@ -14,7 +14,7 @@
var Dimensions = require('Dimensions');
var Platform = require('Platform');
var Keyboard = require('Keyboard');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var Subscribable = require('Subscribable');
var TextInputState = require('TextInputState');
var UIManager = require('UIManager');

View File

@ -16,7 +16,7 @@ const EdgeInsetsPropType = require('EdgeInsetsPropType');
const Platform = require('Platform');
const PointPropType = require('PointPropType');
const React = require('React');
const ReactNative = require('ReactNative');
const ReactNative = require('react/lib/ReactNative');
const ScrollResponder = require('ScrollResponder');
const StyleSheet = require('StyleSheet');
const StyleSheetPropType = require('StyleSheetPropType');

View File

@ -11,8 +11,8 @@
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');

View File

@ -12,9 +12,9 @@
'use strict';
var Image = require('Image');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var Platform = require('Platform');
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
@ -159,7 +159,7 @@ var Slider = React.createClass({
onSlidingComplete && onSlidingComplete(event.nativeEvent.value);
});
return <RCTSlider
return <RCTSlider
{...props}
enabled={!this.props.disabled}
onStartShouldSetResponder={() => true}

View File

@ -12,8 +12,8 @@
'use strict';
var Image = require('Image');
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
@ -130,7 +130,7 @@ var SliderIOS = React.createClass({
'SliderIOS is deprecated and will be removed in ' +
'future versions of React Native. Use the cross-platform Slider ' +
'as a drop-in replacement.');
let {style, onValueChange, onSlidingComplete, ...props} = this.props;
props.style = [styles.slider, style];

View File

@ -1,27 +1,19 @@
/**
* @generated SignedSource<<2a163cdb088fb963f941e627fd89ce11>>
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! This file is a check-in of a static_upstream project! !!
* !! !!
* !! You should not modify this file directly. Instead: !!
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
* !! the latest version from upstream. !!
* !! 2) Make your changes, test them, etc. !!
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
* !! static_upstream. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* Copyright 2004-present Facebook. 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.
*
* @providesModule StaticContainer.react
* @typechecks
* @flow
*/
'use strict';
var React = require('React');
var onlyChild = require('onlyChild');
var onlyChild = require('react/lib/onlyChild');
/**
* Renders static content efficiently by allowing React to short-circuit the

View File

@ -12,7 +12,7 @@
'use strict';
var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var StyleSheet = require('StyleSheet');

View File

@ -10,8 +10,8 @@
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var View = require('View');

View File

@ -14,8 +14,8 @@
'use strict';
var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var PropTypes = require('ReactPropTypes');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');

View File

@ -14,12 +14,12 @@
const ColorPropType = require('ColorPropType');
const DocumentSelectionState = require('DocumentSelectionState');
const EventEmitter = require('EventEmitter');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const Platform = require('Platform');
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const ReactNative = require('ReactNative');
const ReactChildren = require('ReactChildren');
const ReactNative = require('react/lib/ReactNative');
const ReactChildren = require('react/lib/ReactChildren');
const StyleSheet = require('StyleSheet');
const Text = require('Text');
const TextInputState = require('TextInputState');

View File

@ -12,10 +12,10 @@
'use strict';
var Image = require('Image');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var UIManager = require('UIManager');
var View = require('View');
var ColorPropType = require('ColorPropType');

View File

@ -1,10 +1,17 @@
/**
* Copyright (c) 2015-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.
*
* @providesModule BoundingDimensions
*/
'use strict';
var PooledClass = require('PooledClass');
var PooledClass = require('react/lib/PooledClass');
var twoArgumentPooler = PooledClass.twoArgumentPooler;
@ -39,4 +46,3 @@ BoundingDimensions.getPooledFromElement = function(element) {
PooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler);
module.exports = BoundingDimensions;

View File

@ -1,10 +1,17 @@
/**
* Copyright (c) 2015-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.
*
* @providesModule Position
*/
'use strict';
var PooledClass = require('PooledClass');
var PooledClass = require('react/lib/PooledClass');
var twoArgumentPooler = PooledClass.twoArgumentPooler;

View File

@ -13,7 +13,7 @@
var Animated = require('Animated');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var Touchable = require('Touchable');

View File

@ -14,7 +14,7 @@
// Note (avik): add @flow when Flow supports spread properties in propTypes
var ColorPropType = require('ColorPropType');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
@ -27,7 +27,7 @@ var ensureComponentIsNative = require('ensureComponentIsNative');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var keyOf = require('fbjs/lib/keyOf');
var merge = require('merge');
var onlyChild = require('onlyChild');
var onlyChild = require('react/lib/onlyChild');
type Event = Object;

View File

@ -10,15 +10,15 @@
*/
'use strict';
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var UIManager = require('UIManager');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var onlyChild = require('onlyChild');
var onlyChild = require('react/lib/onlyChild');
var processColor = require('processColor');
var requireNativeComponent = require('requireNativeComponent');

View File

@ -14,7 +14,7 @@
// Note (avik): add @flow when Flow supports spread properties in propTypes
var Animated = require('Animated');
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var React = require('React');
var TimerMixin = require('react-timer-mixin');
var Touchable = require('Touchable');

View File

@ -1,4 +1,3 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
@ -19,7 +18,7 @@ const Touchable = require('Touchable');
const View = require('View');
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
const onlyChild = require('onlyChild');
const onlyChild = require('react/lib/onlyChild');
const warning = require('fbjs/lib/warning');
type Event = Object;

View File

@ -15,7 +15,7 @@ jest.mock('NativeModules')
.mock('View');
const React = require('React');
const ReactTestRenderer = require('ReactTestRenderer');
const ReactTestRenderer = require('react/lib/ReactTestRenderer');
const Text = require('Text');
const TouchableHighlight = require('TouchableHighlight');

View File

@ -12,7 +12,7 @@
'use strict';
var ColorPropType = require('ColorPropType');
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var ShadowPropTypesIOS = {
/**

View File

@ -12,8 +12,8 @@
'use strict';
const EdgeInsetsPropType = require('EdgeInsetsPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const PropTypes = require('ReactPropTypes');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
@ -390,10 +390,10 @@ const View = React.createClass({
* in CSS:
* ```
* .box-none {
* pointer-events: none;
* pointer-events: none;
* }
* .box-none * {
* pointer-events: all;
* pointer-events: all;
* }
* ```
* - `'box-only'`: The view can be the target of touch events but it's
@ -401,10 +401,10 @@ const View = React.createClass({
* in CSS:
* ```
* .box-only {
* pointer-events: all;
* pointer-events: all;
* }
* .box-only * {
* pointer-events: none;
* pointer-events: none;
* }
* ```
* > Since `pointerEvents` does not affect layout/appearance, and we are

View File

@ -12,7 +12,7 @@
'use strict';
var LayoutPropTypes = require('LayoutPropTypes');
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var ColorPropType = require('ColorPropType');
var ShadowPropTypesIOS = require('ShadowPropTypesIOS');
var TransformPropTypes = require('TransformPropTypes');

View File

@ -12,9 +12,9 @@
'use strict';
var React = require('React');
var ReactNative = require('ReactNative');
var ReactElement = require('ReactElement');
var ReactPropTypes = require('ReactPropTypes');
var ReactNative = require('react/lib/ReactNative');
var ReactElement = require('react/lib/ReactElement');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var UIManager = require('UIManager');
var View = require('View');

View File

@ -13,7 +13,7 @@
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var ActivityIndicator = require('ActivityIndicator');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');

View File

@ -14,7 +14,7 @@
var ActivityIndicator = require('ActivityIndicator');
var EdgeInsetsPropType = require('EdgeInsetsPropType');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var StyleSheet = require('StyleSheet');
var Text = require('Text');
var UIManager = require('UIManager');

View File

@ -34,7 +34,7 @@
var ListViewDataSource = require('ListViewDataSource');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var RCTScrollViewManager = require('NativeModules').ScrollViewManager;
var ScrollView = require('ScrollView');
var ScrollResponder = require('ScrollResponder');

View File

@ -40,7 +40,7 @@ const NavigationPagerStyleInterpolator = require('NavigationPagerStyleInterpolat
const NavigationPointerEventsContainer = require('NavigationPointerEventsContainer');
const NavigationPropTypes = require('NavigationPropTypes');
const React = require('React');
const ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin');
const ReactComponentWithPureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin');
const StyleSheet = require('StyleSheet');
const View = require('View');

View File

@ -38,7 +38,7 @@ const NavigationCardStackStyleInterpolator = require('NavigationCardStackStyleIn
const NavigationCardStackPanResponder = require('NavigationCardStackPanResponder');
const NavigationPropTypes = require('NavigationPropTypes');
const React = require('React');
const ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin');
const ReactComponentWithPureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin');
const StyleSheet = require('StyleSheet');
const View = require('View');

View File

@ -38,7 +38,7 @@ const NavigationHeaderTitle = require('NavigationHeaderTitle');
const NavigationHeaderBackButton = require('NavigationHeaderBackButton');
const NavigationPropTypes = require('NavigationPropTypes');
const NavigationHeaderStyleInterpolator = require('NavigationHeaderStyleInterpolator');
const ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin');
const ReactComponentWithPureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin');
const {
Animated,

View File

@ -65,7 +65,7 @@ function setupDevtools() {
return;
}
// This is breaking encapsulation of the React package. Move plz.
var ReactNativeComponentTree = require('ReactNativeComponentTree');
var ReactNativeComponentTree = require('react/lib/ReactNativeComponentTree');
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
ComponentTree: {
getClosestInstanceFromNode: function (node) {
@ -83,8 +83,8 @@ function setupDevtools() {
}
}
},
Mount: require('ReactNativeMount'),
Reconciler: require('ReactReconciler')
Mount: require('react/lib/ReactNativeMount'),
Reconciler: require('react/lib/ReactReconciler')
});
ws.onmessage = handleMessage;
}

View File

@ -11,12 +11,12 @@
*/
'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
var NativeModules = require('NativeModules');
var ImageResizeMode = require('ImageResizeMode');
var ImageStylePropTypes = require('ImageStylePropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet');

View File

@ -15,9 +15,9 @@ const EdgeInsetsPropType = require('EdgeInsetsPropType');
const ImageResizeMode = require('ImageResizeMode');
const ImageSourcePropType = require('ImageSourcePropType');
const ImageStylePropTypes = require('ImageStylePropTypes');
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const NativeModules = require('NativeModules');
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
const StyleSheet = require('StyleSheet');

View File

@ -11,7 +11,7 @@
*/
'use strict';
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const ImageSourcePropType = PropTypes.oneOfType([
PropTypes.shape({
@ -24,12 +24,12 @@ const ImageSourcePropType = PropTypes.oneOfType([
uri: PropTypes.string,
/**
* `method` is the HTTP Method to use. Defaults to GET if not specified.
*/
*/
method: PropTypes.string,
/**
* `headers` is an object representing the HTTP headers to send along with the
* request for a remote image.
*/
*/
headers: PropTypes.objectOf(PropTypes.string),
/**
* `body` is the HTTP body to send with the request. This must be a valid

View File

@ -13,7 +13,7 @@
var ImageResizeMode = require('ImageResizeMode');
var LayoutPropTypes = require('LayoutPropTypes');
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var ColorPropType = require('ColorPropType');
var ShadowPropTypesIOS = require('ShadowPropTypesIOS');
var TransformPropTypes = require('TransformPropTypes');

View File

@ -12,7 +12,7 @@
'use strict';
var BoxInspector = require('BoxInspector');
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var React = require('React');
var StyleInspector = require('StyleInspector');
var StyleSheet = require('StyleSheet');

View File

@ -10,7 +10,7 @@
*/
'use strict';
var ReactNativeComponentTree = require('ReactNativeComponentTree');
var ReactNativeComponentTree = require('react/lib/ReactNativeComponentTree');
function traverseOwnerTreeUp(hierarchy, instance) {
if (instance) {

View File

@ -12,7 +12,7 @@
'use strict';
const InteractionManager = require('./InteractionManager');
const TouchHistoryMath = require('TouchHistoryMath');
const TouchHistoryMath = require('react/lib/TouchHistoryMath');
const currentCentroidXOfTouchesChangedAfter = TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;
const currentCentroidYOfTouchesChangedAfter = TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;

View File

@ -11,7 +11,7 @@
*/
'use strict';
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var UIManager = require('UIManager');
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');

View File

@ -12,7 +12,7 @@
'use strict';
const Platform = require('Platform');
const PropTypes = require('ReactPropTypes');
const PropTypes = require('react/lib/ReactPropTypes');
const React = require('React');
const StyleSheet = require('StyleSheet');
const UIManager = require('UIManager');
@ -31,18 +31,18 @@ const RCTModalHostView = requireNativeComponent('RCTModalHostView', null);
* ```javascript
* import React, { Component } from 'react';
* import { Modal, Text, TouchableHighlight, View } from 'react-native';
*
*
* class ModalExample extends Component {
*
*
* constructor(props) {
* super(props);
* this.state = {modalVisible: false};
* }
*
*
* setModalVisible(visible) {
* this.setState({modalVisible: visible});
* }
*
*
* render() {
* return (
* <View style={{marginTop: 22}}>
@ -55,23 +55,23 @@ const RCTModalHostView = requireNativeComponent('RCTModalHostView', null);
* <View style={{marginTop: 22}}>
* <View>
* <Text>Hello World!</Text>
*
*
* <TouchableHighlight onPress={() => {
* this.setModalVisible(!this.state.modalVisible)
* }}>
* <Text>Hide Modal</Text>
* </TouchableHighlight>
*
*
* </View>
* </View>
* </Modal>
*
*
* <TouchableHighlight onPress={() => {
* this.setModalVisible(true)
* }}>
* <Text>Show Modal</Text>
* </TouchableHighlight>
*
*
* </View>
* );
* }
@ -98,7 +98,7 @@ class Modal extends React.Component {
visible: PropTypes.bool,
/**
* The `onRequestClose` prop allows passing a function that will be called once the modal has been dismissed.
*
*
* _On the Android platform, this is a required function._
*/
onRequestClose: Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func,

View File

@ -14,7 +14,7 @@
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var Subscribable = require('Subscribable');
var StyleSheet = require('StyleSheet');
var View = require('View');

View File

@ -14,7 +14,7 @@
var AppContainer = require('AppContainer');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var invariant = require('fbjs/lib/invariant');

View File

@ -15,7 +15,7 @@ var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
var UIManager = require('UIManager');
var UnimplementedView = require('UnimplementedView');
var createReactNativeComponentClass = require('createReactNativeComponentClass');
var createReactNativeComponentClass = require('react/lib/createReactNativeComponentClass');
var insetsDiffer = require('insetsDiffer');
var pointsDiffer = require('pointsDiffer');

View File

@ -1,17 +1,16 @@
/**
* Copyright (c) 2015-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.
*
* @providesModule ColorPropType
*/
/**
* Copyright (c) 2015-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.
*
* @providesModule ColorPropType
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypeLocationNames = require('ReactPropTypeLocationNames');
var ReactPropTypeLocationNames = require('react/lib/ReactPropTypeLocationNames');
var normalizeColor = require('normalizeColor');

View File

@ -11,7 +11,7 @@
*/
'use strict';
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
/**
* React Native's layout system is based on Flexbox and is powered both

View File

@ -11,7 +11,7 @@
*/
'use strict';
var PropTypes = require('ReactPropTypes');
var PropTypes = require('react/lib/ReactPropTypes');
var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');

View File

@ -12,7 +12,7 @@
'use strict';
var PixelRatio = require('PixelRatio');
var ReactNativePropRegistry = require('ReactNativePropRegistry');
var ReactNativePropRegistry = require('react/lib/ReactNativePropRegistry');
var StyleSheetValidation = require('StyleSheetValidation');
var flatten = require('flattenStyle');

View File

@ -12,7 +12,7 @@
'use strict';
var ImageStylePropTypes = require('ImageStylePropTypes');
var ReactPropTypeLocations = require('ReactPropTypeLocations');
var ReactPropTypeLocations = require('react/lib/ReactPropTypeLocations');
var TextStylePropTypes = require('TextStylePropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var deprecatedPropType = require('deprecatedPropType');
var ArrayOfNumberPropType = ReactPropTypes.arrayOf(ReactPropTypes.number);

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactNativePropRegistry = require('ReactNativePropRegistry');
var ReactNativePropRegistry = require('react/lib/ReactNativePropRegistry');
var invariant = require('fbjs/lib/invariant');
import type { StyleObj } from 'StyleSheetTypes';

View File

@ -11,7 +11,7 @@
*/
'use strict';
const NativeMethodsMixin = require('NativeMethodsMixin');
const NativeMethodsMixin = require('react/lib/NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const ReactNativeViewAttributes = require('ReactNativeViewAttributes');
@ -20,7 +20,7 @@ const TextStylePropTypes = require('TextStylePropTypes');
const Touchable = require('Touchable');
const createReactNativeComponentClass =
require('createReactNativeComponentClass');
require('react/lib/createReactNativeComponentClass');
const merge = require('merge');
const stylePropType = StyleSheetPropType(TextStylePropTypes);

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactPropTypes = require('ReactPropTypes');
var ReactPropTypes = require('react/lib/ReactPropTypes');
var ColorPropType = require('ColorPropType');
var ViewStylePropTypes = require('ViewStylePropTypes');

View File

@ -11,8 +11,8 @@
*/
'use strict';
var ReactPerf = require('ReactPerf');
var ReactDebugTool = require('ReactDebugTool');
var ReactPerf = require('react/lib/ReactPerf');
var ReactDebugTool = require('react/lib/ReactDebugTool');
var invariant = require('fbjs/lib/invariant');
var performanceNow = require('fbjs/lib/performanceNow');

View File

@ -32,14 +32,14 @@ let _asyncCookie = 0;
const ReactSystraceDevtool = __DEV__ ? {
onBeginReconcilerTimer(debugID, timerType) {
const displayName = require('ReactComponentTreeDevtool').getDisplayName(debugID);
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
Systrace.beginEvent(`ReactReconciler.${timerType}(${displayName})`);
},
onEndReconcilerTimer(debugID, timerType) {
Systrace.endEvent();
},
onBeginLifeCycleTimer(debugID, timerType) {
const displayName = require('ReactComponentTreeDevtool').getDisplayName(debugID);
const displayName = require('react/lib/ReactComponentTreeDevtool').getDisplayName(debugID);
Systrace.beginEvent(`${displayName}.${timerType}()`);
},
onEndLifeCycleTimer(debugID, timerType) {
@ -53,10 +53,10 @@ const Systrace = {
if (__DEV__) {
if (enabled) {
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);
require('ReactDebugTool').addDevtool(ReactSystraceDevtool);
require('react/lib/ReactDebugTool').addDevtool(ReactSystraceDevtool);
} else {
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);
require('ReactDebugTool').removeDevtool(ReactSystraceDevtool);
require('react/lib/ReactDebugTool').removeDevtool(ReactSystraceDevtool);
}
}
_enabled = enabled;

View File

@ -15,7 +15,7 @@ const Platform = require('Platform');
const NativeModules = require('NativeModules');
const { UIManager } = NativeModules;
const findNodeHandle = require('findNodeHandle');
const findNodeHandle = require('react/lib/findNodeHandle');
const _takeSnapshot = UIManager.takeSnapshot;

View File

@ -11,7 +11,7 @@
*/
'use strict';
var ReactPropTypeLocationNames = require('ReactPropTypeLocationNames');
var ReactPropTypeLocationNames = require('react/lib/ReactPropTypeLocationNames');
var invariant = require('fbjs/lib/invariant');
var merge = require('merge');

12
Libraries/react-native/React.js vendored Normal file
View File

@ -0,0 +1,12 @@
/**
* Copyright (c) 2016-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.
*
* @providesModule React
*/
'use strict';
module.exports = require('react/lib/React');

13
Libraries/react-native/ReactNative.js vendored Normal file
View File

@ -0,0 +1,13 @@
/**
* Copyright (c) 2016-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
*/
'use strict';
module.exports = require('react/lib/ReactNative');

View File

@ -13,8 +13,8 @@
const warning = require('fbjs/lib/warning');
if (__DEV__) {
const warningDedupe = {};
const addonWarn = function(prevName, newPackageName) {
var warningDedupe = {};
var addonWarn = function(prevName, newPackageName) {
warning(
warningDedupe[prevName],
'React.addons.' + prevName + ' is deprecated. Please import the "' +
@ -127,14 +127,14 @@ const ReactNative = {
if (__DEV__) {
addonWarn('LinkedStateMixin', 'react-addons-linked-state-mixin');
}
return require('LinkedStateMixin');
return require('react/lib/LinkedStateMixin');
},
Perf: undefined,
get PureRenderMixin() {
if (__DEV__) {
addonWarn('PureRenderMixin', 'react-addons-pure-render-mixin');
}
return require('ReactComponentWithPureRenderMixin');
return require('react/lib/ReactComponentWithPureRenderMixin');
},
get TestModule() {
if (__DEV__) {
@ -157,19 +157,19 @@ const ReactNative = {
);
warningDedupe.batchedUpdates = true;
}
return require('ReactUpdates').batchedUpdates;
return require('react/lib/ReactUpdates').batchedUpdates;
},
get createFragment() {
if (__DEV__) {
addonWarn('createFragment', 'react-addons-create-fragment');
}
return require('ReactFragment').create;
return require('react/lib/ReactFragment').create;
},
get update() {
if (__DEV__) {
addonWarn('update', 'react-addons-update');
}
return require('update');
return require('react/lib/update');
},
},
};
@ -190,7 +190,7 @@ if (__DEV__) {
// Preserve getters with warnings on the internal ReactNative copy without
// invoking them.
const ReactNativeInternal = require('ReactNative');
const ReactNativeInternal = require('react/lib/ReactNative');
function applyForwarding(key) {
if (__DEV__) {
Object.defineProperty(
@ -213,7 +213,7 @@ if (__DEV__) {
if (__DEV__) {
addonWarn('Perf', 'react-addons-perf');
}
return require('ReactPerf');
return require('react/lib/ReactPerf');
}
});
Object.defineProperty(ReactNative.addons, 'TestUtils', {
@ -222,7 +222,7 @@ if (__DEV__) {
if (__DEV__) {
addonWarn('update', 'react-addons-test-utils');
}
return require('ReactTestUtils');
return require('react/lib/ReactTestUtils');
}
});
}

View File

@ -22,7 +22,7 @@
// Our ReactNative.js has had its types stripped, so here we
// need to enumerate and type the properties we need access to.
//
var ReactNativeInternal = (require('ReactNative'): {
var ReactNativeInternal = (require('react/lib/ReactNative'): {
// render
render: (
element: ReactElement<any>,

View File

@ -13,7 +13,7 @@
var BatchedBridge = require('BatchedBridge');
var React = require('React');
var ReactNative = require('ReactNative');
var ReactNative = require('react/lib/ReactNative');
var View = require('View');
var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');

View File

@ -24,11 +24,8 @@
"haste": {
"defaultPlatform": "ios",
"providesModuleNodeModules": [
"fbjs",
"react",
"react-native",
"parse",
"react-transform-hmr"
"parse"
],
"platforms": [
"ios",

View File

@ -93,7 +93,6 @@ class Resolver {
(opts.blacklistRE && opts.blacklistRE.test(filepath));
},
providesModuleNodeModules: [
'react',
'react-native',
'react-native-windows',
// Parse requires AsyncStorage. They will