From 91b6b4efb90c733715b20d18f88c5d972cf48df3 Mon Sep 17 00:00:00 2001 From: Marshall Roch Date: Wed, 6 Sep 2017 03:25:01 -0700 Subject: [PATCH] @allow-large-files Flow v0.54.0 Reviewed By: leebyron Differential Revision: D5773490 fbshipit-source-id: 2c54bb6326f23edbe9a969f3010f79da8189923e --- .flowconfig | 6 ++--- IntegrationTests/AsyncStorageTest.js | 6 ++++- .../IntegrationTestHarnessTest.js | 9 ++++++- IntegrationTests/IntegrationTestsApp.js | 3 +++ IntegrationTests/SimpleSnapshotTest.js | 3 +++ IntegrationTests/TimersTest.js | 3 +++ .../websocket_integration_test_server.js | 3 +++ Libraries/Blob/Blob.js | 3 +++ .../Keyboard/KeyboardAvoidingView.js | 3 +++ .../Components/Navigation/NavigatorIOS.ios.js | 3 +++ Libraries/Components/ScrollResponder.js | 6 +++++ Libraries/Components/ScrollView/ScrollView.js | 3 +++ Libraries/Components/Slider/Slider.js | 12 +++++++++ Libraries/Components/TextInput/TextInput.js | 9 +++++++ .../Touchable/TouchableHighlight.js | 6 +++++ .../Touchable/TouchableWithoutFeedback.js | 6 +++++ .../View/ReactNativeStyleAttributes.js | 3 +++ Libraries/Core/Devtools/parseErrorStack.js | 3 +++ Libraries/Core/Devtools/setupDevtools.js | 3 +++ Libraries/Core/InitializeCore.js | 3 +++ Libraries/Core/Timers/JSTimers.js | 6 +++++ Libraries/Experimental/IncrementalExample.js | 3 +++ .../Experimental/SwipeableRow/SwipeableRow.js | 6 +++++ Libraries/Geolocation/Geolocation.js | 3 +++ Libraries/Image/ImageResizeMode.js | 3 +++ Libraries/Inspector/Inspector.js | 3 +++ Libraries/Interaction/InteractionManager.js | 3 +++ Libraries/Interaction/JSEventLoopWatchdog.js | 3 +++ Libraries/LayoutAnimation/LayoutAnimation.js | 3 +++ Libraries/Lists/FillRateHelper.js | 6 +++++ Libraries/Lists/ListView/ListView.js | 12 +++++++++ .../Lists/ListView/ListViewDataSource.js | 3 +++ Libraries/Lists/VirtualizedList.js | 3 +++ Libraries/Network/XMLHttpRequest.js | 6 +++++ Libraries/Promise.js | 9 +++++++ .../ReactNative/requireNativeComponent.js | 3 +++ Libraries/ReactNative/verifyPropTypes.js | 9 ------- Libraries/Text/TextUpdateTest.js | 3 +++ Libraries/Utilities/PerformanceLogger.js | 3 +++ Libraries/Utilities/binaryToBase64.js | 3 +++ Libraries/WebSocket/WebSocket.js | 9 +++++++ Libraries/promiseRejectionIsError.js | 3 +++ Libraries/vendor/emitter/mixInEventEmitter.js | 3 +++ RNTester/js/ProgressViewIOSExample.js | 3 +++ RNTester/js/TimerExample.js | 6 +++++ RNTester/js/http_test_server.js | 3 +++ RNTester/js/websocket_test_server.js | 3 +++ jest/preprocessor.js | 12 +++++++++ local-cli/bundle/buildBundle.js | 26 +++++++++++++++++-- local-cli/bundle/types.flow.js | 3 +++ local-cli/cliEntry.js | 6 +++++ local-cli/core/index.js | 6 +++++ local-cli/link/link.js | 9 +++++++ local-cli/server/runServer.js | 26 +++++++++++++++++-- local-cli/server/util/attachHMRServer.js | 6 +++++ local-cli/server/util/launchChrome.js | 3 +++ local-cli/templates/HelloWorld/_flowconfig | 6 ++--- local-cli/util/Config.js | 18 +++++++++++++ package.json | 4 +-- 59 files changed, 321 insertions(+), 23 deletions(-) diff --git a/.flowconfig b/.flowconfig index 706412073..683702d26 100644 --- a/.flowconfig +++ b/.flowconfig @@ -46,12 +46,12 @@ suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeState suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError unsafe.enable_getters_and_setters=true [version] -^0.53.0 +^0.54.0 diff --git a/IntegrationTests/AsyncStorageTest.js b/IntegrationTests/AsyncStorageTest.js index 31df5026b..044392eb6 100644 --- a/IntegrationTests/AsyncStorageTest.js +++ b/IntegrationTests/AsyncStorageTest.js @@ -189,7 +189,11 @@ class AsyncStorageTest extends React.Component<{}, $FlowFixMeState> { return ( - {this.constructor.displayName + ': '} + { + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This + * comment suppresses an error found when Flow v0.54 was deployed. + * To see the error delete this comment and run Flow. */ + this.constructor.displayName + ': '} {this.state.done ? 'Done' : 'Testing...'} {'\n\n' + this.state.messages} diff --git a/IntegrationTests/IntegrationTestHarnessTest.js b/IntegrationTests/IntegrationTestHarnessTest.js index 1b5895f9e..7c9f2527c 100644 --- a/IntegrationTests/IntegrationTestHarnessTest.js +++ b/IntegrationTests/IntegrationTestHarnessTest.js @@ -11,6 +11,9 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); var React = require('react'); var PropTypes = require('prop-types'); @@ -60,7 +63,11 @@ class IntegrationTestHarnessTest extends React.Component<{ return ( - {this.constructor.displayName + ': '} + { + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This + * comment suppresses an error found when Flow v0.54 was deployed. + * To see the error delete this comment and run Flow. */ + this.constructor.displayName + ': '} {this.state.done ? 'Done' : 'Testing...'} diff --git a/IntegrationTests/IntegrationTestsApp.js b/IntegrationTests/IntegrationTestsApp.js index ebe48478d..0594e289b 100644 --- a/IntegrationTests/IntegrationTestsApp.js +++ b/IntegrationTests/IntegrationTestsApp.js @@ -40,6 +40,9 @@ var TESTS = [ ]; TESTS.forEach( + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ (test) => AppRegistry.registerComponent(test.displayName, () => test) ); diff --git a/IntegrationTests/SimpleSnapshotTest.js b/IntegrationTests/SimpleSnapshotTest.js index 70158b63f..3998118dd 100644 --- a/IntegrationTests/SimpleSnapshotTest.js +++ b/IntegrationTests/SimpleSnapshotTest.js @@ -13,6 +13,9 @@ var React = require('react'); var ReactNative = require('react-native'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var requestAnimationFrame = require('fbjs/lib/requestAnimationFrame'); var { diff --git a/IntegrationTests/TimersTest.js b/IntegrationTests/TimersTest.js index 06d4c6b1a..ddd052081 100644 --- a/IntegrationTests/TimersTest.js +++ b/IntegrationTests/TimersTest.js @@ -14,6 +14,9 @@ var React = require('react'); var createReactClass = require('create-react-class'); var ReactNative = require('react-native'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var TimerMixin = require('react-timer-mixin'); var { diff --git a/IntegrationTests/websocket_integration_test_server.js b/IntegrationTests/websocket_integration_test_server.js index 175c1db69..b7887f1c5 100755 --- a/IntegrationTests/websocket_integration_test_server.js +++ b/IntegrationTests/websocket_integration_test_server.js @@ -15,6 +15,9 @@ /* eslint-env node */ +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const WebSocket = require('ws'); console.log(`\ diff --git a/Libraries/Blob/Blob.js b/Libraries/Blob/Blob.js index 0180e15e2..590f48fc5 100644 --- a/Libraries/Blob/Blob.js +++ b/Libraries/Blob/Blob.js @@ -13,6 +13,9 @@ 'use strict'; const invariant = require('fbjs/lib/invariant'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const uuid = require('uuid'); const { BlobModule } = require('NativeModules'); diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index c5afbbefb..ad5dbbac0 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -17,6 +17,9 @@ const LayoutAnimation = require('LayoutAnimation'); const Platform = require('Platform'); const PropTypes = require('prop-types'); const React = require('React'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TimerMixin = require('react-timer-mixin'); const View = require('View'); const ViewPropTypes = require('ViewPropTypes'); diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index 024c0e1a3..96bdd3629 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -27,6 +27,9 @@ var createReactClass = require('create-react-class'); var invariant = require('fbjs/lib/invariant'); var requireNativeComponent = require('requireNativeComponent'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const keyMirror = require('fbjs/lib/keyMirror'); var TRANSITIONER_REF = 'transitionerRef'; diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index cb16e9b6e..dd4ca0cab 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -21,7 +21,13 @@ var UIManager = require('UIManager'); var invariant = require('fbjs/lib/invariant'); var nullthrows = require('fbjs/lib/nullthrows'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var performanceNow = require('fbjs/lib/performanceNow'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var warning = require('fbjs/lib/warning'); var { ScrollViewManager } = require('NativeModules'); diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 980d5d734..5aa55af73 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -33,6 +33,9 @@ const flattenStyle = require('flattenStyle'); const invariant = require('fbjs/lib/invariant'); const processDecelerationRate = require('processDecelerationRate'); const requireNativeComponent = require('requireNativeComponent'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); import type {NativeMethodsMixinType} from 'ReactNativeTypes'; diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index 712100bff..2437a021f 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -159,8 +159,14 @@ var Slider = createReactClass({ render: function() { const {style, onValueChange, onSlidingComplete, ...props} = this.props; + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ props.style = [styles.slider, style]; + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ props.onValueChange = onValueChange && ((event: Event) => { let userEvent = true; if (Platform.OS === 'android') { @@ -171,8 +177,14 @@ var Slider = createReactClass({ onValueChange && userEvent && onValueChange(event.nativeEvent.value); }); + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ props.onChange = props.onValueChange; + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ props.onSlidingComplete = onSlidingComplete && ((event: Event) => { onSlidingComplete && onSlidingComplete(event.nativeEvent.value); }); diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index be140d7f6..32d588cea 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -23,14 +23,23 @@ const ReactNative = require('ReactNative'); const StyleSheet = require('StyleSheet'); const Text = require('Text'); const TextInputState = require('TextInputState'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TimerMixin = require('react-timer-mixin'); const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); const UIManager = require('UIManager'); const ViewPropTypes = require('ViewPropTypes'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const emptyFunction = require('fbjs/lib/emptyFunction'); const invariant = require('fbjs/lib/invariant'); const requireNativeComponent = require('requireNativeComponent'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); const onlyMultiline = { diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index 022419021..bd79c6290 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -17,6 +17,9 @@ const PropTypes = require('prop-types'); const React = require('React'); const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); const StyleSheet = require('StyleSheet'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TimerMixin = require('react-timer-mixin'); const Touchable = require('Touchable'); const TouchableWithoutFeedback = require('TouchableWithoutFeedback'); @@ -26,6 +29,9 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const ensureComponentIsNative = require('ensureComponentIsNative'); const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const keyOf = require('fbjs/lib/keyOf'); const merge = require('merge'); diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 8e8fbb00e..c00ae85ab 100755 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -14,11 +14,17 @@ const EdgeInsetsPropType = require('EdgeInsetsPropType'); const React = require('React'); const PropTypes = require('prop-types'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TimerMixin = require('react-timer-mixin'); const Touchable = require('Touchable'); const createReactClass = require('create-react-class'); const ensurePositiveDelayProps = require('ensurePositiveDelayProps'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); const { diff --git a/Libraries/Components/View/ReactNativeStyleAttributes.js b/Libraries/Components/View/ReactNativeStyleAttributes.js index fd26f3969..b5cebe4f7 100644 --- a/Libraries/Components/View/ReactNativeStyleAttributes.js +++ b/Libraries/Components/View/ReactNativeStyleAttributes.js @@ -16,6 +16,9 @@ var ImageStylePropTypes = require('ImageStylePropTypes'); var TextStylePropTypes = require('TextStylePropTypes'); var ViewStylePropTypes = require('ViewStylePropTypes'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var keyMirror = require('fbjs/lib/keyMirror'); var processColor = require('processColor'); var processTransform = require('processTransform'); diff --git a/Libraries/Core/Devtools/parseErrorStack.js b/Libraries/Core/Devtools/parseErrorStack.js index db22d7910..11466533f 100644 --- a/Libraries/Core/Devtools/parseErrorStack.js +++ b/Libraries/Core/Devtools/parseErrorStack.js @@ -27,6 +27,9 @@ function parseErrorStack(e: ExtendedError): Array { return []; } + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ const stacktraceParser = require('stacktrace-parser'); const stack = Array.isArray(e.stack) ? e.stack : stacktraceParser.parse(e.stack); diff --git a/Libraries/Core/Devtools/setupDevtools.js b/Libraries/Core/Devtools/setupDevtools.js index 3658c652b..05968d53a 100644 --- a/Libraries/Core/Devtools/setupDevtools.js +++ b/Libraries/Core/Devtools/setupDevtools.js @@ -29,6 +29,9 @@ if (__DEV__) { const AppState = require('AppState'); const WebSocket = require('WebSocket'); const {PlatformConstants} = require('NativeModules'); + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ const reactDevTools = require('react-devtools-core'); register = function (plugin: DevToolsPlugin) { diff --git a/Libraries/Core/InitializeCore.js b/Libraries/Core/InitializeCore.js index fd239f119..bb100bb3b 100644 --- a/Libraries/Core/InitializeCore.js +++ b/Libraries/Core/InitializeCore.js @@ -135,6 +135,9 @@ polyfillGlobal('regeneratorRuntime', () => { // The require just sets up the global, so make sure when we first // invoke it the global does not exist delete global.regeneratorRuntime; + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ require('regenerator-runtime/runtime'); return global.regeneratorRuntime; }); diff --git a/Libraries/Core/Timers/JSTimers.js b/Libraries/Core/Timers/JSTimers.js index 73b6c1235..f60a4580b 100644 --- a/Libraries/Core/Timers/JSTimers.js +++ b/Libraries/Core/Timers/JSTimers.js @@ -23,6 +23,9 @@ import type {ExtendedError} from 'parseErrorStack'; let _performanceNow = null; function performanceNow() { if (!_performanceNow) { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ _performanceNow = require('fbjs/lib/performanceNow'); } return _performanceNow(); @@ -101,6 +104,9 @@ function _allocateCallback(func: Function, type: JSTimerType): number { * recurring (setInterval). */ function _callTimer(timerID: number, frameTime: number, didTimeout: ?boolean) { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ require('fbjs/lib/warning')( timerID <= GUID, 'Tried to call timer with ID %s but no such timer exists.', diff --git a/Libraries/Experimental/IncrementalExample.js b/Libraries/Experimental/IncrementalExample.js index bdfb3d189..13272627f 100644 --- a/Libraries/Experimental/IncrementalExample.js +++ b/Libraries/Experimental/IncrementalExample.js @@ -28,6 +28,9 @@ const IncrementalPresenter = require('IncrementalPresenter'); const JSEventLoopWatchdog = require('JSEventLoopWatchdog'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const performanceNow = require('fbjs/lib/performanceNow'); InteractionManager.setDeadline(1000); diff --git a/Libraries/Experimental/SwipeableRow/SwipeableRow.js b/Libraries/Experimental/SwipeableRow/SwipeableRow.js index 42f34a480..9332c640e 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableRow.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableRow.js @@ -17,10 +17,16 @@ const PanResponder = require('PanResponder'); const React = require('React'); const PropTypes = require('prop-types'); const StyleSheet = require('StyleSheet'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TimerMixin = require('react-timer-mixin'); const View = require('View'); const createReactClass = require('create-react-class'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const emptyFunction = require('fbjs/lib/emptyFunction'); const IS_RTL = I18nManager.isRTL; diff --git a/Libraries/Geolocation/Geolocation.js b/Libraries/Geolocation/Geolocation.js index 2a68585ff..712dc9f13 100644 --- a/Libraries/Geolocation/Geolocation.js +++ b/Libraries/Geolocation/Geolocation.js @@ -16,6 +16,9 @@ const RCTLocationObserver = require('NativeModules').LocationObserver; const invariant = require('fbjs/lib/invariant'); const logError = require('logError'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); const LocationEventEmitter = new NativeEventEmitter(RCTLocationObserver); diff --git a/Libraries/Image/ImageResizeMode.js b/Libraries/Image/ImageResizeMode.js index 626069d6d..0f9cb3b3d 100644 --- a/Libraries/Image/ImageResizeMode.js +++ b/Libraries/Image/ImageResizeMode.js @@ -11,6 +11,9 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var keyMirror = require('fbjs/lib/keyMirror'); /** diff --git a/Libraries/Inspector/Inspector.js b/Libraries/Inspector/Inspector.js index 166718126..24439c504 100644 --- a/Libraries/Inspector/Inspector.js +++ b/Libraries/Inspector/Inspector.js @@ -25,6 +25,9 @@ const Touchable = require('Touchable'); const UIManager = require('UIManager'); const View = require('View'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const emptyObject = require('fbjs/lib/emptyObject'); const invariant = require('fbjs/lib/invariant'); diff --git a/Libraries/Interaction/InteractionManager.js b/Libraries/Interaction/InteractionManager.js index 5beb56e59..cd3863ec7 100644 --- a/Libraries/Interaction/InteractionManager.js +++ b/Libraries/Interaction/InteractionManager.js @@ -18,6 +18,9 @@ const TaskQueue = require('TaskQueue'); const infoLog = require('infoLog'); const invariant = require('fbjs/lib/invariant'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const keyMirror = require('fbjs/lib/keyMirror'); type Handle = number; diff --git a/Libraries/Interaction/JSEventLoopWatchdog.js b/Libraries/Interaction/JSEventLoopWatchdog.js index acd3f7575..702f18d6c 100644 --- a/Libraries/Interaction/JSEventLoopWatchdog.js +++ b/Libraries/Interaction/JSEventLoopWatchdog.js @@ -12,6 +12,9 @@ 'use strict'; const infoLog = require('infoLog'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const performanceNow = require('fbjs/lib/performanceNow'); type Handler = { diff --git a/Libraries/LayoutAnimation/LayoutAnimation.js b/Libraries/LayoutAnimation/LayoutAnimation.js index 1b218201b..dc0720ba0 100644 --- a/Libraries/LayoutAnimation/LayoutAnimation.js +++ b/Libraries/LayoutAnimation/LayoutAnimation.js @@ -15,6 +15,9 @@ const PropTypes = require('prop-types'); const UIManager = require('UIManager'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const keyMirror = require('fbjs/lib/keyMirror'); const {checkPropTypes} = PropTypes; diff --git a/Libraries/Lists/FillRateHelper.js b/Libraries/Lists/FillRateHelper.js index 20f04d112..6a7da8416 100644 --- a/Libraries/Lists/FillRateHelper.js +++ b/Libraries/Lists/FillRateHelper.js @@ -15,7 +15,13 @@ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const performanceNow = require('fbjs/lib/performanceNow'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); export type FillRateInfo = Info; diff --git a/Libraries/Lists/ListView/ListView.js b/Libraries/Lists/ListView/ListView.js index 1afdde664..5273cc1cb 100644 --- a/Libraries/Lists/ListView/ListView.js +++ b/Libraries/Lists/ListView/ListView.js @@ -21,9 +21,15 @@ var RCTScrollViewManager = require('NativeModules').ScrollViewManager; var ScrollView = require('ScrollView'); var ScrollResponder = require('ScrollResponder'); var StaticRenderer = require('StaticRenderer'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var TimerMixin = require('react-timer-mixin'); var View = require('View'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var cloneReferencedElement = require('react-clone-referenced-element'); var createReactClass = require('create-react-class'); var isEmpty = require('isEmpty'); @@ -423,6 +429,9 @@ var ListView = createReactClass({ var rowIDs = allRowIDs[sectionIdx]; if (rowIDs.length === 0) { if (this.props.enableEmptySections === undefined) { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses + * an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ var warning = require('fbjs/lib/warning'); warning( false, @@ -517,6 +526,9 @@ var ListView = createReactClass({ if (props.removeClippedSubviews === undefined) { props.removeClippedSubviews = true; } + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ Object.assign(props, { onScroll: this._onScroll, /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This diff --git a/Libraries/Lists/ListView/ListViewDataSource.js b/Libraries/Lists/ListView/ListViewDataSource.js index adc2f776f..4a3f0ff42 100644 --- a/Libraries/Lists/ListView/ListViewDataSource.js +++ b/Libraries/Lists/ListView/ListViewDataSource.js @@ -14,6 +14,9 @@ var invariant = require('fbjs/lib/invariant'); var isEmpty = require('isEmpty'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var warning = require('fbjs/lib/warning'); function defaultGetRowData( diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index c1c22756d..31dd01b59 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -26,6 +26,9 @@ const ViewabilityHelper = require('ViewabilityHelper'); const flattenStyle = require('flattenStyle'); const infoLog = require('infoLog'); const invariant = require('fbjs/lib/invariant'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); const {computeWindowedRenderLimits} = require('VirtualizeUtils'); diff --git a/Libraries/Network/XMLHttpRequest.js b/Libraries/Network/XMLHttpRequest.js index 5267bb4cf..be5905ff0 100644 --- a/Libraries/Network/XMLHttpRequest.js +++ b/Libraries/Network/XMLHttpRequest.js @@ -14,8 +14,14 @@ const EventTarget = require('event-target-shim'); const RCTNetworking = require('RCTNetworking'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const base64 = require('base64-js'); const invariant = require('fbjs/lib/invariant'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); type ResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text'; diff --git a/Libraries/Promise.js b/Libraries/Promise.js index c4f3545bf..61ea1ede7 100644 --- a/Libraries/Promise.js +++ b/Libraries/Promise.js @@ -11,9 +11,15 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const Promise = require('fbjs/lib/Promise.native'); if (__DEV__) { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ require('promise/setimmediate/rejection-tracking').enable({ allRejections: true, onUnhandled: (id, error = {}) => { @@ -25,6 +31,9 @@ if (__DEV__) { message = Error.prototype.toString.call(error); stack = error.stack; } else { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses + * an error found when Flow v0.54 was deployed. To see the error delete + * this comment and run Flow. */ message = require('pretty-format')(error); } diff --git a/Libraries/ReactNative/requireNativeComponent.js b/Libraries/ReactNative/requireNativeComponent.js index 3b51ac794..5a795eeb5 100644 --- a/Libraries/ReactNative/requireNativeComponent.js +++ b/Libraries/ReactNative/requireNativeComponent.js @@ -23,6 +23,9 @@ const processColor = require('processColor'); const resolveAssetSource = require('resolveAssetSource'); const sizesDiffer = require('sizesDiffer'); const verifyPropTypes = require('verifyPropTypes'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const warning = require('fbjs/lib/warning'); /** diff --git a/Libraries/ReactNative/verifyPropTypes.js b/Libraries/ReactNative/verifyPropTypes.js index f559c7597..ee8532c3f 100644 --- a/Libraries/ReactNative/verifyPropTypes.js +++ b/Libraries/ReactNative/verifyPropTypes.js @@ -43,9 +43,6 @@ function verifyPropTypes( if (!propTypes) { throw new Error( - /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This - * comment suppresses an error when upgrading Flow's support for React. - * To see the error delete this comment and run Flow. */ '`' + componentName + '` has no propTypes defined`' ); } @@ -57,15 +54,9 @@ function verifyPropTypes( (!nativePropsToIgnore || !nativePropsToIgnore[prop])) { var message; if (propTypes.hasOwnProperty(prop)) { - /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This - * comment suppresses an error when upgrading Flow's support for React. - * To see the error delete this comment and run Flow. */ message = '`' + componentName + '` has incorrectly defined propType for native prop `' + viewConfig.uiViewClassName + '.' + prop + '` of native type `' + nativeProps[prop]; } else { - /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This - * comment suppresses an error when upgrading Flow's support for React. - * To see the error delete this comment and run Flow. */ message = '`' + componentName + '` has no propType for native prop `' + viewConfig.uiViewClassName + '.' + prop + '` of native type `' + nativeProps[prop] + '`'; diff --git a/Libraries/Text/TextUpdateTest.js b/Libraries/Text/TextUpdateTest.js index bd12bb848..f0de98e9a 100644 --- a/Libraries/Text/TextUpdateTest.js +++ b/Libraries/Text/TextUpdateTest.js @@ -14,6 +14,9 @@ var React = require('react'); var createReactClass = require('create-react-class'); var ReactNative = require('react-native'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var TimerMixin = require('react-timer-mixin'); var { NativeModules, diff --git a/Libraries/Utilities/PerformanceLogger.js b/Libraries/Utilities/PerformanceLogger.js index 39122e0e9..584da0886 100644 --- a/Libraries/Utilities/PerformanceLogger.js +++ b/Libraries/Utilities/PerformanceLogger.js @@ -16,6 +16,9 @@ const Systrace = require('Systrace'); const infoLog = require('infoLog'); const performanceNow = + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ global.nativePerformanceNow || require('fbjs/lib/performanceNow'); type Timespan = { diff --git a/Libraries/Utilities/binaryToBase64.js b/Libraries/Utilities/binaryToBase64.js index ba23c5c85..008c6ac19 100644 --- a/Libraries/Utilities/binaryToBase64.js +++ b/Libraries/Utilities/binaryToBase64.js @@ -11,6 +11,9 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const base64 = require('base64-js'); function binaryToBase64(data: ArrayBuffer | $ArrayBufferView) { diff --git a/Libraries/WebSocket/WebSocket.js b/Libraries/WebSocket/WebSocket.js index 96f159a51..463b4c607 100644 --- a/Libraries/WebSocket/WebSocket.js +++ b/Libraries/WebSocket/WebSocket.js @@ -18,6 +18,9 @@ const NativeModules = require('NativeModules'); const Platform = require('Platform'); const WebSocketEvent = require('WebSocketEvent'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const base64 = require('base64-js'); const binaryToBase64 = require('binaryToBase64'); const invariant = require('fbjs/lib/invariant'); @@ -104,7 +107,13 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) { // Preserve deprecated backwards compatibility for the 'origin' option if (unrecognized && typeof unrecognized.origin === 'string') { console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.'); + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This + * comment suppresses an error found when Flow v0.54 was deployed. To see + * the error delete this comment and run Flow. */ headers.origin = unrecognized.origin; + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This + * comment suppresses an error found when Flow v0.54 was deployed. To see + * the error delete this comment and run Flow. */ delete unrecognized.origin; } diff --git a/Libraries/promiseRejectionIsError.js b/Libraries/promiseRejectionIsError.js index a2ab6bb38..60d1a0032 100644 --- a/Libraries/promiseRejectionIsError.js +++ b/Libraries/promiseRejectionIsError.js @@ -12,6 +12,9 @@ 'use strict'; require('Promise'); // make sure the default rejection handler is installed +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const rejectionTracking = require('promise/setimmediate/rejection-tracking'); module.exports = () => { diff --git a/Libraries/vendor/emitter/mixInEventEmitter.js b/Libraries/vendor/emitter/mixInEventEmitter.js index 73353a52d..b8693f055 100644 --- a/Libraries/vendor/emitter/mixInEventEmitter.js +++ b/Libraries/vendor/emitter/mixInEventEmitter.js @@ -16,6 +16,9 @@ const EventEmitterWithHolding = require('EventEmitterWithHolding'); const EventHolder = require('EventHolder'); const invariant = require('fbjs/lib/invariant'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const keyOf = require('fbjs/lib/keyOf'); import type EmitterSubscription from 'EmitterSubscription'; diff --git a/RNTester/js/ProgressViewIOSExample.js b/RNTester/js/ProgressViewIOSExample.js index e9b8cd9d9..6b7be48a0 100644 --- a/RNTester/js/ProgressViewIOSExample.js +++ b/RNTester/js/ProgressViewIOSExample.js @@ -19,6 +19,9 @@ var { StyleSheet, View, } = ReactNative; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var TimerMixin = require('react-timer-mixin'); var ProgressViewExample = createReactClass({ diff --git a/RNTester/js/TimerExample.js b/RNTester/js/TimerExample.js index 7d4b0ad74..7faf66756 100644 --- a/RNTester/js/TimerExample.js +++ b/RNTester/js/TimerExample.js @@ -21,8 +21,14 @@ var { Text, View, } = ReactNative; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var TimerMixin = require('react-timer-mixin'); var RNTesterButton = require('./RNTesterButton'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ var performanceNow = require('fbjs/lib/performanceNow'); function burnCPU(milliseconds) { diff --git a/RNTester/js/http_test_server.js b/RNTester/js/http_test_server.js index 3c18d9abb..7af1f052e 100755 --- a/RNTester/js/http_test_server.js +++ b/RNTester/js/http_test_server.js @@ -20,6 +20,9 @@ Test server for WebSocketExample This will set a cookie named "wstest" on the response of any incoming request. `); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const connect = require('connect'); const http = require('http'); diff --git a/RNTester/js/websocket_test_server.js b/RNTester/js/websocket_test_server.js index 6a753b27b..01feb12d5 100755 --- a/RNTester/js/websocket_test_server.js +++ b/RNTester/js/websocket_test_server.js @@ -14,6 +14,9 @@ /* eslint-env node */ +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const WebSocket = require('ws'); const fs = require('fs'); diff --git a/jest/preprocessor.js b/jest/preprocessor.js index 50962fd12..3734c48c4 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -13,8 +13,17 @@ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const babel = require('babel-core'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const babelRegisterOnly = require('metro-bundler/src/babelRegisterOnly'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction'); const nodeFiles = RegExp([ @@ -25,6 +34,9 @@ const nodeOptions = babelRegisterOnly.config([nodeFiles]); babelRegisterOnly([]); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const transformer = require('metro-bundler/src/transformer.js'); module.exports = { process(src/*: string*/, file/*: string*/) { diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index 127935ee1..8974bb93c 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.js @@ -12,17 +12,35 @@ 'use strict'; const log = require('../util/log').out('bundle'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const Server = require('metro-bundler/src/Server'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const Terminal = require('metro-bundler/src/lib/Terminal'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TerminalReporter = require('metro-bundler/src/lib/TerminalReporter'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TransformCaching = require('metro-bundler/src/lib/TransformCaching'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const outputBundle = require('metro-bundler/src/shared/output/bundle'); const path = require('path'); const saveAssets = require('./saveAssets'); const defaultAssetExts = require('metro-bundler/src/defaults').assetExts; const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts; const defaultPlatforms = require('metro-bundler/src/defaults').platforms; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults').providesModuleNodeModules; const {ASSET_REGISTRY_PATH} = require('../core/Constants'); @@ -32,6 +50,9 @@ import type {ConfigT} from '../util/Config'; function saveBundle(output, bundle, args) { return Promise.resolve( + /* $FlowFixMe(>=0.54.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ output.save(bundle, args, log) ).then(() => bundle); } @@ -82,8 +103,9 @@ function buildBundle( ? config.getProvidesModuleNodeModules() : defaultProvidesModuleNodeModules; - /* $FlowFixMe: Flow is wrong, Node.js docs specify that process.stdout is an - * instance of a net.Socket (a local socket, not network). */ + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ const terminal = new Terminal(process.stdout); const options = { assetExts: defaultAssetExts.concat(assetExts), diff --git a/local-cli/bundle/types.flow.js b/local-cli/bundle/types.flow.js index 0f12746c9..886f20e55 100644 --- a/local-cli/bundle/types.flow.js +++ b/local-cli/bundle/types.flow.js @@ -10,4 +10,7 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ export type {OutputOptions, RequestOptions} from 'metro-bundler/src/shared/types.flow'; diff --git a/local-cli/cliEntry.js b/local-cli/cliEntry.js index 641254199..3062394a8 100644 --- a/local-cli/cliEntry.js +++ b/local-cli/cliEntry.js @@ -13,8 +13,14 @@ const config = require('./core'); const assertRequiredOptions = require('./util/assertRequiredOptions'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const chalk = require('chalk'); const childProcess = require('child_process'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const commander = require('commander'); const commands = require('./commands'); const init = require('./init/init'); diff --git a/local-cli/core/index.js b/local-cli/core/index.js index 6fe4374af..aab8fc894 100644 --- a/local-cli/core/index.js +++ b/local-cli/core/index.js @@ -18,7 +18,13 @@ const ios = require('./ios'); const windows = require('./windows'); const wrapCommands = require('./wrapCommands'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const flatten = require('lodash').flatten; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const minimist = require('minimist'); const path = require('path'); diff --git a/local-cli/link/link.js b/local-cli/link/link.js index 124bd8e66..16afa7d94 100644 --- a/local-cli/link/link.js +++ b/local-cli/link/link.js @@ -9,12 +9,21 @@ * @flow */ +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const log = require('npmlog'); const path = require('path'); const uniq = require('lodash').uniq; const flatten = require('lodash').flatten; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const chalk = require('chalk'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const isEmpty = require('lodash').isEmpty; const promiseWaterfall = require('./promiseWaterfall'); const registerDependencyAndroid = require('./android/registerNativeModule'); diff --git a/local-cli/server/runServer.js b/local-cli/server/runServer.js index f3e93ace9..79f832b35 100644 --- a/local-cli/server/runServer.js +++ b/local-cli/server/runServer.js @@ -13,15 +13,27 @@ 'use strict'; require('../../setupBabel')(); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const ReactPackager = require('metro-bundler'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const Terminal = require('metro-bundler/src/lib/Terminal'); const attachHMRServer = require('./util/attachHMRServer'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const connect = require('connect'); const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddleware'); const defaultAssetExts = require('metro-bundler/src/defaults').assetExts; const defaultSourceExts = require('metro-bundler/src/defaults').sourceExts; const defaultPlatforms = require('metro-bundler/src/defaults').platforms; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const defaultProvidesModuleNodeModules = require('metro-bundler/src/defaults') .providesModuleNodeModules; const fs = require('fs'); @@ -37,11 +49,17 @@ const statusPageMiddleware = require('./middleware/statusPageMiddleware.js'); const systraceProfileMiddleware = require('./middleware/systraceProfileMiddleware.js'); const webSocketProxy = require('./util/webSocketProxy.js'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const TransformCaching = require('metro-bundler/src/lib/TransformCaching'); const {ASSET_REGISTRY_PATH} = require('../core/Constants'); import type {ConfigT} from '../util/Config'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ import type {Reporter} from 'metro-bundler/src/lib/reporting'; export type Args = {| @@ -141,11 +159,15 @@ function getPackagerServer(args, config) { LogReporter = require(path.resolve(args.customLogReporterPath)); } } else { + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ LogReporter = require('metro-bundler/src/lib/TerminalReporter'); } - /* $FlowFixMe: Flow is wrong, Node.js docs specify that process.stdout is an - * instance of a net.Socket (a local socket, not network). */ + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ const terminal = new Terminal(process.stdout); return ReactPackager.createServer({ assetExts: defaultAssetExts.concat(args.assetExts), diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index b9502893c..5da713527 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -110,6 +110,9 @@ function attachHMRServer( dependenciesModulesCache: {[mixed]: TModule}, shallowDependencies: {[string]: Array}, inverseDependenciesCache: mixed, + /* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment + * suppresses an error found when Flow v0.54 was deployed. To see the error + * delete this comment and run Flow. */ resolutionResponse: ResolutionResponse, }> { const response = await packagerServer.getDependencies({ @@ -391,6 +394,9 @@ function attachHMRServer( } } + /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an + * error found when Flow v0.54 was deployed. To see the error delete this + * comment and run Flow. */ const WebSocketServer = require('ws').Server; const wss = new WebSocketServer({ server: httpServer, diff --git a/local-cli/server/util/launchChrome.js b/local-cli/server/util/launchChrome.js index 792f0db67..8d91a4966 100644 --- a/local-cli/server/util/launchChrome.js +++ b/local-cli/server/util/launchChrome.js @@ -10,6 +10,9 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const opn = require('opn'); const execSync = require('child_process').execSync; diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index a359500ee..837c16729 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -37,12 +37,12 @@ suppress_type=$FlowFixMeProps suppress_type=$FlowFixMeState suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-4]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError unsafe.enable_getters_and_setters=true [version] -^0.53.0 +^0.54.0 diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 227d394e5..7ba6b6383 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -10,6 +10,9 @@ */ 'use strict'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const blacklist = require('metro-bundler/src/blacklist'); const findSymlinksPaths = require('./findSymlinksPaths'); const fs = require('fs'); @@ -17,6 +20,9 @@ const getPolyfills = require('../../rn-get-polyfills'); const invariant = require('fbjs/lib/invariant'); const path = require('path'); +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ const {providesModuleNodeModules} = require('metro-bundler/src/defaults'); const RN_CLI_CONFIG = 'rn-cli.config.js'; @@ -26,9 +32,21 @@ import type { PostMinifyProcess, PostProcessModules, PostProcessBundleSourcemap +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ } from 'metro-bundler/src/Bundler'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ import type {HasteImpl} from 'metro-bundler/src/node-haste/Module'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ import type {TransformVariants} from 'metro-bundler/src/ModuleGraph/types.flow'; +/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error + * found when Flow v0.54 was deployed. To see the error delete this comment and + * run Flow. */ import type {PostProcessModules as PostProcessModulesForBuck} from 'metro-bundler/src/ModuleGraph/types.flow.js'; /** diff --git a/package.json b/package.json index a0893ce70..e56101b9f 100644 --- a/package.json +++ b/package.json @@ -196,7 +196,7 @@ "eslint-plugin-flowtype": "^2.33.0", "eslint-plugin-prettier": "2.1.1", "eslint-plugin-react": "^7.2.1", - "flow-bin": "^0.53.0", + "flow-bin": "^0.54.0", "jest": "^21", "mock-fs": "^4.4.1", "prettier": "1.5.2", @@ -205,4 +205,4 @@ "shelljs": "0.6.0", "sinon": "^2.2.0" } -} \ No newline at end of file +}