Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Adds flow definitions files #2719
@ibgreen and @Pessimistress I am a bit confused about how we should do this. In #2645 and #2647 adding Flow type definitions is still a bit controversial. My solution was to treat our own code base as a third party and creating library definitions for the types and others, but I am not sure if the result is going to be good. Also, I just found an RFC that also proposes the implementation of a type system, but in a more "manual" way, without Flow or TypeScript. I still couldn't find a way how to automate libdefs writing, so the only advantage I see in creating Flow libdefs is for people who choose to use Flow in their projects, not in the development of Deck.gl itself. What do you think? Should I continue working on the libdefs approach or drop it and create a layer of types without third parties software?
@IgorWilbert Adding a separate type definitions file is not controversial. Changing the existing source code to use flow syntax is.
We did already implement the runtime prop type system. Look in any layer source code, you will find prop type definitions, e.g. https://github.com/uber/deck.gl/blob/master/modules/layers/src/line-layer/line-layer.js#L31
The only automation I could think of was a script that converts the above prop types to flow/typescript definition objects. I wrote a script to iterate over the props in all the layers here:
However, I am not familiar the exact syntax of a flow type definition file, you would just need to help with implementing that.
For the rest of the API it is mainly the various methods of the Deck class, the View classes etc that would need manual flow type definition entries in your file.
Does this help?
Hi @ibgreen ! Thanks for the help. Sorry to bother you, but before proceeding I would like to know your thoughts about what I have done so far.