Upgrade to Flow v0.68.0
Reviewed By: gabelevi Differential Revision: D7310349 fbshipit-source-id: 70d29815dd7912704aec8a015c970be3fafeeba3
This commit is contained in:
parent
5347ecfd29
commit
0d924dd629
|
@ -52,4 +52,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.67.0
|
^0.68.0
|
||||||
|
|
|
@ -51,6 +51,9 @@ let _uniqueId = 1;
|
||||||
function _flush(rootNode: AnimatedValue): void {
|
function _flush(rootNode: AnimatedValue): void {
|
||||||
const animatedStyles = new Set();
|
const animatedStyles = new Set();
|
||||||
function findAnimatedStyles(node) {
|
function findAnimatedStyles(node) {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (typeof node.update === 'function') {
|
if (typeof node.update === 'function') {
|
||||||
animatedStyles.add(node);
|
animatedStyles.add(node);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -142,6 +142,9 @@ class SwipeableListView extends React.Component<Props, State> {
|
||||||
* (from high 20s to almost consistently 60 fps)
|
* (from high 20s to almost consistently 60 fps)
|
||||||
*/
|
*/
|
||||||
_setListViewScrollable(value: boolean): void {
|
_setListViewScrollable(value: boolean): void {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') {
|
if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') {
|
||||||
this._listViewRef.setNativeProps({
|
this._listViewRef.setNativeProps({
|
||||||
scrollEnabled: value,
|
scrollEnabled: value,
|
||||||
|
@ -151,6 +154,9 @@ class SwipeableListView extends React.Component<Props, State> {
|
||||||
|
|
||||||
// Passing through ListView's getScrollResponder() function
|
// Passing through ListView's getScrollResponder() function
|
||||||
getScrollResponder(): ?Object {
|
getScrollResponder(): ?Object {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') {
|
if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') {
|
||||||
return this._listViewRef.getScrollResponder();
|
return this._listViewRef.getScrollResponder();
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,10 +748,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||||
cellKey={this._getCellKey() + '-header'}
|
cellKey={this._getCellKey() + '-header'}
|
||||||
key="$header">
|
key="$header">
|
||||||
<View onLayout={this._onLayoutHeader} style={inversionStyle}>
|
<View onLayout={this._onLayoutHeader} style={inversionStyle}>
|
||||||
{/*
|
|
||||||
Flow doesn't know this is a React.Element and not a React.Component
|
|
||||||
$FlowFixMe https://fburl.com/b9xmtm09
|
|
||||||
*/}
|
|
||||||
{element}
|
{element}
|
||||||
</View>
|
</View>
|
||||||
</VirtualizedCellWrapper>,
|
</VirtualizedCellWrapper>,
|
||||||
|
@ -883,10 +879,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||||
cellKey={this._getCellKey() + '-footer'}
|
cellKey={this._getCellKey() + '-footer'}
|
||||||
key="$footer">
|
key="$footer">
|
||||||
<View onLayout={this._onLayoutFooter} style={inversionStyle}>
|
<View onLayout={this._onLayoutFooter} style={inversionStyle}>
|
||||||
{/*
|
|
||||||
Flow doesn't know this is a React.Element and not a React.Component
|
|
||||||
$FlowFixMe https://fburl.com/b9xmtm09
|
|
||||||
*/}
|
|
||||||
{element}
|
{element}
|
||||||
</View>
|
</View>
|
||||||
</VirtualizedCellWrapper>,
|
</VirtualizedCellWrapper>,
|
||||||
|
@ -1122,6 +1114,9 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||||
const itemCount = this.props.getItemCount(this.props.data);
|
const itemCount = this.props.getItemCount(this.props.data);
|
||||||
for (let ii = 0; ii < itemCount; ii++) {
|
for (let ii = 0; ii < itemCount; ii++) {
|
||||||
const frame = this._getFrameMetricsApprox(ii);
|
const frame = this._getFrameMetricsApprox(ii);
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (frame.inLayout) {
|
if (frame.inLayout) {
|
||||||
framesInLayout.push(frame);
|
framesInLayout.push(frame);
|
||||||
}
|
}
|
||||||
|
@ -1646,6 +1641,9 @@ class CellRenderer extends React.Component<
|
||||||
separators: this._separators,
|
separators: this._separators,
|
||||||
});
|
});
|
||||||
const onLayout =
|
const onLayout =
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
getItemLayout && !parentProps.debug && !fillRateHelper.enabled()
|
getItemLayout && !parentProps.debug && !fillRateHelper.enabled()
|
||||||
? undefined
|
? undefined
|
||||||
: this.props.onLayout;
|
: this.props.onLayout;
|
||||||
|
|
|
@ -105,6 +105,9 @@ function sprintf(format, ...args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateWarningMap(...args): void {
|
function updateWarningMap(...args): void {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
if (console.disableYellowBox) {
|
if (console.disableYellowBox) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -178,6 +181,9 @@ function isWarningIgnored(warning: string): boolean {
|
||||||
|
|
||||||
// DEPRECATED
|
// DEPRECATED
|
||||||
return (
|
return (
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
Array.isArray(console.ignoredYellowBox) &&
|
Array.isArray(console.ignoredYellowBox) &&
|
||||||
console.ignoredYellowBox.some(ignorePrefix =>
|
console.ignoredYellowBox.some(ignorePrefix =>
|
||||||
warning.startsWith(String(ignorePrefix)),
|
warning.startsWith(String(ignorePrefix)),
|
||||||
|
@ -379,6 +385,9 @@ class YellowBox extends React.Component<
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (console.disableYellowBox || this.state.warningMap.size === 0) {
|
if (console.disableYellowBox || this.state.warningMap.size === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,9 @@ function renderApplication<Props: Object>(
|
||||||
// to be async also. To do this, wrap AppContainer with an async marker.
|
// to be async also. To do this, wrap AppContainer with an async marker.
|
||||||
// For more info see https://fb.me/is-component-async
|
// For more info see https://fb.me/is-component-async
|
||||||
if (
|
if (
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
RootComponent.prototype != null &&
|
RootComponent.prototype != null &&
|
||||||
RootComponent.prototype.unstable_isAsyncReactComponent === true
|
RootComponent.prototype.unstable_isAsyncReactComponent === true
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -42,6 +42,9 @@ function renderFabricSurface<Props: Object>(
|
||||||
// to be async also. To do this, wrap AppContainer with an async marker.
|
// to be async also. To do this, wrap AppContainer with an async marker.
|
||||||
// For more info see https://fb.me/is-component-async
|
// For more info see https://fb.me/is-component-async
|
||||||
if (
|
if (
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
RootComponent.prototype != null &&
|
RootComponent.prototype != null &&
|
||||||
RootComponent.prototype.unstable_isAsyncReactComponent === true
|
RootComponent.prototype.unstable_isAsyncReactComponent === true
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -121,6 +121,9 @@ function requireNativeComponent(
|
||||||
// TODO (bvaughn) Revert this particular change any time after April 1
|
// TODO (bvaughn) Revert this particular change any time after April 1
|
||||||
if (componentInterface) {
|
if (componentInterface) {
|
||||||
viewConfig.propTypes =
|
viewConfig.propTypes =
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete
|
||||||
|
* this comment and run Flow. */
|
||||||
typeof componentInterface.__propTypesSecretDontUseThesePlease ===
|
typeof componentInterface.__propTypesSecretDontUseThesePlease ===
|
||||||
'object'
|
'object'
|
||||||
? componentInterface.__propTypesSecretDontUseThesePlease
|
? componentInterface.__propTypesSecretDontUseThesePlease
|
||||||
|
|
|
@ -119,6 +119,9 @@ function requireNativeComponent(
|
||||||
// TODO (bvaughn) Revert this particular change any time after April 1
|
// TODO (bvaughn) Revert this particular change any time after April 1
|
||||||
if (componentInterface) {
|
if (componentInterface) {
|
||||||
viewConfig.propTypes =
|
viewConfig.propTypes =
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete
|
||||||
|
* this comment and run Flow. */
|
||||||
typeof componentInterface.__propTypesSecretDontUseThesePlease ===
|
typeof componentInterface.__propTypesSecretDontUseThesePlease ===
|
||||||
'object'
|
'object'
|
||||||
? componentInterface.__propTypesSecretDontUseThesePlease
|
? componentInterface.__propTypesSecretDontUseThesePlease
|
||||||
|
|
|
@ -103,6 +103,9 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
|
||||||
const {headers = {}, ...unrecognized} = options || {};
|
const {headers = {}, ...unrecognized} = options || {};
|
||||||
|
|
||||||
// Preserve deprecated backwards compatibility for the 'origin' option
|
// Preserve deprecated backwards compatibility for the 'origin' option
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (unrecognized && typeof unrecognized.origin === 'string') {
|
if (unrecognized && typeof unrecognized.origin === 'string') {
|
||||||
console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.');
|
console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.');
|
||||||
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
|
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This
|
||||||
|
|
|
@ -123,6 +123,9 @@ var CameraRollView = createReactClass({
|
||||||
this.fetch();
|
this.fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
UNSAFE_componentWillReceiveProps: function(nextProps: {groupTypes?: string}) {
|
UNSAFE_componentWillReceiveProps: function(nextProps: {groupTypes?: string}) {
|
||||||
if (this.props.groupTypes !== nextProps.groupTypes) {
|
if (this.props.groupTypes !== nextProps.groupTypes) {
|
||||||
this.fetch(true);
|
this.fetch(true);
|
||||||
|
|
|
@ -76,6 +76,9 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
|
||||||
const filterText = this.props.persister.state.filter;
|
const filterText = this.props.persister.state.filter;
|
||||||
const filterRegex = new RegExp(String(filterText), 'i');
|
const filterRegex = new RegExp(String(filterText), 'i');
|
||||||
const filter = (example) =>
|
const filter = (example) =>
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
this.props.disableSearch ||
|
this.props.disableSearch ||
|
||||||
filterRegex.test(example.module.title) &&
|
filterRegex.test(example.module.title) &&
|
||||||
(!Platform.isTVOS || example.supportsTVOS);
|
(!Platform.isTVOS || example.supportsTVOS);
|
||||||
|
@ -128,6 +131,9 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
|
||||||
);
|
);
|
||||||
|
|
||||||
_renderTitleRow(): ?React.Element<any> {
|
_renderTitleRow(): ?React.Element<any> {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (!this.props.displayTitleRow) {
|
if (!this.props.displayTitleRow) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -146,6 +152,9 @@ class RNTesterExampleList extends React.Component<Props, $FlowFixMeState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderTextInput(): ?React.Element<any> {
|
_renderTextInput(): ?React.Element<any> {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
if (this.props.disableSearch) {
|
if (this.props.disableSearch) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,9 @@ class RNTesterPage extends React.Component<{
|
||||||
wrapperProps.keyboardShouldPersistTaps = 'handled';
|
wrapperProps.keyboardShouldPersistTaps = 'handled';
|
||||||
wrapperProps.keyboardDismissMode = 'interactive';
|
wrapperProps.keyboardDismissMode = 'interactive';
|
||||||
}
|
}
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
var title = this.props.title ?
|
var title = this.props.title ?
|
||||||
<RNTesterTitle title={this.props.title} /> :
|
<RNTesterTitle title={this.props.title} /> :
|
||||||
null;
|
null;
|
||||||
|
|
|
@ -78,6 +78,9 @@ function runServer(
|
||||||
var ms = null;
|
var ms = null;
|
||||||
|
|
||||||
const terminal = new Terminal(process.stdout);
|
const terminal = new Terminal(process.stdout);
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
const ReporterImpl = getReporterImpl(args.customLogReporterPath || null);
|
const ReporterImpl = getReporterImpl(args.customLogReporterPath || null);
|
||||||
const reporter = new ReporterImpl(terminal);
|
const reporter = new ReporterImpl(terminal);
|
||||||
const packagerServer = getPackagerServer(args, config, reporter);
|
const packagerServer = getPackagerServer(args, config, reporter);
|
||||||
|
@ -105,10 +108,16 @@ function runServer(
|
||||||
|
|
||||||
app.use(morgan('combined')).use(errorhandler());
|
app.use(morgan('combined')).use(errorhandler());
|
||||||
|
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
if (args.https && (!args.key || !args.cert)) {
|
if (args.https && (!args.key || !args.cert)) {
|
||||||
throw new Error('Cannot use https without specifying key and cert options');
|
throw new Error('Cannot use https without specifying key and cert options');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
const serverInstance = args.https
|
const serverInstance = args.https
|
||||||
? https.createServer(
|
? https.createServer(
|
||||||
{
|
{
|
||||||
|
@ -157,11 +166,17 @@ function getReporterImpl(customLogReporterPath: ?string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPackagerServer(args, config, reporter) {
|
function getPackagerServer(args, config, reporter) {
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an error
|
||||||
|
* found when Flow v0.68 was deployed. To see the error delete this comment
|
||||||
|
* and run Flow. */
|
||||||
const transformModulePath = args.transformer
|
const transformModulePath = args.transformer
|
||||||
? path.resolve(args.transformer)
|
? path.resolve(args.transformer)
|
||||||
: config.getTransformModulePath();
|
: config.getTransformModulePath();
|
||||||
|
|
||||||
const providesModuleNodeModules =
|
const providesModuleNodeModules =
|
||||||
|
/* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an
|
||||||
|
* error found when Flow v0.68 was deployed. To see the error delete this
|
||||||
|
* comment and run Flow. */
|
||||||
args.providesModuleNodeModules || defaultProvidesModuleNodeModules;
|
args.providesModuleNodeModules || defaultProvidesModuleNodeModules;
|
||||||
|
|
||||||
return Metro.createServer({
|
return Metro.createServer({
|
||||||
|
|
|
@ -51,4 +51,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
^0.67.0
|
^0.68.0
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
"eslint-plugin-jest": "21.8.0",
|
"eslint-plugin-jest": "21.8.0",
|
||||||
"eslint-plugin-prettier": "2.6.0",
|
"eslint-plugin-prettier": "2.6.0",
|
||||||
"eslint-plugin-react": "7.6.1",
|
"eslint-plugin-react": "7.6.1",
|
||||||
"flow-bin": "^0.67.1",
|
"flow-bin": "^0.68.0",
|
||||||
"jest": "22.4.2",
|
"jest": "22.4.2",
|
||||||
"jest-junit": "3.6.0",
|
"jest-junit": "3.6.0",
|
||||||
"prettier": "1.9.1",
|
"prettier": "1.9.1",
|
||||||
|
|
Loading…
Reference in New Issue