Hey @openhab-5iver I wanted to point this repo out to you. I ultimately gave up trying to maintain backwards compatibility with the existing JS libraries due to a few reasons:
It's really hard!
It severely hamstrings new code
The existing libraries don't translate well to modules, as they assume things exist or that isolation doesn't
The existing libraries I would characterise as an awesome investigation into how to do most things with JS in OH (and @lewie clearly did the hard yards to get it all working), but their current state is very messy, with a mixture of styles and idioms, logging in various places put in to debug their development, and masses of commented out code. They have been a very solid foundation for me to use, but ultimately I decided that it was better to use their logic and ideas than the code directly.
The code in this repo can happily co-exist with any other scripting code, as it's just a module that can be installed with npm i ohj then used. However I'd love to contribute it back at some point if you think it's worth it (I'm completely aware that it currently lacks docs etc). Anyway, wanted to point it out to you so that you could see the direction that I've been going.
Hey @openhab-5iver I wanted to point this repo out to you. I ultimately gave up trying to maintain backwards compatibility with the existing JS libraries due to a few reasons:
The code in this repo can happily co-exist with any other scripting code, as it's just a module that can be installed with
npm i ohj
then used. However I'd love to contribute it back at some point if you think it's worth it (I'm completely aware that it currently lacks docs etc). Anyway, wanted to point it out to you so that you could see the direction that I've been going.