diff --git a/.flowconfig b/.flowconfig index db960b5f1b41ab..3d5e14681dcdd7 100644 --- a/.flowconfig +++ b/.flowconfig @@ -15,11 +15,8 @@ # Ignore react and fbjs where there are overlaps, but don't ignore # anything that react-native relies on .*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/Promise.js .*/node_modules/fbjs/lib/fetch.js .*/node_modules/fbjs/lib/ExecutionEnvironment.js -.*/node_modules/fbjs/lib/isEmpty.js -.*/node_modules/fbjs/lib/crc32.js .*/node_modules/fbjs/lib/ErrorUtils.js # Flow has a built-in definition for the 'react' module which we prefer to use @@ -28,6 +25,11 @@ .*/node_modules/react/lib/React.js .*/node_modules/react/lib/ReactDOM.js +.*/__mocks__/.* +.*/__tests__/.* + +.*/commoner/test/source/widget/share.js + # Ignore commoner tests .*/node_modules/commoner/test/.* diff --git a/Examples/Movies/SearchScreen.js b/Examples/Movies/SearchScreen.js index ad1f9b72bfdd64..2e681ed34f50b5 100644 --- a/Examples/Movies/SearchScreen.js +++ b/Examples/Movies/SearchScreen.js @@ -27,7 +27,7 @@ var { } = React; var TimerMixin = require('react-timer-mixin'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var dismissKeyboard = require('dismissKeyboard'); var MovieCell = require('./MovieCell'); diff --git a/Examples/UIExplorer/createExamplePage.js b/Examples/UIExplorer/createExamplePage.js index 20d62badf73b64..3d722029516c6c 100644 --- a/Examples/UIExplorer/createExamplePage.js +++ b/Examples/UIExplorer/createExamplePage.js @@ -24,7 +24,7 @@ var ReactNative = require('ReactNative'); var UIExplorerBlock = require('./UIExplorerBlock'); var UIExplorerPage = require('./UIExplorerPage'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); import type { Example, ExampleModule } from 'ExampleTypes'; diff --git a/IntegrationTests/IntegrationTestHarnessTest.js b/IntegrationTests/IntegrationTestHarnessTest.js index 27ef7428dc4b8c..bfc9c5d88bae08 100644 --- a/IntegrationTests/IntegrationTestHarnessTest.js +++ b/IntegrationTests/IntegrationTestHarnessTest.js @@ -10,7 +10,7 @@ */ 'use strict'; -var requestAnimationFrame = require('requestAnimationFrame'); +var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); var React = require('react-native'); var { Text, diff --git a/IntegrationTests/LoggingTestModule.js b/IntegrationTests/LoggingTestModule.js index 5d3073a377159a..cb801a0af088e2 100644 --- a/IntegrationTests/LoggingTestModule.js +++ b/IntegrationTests/LoggingTestModule.js @@ -12,8 +12,8 @@ var BatchedBridge = require('BatchedBridge'); -var warning = require('warning'); -var invariant = require('invariant'); +var warning = require('fbjs/lib/warning'); +var invariant = require('fbjs/lib/invariant'); var LoggingTestModule = { logToConsole: function(str) { diff --git a/IntegrationTests/SimpleSnapshotTest.js b/IntegrationTests/SimpleSnapshotTest.js index 2f0e93358a572e..181077acd17585 100644 --- a/IntegrationTests/SimpleSnapshotTest.js +++ b/IntegrationTests/SimpleSnapshotTest.js @@ -11,7 +11,7 @@ 'use strict'; var React = require('react-native'); -var requestAnimationFrame = require('requestAnimationFrame'); +var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); var { StyleSheet, diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 9570d2b8c3f514..a6f5dc2342af8a 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -13,7 +13,7 @@ var RCTActionSheetManager = require('NativeModules').ActionSheetManager; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var processColor = require('processColor'); var ActionSheetIOS = { diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index 4c7a85a4d0fdde..8cfacf29860bca 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -20,8 +20,8 @@ var SpringConfig = require('SpringConfig'); var ViewStylePropTypes = require('ViewStylePropTypes'); var flattenStyle = require('flattenStyle'); -var invariant = require('invariant'); -var requestAnimationFrame = require('requestAnimationFrame'); +var invariant = require('fbjs/lib/invariant'); +var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); import type { InterpolationConfigType } from 'Interpolation'; diff --git a/Libraries/AppRegistry/AppRegistry.js b/Libraries/AppRegistry/AppRegistry.js index 57bafd2da85ad4..6077d866308515 100644 --- a/Libraries/AppRegistry/AppRegistry.js +++ b/Libraries/AppRegistry/AppRegistry.js @@ -14,7 +14,7 @@ var BatchedBridge = require('BatchedBridge'); var ReactNative = require('ReactNative'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var renderApplication = require('renderApplication'); if (__DEV__) { diff --git a/Libraries/AppState/AppState.js b/Libraries/AppState/AppState.js index ed06c9203b3232..8f9a7cf4be9aba 100644 --- a/Libraries/AppState/AppState.js +++ b/Libraries/AppState/AppState.js @@ -17,7 +17,7 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var RCTAppState = NativeModules.AppState; var logError = require('logError'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var _eventHandlers = { change: new Map(), diff --git a/Libraries/AppStateIOS/AppStateIOS.android.js b/Libraries/AppStateIOS/AppStateIOS.android.js index 0f59cbea06cf9a..51117413856223 100644 --- a/Libraries/AppStateIOS/AppStateIOS.android.js +++ b/Libraries/AppStateIOS/AppStateIOS.android.js @@ -11,7 +11,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); class AppStateIOS { diff --git a/Libraries/AppStateIOS/AppStateIOS.ios.js b/Libraries/AppStateIOS/AppStateIOS.ios.js index d482b4e7d7b14c..82d968ce9afea7 100644 --- a/Libraries/AppStateIOS/AppStateIOS.ios.js +++ b/Libraries/AppStateIOS/AppStateIOS.ios.js @@ -16,7 +16,7 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var RCTAppState = NativeModules.AppState; var logError = require('logError'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var _eventHandlers = { change: new Map(), diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 985fc2c74cbaba..8f9cc1bc6186ad 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -17,7 +17,7 @@ var RCTCameraRollManager = require('NativeModules').CameraRollManager; var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var GROUP_TYPES_OPTIONS = [ 'Album', diff --git a/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js b/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js index 784bc2c8214776..4a6d99423f3d93 100644 --- a/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +++ b/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js @@ -11,7 +11,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); const DatePickerAndroid = { async open(options: Object): Promise { diff --git a/Libraries/Components/Intent/IntentAndroid.android.js b/Libraries/Components/Intent/IntentAndroid.android.js index 48877dd6b1eef0..0e563d2860d6eb 100644 --- a/Libraries/Components/Intent/IntentAndroid.android.js +++ b/Libraries/Components/Intent/IntentAndroid.android.js @@ -12,7 +12,7 @@ 'use strict'; var Linking = require('Linking'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); /** * NOTE: `IntentAndroid` is being deprecated. Use `Linking` instead. diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index ea5b395a3cf165..c4a2405258df38 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -20,7 +20,7 @@ var StaticContainer = require('StaticContainer.react'); var StyleSheet = require('StyleSheet'); var View = require('View'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var logError = require('logError'); var requireNativeComponent = require('requireNativeComponent'); var resolveAssetSource = require('resolveAssetSource'); diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index f58db6c8f13428..f2372fdccb08ea 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -21,8 +21,8 @@ var UIManager = require('UIManager'); var { ScrollViewManager } = require('NativeModules'); -var invariant = require('invariant'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); import type ReactComponent from 'ReactComponent'; diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index bdc8978e5166b1..dfb9e2b61c3034 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -29,7 +29,7 @@ var deprecatedPropType = require('deprecatedPropType'); var dismissKeyboard = require('dismissKeyboard'); var flattenStyle = require('flattenStyle'); var insetsDiffer = require('insetsDiffer'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var pointsDiffer = require('pointsDiffer'); var requireNativeComponent = require('requireNativeComponent'); var processDecelerationRate = require('processDecelerationRate'); diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index 7a902576c7ef3e..b2080a61f5726a 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -27,8 +27,8 @@ var UIManager = require('UIManager'); var View = require('View'); var createReactNativeComponentClass = require('createReactNativeComponentClass'); -var emptyFunction = require('emptyFunction'); -var invariant = require('invariant'); +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); var requireNativeComponent = require('requireNativeComponent'); var onlyMultiline = { diff --git a/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js b/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js index 02eae1e1fee317..0d7ceee4b64b9e 100644 --- a/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js +++ b/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js @@ -11,7 +11,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); const TimePickerAndroid = { async open(options: Object): Promise { diff --git a/Libraries/Components/ToastAndroid/ToastAndroid.ios.js b/Libraries/Components/ToastAndroid/ToastAndroid.ios.js index 8eb79dfb0dff77..4fc912777abb2f 100644 --- a/Libraries/Components/ToastAndroid/ToastAndroid.ios.js +++ b/Libraries/Components/ToastAndroid/ToastAndroid.ios.js @@ -11,7 +11,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var ToastAndroid = { diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index 83b07248a7f8ae..4f5000c5ce88a7 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -6,9 +6,9 @@ var BoundingDimensions = require('BoundingDimensions'); var Position = require('Position'); -var TouchEventUtils = require('TouchEventUtils'); +var TouchEventUtils = require('fbjs/lib/TouchEventUtils'); -var keyMirror = require('keyMirror'); +var keyMirror = require('fbjs/lib/keyMirror'); var queryLayoutByID = require('queryLayoutByID'); /** diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 1f6f9ed8176e66..a15501bebba8e2 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -25,7 +25,7 @@ var View = require('View'); var ensureComponentIsNative = require('ensureComponentIsNative'); var ensurePositiveDelayProps = require('ensurePositiveDelayProps'); -var keyOf = require('keyOf'); +var keyOf = require('fbjs/lib/keyOf'); var merge = require('merge'); var onlyChild = require('onlyChild'); diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 3b67ed00e2d012..d48e15856303fe 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -18,7 +18,7 @@ var TimerMixin = require('react-timer-mixin'); var Touchable = require('Touchable'); var View = require('View'); var ensurePositiveDelayProps = require('ensurePositiveDelayProps'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var onlyChild = require('onlyChild'); type Event = Object; diff --git a/Libraries/Components/Touchable/ensureComponentIsNative.js b/Libraries/Components/Touchable/ensureComponentIsNative.js index 944093f78e13f1..c66735b508b16c 100644 --- a/Libraries/Components/Touchable/ensureComponentIsNative.js +++ b/Libraries/Components/Touchable/ensureComponentIsNative.js @@ -11,7 +11,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var ensureComponentIsNative = function(component: any) { invariant( diff --git a/Libraries/Components/Touchable/ensurePositiveDelayProps.js b/Libraries/Components/Touchable/ensurePositiveDelayProps.js index 4c6525a54130ca..d2f6a09e8c89ed 100644 --- a/Libraries/Components/Touchable/ensurePositiveDelayProps.js +++ b/Libraries/Components/Touchable/ensurePositiveDelayProps.js @@ -11,7 +11,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var ensurePositiveDelayProps = function(props: any) { invariant( diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index b9e909a17ecf82..1e91b1ef265f15 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -16,7 +16,7 @@ var ImageStylePropTypes = require('ImageStylePropTypes'); var TextStylePropTypes = require('TextStylePropTypes'); var ViewStylePropTypes = require('ViewStylePropTypes'); -var keyMirror = require('keyMirror'); +var keyMirror = require('fbjs/lib/keyMirror'); var matricesDiffer = require('matricesDiffer'); var processColor = require('processColor'); var processTransform = require('processTransform'); diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index d8274855c3685e..ebf06456671dd7 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -18,7 +18,7 @@ var UIManager = require('UIManager'); var View = require('View'); var deprecatedPropType = require('deprecatedPropType'); -var keyMirror = require('keyMirror'); +var keyMirror = require('fbjs/lib/keyMirror'); var merge = require('merge'); var requireNativeComponent = require('requireNativeComponent'); var resolveAssetSource = require('resolveAssetSource'); diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index f733963e82b6bb..9fc11a5c50d5d0 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -21,8 +21,8 @@ var View = require('View'); var ScrollView = require('ScrollView'); var deprecatedPropType = require('deprecatedPropType'); -var invariant = require('invariant'); -var keyMirror = require('keyMirror'); +var invariant = require('fbjs/lib/invariant'); +var keyMirror = require('fbjs/lib/keyMirror'); var processDecelerationRate = require('processDecelerationRate'); var requireNativeComponent = require('requireNativeComponent'); var resolveAssetSource = require('resolveAssetSource'); diff --git a/Libraries/CustomComponents/ListView/ListView.js b/Libraries/CustomComponents/ListView/ListView.js index 357994735f4b5c..b068737d45bfce 100644 --- a/Libraries/CustomComponents/ListView/ListView.js +++ b/Libraries/CustomComponents/ListView/ListView.js @@ -34,7 +34,7 @@ var ScrollResponder = require('ScrollResponder'); var StaticRenderer = require('StaticRenderer'); var TimerMixin = require('react-timer-mixin'); -var isEmpty = require('isEmpty'); +var isEmpty = require('fbjs/lib/isEmpty'); var merge = require('merge'); var PropTypes = React.PropTypes; @@ -247,7 +247,7 @@ var ListView = React.createClass({ }, setNativeProps: function(props) { - this.refs[SCROLLVIEW_REF] && + this.refs[SCROLLVIEW_REF] && this.refs[SCROLLVIEW_REF].setNativeProps(props); }, diff --git a/Libraries/CustomComponents/ListView/ListViewDataSource.js b/Libraries/CustomComponents/ListView/ListViewDataSource.js index 0c18aa646c0bc7..cedf8b584a6a96 100644 --- a/Libraries/CustomComponents/ListView/ListViewDataSource.js +++ b/Libraries/CustomComponents/ListView/ListViewDataSource.js @@ -28,9 +28,9 @@ */ 'use strict'; -var invariant = require('invariant'); -var isEmpty = require('isEmpty'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var isEmpty = require('fbjs/lib/isEmpty'); +var warning = require('fbjs/lib/warning'); function defaultGetRowData( dataBlob: any, diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js index 7024081d207911..406e8be2fc6368 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationContext.js @@ -33,8 +33,8 @@ var NavigationTreeNode = require('NavigationTreeNode'); var Set = require('Set'); -var emptyFunction = require('emptyFunction'); -var invariant = require('invariant'); +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); import type EventSubscription from 'EventSubscription'; diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js index 6e27f5d5e70816..5307e1f869c754 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js @@ -27,7 +27,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); class NavigationEventPool { _list: Array; diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js index 16a95b55f9b7f4..fd0d93222ab739 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js @@ -7,7 +7,7 @@ 'use strict'; var immutable = require('immutable'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); type IterationCallback = (route: any, index: number, key: string) => void; diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationTreeNode.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationTreeNode.js index b100ab5e43e300..5fdb573f223fa8 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationTreeNode.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationTreeNode.js @@ -8,7 +8,7 @@ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var immutable = require('immutable'); var {List} = immutable; diff --git a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEvent-test.js b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEvent-test.js index c3fc0f5ef6cc01..81fb1695ef130d 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEvent-test.js +++ b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEvent-test.js @@ -27,7 +27,7 @@ jest .dontMock('NavigationEvent') - .dontMock('invariant'); + .dontMock('fbjs/lib/invariant'); var NavigationEvent = require('NavigationEvent'); diff --git a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEventEmitter-test.js b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEventEmitter-test.js index 361892084e53ca..63b1ccd0ba1ec2 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEventEmitter-test.js +++ b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationEventEmitter-test.js @@ -26,6 +26,7 @@ jest .dontMock('EmitterSubscription') + .dontMock('EventSubscription') .dontMock('EventEmitter') .dontMock('EventSubscriptionVendor') .dontMock('NavigationEvent') diff --git a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationTreeNode-test.js b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationTreeNode-test.js index 7a00f72ddc5ed2..68de370caf75bf 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationTreeNode-test.js +++ b/Libraries/CustomComponents/Navigator/Navigation/__tests__/NavigationTreeNode-test.js @@ -6,7 +6,7 @@ jest .dontMock('NavigationTreeNode') - .dontMock('invariant') + .dontMock('fbjs/lib/invariant') .dontMock('immutable'); var NavigationTreeNode = require('NavigationTreeNode'); diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index d905c603d1b303..e5a8a3a846b434 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -44,7 +44,7 @@ var View = require('View'); var clamp = require('clamp'); var deprecatedPropType = require('deprecatedPropType'); var flattenStyle = require('flattenStyle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var rebound = require('rebound'); var PropTypes = React.PropTypes; diff --git a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js index e224253c21be2a..6ec0a546d7be61 100644 --- a/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js +++ b/Libraries/CustomComponents/Navigator/NavigatorBreadcrumbNavigationBar.js @@ -37,7 +37,7 @@ var View = require('View'); var { Map } = require('immutable'); var guid = require('guid'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var Interpolators = NavigatorBreadcrumbNavigationBarStyles.Interpolators; var NavigatorNavigationBarStyles = Platform.OS === 'android' ? diff --git a/Libraries/Geolocation/Geolocation.js b/Libraries/Geolocation/Geolocation.js index 42d7378eb102be..3ed401a5d37c80 100644 --- a/Libraries/Geolocation/Geolocation.js +++ b/Libraries/Geolocation/Geolocation.js @@ -14,9 +14,9 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var RCTLocationObserver = require('NativeModules').LocationObserver; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var logError = require('logError'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var subscriptions = []; diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index 566e95d72c59d0..7adbe13c206ce3 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -23,7 +23,7 @@ var StyleSheetPropType = require('StyleSheetPropType'); var View = require('View'); var flattenStyle = require('flattenStyle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var merge = require('merge'); var requireNativeComponent = require('requireNativeComponent'); var resolveAssetSource = require('resolveAssetSource'); diff --git a/Libraries/Image/Image.ios.js b/Libraries/Image/Image.ios.js index 625dc8d50eca1c..43f694b43eccce 100644 --- a/Libraries/Image/Image.ios.js +++ b/Libraries/Image/Image.ios.js @@ -23,10 +23,10 @@ var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); var flattenStyle = require('flattenStyle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var requireNativeComponent = require('requireNativeComponent'); var resolveAssetSource = require('resolveAssetSource'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var { ImageViewManager, diff --git a/Libraries/Image/ImageResizeMode.js b/Libraries/Image/ImageResizeMode.js index 538287258ffc13..531212d86794b4 100644 --- a/Libraries/Image/ImageResizeMode.js +++ b/Libraries/Image/ImageResizeMode.js @@ -11,7 +11,7 @@ */ 'use strict'; -var keyMirror = require('keyMirror'); +var keyMirror = require('fbjs/lib/keyMirror'); /** * ImageResizeMode - Enum for different image resizing modes, set via diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 8fac8edb8a6459..9d0547251a215d 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -16,8 +16,8 @@ const EventEmitter = require('EventEmitter'); const Set = require('Set'); const TaskQueue = require('TaskQueue'); -const invariant = require('invariant'); -const keyMirror = require('keyMirror'); +const invariant = require('fbjs/lib/invariant'); +const keyMirror = require('fbjs/lib/keyMirror'); const setImmediate = require('setImmediate'); type Handle = number; diff --git a/Libraries/Interaction/TaskQueue.js b/Libraries/Interaction/TaskQueue.js index 91698470dfc347..f623f7a3ad9d7e 100644 --- a/Libraries/Interaction/TaskQueue.js +++ b/Libraries/Interaction/TaskQueue.js @@ -13,7 +13,7 @@ const ErrorUtils = require('ErrorUtils'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); type SimpleTask = { name: string; diff --git a/Libraries/Interaction/__tests__/InteractionManager-test.js b/Libraries/Interaction/__tests__/InteractionManager-test.js index 736fc93c585f64..032acf2555465b 100644 --- a/Libraries/Interaction/__tests__/InteractionManager-test.js +++ b/Libraries/Interaction/__tests__/InteractionManager-test.js @@ -6,6 +6,7 @@ jest .autoMockOff() + .mock('ErrorUtils') .mock('BatchedBridge'); function expectToBeCalledOnce(fn) { diff --git a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimersExecution.js b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimersExecution.js index c85c155a772699..df1b609723e6dd 100644 --- a/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimersExecution.js +++ b/Libraries/JavaScriptAppEngine/System/JSTimers/JSTimersExecution.js @@ -10,10 +10,10 @@ */ 'use strict'; -var invariant = require('invariant'); -var keyMirror = require('keyMirror'); -var performanceNow = require('performanceNow'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var keyMirror = require('fbjs/lib/keyMirror'); +var performanceNow = require('fbjs/lib/performanceNow'); +var warning = require('fbjs/lib/warning'); var Systrace = require('Systrace'); /** diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index 140c35ff87850c..108c4d5428e54b 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -15,7 +15,7 @@ var PropTypes = require('ReactPropTypes'); var UIManager = require('UIManager'); var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); -var keyMirror = require('keyMirror'); +var keyMirror = require('fbjs/lib/keyMirror'); var TypesEnum = { spring: true, diff --git a/Libraries/Linking/Linking.js b/Libraries/Linking/Linking.js index d3603166f6722e..280b48ec8a85d7 100644 --- a/Libraries/Linking/Linking.js +++ b/Libraries/Linking/Linking.js @@ -18,7 +18,7 @@ const { LinkingManager: LinkingManagerIOS } = require('NativeModules'); const LinkingManager = Platform.OS === 'android' ? IntentAndroid : LinkingManagerIOS; -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); const Map = require('Map'); const _notifHandlers = new Map(); @@ -53,7 +53,7 @@ const DEVICE_NOTIF_EVENT = 'openURL'; * execution you'll need to add the following lines to you `*AppDelegate.m`: * * ``` - *#import "RCTLinkingManager.h" + *#import "RCTLinkingManager.h" * * - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url * sourceApplication:(NSString *)sourceApplication annotation:(id)annotation diff --git a/Libraries/LinkingIOS/LinkingIOS.js b/Libraries/LinkingIOS/LinkingIOS.js index aa252c7d62aa81..b5ec9f7a6c6068 100644 --- a/Libraries/LinkingIOS/LinkingIOS.js +++ b/Libraries/LinkingIOS/LinkingIOS.js @@ -13,7 +13,7 @@ var Linking = require('Linking'); var RCTLinkingManager = require('NativeModules').LinkingManager; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var _initialURL = RCTLinkingManager && RCTLinkingManager.initialURL; diff --git a/Libraries/Promise.js b/Libraries/Promise.js index 004741948e4d14..16cf30bf4706e3 100644 --- a/Libraries/Promise.js +++ b/Libraries/Promise.js @@ -1,30 +1,18 @@ /** + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. * - * Copyright 2013-2014 Facebook, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 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 Promise - * - * This module wraps and augments the minimally ES6-compliant Promise - * implementation provided by the promise npm package. + * @flow */ - 'use strict'; -global.setImmediate = require('setImmediate'); -var Promise = require('promise/setimmediate/es6-extensions'); -require('promise/setimmediate/done'); +const Promise = require('fbjs/lib/Promise.native'); + if (__DEV__) { require('promise/setimmediate/rejection-tracking').enable({ allRejections: true, @@ -46,12 +34,4 @@ if (__DEV__) { }); } -/** - * Handle either fulfillment or rejection with the same callback. - */ -Promise.prototype.finally = function(onSettled) { - return this.then(onSettled, onSettled); -}; - - module.exports = Promise; diff --git a/Libraries/PushNotificationIOS/PushNotificationIOS.js b/Libraries/PushNotificationIOS/PushNotificationIOS.js index c93f644a43f68e..f22beb36501f0a 100644 --- a/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -13,7 +13,7 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var RCTPushNotificationManager = require('NativeModules').PushNotificationManager; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var _notifHandlers = new Map(); var _initialNotification = RCTPushNotificationManager && diff --git a/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js b/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js index 6c1d887e555de1..d1ffc1d402e23f 100644 --- a/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js +++ b/Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js @@ -16,7 +16,7 @@ var SyntheticEvent = require('SyntheticEvent'); var UIManager = require('UIManager'); var merge = require('merge'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var customBubblingEventTypes = UIManager.customBubblingEventTypes; var customDirectEventTypes = UIManager.customDirectEventTypes; diff --git a/Libraries/ReactIOS/NativeMethodsMixin.js b/Libraries/ReactIOS/NativeMethodsMixin.js index f70a2821165ebd..128752d1ac7555 100644 --- a/Libraries/ReactIOS/NativeMethodsMixin.js +++ b/Libraries/ReactIOS/NativeMethodsMixin.js @@ -16,7 +16,7 @@ var TextInputState = require('TextInputState'); var UIManager = require('UIManager'); var findNodeHandle = require('findNodeHandle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); type MeasureOnSuccessCallback = ( x: number, diff --git a/Libraries/ReactIOS/renderApplication.android.js b/Libraries/ReactIOS/renderApplication.android.js index 05b87178b6f545..b809ba08d0dfaa 100644 --- a/Libraries/ReactIOS/renderApplication.android.js +++ b/Libraries/ReactIOS/renderApplication.android.js @@ -19,7 +19,7 @@ var StyleSheet = require('StyleSheet'); var Subscribable = require('Subscribable'); var View = require('View'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var YellowBox = __DEV__ ? require('YellowBox') : null; diff --git a/Libraries/ReactIOS/renderApplication.ios.js b/Libraries/ReactIOS/renderApplication.ios.js index ad000f64305183..2e37716cc135c0 100644 --- a/Libraries/ReactIOS/renderApplication.ios.js +++ b/Libraries/ReactIOS/renderApplication.ios.js @@ -18,7 +18,7 @@ var StyleSheet = require('StyleSheet'); var Subscribable = require('Subscribable'); var View = require('View'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var Inspector = __DEV__ ? require('Inspector') : null; var YellowBox = __DEV__ ? require('YellowBox') : null; diff --git a/Libraries/ReactIOS/requireNativeComponent.js b/Libraries/ReactIOS/requireNativeComponent.js index 4f8ddaf2e4f435..61993f799fb9be 100644 --- a/Libraries/ReactIOS/requireNativeComponent.js +++ b/Libraries/ReactIOS/requireNativeComponent.js @@ -24,7 +24,7 @@ var processColor = require('processColor'); var resolveAssetSource = require('resolveAssetSource'); var sizesDiffer = require('sizesDiffer'); var verifyPropTypes = require('verifyPropTypes'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); /** * Used to create React components that directly wrap native component diff --git a/Libraries/ReactNative/ReactNative.js b/Libraries/ReactNative/ReactNative.js index e2314ba581f999..148a366663efdd 100644 --- a/Libraries/ReactNative/ReactNative.js +++ b/Libraries/ReactNative/ReactNative.js @@ -27,9 +27,9 @@ var ReactPropTypes = require('ReactPropTypes'); var ReactUpdates = require('ReactUpdates'); var findNodeHandle = require('findNodeHandle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var onlyChild = require('onlyChild'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); ReactNativeDefaultInjection.inject(); diff --git a/Libraries/ReactNative/ReactNativeBaseComponent.js b/Libraries/ReactNative/ReactNativeBaseComponent.js index 19afca80362e9f..b879b45b6a51a0 100644 --- a/Libraries/ReactNative/ReactNativeBaseComponent.js +++ b/Libraries/ReactNative/ReactNativeBaseComponent.js @@ -19,8 +19,8 @@ var ReactMultiChild = require('ReactMultiChild'); var UIManager = require('UIManager'); var deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev'); -var invariant = require('invariant'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); var registrationNames = ReactNativeEventEmitter.registrationNames; var putListener = ReactNativeEventEmitter.putListener; diff --git a/Libraries/ReactNative/ReactNativeDefaultInjection.js b/Libraries/ReactNative/ReactNativeDefaultInjection.js index 0d55d670c40e14..ee97c2560e61a3 100644 --- a/Libraries/ReactNative/ReactNativeDefaultInjection.js +++ b/Libraries/ReactNative/ReactNativeDefaultInjection.js @@ -38,7 +38,7 @@ var ReactUpdates = require('ReactUpdates'); var ResponderEventPlugin = require('ResponderEventPlugin'); var UniversalWorkerNodeHandle = require('UniversalWorkerNodeHandle'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); // Just to ensure this gets packaged, since its only caller is from Native. require('RCTEventEmitter'); diff --git a/Libraries/ReactNative/ReactNativeEventEmitter.js b/Libraries/ReactNative/ReactNativeEventEmitter.js index ac8854b6cb65d2..c7680257aff577 100644 --- a/Libraries/ReactNative/ReactNativeEventEmitter.js +++ b/Libraries/ReactNative/ReactNativeEventEmitter.js @@ -18,7 +18,7 @@ var NodeHandle = require('NodeHandle'); var EventConstants = require('EventConstants'); var merge = require('merge'); -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var topLevelTypes = EventConstants.topLevelTypes; diff --git a/Libraries/ReactNative/ReactNativeMount.js b/Libraries/ReactNative/ReactNativeMount.js index 2a38c3dbba8c07..cf8c5bb336fdd3 100644 --- a/Libraries/ReactNative/ReactNativeMount.js +++ b/Libraries/ReactNative/ReactNativeMount.js @@ -19,7 +19,7 @@ var ReactUpdateQueue = require('ReactUpdateQueue'); var ReactUpdates = require('ReactUpdates'); var UIManager = require('UIManager'); -var emptyObject = require('emptyObject'); +var emptyObject = require('fbjs/lib/emptyObject'); var instantiateReactComponent = require('instantiateReactComponent'); var shouldUpdateReactComponent = require('shouldUpdateReactComponent'); diff --git a/Libraries/ReactNative/ReactNativeTagHandles.js b/Libraries/ReactNative/ReactNativeTagHandles.js index ab350817c6e90c..5a0de4cda393cc 100644 --- a/Libraries/ReactNative/ReactNativeTagHandles.js +++ b/Libraries/ReactNative/ReactNativeTagHandles.js @@ -11,8 +11,8 @@ */ 'use strict'; -var invariant = require('invariant'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); /** * Keeps track of allocating and associating native "tags" which are numeric, diff --git a/Libraries/ReactNative/ReactNativeTextComponent.js b/Libraries/ReactNative/ReactNativeTextComponent.js index e9f67ce59fdb0a..0eb5e0a6b0d0be 100644 --- a/Libraries/ReactNative/ReactNativeTextComponent.js +++ b/Libraries/ReactNative/ReactNativeTextComponent.js @@ -15,7 +15,7 @@ var ReactNativeTagHandles = require('ReactNativeTagHandles'); var UIManager = require('UIManager'); var assign = require('Object.assign'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var ReactNativeTextComponent = function(props) { // This constructor and its argument is currently used by mocks. diff --git a/Libraries/ReactNative/findNodeHandle.js b/Libraries/ReactNative/findNodeHandle.js index 37c772760c503f..dd3191b82d9210 100644 --- a/Libraries/ReactNative/findNodeHandle.js +++ b/Libraries/ReactNative/findNodeHandle.js @@ -16,8 +16,8 @@ var ReactCurrentOwner = require('ReactCurrentOwner'); var ReactInstanceMap = require('ReactInstanceMap'); var ReactNativeTagHandles = require('ReactNativeTagHandles'); -var invariant = require('invariant'); -var warning = require('warning'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); /** * ReactNative vs ReactWeb diff --git a/Libraries/Sample/Sample.android.js b/Libraries/Sample/Sample.android.js index 2024dbdaeafc80..1a66fb9bf57506 100644 --- a/Libraries/Sample/Sample.android.js +++ b/Libraries/Sample/Sample.android.js @@ -6,7 +6,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var Sample = { test: function() { diff --git a/Libraries/Settings/Settings.ios.js b/Libraries/Settings/Settings.ios.js index 73d66ca587c3a6..3d1036fedf490a 100644 --- a/Libraries/Settings/Settings.ios.js +++ b/Libraries/Settings/Settings.ios.js @@ -14,7 +14,7 @@ var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var RCTSettingsManager = require('NativeModules').SettingsManager; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var subscriptions: Array<{keys: Array; callback: ?Function}> = []; diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js index f61decb3cc2ccb..2be4ca2f24961f 100644 --- a/Libraries/StyleSheet/StyleSheetValidation.js +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -16,7 +16,7 @@ var ReactPropTypeLocations = require('ReactPropTypeLocations'); var TextStylePropTypes = require('TextStylePropTypes'); var ViewStylePropTypes = require('ViewStylePropTypes'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); class StyleSheetValidation { static validateStyleProp(prop, style, caller) { diff --git a/Libraries/StyleSheet/flattenStyle.js b/Libraries/StyleSheet/flattenStyle.js index 621c614ffd9f97..a3af4f46e63d8d 100644 --- a/Libraries/StyleSheet/flattenStyle.js +++ b/Libraries/StyleSheet/flattenStyle.js @@ -12,7 +12,7 @@ 'use strict'; var StyleSheetRegistry = require('StyleSheetRegistry'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); import type { StyleObj } from 'StyleSheetTypes'; diff --git a/Libraries/StyleSheet/processTransform.js b/Libraries/StyleSheet/processTransform.js index 4a523f90910870..6978efdcfbe67b 100644 --- a/Libraries/StyleSheet/processTransform.js +++ b/Libraries/StyleSheet/processTransform.js @@ -14,7 +14,7 @@ var MatrixMath = require('MatrixMath'); var Platform = require('Platform'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var stringifySafe = require('stringifySafe'); /** diff --git a/Libraries/Utilities/Dimensions.js b/Libraries/Utilities/Dimensions.js index f73853473dc29c..5cf5f21edc21f2 100644 --- a/Libraries/Utilities/Dimensions.js +++ b/Libraries/Utilities/Dimensions.js @@ -14,7 +14,7 @@ var Platform = require('Platform'); var UIManager = require('UIManager'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var dimensions = UIManager.Dimensions; diff --git a/Libraries/Utilities/HMRClient.js b/Libraries/Utilities/HMRClient.js index 16f32368cc26b7..14850f860ba671 100644 --- a/Libraries/Utilities/HMRClient.js +++ b/Libraries/Utilities/HMRClient.js @@ -12,7 +12,7 @@ 'use strict'; const Platform = require('Platform'); -const invariant = require('invariant'); +const invariant = require('fbjs/lib/invariant'); /** * HMR Client that receives from the server HMR updates and propagates them diff --git a/Libraries/Utilities/MatrixMath.js b/Libraries/Utilities/MatrixMath.js index 32f3cd32f4deb8..6900106a6e0f72 100755 --- a/Libraries/Utilities/MatrixMath.js +++ b/Libraries/Utilities/MatrixMath.js @@ -7,7 +7,7 @@ /* eslint-disable space-infix-ops */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); /** * Memory conservative (mutative) matrix math utilities. Uses "command" diff --git a/Libraries/Utilities/MessageQueue.js b/Libraries/Utilities/MessageQueue.js index 7b31c114914a33..2e542b6c40f389 100644 --- a/Libraries/Utilities/MessageQueue.js +++ b/Libraries/Utilities/MessageQueue.js @@ -18,8 +18,8 @@ let ErrorUtils = require('ErrorUtils'); let JSTimersExecution = require('JSTimersExecution'); let Platform = require('Platform'); -let invariant = require('invariant'); -let keyMirror = require('keyMirror'); +let invariant = require('fbjs/lib/invariant'); +let keyMirror = require('fbjs/lib/keyMirror'); let stringifySafe = require('stringifySafe'); let MODULE_IDS = 0; diff --git a/Libraries/Utilities/PerformanceLogger.js b/Libraries/Utilities/PerformanceLogger.js index e2d0e5c81ad2e6..03e5df830bbe58 100644 --- a/Libraries/Utilities/PerformanceLogger.js +++ b/Libraries/Utilities/PerformanceLogger.js @@ -12,7 +12,7 @@ var BatchedBridge = require('BatchedBridge'); -var performanceNow = require('performanceNow'); +var performanceNow = require('fbjs/lib/performanceNow'); var timespans = {}; var extras = {}; diff --git a/Libraries/Utilities/RCTLog.js b/Libraries/Utilities/RCTLog.js index 65abc5883d0355..32394684cb9d72 100644 --- a/Libraries/Utilities/RCTLog.js +++ b/Libraries/Utilities/RCTLog.js @@ -13,7 +13,7 @@ var BatchedBridge = require('BatchedBridge'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var levelsMap = { log: 'log', diff --git a/Libraries/Utilities/RCTRenderingPerf.js b/Libraries/Utilities/RCTRenderingPerf.js index 126c8a0328528d..3979780ba36473 100644 --- a/Libraries/Utilities/RCTRenderingPerf.js +++ b/Libraries/Utilities/RCTRenderingPerf.js @@ -13,7 +13,7 @@ var ReactDefaultPerf = require('ReactDefaultPerf'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); type perfModule = { start: () => void; diff --git a/Libraries/Utilities/__tests__/MatrixMath-test.js b/Libraries/Utilities/__tests__/MatrixMath-test.js index 5bfa1e9d7b810b..b8c10ac402e2d7 100644 --- a/Libraries/Utilities/__tests__/MatrixMath-test.js +++ b/Libraries/Utilities/__tests__/MatrixMath-test.js @@ -9,7 +9,7 @@ 'use strict'; jest.dontMock('MatrixMath'); -jest.dontMock('invariant'); +jest.dontMock('fbjs/lib/invariant'); var MatrixMath = require('MatrixMath'); diff --git a/Libraries/Utilities/__tests__/MessageQueue-test.js b/Libraries/Utilities/__tests__/MessageQueue-test.js index ab04d0fe54cf6c..14c50e746d7d96 100644 --- a/Libraries/Utilities/__tests__/MessageQueue-test.js +++ b/Libraries/Utilities/__tests__/MessageQueue-test.js @@ -9,7 +9,7 @@ 'use strict'; jest.dontMock('MessageQueue') - .dontMock('keyMirror'); + .dontMock('fbjs/lib/keyMirror'); var MessageQueue = require('MessageQueue'); let MODULE_IDS = 0; diff --git a/Libraries/Utilities/buildStyleInterpolator.js b/Libraries/Utilities/buildStyleInterpolator.js index 0c0fa7fd1221c5..ff51699b033d45 100644 --- a/Libraries/Utilities/buildStyleInterpolator.js +++ b/Libraries/Utilities/buildStyleInterpolator.js @@ -9,7 +9,7 @@ */ /* eslint-disable global-strict */ -var keyOf = require('keyOf'); +var keyOf = require('fbjs/lib/keyOf'); var X_DIM = keyOf({x: null}); var Y_DIM = keyOf({y: null}); diff --git a/Libraries/Utilities/createStrictShapeTypeChecker.js b/Libraries/Utilities/createStrictShapeTypeChecker.js index 883da2459f7c58..b5fe14a1b95051 100644 --- a/Libraries/Utilities/createStrictShapeTypeChecker.js +++ b/Libraries/Utilities/createStrictShapeTypeChecker.js @@ -13,7 +13,7 @@ var ReactPropTypeLocationNames = require('ReactPropTypeLocationNames'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var merge = require('merge'); function createStrictShapeTypeChecker( diff --git a/Libraries/Utilities/cssVar.js b/Libraries/Utilities/cssVar.js index 0ab64e7f9ca5cb..094689ae25f1aa 100644 --- a/Libraries/Utilities/cssVar.js +++ b/Libraries/Utilities/cssVar.js @@ -6,7 +6,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var CSSVarConfig = require('CSSVarConfig'); var cssVar = function(/*string*/ key) /*string*/ { diff --git a/Libraries/Vibration/VibrationIOS.android.js b/Libraries/Vibration/VibrationIOS.android.js index f52be6b7501b7c..37cdf859c1eb8c 100644 --- a/Libraries/Vibration/VibrationIOS.android.js +++ b/Libraries/Vibration/VibrationIOS.android.js @@ -12,7 +12,7 @@ */ 'use strict'; -var warning = require('warning'); +var warning = require('fbjs/lib/warning'); var VibrationIOS = { vibrate: function() { diff --git a/Libraries/Vibration/VibrationIOS.ios.js b/Libraries/Vibration/VibrationIOS.ios.js index 2a1dc701c17383..1e0a17942d675e 100644 --- a/Libraries/Vibration/VibrationIOS.ios.js +++ b/Libraries/Vibration/VibrationIOS.ios.js @@ -13,7 +13,7 @@ var RCTVibration = require('NativeModules').Vibration; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); /** * The Vibration API is exposed at `VibrationIOS.vibrate()`. On iOS, calling this diff --git a/Libraries/vendor/core/isEmpty.js b/Libraries/vendor/core/isEmpty.js deleted file mode 100644 index 27f4c0069a06f7..00000000000000 --- a/Libraries/vendor/core/isEmpty.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @generated SignedSource<<97ffcebc9ae390e734026a4f3964bff6>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! 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. !! - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * - * @providesModule isEmpty - */ - -/** - * Mimics empty from PHP. - */ -function isEmpty(obj) { - if (Array.isArray(obj)) { - return obj.length === 0; - } else if (typeof obj === 'object') { - for (var i in obj) { - return false; - } - return true; - } else { - return !obj; - } -} - -module.exports = isEmpty; diff --git a/Libraries/vendor/core/mergeHelpers.js b/Libraries/vendor/core/mergeHelpers.js index 58fa238d4f2bd4..d0c506b3d924ff 100644 --- a/Libraries/vendor/core/mergeHelpers.js +++ b/Libraries/vendor/core/mergeHelpers.js @@ -33,8 +33,8 @@ "use strict"; -var invariant = require('invariant'); -var keyMirror = require('keyMirror'); +var invariant = require('fbjs/lib/invariant'); +var keyMirror = require('fbjs/lib/keyMirror'); /** * Maximum number of levels to traverse. Will catch circular structures. diff --git a/Libraries/vendor/crypto/crc32.js b/Libraries/vendor/crypto/crc32.js deleted file mode 100644 index 540d60aa832b6e..00000000000000 --- a/Libraries/vendor/crypto/crc32.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @generated SignedSource<<77bdeb858138636c96c405d64b6be55c>> - * - * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - * !! 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. - * - * @providesModule crc32 - */ - -/* jslint bitwise: true */ - -/** - * Modified from the original for performance improvements. - * - * @see http://create.stephan-brumme.com/crc32/ - * @see http://stackoverflow.com/questions/18638900/ - * @copyright 2006 Andrea Ercolino - * @license MIT - */ - -var table = [ - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, - 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, - 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, - 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, - 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, - 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, - 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, - 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, - 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, - 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, - 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, - 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, - 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, - 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, - 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, - 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, - 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, - 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, - 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, - 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, - 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, - 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, - 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, - 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, - 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, - 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, - 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, - 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D -]; - -if (global.Int32Array !== undefined) { - table = new Int32Array(table); -} - -/** - * @returns Number - */ -function crc32(str) { - var crc = -1; - for (var i = 0, len = str.length; i < len; i++) { - crc = (crc >>> 8) ^ table[(crc ^ str.charCodeAt(i)) & 0xFF]; - } - return ~crc; -} - -module.exports = crc32; diff --git a/Libraries/vendor/emitter/EventEmitter.js b/Libraries/vendor/emitter/EventEmitter.js index b5c14a66a7c7a9..ba6781a57e3f98 100644 --- a/Libraries/vendor/emitter/EventEmitter.js +++ b/Libraries/vendor/emitter/EventEmitter.js @@ -14,8 +14,8 @@ var EmitterSubscription = require('EmitterSubscription'); var ErrorUtils = require('ErrorUtils'); var EventSubscriptionVendor = require('EventSubscriptionVendor'); -var emptyFunction = require('emptyFunction'); -var invariant = require('invariant'); +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); /** * @class EventEmitter diff --git a/Libraries/vendor/emitter/EventHolder.js b/Libraries/vendor/emitter/EventHolder.js index 4345c3d387cdf4..76cfd33141e821 100644 --- a/Libraries/vendor/emitter/EventHolder.js +++ b/Libraries/vendor/emitter/EventHolder.js @@ -17,7 +17,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); class EventHolder { constructor() { diff --git a/Libraries/vendor/emitter/EventSubscriptionVendor.js b/Libraries/vendor/emitter/EventSubscriptionVendor.js index add1f408e4a897..d992a69a553696 100644 --- a/Libraries/vendor/emitter/EventSubscriptionVendor.js +++ b/Libraries/vendor/emitter/EventSubscriptionVendor.js @@ -17,7 +17,7 @@ */ 'use strict'; -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); /** * EventSubscriptionVendor stores a set of EventSubscriptions that are diff --git a/Libraries/vendor/emitter/mixInEventEmitter.js b/Libraries/vendor/emitter/mixInEventEmitter.js index 4dc938199d401b..fc39f7b649e13f 100644 --- a/Libraries/vendor/emitter/mixInEventEmitter.js +++ b/Libraries/vendor/emitter/mixInEventEmitter.js @@ -21,8 +21,8 @@ var EventHolder = require('EventHolder'); var EventValidator = require('EventValidator'); var copyProperties = require('copyProperties'); -var invariant = require('invariant'); -var keyOf = require('keyOf'); +var invariant = require('fbjs/lib/invariant'); +var keyOf = require('fbjs/lib/keyOf'); var TYPES_KEY = keyOf({__types: true}); diff --git a/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js b/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js index b91feba9b1e2a2..ca7faa7fecfec0 100644 --- a/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js +++ b/Libraries/vendor/react/platformImplementations/universal/worker/UniversalWorkerNodeHandle.js @@ -4,7 +4,7 @@ var ReactNativeTagHandles = require('ReactNativeTagHandles'); -var invariant = require('invariant'); +var invariant = require('fbjs/lib/invariant'); var UniversalWorkerNodeHandle = { getRootNodeID: function(nodeHandle) { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4cf8daa434b88d..bc519c383b2217 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -137,11 +137,6 @@ "from": "https://registry.npmjs.org/globals/-/globals-6.4.1.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-6.4.1.tgz" }, - "regenerator": { - "version": "0.8.40", - "from": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz", - "resolved": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz" - }, "js-tokens": { "version": "1.0.1", "from": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.1.tgz", @@ -151,6 +146,11 @@ "version": "0.10.33", "from": "https://registry.npmjs.org/recast/-/recast-0.10.33.tgz", "resolved": "https://registry.npmjs.org/recast/-/recast-0.10.33.tgz" + }, + "regenerator": { + "version": "0.8.40", + "from": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz", + "resolved": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz" } } }, @@ -248,15 +248,15 @@ "from": "https://registry.npmjs.org/recast/-/recast-0.10.33.tgz", "resolved": "https://registry.npmjs.org/recast/-/recast-0.10.33.tgz" }, - "source-map": { - "version": "0.5.3", - "from": "https://registry.npmjs.org/source-map/-/source-map-0.5.3.tgz", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.3.tgz" - }, "regenerator": { "version": "0.8.40", "from": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz", "resolved": "https://registry.npmjs.org/regenerator/-/regenerator-0.8.40.tgz" + }, + "source-map": { + "version": "0.5.3", + "from": "https://registry.npmjs.org/source-map/-/source-map-0.5.3.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.3.tgz" } } }, @@ -1820,19 +1820,21 @@ "resolved": "https://registry.npmjs.org/fast-path/-/fast-path-1.1.0.tgz" }, "fbjs": { - "version": "0.6.0", - "from": "https://registry.npmjs.org/fbjs/-/fbjs-0.6.0.tgz", - "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.6.0.tgz", + "version": "0.7.2", + "from": "fbjs@0.7.2", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.7.2.tgz", "dependencies": { - "ua-parser-js": { - "version": "0.7.10", - "from": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.10.tgz", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.10.tgz" - }, - "whatwg-fetch": { - "version": "0.9.0", - "from": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz" + "isomorphic-fetch": { + "version": "2.2.1", + "from": "isomorphic-fetch@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "dependencies": { + "whatwg-fetch": { + "version": "0.11.0", + "from": "whatwg-fetch@>=0.10.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.11.0.tgz" + } + } } } }, @@ -1905,26 +1907,26 @@ "from": "ansi@~0.3.0", "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" }, - "ansi-styles": { - "version": "2.1.0", - "from": "ansi-styles@^2.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" - }, - "asn1": { - "version": "0.1.11", - "from": "asn1@0.1.11", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" - }, "ansi-regex": { "version": "2.0.0", "from": "ansi-regex@^2.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" }, + "ansi-styles": { + "version": "2.1.0", + "from": "ansi-styles@^2.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + }, "are-we-there-yet": { "version": "1.0.4", "from": "are-we-there-yet@~1.0.0", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz" }, + "asn1": { + "version": "0.1.11", + "from": "asn1@0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz" + }, "assert-plus": { "version": "0.1.5", "from": "assert-plus@^0.1.5", @@ -1960,16 +1962,16 @@ "from": "brace-expansion@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" }, - "chalk": { - "version": "1.1.1", - "from": "chalk@^1.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" - }, "caseless": { "version": "0.11.0", "from": "caseless@~0.11.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" }, + "chalk": { + "version": "1.1.1", + "from": "chalk@^1.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" + }, "combined-stream": { "version": "1.0.5", "from": "combined-stream@~1.0.5", @@ -2000,16 +2002,16 @@ "from": "ctype@0.5.3", "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz" }, - "deep-extend": { - "version": "0.2.11", - "from": "deep-extend@~0.2.5", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" - }, "debug": { "version": "0.7.4", "from": "debug@~0.7.2", "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz" }, + "deep-extend": { + "version": "0.2.11", + "from": "deep-extend@~0.2.5", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.2.11.tgz" + }, "delayed-stream": { "version": "1.0.0", "from": "delayed-stream@~1.0.0", @@ -2120,16 +2122,16 @@ "from": "is-property@^1.0.0", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" }, - "isstream": { - "version": "0.1.2", - "from": "isstream@~0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" - }, "isarray": { "version": "0.0.1", "from": "isarray@0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" }, + "isstream": { + "version": "0.1.2", + "from": "isstream@~0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, "json-stringify-safe": { "version": "5.0.1", "from": "json-stringify-safe@~5.0.1", @@ -2140,51 +2142,51 @@ "from": "jsonpointer@2.0.0", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, + "lodash._basetostring": { + "version": "3.0.1", + "from": "lodash._basetostring@^3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz" + }, "lodash._createpadding": { "version": "3.6.1", "from": "lodash._createpadding@^3.0.0", "resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz" }, + "lodash.pad": { + "version": "3.1.1", + "from": "lodash.pad@^3.0.0", + "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz" + }, "lodash.padleft": { "version": "3.1.1", "from": "lodash.padleft@^3.0.0", "resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz" }, - "lodash._basetostring": { - "version": "3.0.1", - "from": "lodash._basetostring@^3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz" - }, - "lodash.pad": { + "lodash.padright": { "version": "3.1.1", - "from": "lodash.pad@^3.0.0", - "resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz" + "from": "lodash.padright@^3.0.0", + "resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz" }, "lodash.repeat": { "version": "3.0.1", "from": "lodash.repeat@^3.0.0", "resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz" }, - "lodash.padright": { - "version": "3.1.1", - "from": "lodash.padright@^3.0.0", - "resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz" - }, "mime-db": { "version": "1.19.0", "from": "mime-db@~1.19.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.19.0.tgz" }, - "minimist": { - "version": "0.0.8", - "from": "minimist@0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - }, "mime-types": { "version": "2.1.7", "from": "mime-types@~2.1.7", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.7.tgz" }, + "minimist": { + "version": "0.0.8", + "from": "minimist@0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + }, "mkdirp": { "version": "0.5.1", "from": "mkdirp@>=0.3.0 <0.4.0||>=0.4.0 <0.5.0||>=0.5.0 <0.6.0", @@ -2200,6 +2202,11 @@ "from": "npmlog@~1.2.0", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz" }, + "oauth-sign": { + "version": "0.8.0", + "from": "oauth-sign@~0.8.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" + }, "once": { "version": "1.1.1", "from": "once@~1.1.1", @@ -2210,11 +2217,6 @@ "from": "path-is-absolute@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" }, - "oauth-sign": { - "version": "0.8.0", - "from": "oauth-sign@~0.8.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" - }, "pinkie": { "version": "1.0.0", "from": "pinkie@^1.0.0", @@ -2265,6 +2267,11 @@ "from": "strip-ansi@^3.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" }, + "strip-json-comments": { + "version": "0.1.3", + "from": "strip-json-comments@0.1.x", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" + }, "supports-color": { "version": "2.0.0", "from": "supports-color@^2.0.0", @@ -2280,21 +2287,16 @@ "from": "tough-cookie@~2.2.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.0.tgz" }, - "strip-json-comments": { - "version": "0.1.3", - "from": "strip-json-comments@0.1.x", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-0.1.3.tgz" + "tunnel-agent": { + "version": "0.4.1", + "from": "tunnel-agent@~0.4.1", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" }, "uid-number": { "version": "0.0.3", "from": "uid-number@0.0.3", "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.3.tgz" }, - "tunnel-agent": { - "version": "0.4.1", - "from": "tunnel-agent@~0.4.1", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" - }, "wrappy": { "version": "1.0.1", "from": "wrappy@>=1.0.0 <2.0.0", @@ -4222,6 +4224,18 @@ } } } + }, + "fbjs": { + "version": "0.6.0", + "from": "https://registry.npmjs.org/fbjs/-/fbjs-0.6.0.tgz", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.6.0.tgz", + "dependencies": { + "whatwg-fetch": { + "version": "0.9.0", + "from": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz" + } + } } } }, @@ -4708,6 +4722,11 @@ "from": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz", "resolved": "https://registry.npmjs.org/tryor/-/tryor-0.1.2.tgz" }, + "ua-parser-js": { + "version": "0.7.10", + "from": "ua-parser-js@>=0.7.9 <0.8.0", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.10.tgz" + }, "uglify-js": { "version": "2.4.24", "from": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", diff --git a/package.json b/package.json index 9d6cfa9935e96b..4884bdcda80831 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ }, "modulePathIgnorePatterns": [ "/node_modules/(?!react|fbjs|react-native|parse|react-transform-hmr|core-js|promise)/", + "node_modules/react/node_modules/fbjs/", "node_modules/react/lib/React.js", "node_modules/react/lib/ReactDOM.js", "node_modules/fbjs/lib/Map.js", @@ -79,7 +80,8 @@ "downstream/core/nativeRequestAnimationFrame.js", "downstream/core/toArray.js", "node_modules/jest-cli", - "node_modules/react/dist" + "node_modules/react/dist", + "/node_modules/fbjs/.*/__mocks__/" ], "testFileExtensions": [ "js" @@ -87,7 +89,8 @@ "unmockedModulePathPatterns": [ "promise", "source-map", - "fast-path" + "fast-path", + "fbjs" ] }, "main": "Libraries/react-native/react-native.js", @@ -136,7 +139,7 @@ "debug": "^2.2.0", "event-target-shim": "^1.0.5", "fast-path": "^1.1.0", - "fbjs": "^0.6.0", + "fbjs": "^0.7.2", "fbjs-scripts": "^0.4.0", "graceful-fs": "^4.1.2", "image-size": "^0.3.5", diff --git a/packager/blacklist.js b/packager/blacklist.js index ee369e1af7266d..27ec2899300fb6 100644 --- a/packager/blacklist.js +++ b/packager/blacklist.js @@ -17,57 +17,8 @@ var sharedBlacklist = [ 'node_modules/react/lib/React.js', 'node_modules/react/lib/ReactDOM.js', - // For each of these fbjs files (especially the non-forks/stubs), we should - // consider deleting the conflicting copy and just using the fbjs version. - // // fbjs forks: 'node_modules/fbjs/lib/Map.js', - 'node_modules/fbjs/lib/Promise.js', - 'node_modules/fbjs/lib/fetch.js', - // fbjs stubs: - 'node_modules/fbjs/lib/ErrorUtils.js', - 'node_modules/fbjs/lib/URI.js', - // fbjs modules: - 'node_modules/fbjs/lib/Deferred.js', - 'node_modules/fbjs/lib/PromiseMap.js', - 'node_modules/fbjs/lib/UserAgent.js', - 'node_modules/fbjs/lib/areEqual.js', - 'node_modules/fbjs/lib/base62.js', - 'node_modules/fbjs/lib/crc32.js', - 'node_modules/fbjs/lib/everyObject.js', - 'node_modules/fbjs/lib/fetchWithRetries.js', - 'node_modules/fbjs/lib/filterObject.js', - 'node_modules/fbjs/lib/flattenArray.js', - 'node_modules/fbjs/lib/forEachObject.js', - 'node_modules/fbjs/lib/isEmpty.js', - 'node_modules/fbjs/lib/nullthrows.js', - 'node_modules/fbjs/lib/removeFromArray.js', - 'node_modules/fbjs/lib/resolveImmediate.js', - 'node_modules/fbjs/lib/someObject.js', - 'node_modules/fbjs/lib/sprintf.js', - 'node_modules/fbjs/lib/xhrSimpleDataSerializer.js', - - // Those conflicts with the ones in fbjs/. We need to blacklist the - // internal version otherwise they won't work in open source. - 'downstream/core/CSSCore.js', - 'downstream/core/TouchEventUtils.js', - 'downstream/core/camelize.js', - 'downstream/core/createArrayFromMixed.js', - 'downstream/core/createNodesFromMarkup.js', - 'downstream/core/dom/containsNode.js', - 'downstream/core/dom/focusNode.js', - 'downstream/core/dom/getActiveElement.js', - 'downstream/core/dom/getUnboundedScrollPosition.js', - 'downstream/core/dom/isNode.js', - 'downstream/core/dom/isTextNode.js', - 'downstream/core/emptyFunction.js', - 'downstream/core/emptyObject.js', - 'downstream/core/getMarkupWrap.js', - 'downstream/core/hyphenate.js', - 'downstream/core/hyphenateStyleName.js', - 'downstream/core/invariant.js', - 'downstream/core/nativeRequestAnimationFrame.js', - 'downstream/core/toArray.js', /website\/node_modules\/.*/, diff --git a/packager/package.json b/packager/package.json index 117369a73bf130..cf2306f0ff05d1 100644 --- a/packager/package.json +++ b/packager/package.json @@ -1,5 +1,5 @@ { - "version": "0.1.3", + "version": "0.1.4", "name": "react-native-packager", "description": "Build native apps with React!", "repository": { diff --git a/packager/react-packager/src/Resolver/index.js b/packager/react-packager/src/Resolver/index.js index 76d8d5af219bb4..d60e0fb2b4d59e 100644 --- a/packager/react-packager/src/Resolver/index.js +++ b/packager/react-packager/src/Resolver/index.js @@ -84,7 +84,6 @@ class Resolver { (opts.blacklistRE && opts.blacklistRE.test(filepath)); }, providesModuleNodeModules: [ - 'fbjs', 'react', 'react-native', // Parse requires AsyncStorage. They will