From d2a1461d26df4c1b29362c0f6900fbf639d243d8 Mon Sep 17 00:00:00 2001 From: Avik Chaudhuri Date: Tue, 17 Apr 2018 05:37:02 -0700 Subject: [PATCH] @allow-large-files clean up xplat/js for flow 0.70.0 Reviewed By: fishythefish Differential Revision: D7643236 fbshipit-source-id: 1d9a95f1e249ce3fdc552a4ca92a6c63b267dae4 --- .flowconfig | 2 +- Libraries/Animated/src/nodes/AnimatedInterpolation.js | 3 +++ Libraries/Components/Switch/Switch.js | 9 +++++++++ Libraries/Lists/VirtualizedList.js | 3 +++ RNTester/js/PointerEventsExample.js | 3 +++ RNTester/js/ScrollViewExample.js | 10 ++++++++-- local-cli/templates/HelloWorld/_flowconfig | 2 +- local-cli/util/Config.js | 3 +++ package.json | 2 +- 9 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.flowconfig b/.flowconfig index f67339eee..386c9389a 100644 --- a/.flowconfig +++ b/.flowconfig @@ -52,4 +52,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.69.0 +^0.70.0 diff --git a/Libraries/Animated/src/nodes/AnimatedInterpolation.js b/Libraries/Animated/src/nodes/AnimatedInterpolation.js index eb4cc5d69..bc7b13658 100644 --- a/Libraries/Animated/src/nodes/AnimatedInterpolation.js +++ b/Libraries/Animated/src/nodes/AnimatedInterpolation.js @@ -350,6 +350,9 @@ class AnimatedInterpolation extends AnimatedWithChildren { __transformDataType(range: Array) { // Change the string array type to number array // So we can reuse the same logic in iOS and Android platform + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete this + * comment and run Flow. */ return range.map(function(value) { if (typeof value !== 'string') { return value; diff --git a/Libraries/Components/Switch/Switch.js b/Libraries/Components/Switch/Switch.js index e88272dac..f259229c3 100644 --- a/Libraries/Components/Switch/Switch.js +++ b/Libraries/Components/Switch/Switch.js @@ -102,9 +102,18 @@ const Switch = createReactClass({ props.onStartShouldSetResponder = () => true; props.onResponderTerminationRequest = () => false; if (Platform.OS === 'android') { + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete + * this comment and run Flow. */ props.enabled = !this.props.disabled; + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete + * this comment and run Flow. */ props.on = this.props.value; props.style = this.props.style; + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete + * this comment and run Flow. */ props.trackTintColor = this.props.value ? this.props.onTintColor : this.props.tintColor; } else if (Platform.OS === 'ios') { props.style = [styles.rctSwitchIOS, this.props.style]; diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index e03750e10..2b1b83ff4 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -906,6 +906,9 @@ class VirtualizedList extends React.PureComponent { stickyHeaderIndices, }; if (inversionStyle) { + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete + * this comment and run Flow. */ scrollProps.style = [inversionStyle, this.props.style]; } diff --git a/RNTester/js/PointerEventsExample.js b/RNTester/js/PointerEventsExample.js index ac838c4eb..ac15811c9 100644 --- a/RNTester/js/PointerEventsExample.js +++ b/RNTester/js/PointerEventsExample.js @@ -251,4 +251,7 @@ exports.framework = 'React'; exports.title = 'Pointer Events'; exports.description = 'Demonstrates the use of the pointerEvents prop of a ' + 'View to control how touches should be handled.'; +/* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.70 was deployed. To see the error delete this comment + * and run Flow. */ exports.examples = exampleClasses.map(infoToExample); diff --git a/RNTester/js/ScrollViewExample.js b/RNTester/js/ScrollViewExample.js index f5b5c8aab..66bedc935 100644 --- a/RNTester/js/ScrollViewExample.js +++ b/RNTester/js/ScrollViewExample.js @@ -118,8 +118,14 @@ exports.examples = [ return ( - {renderScrollView('LTR layout', {direction: 'ltr'})} - {renderScrollView('RTL layout', {direction: 'rtl'})} + {/* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment + * suppresses an error found when Flow v0.70 was deployed. To see + * the error delete this comment and run Flow. */ + renderScrollView('LTR layout', {direction: 'ltr'})} + {/* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment + * suppresses an error found when Flow v0.70 was deployed. To see + * the error delete this comment and run Flow. */ + renderScrollView('RTL layout', {direction: 'rtl'})} ); }, diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 159649f13..4f75b3cb1 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -51,4 +51,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.69.0 +^0.70.0 diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index 9fc4487fe..5cd7b0f5f 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -42,6 +42,9 @@ function getProjectPath() { const resolveSymlinksForRoots = roots => roots.reduce( + /* $FlowFixMe(>=0.70.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.70 was deployed. To see the error delete this + * comment and run Flow. */ (arr, rootPath) => arr.concat(findSymlinkedModules(rootPath, roots)), [...roots], ); diff --git a/package.json b/package.json index 01c8d57da..3509869f9 100644 --- a/package.json +++ b/package.json @@ -206,7 +206,7 @@ "eslint-plugin-jest": "21.8.0", "eslint-plugin-prettier": "2.6.0", "eslint-plugin-react": "7.6.1", - "flow-bin": "^0.69.0", + "flow-bin": "^0.70.0", "jest": "23.0.0-alpha.4", "jest-junit": "3.6.0", "prettier": "1.9.1",