Skip to content

Commit

Permalink
upgrade to flow 0.122.0
Browse files Browse the repository at this point in the history
Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D20919782

fbshipit-source-id: 3d5dc54ea4daafb8a1d96cad6c35a2dab4c24097
  • Loading branch information
mroch authored and facebook-github-bot committed Apr 8, 2020
1 parent bf2609d commit 4a48b02
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ untyped-import
untyped-type-import

[version]
^0.121.0
^0.122.0
2 changes: 1 addition & 1 deletion .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ untyped-import
untyped-type-import

[version]
^0.121.0
^0.122.0
28 changes: 15 additions & 13 deletions Libraries/Utilities/ReactNativeTestTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ const React = require('react');

const ReactTestRenderer = require('react-test-renderer');
const ShallowRenderer = require('react-test-renderer/shallow');
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when Flow
* v0.120 was deployed. To see the error, delete this comment and run Flow. */
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an error
* found when Flow v0.122.0 was deployed. To see the error, delete this comment
* and run Flow. */
const shallowRenderer = new ShallowRenderer();

import type {ReactTestRenderer as ReactTestRendererType} from 'react-test-renderer';
Expand All @@ -27,8 +28,9 @@ export type ReactTestInstance = $PropertyType<ReactTestRendererType, 'root'>;
export type Predicate = (node: ReactTestInstance) => boolean;

type $ReturnType<Fn> = $Call<<Ret, A>((...A) => Ret) => Ret, Fn>;
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when Flow
* v0.120 was deployed. To see the error, delete this comment and run Flow. */
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an error
* found when Flow v0.122.0 was deployed. To see the error, delete this comment
* and run Flow. */
export type ReactTestRendererJSON = $ReturnType<ReactTestRenderer.create.toJSON>;

const {
Expand All @@ -54,13 +56,13 @@ function byClickable(): Predicate {
// HACK: Find components that use `Pressability`.
node.instance?.state?.pressability != null ||
// TODO: Remove this after deleting `Touchable`.
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when Flow
* v0.120 was deployed. To see the error, delete this comment and run
* Flow. */
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
(node.instance &&
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when
* Flow v0.120 was deployed. To see the error, delete this comment and
* run Flow. */
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.122.0 was deployed. To see the error,
* delete this comment and run Flow. */
typeof node.instance.touchableHandlePress === 'function'),
'is clickable',
);
Expand All @@ -75,9 +77,9 @@ function byTestID(testID: string): Predicate {

function byTextMatching(regex: RegExp): Predicate {
return withMessage(
/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when Flow
* v0.120 was deployed. To see the error, delete this comment and run Flow.
*/
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
node => node.props && regex.exec(node.props.children),
`text content matches ${regex.toString()}`,
);
Expand Down
18 changes: 9 additions & 9 deletions Libraries/Utilities/registerGeneratedViewConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,25 @@ function registerGeneratedViewConfig(
const mergedViewConfig = {
uiViewClassName: componentName,
Commands: {},
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
bubblingEventTypes: {
...ReactNativeViewViewConfig.bubblingEventTypes,
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.111 was deployed. To see the error, delete
* this comment and run Flow. */
...(viewConfig.bubblingEventTypes || {}),
},
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
directEventTypes: {
...ReactNativeViewViewConfig.directEventTypes,
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.111 was deployed. To see the error, delete
* this comment and run Flow. */
...(viewConfig.directEventTypes || {}),
},
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
validAttributes: {
...ReactNativeViewViewConfig.validAttributes,
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.111 was deployed. To see the error, delete
* this comment and run Flow. */
...(viewConfig.validAttributes || {}),
},
};
Expand Down
5 changes: 3 additions & 2 deletions RNTester/js/examples/TextInput/TextInputExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class AutogrowingTextInputExample extends React.Component<{...}> {
onValueChange={value => this.setState({multiline: value})}
/>
<Text>TextInput:</Text>
{/* $FlowFixMe(>=0.122.0 site=react_native_android_fb) This comment
* suppresses an error found when Flow v0.122.0 was deployed. To see
* the error, delete this comment and run Flow. */}
<TextInput
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
* found when making Flow check .android.js files. */
Expand All @@ -114,8 +117,6 @@ class AutogrowingTextInputExample extends React.Component<{...}> {
* found when making Flow check .android.js files. */
this.setState({contentSize: event.nativeEvent.contentSize})
}
/* $FlowFixMe(>=0.78.0 site=react_native_android_fb) This issue was
* found when making Flow check .android.js files. */
{...props}
/>
<Text>Plain text value representation:</Text>
Expand Down
6 changes: 3 additions & 3 deletions RNTester/js/examples/TurboModule/SampleTurboModuleExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ class SampleTurboModuleExample extends React.Component<{||}, State> {

_setResult(name, result) {
this.setState(({testResults}) => ({
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.122.0 was deployed. To see the error, delete
* this comment and run Flow. */
testResults: {
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.111 was deployed. To see the error,
* delete this comment and run Flow. */
...testResults,
/* $FlowFixMe(>=0.111.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.111 was deployed. To see the error,
Expand Down
5 changes: 3 additions & 2 deletions jest/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ const React = require('react');
const ShallowRenderer = require('react-test-renderer/shallow');
const TestRenderer = require('react-test-renderer');

/* $FlowFixMe(>=0.120.0) This comment suppresses an error found when Flow
* v0.120 was deployed. To see the error, delete this comment and run Flow. */
/* $FlowFixMe(>=0.122.0 site=react_native_fb) This comment suppresses an error
* found when Flow v0.122.0 was deployed. To see the error, delete this comment
* and run Flow. */
const renderer = new ShallowRenderer();

export const shallow = (Component: React.Element<any>): any => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"eslint-plugin-react-hooks": "^3.0.0",
"eslint-plugin-react-native": "3.8.1",
"eslint-plugin-relay": "1.7.0",
"flow-bin": "^0.121.0",
"flow-bin": "^0.122.0",
"flow-remove-types": "1.2.3",
"jest": "^24.9.0",
"jest-junit": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion template/_flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ untyped-import
untyped-type-import

[version]
^0.121.0
^0.122.0
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3530,10 +3530,10 @@ flat-cache@^1.2.1:
rimraf "~2.6.2"
write "^0.2.1"

flow-bin@^0.121.0:
version "0.121.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.121.0.tgz#e206bdc3d510277f9a847920540f72c49e87c130"
integrity sha512-QYRMs+AoMLj/OTaSo9+8c3kzM/u8YgvfrInp0qzhtzC02Sc2jb3BV/QZWZGjPo+XK3twyyqXrcI3s8MuL1UQRg==
flow-bin@^0.122.0:
version "0.122.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.122.0.tgz#c723a2b33b1a70bd10204704ae1dc776d5d89d79"
integrity sha512-my8N5jgl/A+UVby9E7NDppHdhLgRbWgKbmFZSx2MSYMRh3d9YGnM2MM+wexpUpl0ftY1IM6ZcUwaAhrypLyvlA==

flow-parser@0.*:
version "0.89.0"
Expand Down

0 comments on commit 4a48b02

Please sign in to comment.