diff --git a/.flowconfig b/.flowconfig index 4d3bd2c9..9714c6b8 100644 --- a/.flowconfig +++ b/.flowconfig @@ -19,4 +19,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError munge_underscores=true [version] -^0.69.0 +^0.70.0 diff --git a/package.json b/package.json index 98025fc8..bdb6eb17 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "eslint-plugin-prettier": "2.6.0", "eslint-plugin-react": "7.6.1", "eslint-plugin-relay": "0.0.21", - "flow-bin": "^0.69.0", + "flow-bin": "^0.70.0", "glob": "^7.1.1", "istanbul-api": "^1.1.0", "istanbul-lib-coverage": "^1.0.0", diff --git a/packages/metro/src/DeltaBundler/DeltaCalculator.js b/packages/metro/src/DeltaBundler/DeltaCalculator.js index 532b9076..6a40ca83 100644 --- a/packages/metro/src/DeltaBundler/DeltaCalculator.js +++ b/packages/metro/src/DeltaBundler/DeltaCalculator.js @@ -204,7 +204,6 @@ class DeltaCalculator extends EventEmitter { // inlineRequires information, since scripts by definition don't have // requires(). if (this._options.type === 'script') { - // $FlowIssue #23854098 - Object.assign() loses the strictness of an object in flow return { ...transformOptionsForBlacklist, inlineRequires: false, diff --git a/packages/metro/src/ModuleGraph/node-haste/HasteFS.js b/packages/metro/src/ModuleGraph/node-haste/HasteFS.js index 7d554049..557de553 100644 --- a/packages/metro/src/ModuleGraph/node-haste/HasteFS.js +++ b/packages/metro/src/ModuleGraph/node-haste/HasteFS.js @@ -46,6 +46,9 @@ module.exports = class HasteFS { } getAllFiles() { + /* $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 Array.from(this.files.keys()); } @@ -55,6 +58,9 @@ module.exports = class HasteFS { matches(directory: string, pattern: RegExp) { const entries = this.directoryEntries.get(directory); + /* $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 entries ? entries.filter(pattern.test, pattern) : []; } }; diff --git a/packages/metro/src/Server.js b/packages/metro/src/Server.js index b0bafe47..c0915f63 100644 --- a/packages/metro/src/Server.js +++ b/packages/metro/src/Server.js @@ -481,7 +481,6 @@ class Server { module.output.map, ); - // $FlowIssue #16581373 spread of an exact object should be exact return { ...module, output: { diff --git a/packages/metro/src/babel-bridge.js b/packages/metro/src/babel-bridge.js index cb0f40a7..582aee31 100644 --- a/packages/metro/src/babel-bridge.js +++ b/packages/metro/src/babel-bridge.js @@ -58,6 +58,9 @@ function resolvePlugins7(plugins: Array) { * installed in the react-native package. */ type ModuleES6 = {__esModule?: boolean, default?: {}}; + /* $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 plugins.map(plugin => { // Normalise plugin to an array. plugin = Array.isArray(plugin) ? plugin : [plugin]; @@ -379,9 +382,15 @@ function getBabelRegisterConfig7() { ]; function config(onlyList: Array) { + /* $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. */ _only = _only.concat(onlyList); return { presets: [], + /* $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. */ plugins: PLUGINS.map(pluginName => // $FlowFixMe TODO t26372934 plugin require require(`@babel/plugin-${pluginName}`), diff --git a/packages/metro/src/index.js b/packages/metro/src/index.js index 079ad6bf..28c5258f 100644 --- a/packages/metro/src/index.js +++ b/packages/metro/src/index.js @@ -164,7 +164,6 @@ exports.createConnectMiddleware = async function({ config, ...rest }: CreateConnectMiddlewareOptions) { - // $FlowFixMe Flow doesn't support object spread enough for the following line const metroServer = await runMetro({ ...rest, config, @@ -229,7 +228,6 @@ exports.runServer = async ({ attachHmrServer, middleware, end, - // $FlowFixMe Flow doesn't support object spread enough for the following line } = await exports.createConnectMiddleware({ ...rest, port, @@ -325,7 +323,6 @@ exports.runBuild = async ({ sourceMapUrl, ...rest }: RunBuildOptions) => { - // $FlowIssue #16581373 spread of an exact object should be exact const metroServer = await runMetro({ ...rest, config, @@ -385,7 +382,6 @@ exports.buildGraph = async function({ platform = `web`, ...rest }: BuildGraphOptions): Promise { - // $FlowIssue #16581373 spread of an exact object should be exact const metroServer = await runMetro({ ...rest, config, diff --git a/packages/metro/src/lib/JsonReporter.js b/packages/metro/src/lib/JsonReporter.js index 94473177..6a8a11d5 100644 --- a/packages/metro/src/lib/JsonReporter.js +++ b/packages/metro/src/lib/JsonReporter.js @@ -27,9 +27,21 @@ class JsonReporter { /* $FlowFixMe: fine to call on `undefined`. */ if (Object.prototype.toString.call(event.error) === '[object Error]') { event = {...event}; + /* $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. */ event.error = { + /* $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. */ ...event.error, + /* $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. */ message: event.error.message, + /* $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. */ stack: event.error.stack, }; } diff --git a/packages/metro/src/lib/removeInlineRequiresBlacklistFromOptions.js b/packages/metro/src/lib/removeInlineRequiresBlacklistFromOptions.js index 9ee6c147..29fa2225 100644 --- a/packages/metro/src/lib/removeInlineRequiresBlacklistFromOptions.js +++ b/packages/metro/src/lib/removeInlineRequiresBlacklistFromOptions.js @@ -17,7 +17,6 @@ function removeInlineRequiresBlacklistFromOptions( transformOptions: JSTransformerOptions, ): JSTransformerOptions { if (typeof transformOptions.inlineRequires === 'object') { - // $FlowIssue #23854098 - Object.assign() loses the strictness of an object in flow return { ...transformOptions, inlineRequires: !(path in transformOptions.inlineRequires.blacklist), diff --git a/packages/metro/src/shared/output/unbundle/as-indexed-file.js b/packages/metro/src/shared/output/unbundle/as-indexed-file.js index 64c8c200..3c2841ee 100644 --- a/packages/metro/src/shared/output/unbundle/as-indexed-file.js +++ b/packages/metro/src/shared/output/unbundle/as-indexed-file.js @@ -198,6 +198,9 @@ function buildTableAndContents( moduleGroups, ); + /* $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 [fileHeader, table, startupCodeBuffer].concat( moduleBuffers.map(({buffer}) => buffer), ); diff --git a/yarn.lock b/yarn.lock index cb521072..4236c9ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2821,9 +2821,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.69.0.tgz#053159a684a6051fcbf0b71a2eb19a9679082da6" +flow-bin@^0.70.0: + version "0.70.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.70.0.tgz#080ae83a997f2b4ddb3dc2649bf13336825292b5" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2"