mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
We typecheck the reconciler against each one of our host configs. `yarn flow dom` checks it against the DOM renderer, `yarn flow native` checks it against the native renderer, and so on. To do this, we generate separate flowconfig files. Currently, there is no root-level host config, so running Flow directly via `flow` CLI doesn't work. You have to use the `yarn flow` command and pick a specific renderer. A drawback of this design, though, is that our Flow setup doesn't work with other tooling. Namely, editor integrations. I think the intent of this was maybe so you don't run Flow against a renderer than you intended, see it pass, and wrongly think you fixed all the errors. However, since they all run in CI, I don't think this is a big deal. In practice, I nearly always run Flow against the same renderer (DOM), and I'm guessing that's the most common workflow for others, too. So what I've done in this commit is modify the `yarn flow` command to copy the generated `.flowconfig` file into the root directory. The editor integration will pick this up and show Flow information for whatever was the last renderer you checked. Everything else about the setup is the same, and all the renderers will continue to be checked by CI. |
||
|---|---|---|
| .. | ||
| config | ||
| createFlowConfigs.js | ||
| environment.js | ||
| react-devtools.js | ||
| react-native-host-hooks.js | ||
| react-relay-hooks.js | ||
| runFlow.js | ||