flummox
flummox copied to clipboard
Annotations for Flow Type Checker
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 :-)
I would love to use Flow, but need to wait for more complete ES6 support. https://github.com/facebook/flow/issues/62
:+1:
as far as I know Babel supports Flow annotations
Babel will strip the annotations, but Flow itself doesn't support certain ES6 features, so type-checking won't work.
there is a way to blacklist flow transformer https://github.com/babel/babel/issues/665#issuecomment-76526326
Huh? Then what's the point?
to run Flow on transpiled ES5 code with Flow annotations in it
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')
?
yep
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.
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
@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.