Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell template app .flowconfig to look for .native.js files #16816

Closed
wants to merge 1 commit into from

Conversation

Ashoat
Copy link
Contributor

@Ashoat Ashoat commented Nov 13, 2017

Motivation

metro-bundler looks for .native.js files (see here). Packages such as react-navigation rely on this functionality (see here). This PR makes it so you can react-native init, yarn add react-navigation, and flow successfully!

Test Plan

  1. react-native init
  2. yarn add react-navigation
  3. flow

Release Notes

[CLI] [MINOR] [Flow] - Tell template app .flowconfig to look for .native.js files

`metro-bundler` looks for `.native.js` files ([see here](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js#L458)). Packages such as `react-navigation` rely on this functionality ([see here](https://github.com/react-community/react-navigation/blob/master/src/PlatformHelpers.native.js)). This PR makes it so you can `react-native init`, `yarn add react-navigation`, and `flow` successfully!

All four must be specified, since specifying any `module.file_ext` overrides the default three.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 13, 2017
@Ashoat
Copy link
Contributor Author

Ashoat commented Nov 20, 2017

@gabelevi, any chance you could look at this? It's a small change to react-native init's .flowconfig template file, and it's necessary for React Navigation's flow config to work.

@Ashoat
Copy link
Contributor Author

Ashoat commented Nov 26, 2017

@calebmer, could I trouble you to look at this? It's a small change to react-native init's .flowconfig template file, and it's necessary for React Navigation's flow config to work.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Nov 30, 2017
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

bowerman0 pushed a commit to bowerman0/react-native that referenced this pull request Dec 5, 2017
Summary:
`metro-bundler` looks for `.native.js` files ([see here](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js#L458)). Packages such as `react-navigation` rely on this functionality ([see here](https://github.com/react-community/react-navigation/blob/master/src/PlatformHelpers.native.js)). This PR makes it so you can `react-native init`, `yarn add react-navigation`, and `flow` successfully!

1. `react-native init`
2. `yarn add react-navigation`
3. `flow`

[CLI] [MINOR] [Flow] - Tell template app .flowconfig to look for .native.js files
Closes facebook#16816

Differential Revision: D6445363

Pulled By: shergin

fbshipit-source-id: c0ce7ed27a8a3291deaa09d98e822362f93929c8
bowerman0 pushed a commit to bowerman0/react-native that referenced this pull request Dec 5, 2017
Summary:
`metro-bundler` looks for `.native.js` files ([see here](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js#L458)). Packages such as `react-navigation` rely on this functionality ([see here](https://github.com/react-community/react-navigation/blob/master/src/PlatformHelpers.native.js)). This PR makes it so you can `react-native init`, `yarn add react-navigation`, and `flow` successfully!

1. `react-native init`
2. `yarn add react-navigation`
3. `flow`

[CLI] [MINOR] [Flow] - Tell template app .flowconfig to look for .native.js files
Closes facebook#16816

Differential Revision: D6445363

Pulled By: shergin

fbshipit-source-id: c0ce7ed27a8a3291deaa09d98e822362f93929c8
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
Summary:
`metro-bundler` looks for `.native.js` files ([see here](https://github.com/facebook/metro-bundler/blob/master/packages/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js#L458)). Packages such as `react-navigation` rely on this functionality ([see here](https://github.com/react-community/react-navigation/blob/master/src/PlatformHelpers.native.js)). This PR makes it so you can `react-native init`, `yarn add react-navigation`, and `flow` successfully!

1. `react-native init`
2. `yarn add react-navigation`
3. `flow`

[CLI] [MINOR] [Flow] - Tell template app .flowconfig to look for .native.js files
Closes facebook/react-native#16816

Differential Revision: D6445363

Pulled By: shergin

fbshipit-source-id: c0ce7ed27a8a3291deaa09d98e822362f93929c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants