[New Dev Build (v3.3.0)] uibuilder

For anyone following or using uibuilder, you may be interested in this new dev build that you can install from GitHub.

It has a couple of exiting features and a load of bugfixes as well as some significant code restructuring that may excite people who have been looking for ways in which to tie other nodes into the uibuilder universe.

Some further testing probably would be sensible before release and if you would like to help, please install the default main branch from github and give it a go.

Please also note that uibuilder will soon move its node.js dependency up from the current v10 to v12 since v10 is no longer in support and a number of dependencies are changing. That will happen after this release however.


Changes

New

  • Add new pre-defined msg from Node-RED that will cause the front-end client (browser) to reload.
  • Add auto-reload flag to file editor - if set, any connected clients will automatically reload when a file is saved. (Only from the file editor in Node-RED for now, later I'll extend this to work if you are editing files using external editors).
  • Added initial documentation for front-end build tooling to technical documentation (general info and Snowpack).

Fixed

  • Issue #126 - Security not turning on even if TLS is used
  • Updated security.js template to remove simple false return if authentication fails - this is no longer valid.

Updated

  • Bump dependencies to latest

  • Add collapsible summaries to README.md

  • Various updates to technical documentation

  • Update chkAuth validation function to make it more robust

  • Improve auth process logging and msg._auth.info checks

  • Remove simple true/false return from auth processing as this is no longer valid

  • uibuilderfe

    • Added initial code for a simple alert - not yet ready for use.
  • Internal code refactoring

    • Prep for adding the ability for uibuilder to use its own independent ExpressJS server

    • Rename uibuilder.js's nodeGo() function to nodeInstance() for clarity

    • Add dumpReq() to tilib.js - returns the important bits of an ExpressJS REQ object

    • Begin to add Node-RED type definitions

    • Add ExpressJS type definitions

    • Other linting improvements

    • Moved Socket.IO processing to its own Singleton class module.

      This means that any Node-RED related module can potentially require the socket.js module and get access to the list of Socket.IO namespace's for all uibuilder node instances. All you need is the uibuilder URL name.

      It also means that any module can send messages to connected front-end clients simply by referencing the module and knowing the url.

      Note that this currently only works once the class has been instantiated and a setup method called. That requires a number of objects to be passed to it. This happens when you have added and deployed a uibuilder node to your flows. In theory, you could also do this in your own code though this isn't tested.

      But it does mean that you could now write another custom node that could make use of the uibuilder communications channel. Of course, it also opens the way for new nodes to be added to uibuilder.

  • Include PR #131 - add Socket.IO CORS support

3 Likes

Some more updates pushed to GitHub.

  • The front-end library now prevents uibuilder.start() from being run more than once.
  • It also has a new function uibuilder.clearEventListeners() which can be run at any time including before you have run start. It forcibly removes all of the event listeners that have been added via onChange.
  • I've also started on the next section of code refactoring by starting to move the ExpressJS web server processing into its own singleton class instance. Further simplifying the core code as well has allowing greater flexibility and similar benefits to the Socket.IO refactoring.
4 Likes

Just pushed another update. The migration of the ExpressJS handling to its own singleton module is now completed.

This has already opened up some more opportunities for more improvements to uibuilder. Potentially opening up the ability to implement a more dynamic routing capability that will let uibuilder instances dynamically switch between source and dist (built) folders.

2 Likes