Ant-design: Flowtype support

Created on 24 Sep 2017  ·  8Comments  ·  Source: ant-design/ant-design

What problem does this feature solve?

Provide Flow type checking and code suggestions.

What does the proposed API look like?

We just need a libdef like described here. https://flow.org/en/docs/libdefs/
It shouldn't be very complicated to achieve since it can probably be generated from Typescript definitions.

help wanted

Most helpful comment

"Better" you might think it is, not everybody shares that opinion. But that's not even the point. Nobody is asking you to move to javascript + Flow. You can and should, of course, keep going with Typescript.
This ticket was just about providing _libdefs_ files for Flow compatibility, which I'm sure would delight many, many users in a near future.

All 8 comments

it can probably be generated from Typescript definitions.

Could your create a PR? Thanks.

I think we won't support it. Typescript is enough and better.

"Better" you might think it is, not everybody shares that opinion. But that's not even the point. Nobody is asking you to move to javascript + Flow. You can and should, of course, keep going with Typescript.
This ticket was just about providing _libdefs_ files for Flow compatibility, which I'm sure would delight many, many users in a near future.

providing libdefs files for Flow compatibility

That is always welcome if someone could help us to make it happen. Feel free to propose a PR for it. I just say this is not our first priority now.

+1

Did someone manage to generate the libdefs files?

https://github.com/rj254/antd-flow-types

Someone wrote some flow types.

Can someone validate these?

It seems like there are Flow type definitions in the official flow-typed repo now:

https://github.com/flow-typed/flow-typed/tree/master/definitions/npm/antd_v3.x.x/flow_v0.104.x-

I have no idea how well they work (have not tried them).

Was this page helpful?
0 / 5 - 0 ratings