codeoverflow-org / nodecg-io

A NodeCG-bundle which implements Social Media API's in the NodeCG framework
https://nodecg.io
MIT License
108 stars 26 forks source link

Clarify what the native/raw client should be exactly #91

Closed hlxid closed 3 years ago

hlxid commented 4 years ago

Description

The definition of our "native client" is not pretty clear and needs clarification. Please refer to https://github.com/codeoverflow-org/nodecg-io/pull/68#issuecomment-662597354.

sebinside commented 4 years ago

I have still no definitive answer to that... It may be not possible to generalize that and to just always yield the internal object which handles the calls...

hlxid commented 3 years ago

tbh I have recently thought about completely dropping the wrapper object arround each service.

The idea to have simpler functions to access certain things in the client libs was nice in theory but in reality we didn't use it except for #102/#107 (things like in the websocket-client don't really count because the almost just passthrough the call and therefore are mostly maintance overhead). These libraries are made with developer-experince in mind so should be no wonder that we barely had the need to add anything to make them easier to use. If we have a service with a client that was designed by us like wrappers around REST/WebSocket Apis this is also not of any advantage (e.g. nanoleaf, streamelements). In contrast users of nodecg-io almost everytime have the hassle of getting the native client and because client.getNativeClient() is too long they also usually create a extra variable for it.

Instead I would want to just return the client directly without the wrapper. Less hassle for nodecg-io, less hassle for the user and if we want to add any simplifications we can just create a class which inherits the actual client and add functions there or if they are really meaningful we could just upstream them to the respective library.

Any objections or opinions on this?

If we decide to do this I would push 0.1.0 back and implement this before the release because with that release I guess more will use it because you don't need to mess with the lerna setup anymore and can just npm install anything in your normal nodecg bundle. Getting rid of the wrapper would break every bundle using nodecg-io but I would rather do this now than if we are on a later version.