Switch to the WebCrypto API for Gladys Plus instead of the polyfill we were using until now
Update server dependencies
Update front-end dependencies
Update GitHub Actions
Update Cypress
What I’ve done so far:
1., 2., 3. (partially) and 5. in this PR:
For now I’m switching to Node.js 18 on the server, and Node.js 16 on the front-end, because preact-cli runs on Webpack 4 which is not compatible with Node.js 18 yet.
There are several reasons for this improvement; it’s not just upgrading to Node.js 16/18 that’s the key:
Open-Zwave was a library based on C++ bindings that had to be built at each npm install + docker build for every architecture. Removing this lib contributed a lot.
Before Node.js 16, the WebCrypto API wasn’t available in Node.js, so I used a polyfill that had to be compiled at each npm install + each docker build for every architecture.
This removes node-webcrypto-ossl, which was a nightmare to compile, and we go through Node.js’s native API.
Potentially, this improves the performance and stability of the Gladys Plus part because we use a rock-solid, official native API.
We’re moving to a more recent version of sqlite3 which has proper bindings with the Node-API, and which is normally pre-compiled for each architecture; likewise, we save a build per npm install + docker build per architecture.
In short, the ecosystem has evolved a lot and not using the latest version of Node prevented us from adopting many new optimizations.
Another advantage of all this is that we’ll have a much easier developer onboarding, which will remove a barrier to developing Gladys services.
We’ll be able to update the tutorials, and it will be much simpler
FYI, I incorporated the various feedback on the PR and merged the PR into master so that all ongoing PRs can adapt and benefit from the build speed improvements!
I updated the Linux/MacOS developer documentation, which is now much clearer in my opinion — open-zwave is done
FYI, in the end I moved to Node.js 18 on the back and the front, so no Node 16.
For the Windows documentation, could someone give it a pass and check that everything works well with Node.js 18 LTS on WSL and update the documentation? Thanks!
And there’s still room for improvement, there are 4-5 tests on the MQTT and Zigbee2mqtt services that take 10 seconds each, so almost half of the total test time is spent on these integrations.