Closed nmn closed 6 years ago
I think the Reason team is already working on something like this 😄 That said, if you wanted to work on it in the context of this project you would have to:
This is also how we've accidentally made a TS -> Flow translator lol
@nmn I agree that this would be amazing. Bucklescript, which does the code generation for Reason, would need to support it. See this thread.
I think the Reason team is now actively working on this.
@rrdelaney Yes, it appears so. Do you know where that development is taking place? @jordwalke made it sound as though code had already been written here.
A Converter from Reason files to Flow type definition files?
This is probably out of scope for the project but I just wanted to bring it up in case there's any work already done in the area. If we run
ocamlc -dtypedtree
on an.mli
file, it gives all the data that is generally needed to generate a flow type definition file. There are a few clever Flow tricks to make it not lossy, by using Tuple types and opaque types, but it should definitely be possible.This project I feel like would be very useful if we want to move to a world where we can write libraries in Reason/Ocaml and generate the Javascript and also the types in Flow/Typescript.
Thoughts?