From adc8a33fcfeb8fc163f48ae4a4bc5aaac98bcb0d Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 2 Nov 2018 00:26:18 -0700 Subject: [PATCH] Deploy Flow v0.85 to xplat/js Reviewed By: fishythefish Differential Revision: D12898653 fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a --- .flowconfig | 2 +- .flowconfig.android | 2 +- Libraries/Components/ScrollView/ScrollView.js | 4 ++-- Libraries/StyleSheet/StyleSheetValidation.js | 3 +++ Libraries/Text/TextAncestor.js | 3 +++ RNTester/js/ActivityIndicatorExample.js | 3 +++ RNTester/js/AnimatedExample.js | 3 +++ RNTester/js/ImageEditingExample.js | 3 +++ RNTester/js/NativeAnimationsExample.js | 3 +++ RNTester/js/ProgressViewIOSExample.js | 3 +++ RNTester/js/RNTesterApp.android.js | 4 ---- RNTester/js/RNTesterApp.ios.js | 3 --- RNTester/js/RNTesterExampleList.js | 3 +++ RNTester/js/RNTesterSettingSwitchRow.js | 3 +++ RNTester/js/ScrollViewExample.js | 3 +++ RNTester/js/ScrollViewSimpleExample.js | 3 +++ RNTester/js/ShareExample.js | 3 +++ RNTester/js/TVEventHandlerExample.js | 3 +++ RNTester/js/TextInputExample.android.js | 6 ++++++ RNTester/js/TextInputExample.ios.js | 18 ++++++++++++++++++ local-cli/bundle/buildBundle.js | 3 +++ local-cli/templates/HelloWorld/_flowconfig | 2 +- package.json | 2 +- yarn.lock | 8 ++++---- 24 files changed, 76 insertions(+), 17 deletions(-) diff --git a/.flowconfig b/.flowconfig index c6b5bfc62..bee33ca3d 100644 --- a/.flowconfig +++ b/.flowconfig @@ -101,4 +101,4 @@ untyped-import untyped-type-import [version] -^0.84.0 +^0.85.0 diff --git a/.flowconfig.android b/.flowconfig.android index 561f7b77b..0a3ce6b35 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -101,4 +101,4 @@ untyped-import untyped-type-import [version] -^0.84.0 +^0.85.0 diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index fb4222103..52863d11c 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -397,8 +397,8 @@ export type Props = $ReadOnly<{| * - `false`, deprecated, use 'never' instead * - `true`, deprecated, use 'always' instead */ - /* $FlowFixMe(>=0.84.0 site=react_native_fb) This comment suppresses an error - * found when Flow v0.84 was deployed. To see the error, delete this comment + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment * and run Flow. */ keyboardShouldPersistTaps?: ?('always' | 'never' | 'handled' | false | true), /** diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js index 5ff8a5c84..116e1fce7 100644 --- a/Libraries/StyleSheet/StyleSheetValidation.js +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -60,6 +60,9 @@ class StyleSheetValidation { } } + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ static addValidStylePropTypes(stylePropTypes) { if (!__DEV__ || global.__RCTProfileIsProfiling) { return; diff --git a/Libraries/Text/TextAncestor.js b/Libraries/Text/TextAncestor.js index 85d0bc2de..e3463859a 100644 --- a/Libraries/Text/TextAncestor.js +++ b/Libraries/Text/TextAncestor.js @@ -15,4 +15,7 @@ const React = require('React'); /** * Whether the current element is the descendant of a element. */ +/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ module.exports = React.createContext(false); diff --git a/RNTester/js/ActivityIndicatorExample.js b/RNTester/js/ActivityIndicatorExample.js index 1e8fee82a..a9bd7ff06 100644 --- a/RNTester/js/ActivityIndicatorExample.js +++ b/RNTester/js/ActivityIndicatorExample.js @@ -25,6 +25,9 @@ class ToggleAnimatingActivityIndicator extends Component< > { _timer: Timer; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ constructor(props) { super(props); this.state = { diff --git a/RNTester/js/AnimatedExample.js b/RNTester/js/AnimatedExample.js index 5012ff7df..51b335700 100644 --- a/RNTester/js/AnimatedExample.js +++ b/RNTester/js/AnimatedExample.js @@ -59,6 +59,9 @@ exports.examples = [ } } class FadeInExample extends React.Component<$FlowFixMeProps, any> { + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete + * this comment and run Flow. */ constructor(props) { super(props); this.state = { diff --git a/RNTester/js/ImageEditingExample.js b/RNTester/js/ImageEditingExample.js index 31663ceff..af22c3034 100644 --- a/RNTester/js/ImageEditingExample.js +++ b/RNTester/js/ImageEditingExample.js @@ -50,6 +50,9 @@ class SquareImageCropper extends React.Component< _isMounted: boolean; _transformData: ImageCropData; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ constructor(props) { super(props); this._isMounted = true; diff --git a/RNTester/js/NativeAnimationsExample.js b/RNTester/js/NativeAnimationsExample.js index 176e668f5..30f47ae22 100644 --- a/RNTester/js/NativeAnimationsExample.js +++ b/RNTester/js/NativeAnimationsExample.js @@ -293,6 +293,9 @@ class TrackingExample extends React.Component< this.state.toJS.setValue(nextValue); }; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ renderBlock = (anim, dest) => [ { this._rafId = requestAnimationFrame(() => this.updateProgress()); }; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ getProgress = offset => { const progress = this.state.progress + offset; return Math.sin(progress % Math.PI) % 1; diff --git a/RNTester/js/RNTesterApp.android.js b/RNTester/js/RNTesterApp.android.js index 6a7316114..16c6660e0 100644 --- a/RNTester/js/RNTesterApp.android.js +++ b/RNTester/js/RNTesterApp.android.js @@ -122,8 +122,6 @@ class RNTesterApp extends React.Component { _renderDrawerContent = () => { return ( - {/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was - * found when making Flow check .android.js files. */} { style={styles.toolbar} title="RNTester" /> - {/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was - * found when making Flow check .android.js files. */} { return (
- {/* $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. */} ( ); +/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ RNTesterExampleList = RNTesterStatePersister.createContainer( RNTesterExampleList, { diff --git a/RNTester/js/RNTesterSettingSwitchRow.js b/RNTester/js/RNTesterSettingSwitchRow.js index c44a6a82e..383538b24 100644 --- a/RNTester/js/RNTesterSettingSwitchRow.js +++ b/RNTester/js/RNTesterSettingSwitchRow.js @@ -49,6 +49,9 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', }, }); +/* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ RNTesterSettingSwitchRow = RNTesterStatePersister.createContainer( RNTesterSettingSwitchRow, { diff --git a/RNTester/js/ScrollViewExample.js b/RNTester/js/ScrollViewExample.js index 9f93e0267..6c8521a1e 100644 --- a/RNTester/js/ScrollViewExample.js +++ b/RNTester/js/ScrollViewExample.js @@ -138,6 +138,9 @@ if (Platform.OS === 'ios') { let itemCount = 6; class AppendingList extends React.Component<{}, *> { state = { + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses + * an error found when Flow v0.85 was deployed. To see the error, + * delete this comment and run Flow. */ items: [...Array(itemCount)].map((_, ii) => ( )), diff --git a/RNTester/js/ScrollViewSimpleExample.js b/RNTester/js/ScrollViewSimpleExample.js index e7393ec07..c72a47076 100644 --- a/RNTester/js/ScrollViewSimpleExample.js +++ b/RNTester/js/ScrollViewSimpleExample.js @@ -21,6 +21,9 @@ class ScrollViewSimpleExample extends React.Component<{}> { static description = 'Component that enables scrolling through child components.'; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ makeItems = (nItems: number, styles): Array => { const items = []; for (let i = 0; i < nItems; i++) { diff --git a/RNTester/js/ShareExample.js b/RNTester/js/ShareExample.js index 30d18280f..d1608a250 100644 --- a/RNTester/js/ShareExample.js +++ b/RNTester/js/ShareExample.js @@ -31,6 +31,9 @@ class ShareMessageExample extends React.Component<$FlowFixMeProps, any> { _shareText: Function; _showResult: Function; + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ constructor(props) { super(props); diff --git a/RNTester/js/TVEventHandlerExample.js b/RNTester/js/TVEventHandlerExample.js index ed90ddeb2..4a5dd7ea3 100644 --- a/RNTester/js/TVEventHandlerExample.js +++ b/RNTester/js/TVEventHandlerExample.js @@ -33,6 +33,9 @@ class TVEventHandlerView extends React.Component< lastEventType: string, }, > { + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ constructor(props) { super(props); this.state = { diff --git a/RNTester/js/TextInputExample.android.js b/RNTester/js/TextInputExample.android.js index d8c26ecaa..6fc88f625 100644 --- a/RNTester/js/TextInputExample.android.js +++ b/RNTester/js/TextInputExample.android.js @@ -75,6 +75,9 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { } class RewriteExample extends React.Component<$FlowFixMeProps, $FlowFixMeState> { + /* $FlowFixMe(>=0.85.0 site=react_native_android_fb) This comment suppresses + * an error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: ''}; @@ -113,6 +116,9 @@ class TokenizedTextExample extends React.Component< $FlowFixMeProps, $FlowFixMeState, > { + /* $FlowFixMe(>=0.85.0 site=react_native_android_fb) This comment suppresses + * an error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: 'Hello #World'}; diff --git a/RNTester/js/TextInputExample.ios.js b/RNTester/js/TextInputExample.ios.js index d2654924c..4de3908ea 100644 --- a/RNTester/js/TextInputExample.ios.js +++ b/RNTester/js/TextInputExample.ios.js @@ -92,6 +92,9 @@ class TextEventsExample extends React.Component<{}, $FlowFixMeState> { } class TextInputAccessoryViewExample extends React.Component<{}, *> { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: 'Placeholder Text'}; @@ -121,6 +124,9 @@ class TextInputAccessoryViewExample extends React.Component<{}, *> { } class RewriteExample extends React.Component<$FlowFixMeProps, any> { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: ''}; @@ -153,6 +159,9 @@ class RewriteExampleInvalidCharacters extends React.Component< $FlowFixMeProps, any, > { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: ''}; @@ -174,6 +183,9 @@ class RewriteExampleInvalidCharacters extends React.Component< } class RewriteExampleKana extends React.Component<$FlowFixMeProps, any> { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: ''}; @@ -195,6 +207,9 @@ class RewriteExampleKana extends React.Component<$FlowFixMeProps, any> { } class SecureEntryExample extends React.Component<$FlowFixMeProps, any> { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: ''}; @@ -216,6 +231,9 @@ class SecureEntryExample extends React.Component<$FlowFixMeProps, any> { } class TokenizedTextExample extends React.Component<$FlowFixMeProps, any> { + /* $FlowFixMe(>=0.85.0 site=react_native_ios_fb) This comment suppresses an + * error found when Flow v0.85 was deployed. To see the error, delete this + * comment and run Flow. */ constructor(props) { super(props); this.state = {text: 'Hello #World'}; diff --git a/local-cli/bundle/buildBundle.js b/local-cli/bundle/buildBundle.js index 0de330e38..b81b74329 100644 --- a/local-cli/bundle/buildBundle.js +++ b/local-cli/bundle/buildBundle.js @@ -31,6 +31,9 @@ async function buildBundle( minify: boolean, }, configPromise: Promise, + /* $FlowFixMe(>=0.85.0 site=react_native_fb) This comment suppresses an error + * found when Flow v0.85 was deployed. To see the error, delete this comment + * and run Flow. */ output = outputBundle, ) { // This is used by a bazillion of npm modules we don't control so we don't diff --git a/local-cli/templates/HelloWorld/_flowconfig b/local-cli/templates/HelloWorld/_flowconfig index 9a2c2ef53..f3eb74de6 100644 --- a/local-cli/templates/HelloWorld/_flowconfig +++ b/local-cli/templates/HelloWorld/_flowconfig @@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.84.0 +^0.85.0 diff --git a/package.json b/package.json index 0a3b6b352..6d46a6477 100644 --- a/package.json +++ b/package.json @@ -217,7 +217,7 @@ "eslint-plugin-prettier": "2.6.0", "eslint-plugin-react": "7.8.2", "eslint-plugin-react-native": "3.5.0", - "flow-bin": "^0.84.0", + "flow-bin": "^0.85.0", "jest": "24.0.0-alpha.4", "jest-junit": "5.1.0", "prettier": "1.13.6", diff --git a/yarn.lock b/yarn.lock index 236d79a0a..232d8f9de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2553,10 +2553,10 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.84.0: - version "0.84.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.84.0.tgz#4cb2364c750fb37a7840524fa62456b53f64cdcb" - integrity sha512-ocji8eEYp+YfICsm+F6cIHUcD7v5sb0/ADEXm6gyUKdjQzmSckMrPUdZtyfP973t3YGHKliUMxMvIBHyR5LbXQ== +flow-bin@^0.85.0: + version "0.85.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.85.0.tgz#a3ca80748a35a071d5bbb2fcd61d64d977fc53a6" + integrity sha512-ougBA2q6Rn9sZrjZQ9r5pTFxCotlGouySpD2yRIuq5AYwwfIT8HHhVMeSwrN5qJayjHINLJyrnsSkkPCZyfMrQ== for-in@^1.0.1, for-in@^1.0.2: version "1.0.2"