facebook / flow

Adds static typing to JavaScript to improve developer productivity and code quality.
https://flow.org/
MIT License
22.07k stars 1.86k forks source link

flow experience needs a lot of work around flowconfig and flow-typed #6966

Open indigoviolet opened 6 years ago

indigoviolet commented 6 years ago

This is not going to be a very specific bug report, and I'm sure none of this will be a surprise to the flow team, but despite that I believe it is worth re-emphasizing. No disrespect is intended!

I'm a big fan of flow's core feature set - which is awesome - but the developer experience around it can really use a lot of improvement. Some of the notably painful things I've encountered in a couple years of using flow over several projects (with pretty smart developers who are motivated to use flow):

Flow is such an awesome tool, I really hope that it grows out of these limitations so that people can take full advantage of its potential. Much love and thanks for the work that has gone into this!

jbrown215 commented 6 years ago

This is really good feedback. Thank you!

Adding a flow-typed library will probably add hundreds of errors into your codebase

There is an incremental solution here, where you can add the library and suppress the errors. At that point, you have the same coverage as you had before, but you can incrementally get rid of the suppressions to increase your coverage. The tool named tool at the root of this repo can be used to automatically suppress all errors with a message. Try running ./tool add-comments --help for more information on usage.

I bet most developers have no idea what fraction of their codebase is well typed

This sounds like a really useful metric to have! Unfortunately we don't have anyone with time to work on it right now, but I really hope we do have this capability at some point.

ArmorDarks commented 6 years ago

I'm very appreciative about what Flow team doing. Flow seems like a great thing. But all that said is true, unfortunately.

Flow-typed didn't work well for us too. I have a strong feeling that there should be a better way to distribute, consume, and what is very important, use, extend and override already defined typing within libraries instead of consuming flow-typed. Because I must assure that flow-typed is a kind of a hell to maintain and for the library developer and for the consumer.

Inability to extend and override already declared typings is extremely troublesome. For instance, some Vue-related packages trying to build better typings for the Vue libraries, but since they can't consume and extend already existing Vue typings in flow-typed, they just forced to copy them by hand.

Another extreme pain point is development on Windows. Not only Flow is significantly slower on Windows, but it carries extreme bugs for months! And the main plugin for VS Code flow-for-vscode due to Windows-related issues is unusable too, and nothing changes for months.