diff --git a/.flowconfig b/.flowconfig index db960b5f1..3d5e14681 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 ad1f9b72b..2e681ed34 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 20d62badf..3d7220295 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 27ef7428d..bfc9c5d88 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 5d3073a37..cb801a0af 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 2f0e93358..181077acd 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 9570d2b8c..a6f5dc234 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 4c7a85a4d..8cfacf298 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 57bafd2da..6077d8663 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 ed06c9203..8f9a7cf4b 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 0f59cbea0..511174138 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 d482b4e7d..82d968ce9 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 985fc2c74..8f9cc1bc6 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 784bc2c82..4a6d99423 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 48877dd6b..0e563d286 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 ea5b395a3..c4a240525 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 f58db6c8f..f2372fdcc 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 bdc8978e5..dfb9e2b61 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 7a902576c..b2080a61f 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 02eae1e1f..0d7ceee4b 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 8eb79dfb0..4fc912777 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 83b07248a..4f5000c5c 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 1f6f9ed81..a15501beb 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 3b67ed00e..d48e15856 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 944093f78..c66735b50 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 4c6525a54..d2f6a09e8 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 b9e909a17..1e91b1ef2 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 d8274855c..ebf064566 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 f733963e8..9fc11a5c5 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 357994735..b068737d4 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 0c18aa646..cedf8b584 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 7024081d2..406e8be2f 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 6e27f5d5e..5307e1f86 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 16a95b55f..fd0d93222 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 b100ab5e4..5fdb573f2 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 c3fc0f5ef..81fb1695e 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 361892084..63b1ccd0b 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 7a00f72dd..68de370ca 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 d905c603d..e5a8a3a84 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 e224253c2..6ec0a546d 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 42d7378eb..3ed401a5d 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 566e95d72..7adbe13c2 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 625dc8d50..43f694b43 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 538287258..531212d86 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 8fac8edb8..9d0547251 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 91698470d..f623f7a3a 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 736fc93c5..032acf255 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 c85c155a7..df1b60972 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 140c35ff8..108c4d542 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 d3603166f..280b48ec8 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 aa252c7d6..b5ec9f7a6 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 004741948..16cf30bf4 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 c93f644a4..f22beb365 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 6c1d887e5..d1ffc1d40 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 f70a28211..128752d1a 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 05b87178b..b809ba08d 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 ad000f643..2e37716cc 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 4f8ddaf2e..61993f799 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 e2314ba58..148a36666 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 19afca803..b879b45b6 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 0d55d670c..ee97c2560 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 ac8854b6c..c7680257a 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 2a38c3dbb..cf8c5bb33 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 ab350817c..5a0de4cda 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 e9f67ce59..0eb5e0a6b 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 37c772760..dd3191b82 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 2024dbdae..1a66fb9bf 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 73d66ca58..3d1036fed 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 f61decb3c..2be4ca2f2 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 621c614ff..a3af4f46e 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 4a523f909..6978efdcf 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 f73853473..5cf5f21ed 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 16f32368c..14850f860 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 32f3cd32f..6900106a6 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 7b31c1149..2e542b6c4 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 e2d0e5c81..03e5df830 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 65abc5883..32394684c 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 126c8a032..3979780ba 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 5bfa1e9d7..b8c10ac40 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 ab04d0fe5..14c50e746 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 0c0fa7fd1..ff51699b0 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 883da2459..b5fe14a1b 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 0ab64e7f9..094689ae2 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 f52be6b75..37cdf859c 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 2a1dc701c..1e0a17942 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 27f4c0069..000000000 --- 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 58fa238d4..d0c506b3d 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 540d60aa8..000000000 --- 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 b5c14a66a..ba6781a57 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 4345c3d38..76cfd3314 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 add1f408e..d992a69a5 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 4dc938199..fc39f7b64 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 b91feba9b..ca7faa7fe 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 4cf8daa43..bc519c383 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._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.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._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.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.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.padright": { "version": "3.1.1", "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" + }, "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 9d6cfa993..4884bdcda 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 ee369e1af..27ec28993 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 117369a73..cf2306f0f 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 76d8d5af2..d60e0fb2b 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