mirror of https://github.com/status-im/metro.git
@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:
parent
c67b6317fa
commit
c82456d8e0
|
@ -19,4 +19,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
|||
munge_underscores=true
|
||||
|
||||
[version]
|
||||
^0.69.0
|
||||
^0.70.0
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) : [];
|
||||
}
|
||||
};
|
||||
|
|
|
@ -481,7 +481,6 @@ class Server {
|
|||
module.output.map,
|
||||
);
|
||||
|
||||
// $FlowIssue #16581373 spread of an exact object should be exact
|
||||
return {
|
||||
...module,
|
||||
output: {
|
||||
|
|
|
@ -58,6 +58,9 @@ function resolvePlugins7(plugins: Array<any>) {
|
|||
* 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<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);
|
||||
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}`),
|
||||
|
|
|
@ -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<Graph> {
|
||||
// $FlowIssue #16581373 spread of an exact object should be exact
|
||||
const metroServer = await runMetro({
|
||||
...rest,
|
||||
config,
|
||||
|
|
|
@ -27,9 +27,21 @@ class JsonReporter<TEvent: {}> {
|
|||
/* $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,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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),
|
||||
);
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue