[Modern] Export Flow types from `relay-runtime`
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
As things stand, the Flow types that the Relay compiler generates are unusable without a decent amount of fiddling to stub out the types they import, as documented in #1689.
The gist of it is that these generated files are trying to import various types from `relay-runtime`, but these types are not exported from those NPM packages. There are various ways to work around this, with the commonly accepted solution being to stub out the required types in a library definition, but these are far from ideal.
In my opinion, the ideal solution would be to include the Flow type definitions in the compiled NPM package. There's a few ways to go about this, from including the original sources alongside the Babel transpiled ones with the `.js.flow` extension, to including just the types in this with the still-experimental `flow gen-flow-files` command, but whatever the approach, including type definitions would be tremendously helpful.
Contributor guide
Research direction
Start by reading the issue linked in #1689 and examining the generated Flow imports and the relay-runtime NPM package exports. Compare the possible type-inclusion approaches described here; the work is done when generated Flow types can use relay-runtime without requiring consumer-defined stubs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100