Commit Graph

2 Commits

Author SHA1 Message Date
Héctor Ramos a1c479fb3b Declare HMRClient module to fix Flow issues in OSS
Summary: Closes https://github.com/facebook/react-native/pull/17881

Differential Revision: D6918186

Pulled By: hramos

fbshipit-source-id: ebcdbde1623eab497062fb50bccb393734b3578f
2018-02-06 16:01:23 -08:00
Héctor Ramos f4d627c8fa Fix failure due to missing Metro flow types
Summary:
Fixes the Flow failure due to an undefined Ast type.

Before:

```
 $ npm run flow -- check

> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"

Error: local-cli/__tests__/fs-mock-test.js:27
 27:   beforeEach(() => {
       ^^^^^^^^^^ beforeEach. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:53
 53:       expect(content).toEqual('beep');
           ^^^^^^ expect. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:88
 88:         expect(content).toEqual('hello, world!');
             ^^^^^^ expect. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:100
100:       expect(content).toEqual('hello, world!');
           ^^^^^^ expect. Could not resolve name

Error: node_modules/metro/src/Bundler/util.js.flow:46
 46: ): Ast {
        ^^^ Ast. Could not resolve name

Error: node_modules/metro/src/ModuleGraph/worker/collect-dependencies.js.flow:283
283: const xp = (module.exports = (ast: Ast) =>
                                        ^^^ Ast. Could not resolve name

Error: node_modules/metro/src/assetTransformer.js.flow:29
 29: ): Promise<{ast: Ast}> {
                      ^^^ Ast. Could not resolve name
```

After

```
$ npm run flow -- check

> react-native@1000.0.0 flow /Users/hramos/git/react-native
> flow "check"

Error: local-cli/__tests__/fs-mock-test.js:27
 27:   beforeEach(() => {
       ^^^^^^^^^^ beforeEach. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:53
 53:       expect(content).toEqual('beep');
           ^^^^^^ expect. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:88
 88:         expect(content).toEqual('hello, world!');
             ^^^^^^ expect. Could not resolve name

Error: local-cli/__tests__/fs-mock-test.js:100
100:       expect(content).toEqual('hello, world!');
           ^^^^^^ expect. Could not resolve name
```

[ GENERAL ] [ BUGFIX] [ .flowconfig ] - Have Flow ignore Metro node_nodules
Closes https://github.com/facebook/react-native/pull/17187

Differential Revision: D6572303

Pulled By: hramos

fbshipit-source-id: aa256b9725970fcc2a6da6578c83e7c0875e3cfd
2017-12-14 15:19:08 -08:00