@allow-large-files clean up xplat/js for flow 0.70.0

Reviewed By: fishythefish

Differential Revision: D7643236

fbshipit-source-id: 1d9a95f1e249ce3fdc552a4ca92a6c63b267dae4
This commit is contained in:
Avik Chaudhuri 2018-04-17 05:37:02 -07:00 committed by Facebook Github Bot
parent c67b6317fa
commit c82456d8e0
11 changed files with 35 additions and 12 deletions

View File

@ -19,4 +19,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
munge_underscores=true munge_underscores=true
[version] [version]
^0.69.0 ^0.70.0

View File

@ -27,7 +27,7 @@
"eslint-plugin-prettier": "2.6.0", "eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react": "7.6.1", "eslint-plugin-react": "7.6.1",
"eslint-plugin-relay": "0.0.21", "eslint-plugin-relay": "0.0.21",
"flow-bin": "^0.69.0", "flow-bin": "^0.70.0",
"glob": "^7.1.1", "glob": "^7.1.1",
"istanbul-api": "^1.1.0", "istanbul-api": "^1.1.0",
"istanbul-lib-coverage": "^1.0.0", "istanbul-lib-coverage": "^1.0.0",

View File

@ -204,7 +204,6 @@ class DeltaCalculator extends EventEmitter {
// inlineRequires information, since scripts by definition don't have // inlineRequires information, since scripts by definition don't have
// requires(). // requires().
if (this._options.type === 'script') { if (this._options.type === 'script') {
// $FlowIssue #23854098 - Object.assign() loses the strictness of an object in flow
return { return {
...transformOptionsForBlacklist, ...transformOptionsForBlacklist,
inlineRequires: false, inlineRequires: false,

View File

@ -46,6 +46,9 @@ module.exports = class HasteFS {
} }
getAllFiles() { 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()); return Array.from(this.files.keys());
} }
@ -55,6 +58,9 @@ module.exports = class HasteFS {
matches(directory: string, pattern: RegExp) { matches(directory: string, pattern: RegExp) {
const entries = this.directoryEntries.get(directory); 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) : []; return entries ? entries.filter(pattern.test, pattern) : [];
} }
}; };

View File

@ -481,7 +481,6 @@ class Server {
module.output.map, module.output.map,
); );
// $FlowIssue #16581373 spread of an exact object should be exact
return { return {
...module, ...module,
output: { output: {

View File

@ -58,6 +58,9 @@ function resolvePlugins7(plugins: Array<any>) {
* installed in the react-native package. * installed in the react-native package.
*/ */
type ModuleES6 = {__esModule?: boolean, default?: {}}; 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 => { return plugins.map(plugin => {
// Normalise plugin to an array. // Normalise plugin to an array.
plugin = Array.isArray(plugin) ? plugin : [plugin]; plugin = Array.isArray(plugin) ? plugin : [plugin];
@ -379,9 +382,15 @@ function getBabelRegisterConfig7() {
]; ];
function config(onlyList: Array<string>) { function config(onlyList: Array<string>) {
/* $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); _only = _only.concat(onlyList);
return { return {
presets: [], 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 => plugins: PLUGINS.map(pluginName =>
// $FlowFixMe TODO t26372934 plugin require // $FlowFixMe TODO t26372934 plugin require
require(`@babel/plugin-${pluginName}`), require(`@babel/plugin-${pluginName}`),

View File

@ -164,7 +164,6 @@ exports.createConnectMiddleware = async function({
config, config,
...rest ...rest
}: CreateConnectMiddlewareOptions) { }: CreateConnectMiddlewareOptions) {
// $FlowFixMe Flow doesn't support object spread enough for the following line
const metroServer = await runMetro({ const metroServer = await runMetro({
...rest, ...rest,
config, config,
@ -229,7 +228,6 @@ exports.runServer = async ({
attachHmrServer, attachHmrServer,
middleware, middleware,
end, end,
// $FlowFixMe Flow doesn't support object spread enough for the following line
} = await exports.createConnectMiddleware({ } = await exports.createConnectMiddleware({
...rest, ...rest,
port, port,
@ -325,7 +323,6 @@ exports.runBuild = async ({
sourceMapUrl, sourceMapUrl,
...rest ...rest
}: RunBuildOptions) => { }: RunBuildOptions) => {
// $FlowIssue #16581373 spread of an exact object should be exact
const metroServer = await runMetro({ const metroServer = await runMetro({
...rest, ...rest,
config, config,
@ -385,7 +382,6 @@ exports.buildGraph = async function({
platform = `web`, platform = `web`,
...rest ...rest
}: BuildGraphOptions): Promise<Graph> { }: BuildGraphOptions): Promise<Graph> {
// $FlowIssue #16581373 spread of an exact object should be exact
const metroServer = await runMetro({ const metroServer = await runMetro({
...rest, ...rest,
config, config,

View File

@ -27,9 +27,21 @@ class JsonReporter<TEvent: {}> {
/* $FlowFixMe: fine to call on `undefined`. */ /* $FlowFixMe: fine to call on `undefined`. */
if (Object.prototype.toString.call(event.error) === '[object Error]') { if (Object.prototype.toString.call(event.error) === '[object Error]') {
event = {...event}; 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 = { 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, ...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, 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, stack: event.error.stack,
}; };
} }

View File

@ -17,7 +17,6 @@ function removeInlineRequiresBlacklistFromOptions(
transformOptions: JSTransformerOptions, transformOptions: JSTransformerOptions,
): JSTransformerOptions { ): JSTransformerOptions {
if (typeof transformOptions.inlineRequires === 'object') { if (typeof transformOptions.inlineRequires === 'object') {
// $FlowIssue #23854098 - Object.assign() loses the strictness of an object in flow
return { return {
...transformOptions, ...transformOptions,
inlineRequires: !(path in transformOptions.inlineRequires.blacklist), inlineRequires: !(path in transformOptions.inlineRequires.blacklist),

View File

@ -198,6 +198,9 @@ function buildTableAndContents(
moduleGroups, 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( return [fileHeader, table, startupCodeBuffer].concat(
moduleBuffers.map(({buffer}) => buffer), moduleBuffers.map(({buffer}) => buffer),
); );

View File

@ -2821,9 +2821,9 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2" graceful-fs "^4.1.2"
write "^0.2.1" write "^0.2.1"
flow-bin@^0.69.0: flow-bin@^0.70.0:
version "0.69.0" version "0.70.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.69.0.tgz#053159a684a6051fcbf0b71a2eb19a9679082da6" resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.70.0.tgz#080ae83a997f2b4ddb3dc2649bf13336825292b5"
for-in@^1.0.1, for-in@^1.0.2: for-in@^1.0.1, for-in@^1.0.2:
version "1.0.2" version "1.0.2"