finos / openfin-react-hooks

A collection of React Hooks built on top of the Openfin API - from Scott Logic
Apache License 2.0
48 stars 18 forks source link

Add support for v1 useChildWindow #52

Closed ms14981 closed 4 years ago

ms14981 commented 4 years ago

This is one way that the V1 hooks could be implemented, done with the useChildWindow hook as an example. Once the format has been decided, I can then look at doing the same for the other hooks.

One thing this doesn't cover is if we want the demo to use a different version of the hooks. Currently, it will just use the V2 hooks. It might be possible to add a switch for the user to swap between V1 and V2 of the hooks in the demo (or even potentially work it out and swap the hooks out at runtime), but I think that this will only matter if the demo app is downloaded and run locally.

I've tried to make the V1 version as close to V2 as possible.

Note: V1 here refers to the JS API version, and relates to any versions below 39 in the versioning method here: https://developer.openfin.co/versions/?product=Runtime. V2 is currently version 39 and above. In the X1.X2.X3.X4 versioning in OpenFin, the JS API version is X3.

oriondean commented 4 years ago

Could we add a runtime switch from V1 to V2 useChildWindow based on the version of OpenFin?

ms14981 commented 4 years ago

Will merge #59 instead