[uibuilder] The next step - 3rd-party comms with a uibuilder front-end

Apparently it's totally fine with that, and it fixes the socket.io error too. I wonder why the Node-RED docs suggest installing in /usr/src/node-red instead of /data, and if there are any downsides to copying package.json to /data and just installing there instead.

1 Like

Don't know, maybe @dceejay knows?

I can't actually think of any issues. But isn't /usr/src/node-red WITHIN the Docker build and therefore, if you were to upgrade it by using a new version, wouldn't the installed nodes be lost?

1 Like

OK, now looked again at the process and I can safely say that uibuilder does not destroy an existing package.json file in <uibRoot>/. Indeed, that wouldn't let uib work at all if it did since that is where the list of installed front-end modules now lives (it used to be in a separate file). Only if there is no package.json file in uibRoot will it create a new file. Once it has a file read in, it makes sure that it contains the required properites:

The uibuilder.packages property gets rebuilt when NR starts and whenever a new front-end library is added or removed. Each installed dependency package is checked and its metadata rebuilt.

That means that even if you install a package manually, all you need to do is restart node-red. uib will then update itself. If you manage the packages from the library manager, you don't need to restart node-red.

OK, I've added an extra test for this. If uib can't find Socket.io the usual way, it will fall back to using require.resolve which should then find it. I can't really test whether this works in your situation since I don't have your configuration. Hopefully though, when you update uibuilder, the error message you were getting should go away and everything should still work!

1 Like

Both of these bugs were related and due to some dodgy logic from me. Now fixed and pushed to vNext.

The help information for the sender node has also been updated.

I think that is all of the things you've reported now sorted! :fireworks: :partying_face:

Still a few other things to complete before deployment but hopefully I'm now back on target thanks greatly to your help.

1 Like

Interesting, maybe I just got things mixed up with all the testing. I was creating and destroying images/containers left and right so I wouldn't be surprised.

No worries, an edge case may yet turn up but I can't see one looking at the code. However, I've added an additional warning to the log for when uibuilder does create the file.

A whole bunch more fixes pushed to vNext just now. If you are having issues, please update.

1 Like