vacuumlabs / verejne.digital

Projekt verejne.digital má za cieľ aplikovať umelú inteligenciu na dáta zverejňované slovenskými verejnými inštitúciami.
Apache License 2.0
0 stars 0 forks source link

Flowtype HOCs #49

Open mpinter opened 6 years ago

borisvida commented 6 years ago

@mpinter Which HOCs exactly do you mean? Seems to me that most of them are typed.

jakubukrop commented 6 years ago

In my opinion the task is about adding flow to component that use HOCs, e.g.

I think that 99% of files in Notices and Connections that do not have 100% flow coverage today are missing HOC flowtypes (e.g. the compose() part is marked as uncovered), see flow-coverage report.

mpinter commented 6 years ago

@borisvida The issue is related to typing compose (and the element returned by it) itself - recompose exposes HOC type which works quite well for it's types, connect and correctly typed higher-order-components - check here https://medium.com/flow-type/flow-support-in-recompose-1b76f58f4cfc - this allows you to have correctly typed props in each HOC applied.

So .. 'correctly typed higher-order components' - that implies withDataProviders does not work out of the box (we've created some basic typing for this in bank-foundry project that seems usable, can share it here), withRouter doesn't work (or didn't the last time I've tried), and in general, the typing would probably be quite painful.

I'd say this task has really low priority and is mostly for someone who'd really want to dig into flow and doesn't have a better task on their hands :) (that said, if someone is coming from a different project and wants to use this one to better understand flow, we've quite good coverage as of now so it's probably easier to do something like this here than elsewhere).

borisvida commented 6 years ago

Thanks a lot guys, I just thought that it's about the data wrappers. I get it now and also I think this info will be useful to anyone working on this task :slightly_smiling_face: :+1: