@allow-large-files Upgrade xplat/js to Flow v0.66

Reviewed By: gabelevi

Differential Revision: D7016717

fbshipit-source-id: 2bd2fd67074ba5d405ecd63a1aeb37354f8634c9
This commit is contained in:
Caleb Meredith 2018-02-16 19:59:54 -08:00 committed by Facebook Github Bot
parent 26684cf3ad
commit da3424c929
18 changed files with 18 additions and 65 deletions

View File

@ -52,4 +52,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.65.0
^0.66.0

View File

@ -113,8 +113,10 @@ type GetPhotosReturn = Promise<{
* Shape of the return value of the `getPhotos` function.
*/
const getPhotosReturnChecker = createStrictShapeTypeChecker({
// $FlowFixMe(>=0.41.0)
edges: PropTypes.arrayOf(
/* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.66 was deployed. To see the error delete this
* comment and run Flow. */
createStrictShapeTypeChecker({
node: createStrictShapeTypeChecker({
type: PropTypes.string.isRequired,

View File

@ -31,9 +31,6 @@ const UIManager = require('UIManager');
const ViewPropTypes = require('ViewPropTypes');
const {ViewContextTypes} = require('ViewContext');
/* $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');

View File

@ -195,9 +195,6 @@ if (__DEV__) {
// Set up inspector
const JSInspector = require('JSInspector');
/* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.56 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe(>=0.56.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.56 was deployed. To see the error
* delete this comment and run Flow. */

View File

@ -22,9 +22,6 @@ 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;

View File

@ -627,8 +627,14 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
render() {
if (this.props.legacyImplementation) {
return (
/* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.66 was deployed. To see the error delete
* this comment and run Flow. */
<MetroListView
{...this.props}
/* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses
* an error found when Flow v0.66 was deployed. To see the error
* delete this comment and run Flow. */
items={this.props.data}
ref={this._captureRef}
/>

View File

@ -50,8 +50,6 @@ type NormalProps = {
type DefaultProps = {
keyExtractor: (item: Item, index: number) => string,
};
/* $FlowFixMe - the renderItem passed in from SectionList is optional there but
* required here */
type Props = NormalProps & DefaultProps;
/**

View File

@ -326,6 +326,9 @@ class SectionList<SectionT: SectionBase<any>> extends React.PureComponent<
const List = this.props.legacyImplementation
? MetroListView
: VirtualizedSectionList;
/* $FlowFixMe(>=0.66.0 site=react_native_fb) This comment suppresses an
* error found when Flow v0.66 was deployed. To see the error delete this
* comment and run Flow. */
return <List {...this.props} ref={this._captureRef} />;
}

View File

@ -52,7 +52,9 @@ type ViewabilityHelperCallbackTuple = {
};
type RequiredProps = {
renderItem: renderItemType,
// TODO: Conflicts with the optional `renderItem` in
// `VirtualizedSectionList`'s props.
renderItem: $FlowFixMe<renderItemType>,
/**
* The default accessor functions assume this is an Array<{key: string}> but you can override
* getItem, getItemCount, and keyExtractor to handle any type of index-based data.

View File

@ -23,9 +23,6 @@ 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 invariant = require('fbjs/lib/invariant');
const warning = require('fbjs/lib/warning');

View File

@ -72,7 +72,6 @@ var propTypes = {
var CameraRollView = createReactClass({
displayName: 'CameraRollView',
// $FlowFixMe(>=0.41.0)
propTypes: propTypes,
getDefaultProps: function(): Object {

View File

@ -11,9 +11,6 @@
'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
@ -33,9 +30,6 @@ 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/src/transformer.js');
module.exports = {
process(src/*: string*/, file/*: string*/) {

View File

@ -30,16 +30,10 @@ describe('fs mock', () => {
it('stores content correctly', () => {
fs.writeFileSync('/test', 'foobar', 'utf8');
const content = fs.readFileSync('/test', 'utf8');
/* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.56 was deployed. To see the error delete this
* comment and run Flow. */
expect(content).toEqual('foobar');
});
it('fails on missing path', () => {
/* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.56 was deployed. To see the error delete this
* comment and run Flow. */
expect(() =>
fs.writeFileSync('/dir/test', 'foobar', 'utf8'),
).toThrowError('ENOENT: no such file or directory');
@ -57,9 +51,6 @@ describe('fs mock', () => {
fs.mkdirSync('/dir', 0o777);
fs.writeFileSync('/dir/test', 'foobar', 'utf8');
const content = fs.readFileSync('/dir/test', 'utf8');
/* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.56 was deployed. To see the error delete this
* comment and run Flow. */
expect(content).toEqual('foobar');
});
@ -68,9 +59,6 @@ describe('fs mock', () => {
fs.writeFileSync('/dir/test', 'foobar', 'utf8');
fs.mkdirSync('/dir', 0o777);
const content = fs.readFileSync('/dir/test', 'utf8');
/* $FlowFixMe(>=0.56.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.56 was deployed. To see the error delete this
* comment and run Flow. */
expect(content).toEqual('foobar');
});
});

View File

@ -10,24 +10,12 @@
'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/src/Server');
const {Terminal} = require('metro-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 TerminalReporter = require('metro/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/src/lib/TransformCaching');
const {defaults} = require('metro');
/* $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/src/shared/output/bundle');
const path = require('path');
const saveAssets = require('./saveAssets');
@ -40,9 +28,6 @@ import type {ConfigT} from 'metro';
const defaultAssetExts = defaults.assetExts;
const defaultSourceExts = defaults.sourceExts;
const defaultPlatforms = 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 = defaults.providesModuleNodeModules;
async function buildBundle(

View File

@ -8,7 +8,4 @@
*/
'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/src/shared/types.flow';

View File

@ -25,9 +25,6 @@ const copyToClipBoardMiddleware = require('./middleware/copyToClipBoardMiddlewar
const defaultAssetExts = Metro.defaults.assetExts;
const defaultSourceExts = Metro.defaults.sourceExts;
const defaultPlatforms = Metro.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 =
Metro.defaults.providesModuleNodeModules;
const errorhandler = require('errorhandler');
@ -46,17 +43,11 @@ 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/src/lib/TransformCaching');
const {ASSET_REGISTRY_PATH} = require('../core/Constants');
import type {ConfigT} from 'metro';
/* $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/src/lib/reporting';
export type Args = {|

View File

@ -51,4 +51,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.65.0
^0.66.0

View File

@ -214,7 +214,7 @@
"eslint-plugin-jest": "21.8.0",
"eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react": "7.6.1",
"flow-bin": "^0.65.0",
"flow-bin": "^0.66.0",
"jest": "22.3.0",
"jest-junit": "3.6.0",
"prettier": "1.9.1",