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

Annotations for Flow Type Checker #41

Open
pe3 opened this issue Feb 23, 2015 · 12 comments
Open

Annotations for Flow Type Checker #41

pe3 opened this issue Feb 23, 2015 · 12 comments

Comments

@pe3
Copy link

pe3 commented Feb 23, 2015

In my understanding it would be possible since Flow 0.4.0 to annotate the Flummox API with type information. For Flummox users it would mean that you could statically check with Facebook Flow that you are calling Flummox the right way from your application code. Sounds tempting :-)

@acdlite
Copy link
Owner

acdlite commented Feb 24, 2015

I would love to use Flow, but need to wait for more complete ES6 support. facebook/flow#62

@emmenko
Copy link

emmenko commented Mar 10, 2015

👍

@chicoxyzzy
Copy link
Contributor

as far as I know Babel supports Flow annotations

@acdlite
Copy link
Owner

acdlite commented Mar 27, 2015

Babel will strip the annotations, but Flow itself doesn't support certain ES6 features, so type-checking won't work.

@chicoxyzzy
Copy link
Contributor

there is a way to blacklist flow transformer babel/babel#665 (comment)

@acdlite
Copy link
Owner

acdlite commented Mar 27, 2015

Huh? Then what's the point?

@chicoxyzzy
Copy link
Contributor

to run Flow on transpiled ES5 code with Flow annotations in it

@acdlite
Copy link
Owner

acdlite commented Mar 27, 2015

Ah, I see. So we would output the ES5 code to a directory called flow or something, and anyone who wants to use it would do require('flummox/flow') instead of require('flummox')?

@chicoxyzzy
Copy link
Contributor

yep

@acdlite
Copy link
Owner

acdlite commented Mar 27, 2015

I like that idea. Do you know of any other libraries that are doing this? I've only played with Flow a bit, and I wonder if it would choke on any of extra code Babel adds.

@chicoxyzzy
Copy link
Contributor

actually no but I saw some people speak about this on babel's gitter channel. I think all should work except runtime will be untyped.
cc @sebmck

@sebmck
Copy link

sebmck commented Mar 29, 2015

@chicoxyzzy No idea how or why people use it. But Flow should accept and run all Babel ES5 output without a problem and if it doesn't then it'd be a bug in Flow.

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

6 participants