Auto-generate Flow definitions from TS definitions using flowgen#16
Auto-generate Flow definitions from TS definitions using flowgen#16
Conversation
|
Really sweet! One question I have – is there a particular reason we don't want these checked in to version control? I've never used Flow 😱 and don't know much about what should / shouldn't be checked in to vc. |
|
@parkerziegler There's really no particular reason not to check them in, but I prefer not to check in build artifacts. As long as we assume there don't have to be any manual changes to the autogenerated |
|
@cem2ran yes, I've tried it before but ran into issues where the generated types weren't quite working as they're very much geared towards types for apps. I think I also encountered an issue when trying to then use it in another library or app that wasn't using gentype. The issue here is still open so I'd say it's just not there yet: rescript-association/genType#95 From a maintenance standpoint I believe though that it's completely acceptable to author Typescript definitions separately |
I've been meaning to add this for a while; Using flowgen we can generate some nice Flow definitions from our rather simple TS definition files.
This will still need to be tested but I'm already opening a PR so that it's visible.
The script that's being added generates
.js.flowfiles for eachd.tsfile.This also upgrades
bs-platformwhich contains a rather important fix for arity-0 functions being passed when a user is meaning to ignore the only argument, which lead to an infinite loop before.