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

Adding Flow types for the API to flow-typed repository #6664

Closed
volkanunsal opened this issue May 14, 2018 · 2 comments
Closed

Adding Flow types for the API to flow-typed repository #6664

volkanunsal opened this issue May 14, 2018 · 2 comments

Comments

@volkanunsal
Copy link

Motivation

I want to use Flow types with the minimized files in dist folder. In order to do so, the flow types must be available either in the distribution or in the Flow typed repo, which is the central source of distribution for flow types for vendor libraries.

Design Alternatives

Current distribution already includes some flow-typed, but these appear to be ad hoc, and for internal use only. One alternative is to include the types in the repo alongside the code. But this would make types inaccessible to those who load the distribution via url or some other way into the global context of the browser.

Implementation

Flow binary has an experimental gen-flow-files command.

$ flow gen-flow-files src --out-dir types

A possible release workflow could use this to generate the API types for the library, and submit a PR for them to the flow-typed repository.

@jaegs
Copy link

jaegs commented May 30, 2018

The script gen-flow-files is buggy and crashes when run on mabpox-gl-js. facebook/flow#5871

@anandthakker
Copy link
Contributor

I'm going to close this in favor of #6963 -- we're interested in providing Flow definitions for downstream projects to use, but prefer to publish them with our npm package rather than via flow-typed (as is recommended in the flow-typed FAQ).

One alternative is to include the types in the repo alongside the code. But this would make types inaccessible to those who load the distribution via url or some other way into the global context of the browser.

I think one option for users in this situation, once #6963 is done, would be to pull the mapbox-gl npm package and use the flow definitions from there.

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

No branches or pull requests

4 participants