diff --git a/.flowconfig b/.flowconfig index 0bbb11213..24a6c3ff7 100644 --- a/.flowconfig +++ b/.flowconfig @@ -9,6 +9,14 @@ # Ignore malformed json .*/node_modules/y18n/test/.*\.json +# Ignore unexpected extra @providesModule +.*/node_modules/commoner/test/source/widget/share.js + +# Ignore duplicate module providers +/Libraries/react-native/React.js +/Libraries/react-native/ReactNative.js +/node_modules/jest-runtime/build/__tests__/.* + [include] [libs] @@ -32,9 +40,9 @@ suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-8]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-8]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy [version] -^0.27.0 +^0.28.0 diff --git a/Examples/UIExplorer/NavigationExperimental/NavigationTransitioner-AnimatedView-example.js b/Examples/UIExplorer/NavigationExperimental/NavigationTransitioner-AnimatedView-example.js index 31cafcb91..db1b088f5 100644 --- a/Examples/UIExplorer/NavigationExperimental/NavigationTransitioner-AnimatedView-example.js +++ b/Examples/UIExplorer/NavigationExperimental/NavigationTransitioner-AnimatedView-example.js @@ -222,7 +222,7 @@ class ExampleScene extends Component { const width = layout.initWidth; const translateX = position.interpolate({ inputRange, - outputRange: [width, 0, -10], + outputRange: ([width, 0, -10]: Array), }); return { diff --git a/Examples/UIExplorer/WebSocketExample.js b/Examples/UIExplorer/WebSocketExample.js index c43079162..d3400fdbc 100644 --- a/Examples/UIExplorer/WebSocketExample.js +++ b/Examples/UIExplorer/WebSocketExample.js @@ -1,4 +1,11 @@ /** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * * The examples provided by Facebook are for non-commercial testing and * evaluation purposes only. * @@ -81,7 +88,7 @@ function showValue(value) { if (typeof ArrayBuffer !== 'undefined' && typeof Uint8Array !== 'undefined' && value instanceof ArrayBuffer) { - return `ArrayBuffer {${Array.from(new Uint8Array(value))}}`; + return `ArrayBuffer {${String(Array.from(new Uint8Array(value)))}}`; } return value; } diff --git a/Libraries/BugReporting/dumpReactTree.js b/Libraries/BugReporting/dumpReactTree.js index 89a7d874c..06c734e3a 100644 --- a/Libraries/BugReporting/dumpReactTree.js +++ b/Libraries/BugReporting/dumpReactTree.js @@ -101,6 +101,7 @@ function convertObject(object: Object, depth: number) { if (!first) { output += ', '; } + // $FlowFixMe(>=0.28.0) output += `${key}: ${convertValue(object[key], depth + 1)}`; first = false; } diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 7ef596275..3d4a8b376 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -143,6 +143,7 @@ class CameraRoll { invariant( type === 'photo' || type === 'video' || type === undefined, + // $FlowFixMe(>=0.28.0) `The second argument to saveToCameraRoll must be 'photo' or 'video'. You passed ${type}` ); diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js index fb5a7f4dd..77fa010e5 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationCardStackStyleInterpolator.js @@ -90,18 +90,18 @@ function forHorizontal(props: NavigationSceneRendererProps): Object { const opacity = position.interpolate({ inputRange, - outputRange: [1, 1, 0.3], + outputRange: ([1, 1, 0.3]: Array), }); const scale = position.interpolate({ inputRange, - outputRange: [1, 1, 0.95], + outputRange: ([1, 1, 0.95]: Array), }); const translateY = 0; const translateX = position.interpolate({ inputRange, - outputRange: [width, 0, -10], + outputRange: ([width, 0, -10]: Array), }); return { @@ -131,18 +131,18 @@ function forVertical(props: NavigationSceneRendererProps): Object { const opacity = position.interpolate({ inputRange, - outputRange: [1, 1, 0.3], + outputRange: ([1, 1, 0.3]: Array), }); const scale = position.interpolate({ inputRange, - outputRange: [1, 1, 0.95], + outputRange: ([1, 1, 0.95]: Array), }); const translateX = 0; const translateY = position.interpolate({ inputRange, - outputRange: [height, 0, -10], + outputRange: ([height, 0, -10]: Array), }); return { diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderStyleInterpolator.js b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderStyleInterpolator.js index f6a0dbf51..fcc37c7a5 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderStyleInterpolator.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationHeaderStyleInterpolator.js @@ -54,7 +54,7 @@ function forLeft(props: NavigationSceneRendererProps): Object { return { opacity: position.interpolate({ inputRange: [ index - 1, index, index + 1 ], - outputRange: [ 0, 1, 0 ], + outputRange: ([ 0, 1, 0 ]: Array), }), }; } @@ -65,13 +65,13 @@ function forCenter(props: NavigationSceneRendererProps): Object { return { opacity:position.interpolate({ inputRange: [ index - 1, index, index + 1 ], - outputRange: [ 0, 1, 0 ], + outputRange: ([ 0, 1, 0 ]: Array), }), transform: [ { translateX: position.interpolate({ inputRange: [ index - 1, index + 1 ], - outputRange: [ 200, -200 ], + outputRange: ([ 200, -200 ]: Array), }), } ], @@ -84,7 +84,7 @@ function forRight(props: NavigationSceneRendererProps): Object { return { opacity: position.interpolate({ inputRange: [ index - 1, index, index + 1 ], - outputRange: [ 0, 1, 0 ], + outputRange: ([ 0, 1, 0 ]: Array), }), }; } diff --git a/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js b/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js index 78a9987ca..87a211b1a 100644 --- a/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js +++ b/Libraries/CustomComponents/NavigationExperimental/NavigationPagerStyleInterpolator.js @@ -91,7 +91,7 @@ function forHorizontal(props: NavigationSceneRendererProps): Object { const width = layout.initWidth; const translateX = position.interpolate({ inputRange, - outputRange: [width, 0, -width], + outputRange: ([width, 0, -width]: Array), }); return { diff --git a/Libraries/Experimental/WindowedListView.js b/Libraries/Experimental/WindowedListView.js index bec56ecbe..2cef3471c 100644 --- a/Libraries/Experimental/WindowedListView.js +++ b/Libraries/Experimental/WindowedListView.js @@ -626,6 +626,7 @@ class CellRenderer extends React.Component { if (this.props.asyncRowPerfEventName) { this._perfUpdateID = g_perf_update_id++; this._asyncCookie = Systrace.beginAsyncEvent(this.props.asyncRowPerfEventName + this._perfUpdateID); + // $FlowFixMe(>=0.28.0) infoLog(`perf_asynctest_${this.props.asyncRowPerfEventName}_start ${this._perfUpdateID} ${Date.now()}`); } if (this.props.includeInLayout) { @@ -662,6 +663,7 @@ class CellRenderer extends React.Component { // Note this doesn't include the native render time but is more accurate than also including the JS render // time of anything that has been queued up. Systrace.endAsyncEvent(this.props.asyncRowPerfEventName + this._perfUpdateID, this._asyncCookie); + // $FlowFixMe(>=0.28.0) infoLog(`perf_asynctest_${this.props.asyncRowPerfEventName}_end ${this._perfUpdateID} ${Date.now()}`); } } diff --git a/Libraries/StyleSheet/StyleSheetTypes.js b/Libraries/StyleSheet/StyleSheetTypes.js index 779e64772..515d3e614 100644 --- a/Libraries/StyleSheet/StyleSheetTypes.js +++ b/Libraries/StyleSheet/StyleSheetTypes.js @@ -12,4 +12,4 @@ 'use strict'; type Atom = number | bool | Object | Array; -export type StyleObj = Atom | Array; +export type StyleObj = Atom; diff --git a/package.json b/package.json index 2961e17c4..59f40476e 100644 --- a/package.json +++ b/package.json @@ -196,7 +196,7 @@ "eslint-plugin-babel": "^3.2.0", "eslint-plugin-flow-vars": "^0.2.1", "eslint-plugin-react": "^4.2.1", - "flow-bin": "^0.27.0", + "flow-bin": "^0.28.0", "jest": "^13.1.0", "jest-repl": "^13.1.0", "jest-runtime": "^13.1.0",