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

Run Flow for each renderer separately #12846

Merged
merged 6 commits into from
May 18, 2018
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented May 17, 2018

This adds per-renderer Flow commands:

  • yarn flow dom
  • yarn flow fabric
  • yarn flow native
  • yarn flow test

If you forget to specify the one you need during local development, yarn flow will prompt you to do so. It should be possible to even run them in parallel although I’d expect it to be super slow so in practice you’ll probably use one at a time.

The typechecks are currently exactly the same between renderers. This is a preparation for #12792 which will shim the host config types for each renderer separately.

The yarn flow-ci command that runs on the CI is changed to run Flow with each renderer, one by one.

Internally, this works by having separate Flow configs in different directories (thus making Flow treat them as isolated from each other). We generate Flow configs from a single master template if you run yarn, yarn flow, or yarn flow-ci.

We'll need to do pre-renderer Flow passes with different configs.
This is the first step to get it working. We only want the original version checked in.
I thought this would be a bit cleaner at first because we now have non-environment files in this directory.
But Sebastian is changing these files at the same time so I want to avoid conflicts and keep the PR more tightly scoped. Undo.
@gaearon
Copy link
Collaborator Author

gaearon commented May 17, 2018

This is ready for review.

@acdlite
Copy link
Collaborator

acdlite commented May 17, 2018

Is it still possible to spawn a Flow server?

@gaearon
Copy link
Collaborator Author

gaearon commented May 17, 2018

Yes, that's what yarn flow does now, both on master (since #12841) and here.

The full check has moved into yarn flow-ci.

@gaearon gaearon merged commit 40addbd into facebook:master May 18, 2018
@gaearon gaearon deleted the many-flows branch May 18, 2018 01:05
elas7 added a commit to elas7/react that referenced this pull request Aug 14, 2018
`flow-coverage-report` stopped working after Flow was set to run for each renderer separately (facebook#12846). It happened because `flow-coverage-report` calls `flow coverage`, and that command doesn't work without a `.flowconfig` in a parent directory of every file checked.

This is fixed by creating a temporary `.flowconfig` in the project root before running `flow-coverage-report`.

This fix also allows to move `.flowcoverage` out of the project root, and to select a renderer before generating the coverage report.

Internally, this is done by rewriting `writeConfig()` to accept a `rootFolder` argument. If `rootFolder` is true, a config is made in the root folder, with the right relative paths.
elas7 added a commit to elas7/react that referenced this pull request Aug 14, 2018
`flow-coverage-report` stopped working after Flow was set to run for each renderer separately (facebook#12846). As discussed in facebook#13393, this is hard to fix without adding complexity to `.flowconfig`'s generation.
gaearon pushed a commit that referenced this pull request Aug 14, 2018
`flow-coverage-report` stopped working after Flow was set to run for each renderer separately (#12846). As discussed in #13393, this is hard to fix without adding complexity to `.flowconfig`'s generation.
@NE-SmallTown
Copy link
Contributor

@gaearon Should we update the PULL_REQUEST_TEMPLATE.md?

@gaearon
Copy link
Collaborator Author

gaearon commented Sep 6, 2018

Sure.

@NE-SmallTown
Copy link
Contributor

Are you working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants