Skip to content

[standards][flow] Set up .flowconfig to support Haste and path-based imports - #24318

Closed
ide wants to merge 1 commit into
react:masterfrom
expo:standard-paths-flow
Closed

[standards][flow] Set up .flowconfig to support Haste and path-based imports#24318
ide wants to merge 1 commit into
react:masterfrom
expo:standard-paths-flow

Conversation

@ide

@ideide commented Apr 5, 2019

Copy link
Copy Markdown
Contributor

Summary

See #24316 for the motivation.

By adding the .android.js and .ios.js extensions to the respective .flowconfig files, Flow is able to find files that either:

  • Are required using Haste
  • Are required using standard paths and have a .js extension
  • Are required using standard paths and have a .platform.js subextension

Changelog

[General] [Changed] - Adjusted .flowconfig to support both Haste and standard path-based requires

Test Plan

After replacing some Haste-style requires with path-based requires, this change to the Flow config made Flow pass.

…imports
By adding the .android.js and .ios.js extensions to the respective .flowconfig files, Flow is able to find files that either:
- Are required using Haste
- Are required using standard paths and have a .js extension
- Are required using standard paths and have a .platform.js subextension
Test plan: After replacing some Haste-style requires with path-based requires, this change to the Flow config made Flow pass.
@ide
ide requested a review from cpojerApril 5, 2019 01:02
@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner labels Apr 5, 2019

@cpojercpojer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's see what happens when I import that to FB, I may need to make some internal changes.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@ide

ide commented Apr 8, 2019

Copy link
Copy Markdown
ContributorAuthor

I may need to make some internal changes.

Hopefully it is straightforward -- the concept here is that there were several files (namely those ending in .platform.js) that Flow was able to find only via Haste names. This commit teaches Flow about .platform.js, and when you specify module.file_ext, you override the defaults and need to re-specify all the extensions you use.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ide in 682e11a.

When will my fix make it into a release? | Upcoming Releases

@react-native-botreact-native-bot added the Merged This PR has been merged. label Apr 8, 2019
dsyang pushed a commit to dsyang/react-native that referenced this pull request Apr 12, 2019
Summary:
See react#24316 for the motivation.
By adding the .android.js and .ios.js extensions to the respective .flowconfig files, Flow is able to find files that either:
- Are required using Haste
- Are required using standard paths and have a .js extension
- Are required using standard paths and have a .platform.js subextension
[General] [Changed] - Adjusted .flowconfig to support both Haste and standard path-based requires
Pull Request resolved: react#24318
Differential Revision: D14822356
Pulled By: cpojer
fbshipit-source-id: dde0c83692d6170f4a44cd3fb8ede162054157e9
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.FlowMergedThis PR has been merged.p: ExpoPartner: ExpoPartner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ide@react-native-bot@cpojer@facebook-github-bot