Skip to content

Releases: TotallyInformation/node-red-contrib-uibuilder

Major Release

18 Dec 17:28
cd64467
Compare
Choose a tag to compare

NOTE: The templates and example flows are not fully updated for release 6.0.0. They need some tidying and replacing of the old FE library with the new one.

Breaking Changes

  • Minimum Node-RED version is now v3
  • Minimum Node.js version is now v14 LTS (in line with Node-RED v3) - note that the minimum minor version changes to the latest v14 LTS version whenever uibuilder is updated.
  • Not sure if this is really breaking. However, uib-cache nodes were not properly handling cases where, when processing incoming msgs, the chosen "Cache by" msg property was an empty string in the input msg. Previously handling of that case was dependent on the store and type being used. It is now ignored. The common case is where the setting is msg.topic and using the default trigger node which has msg.topic set to an empty string. Previously that was sometimes recorded and sometimes not. Now it is never recorded.

Fixed

  • uib-cache: Custom variable name was being ignored - cache processing rewritten
  • uibuilder: Library tab might occasionally list a package that wasn't a direct installed dependency. Now resolved. Only packages listed in <uibRoot>/package.json dependencies property will be listed.
  • nodes/libs/package-msg.js updateInstalledPackageDetails(): Installations with a large number of installed libraries not correctly reporting their details. Resolved (hopefully) async issue. Was using async with .forEach() which doesn't work. Changed to use Promise.all with a map. Thanks to dczysz for reporting. Issue #186. Issue more complex than originally thought. Ended up doing a 2-stage update of the installed libraries data. First stage is quick and synchronous to allow the appropriate vendor folders to be added to the ExpressJS vendor routes. 2nd stage uses npm to get additional library information.
  • Can now stop auto-loading of uibuilder default stylesheet using uibuilder.start({loadStylesheet: false}). Issue #184.
  • Fixed deepscan issues.
  • Old client library was reporting mismatch client version unnecessarily
  • Old client library was not reporting client pageName correctly

New

  • New example: Demonstrating logging methods of messages passed both into and from a uibulder node, to both the Node-RED debug panel and the Web Dev console. Many thanks to Harold Peters Inskipp for the contribution.
  • New Template: Basic Vue v3 example with no build step required.
  • New editor option: Add msg._uib to standard messages (off by default). Can be used to help with authentication/authorisation & session management within Node-RED flows. Contains clientId & remoteAddress and pageName properties.

Changed

  • New client (uibuilder.iife.js and uibuilder.esm.js) improvements

    Note that the new clients are now the preferred client libraries. It is best to use one of these rather than the older uibuilderfe.js client library. Please note that a couple of features were dropped, namely the VueJS versions of the Toast and alert functions. The same input msgs still work to allow for backward compatibility but they will not trigger bootstrap-vue even if that is installed. Use the new Dynamic, data-driven content features instead.

    • Client now knows whether the browser is online or offline. If offline, it no longer keeps outputing socket.io error messages or warnings. A console warn is given whenever the browser goes online or offline. Going online reconnects the socket.io connection to Node-RED.
    • Client now tracks what the last navigation type was (navigate, reload, back_forward, prerender). Enables the client to know whether the page was a new navigation or simply reloaded. Can be accessed in the client using uibuilder.lastNavType.
  • uibuilder node

    • uibuilder can now select any existing folder to serve as the root of your web app. The selector on the advanced tab is now populated with all folders. The folder must, however, contain at least an index.html page otherwise an error is logged and no web page will be shown unless you manually include the page name in your browser address bar.

    • The uibuilder node will now create the required <uibRoot>/package.json file if it does not exist. Removes some unnecessary warning messages.

    • uibRoot added to settings passed to Editor so that the editor can display and link to server folders (links only work when server is local of course).

    • If running in debug mode, key settings dumped to Editor console.

    • Editor panel improvements:

      • The currently installed uibuilder version is now shown on the Advanced tab.
      • The server's instanceRoot filing system folder is shown on the Core tab. This is the configuration and front-end code for this instance of uibuilder.
      • The info showing the current web server is now a link to the instance page (same as the Open button above it).
      • The "Server folder" information now shows the currently used serve folder (e.g. src or dist).
      • The Advanced > Serve dropdown now shows ALL top-level folders. Note that you have to close and re-open the panel to pick up the new folder.
      • In the help panel: Added a link to the Configuring uibuilder nodes page. Added link to the new client library page and a note about deprecation of the old client library.
      • Library tab
        • Package outdated markers added to Editor Library tab. (Currently only on Node-RED startup. Will be improved later.)
        • Package outdated markers are buttons that will update the installation of the package.
  • uib-cache node

    • More compact context variable settings in Editor panel.
    • Flow/global cache context has node id appended to variable name for safety, can be changed but obviously must be unique.
  • uib-list node

    • Now uses same context variable settins as uib-cache for greater flexibility.
    • Flow/global cache context has node id appended to variable name for safety, can be changed but obviously much be unique.
    • Change drop-downs to typed input
    • In editor, disable cache settings if cache turned off
    • Add uib url to name display
  • Various library improvements including some trace and info log msg improvements.

  • Tech docs - updated to indicate the the old client library is now functionally stabilised and will eventually be deprecated.

  • uibindex page (adminapiv2.js) - Add folders to Vendor Routes table (from packageMgt.uibPackageJson.uibuilder.packages).

Feature release: New modern client, new uib-list node

28 Jun 20:15
Compare
Choose a tag to compare

Note that this is likely to be the last of the v5 series (barring small fixes). The next main release should be v6 with a move to Node.js v14 LTS as a minimum version.

Fixed

  • Improved module path search to allow an array of locations. Removes spurious warning about socket.io client not being found.
  • /uibuilder/ping now correctly returns 204 (no content) status not 201.
  • web.js::buildHtmlTable - over-optimised regex broke the table cells, now fixed.
  • Connected control message now correctly contains the client id and client IP address. The client id does not change as much as the _socketId, it is saved in browser local storage so will be the same across sessions and multiple windows/tabs.
  • uib-sender was not using topic defined in settings. If present, that overrides msg.topic.
  • uibuilder node - Editor: Add library had been over-optimised and wasn't working in the right order. Now fixed. This also fixed a problem with url rename.

Changed

  • clientId is now session stable. That means that it does not change unless the client browser is restarted. It is now also included in more messages. For control messages, it will be found as a msg property. For _ui related messages, it will be a property under msg._ui. Any other uses will appear under msg._uib.

  • All code now Linted to "Standard JavaScript" with node.js v12 and front-end to ECMA2019. Null/undefined guards put in place.

  • Package.json: Changed homepage to point to Tech Docs on github.io.

  • Client libraries and css available on ../uibuilder/ path as well as on ./ path for consistency with other server paths.

  • Client connect, disconnect and error control messages (uibulder node output port #2) now contain more information. Includes: client version, clientId, Client IP address, page name, number of (re)connections.

  • express-session and jsonwebtoken dependencies removed as no longer in use.

  • Editor:

    • Added stylesheet containing a class of emoji which provides nicer, cross-platform, colour emojis.
    • Libraries tab:
      • Change "URL to use:" to "Estimated link:" on the Libraries tab to make it clear that it might not be correct (down to the library author).
      • Added info emoji to package name (links to package homepage).
      • Added url link to estimated library to make it easier to find out if it actually exists and exactly where.
  • uib-cache node

    • Added option to not replay the cache if the client connection isn't actually new (e.g. if the client is a reconnection after restarting Node-RED).If the control msg recieved contains msg.connected and it is >0, that means that the client is reconnecting and this isn't a client page load. Note that currently, only the new ES module client library populates the msg.connected value. This option is selected by default.
    • The context store type (node, flow, global) can now be selected (only node was previously used).
    • The variable name can now be changed. May be needed if using flow/global stores with multiple cache nodes.
  • package-mgt.js:

    • Rewrite root package.json and package details processing for more efficiency + prettify package.json output
    • Add outdated (current/wanted/latest) to uibRoot/package.json>uibuilder.packages in prep for update display in Editor
  • Old client library uibuilderfe.js

    • Connection count, and page name added to initial "client connect" message in line with the new client.
    • The old uibuilderfe.js client library is now "functionally stable". It will no longer be updated. Please consider moving to the new library (see below). When v6 is released, the old client library will be deprecated.

New

  • uib-brand.css - will eventually be the new default uibuilder CSS. It is light/dark switchable both manually and by browser preference. Still under development, this WILL CHANGE, probably quite a bit. There are still some variables that are needed in order to be able to sensible control things like spacing and sizing.

  • New ES Module front-end client library (uibuilder.esm.min.js)

    The new library will only work with web browsers from early 2019 or later (only really impacts if you are stuck on IE11 or on an Apple device that doesn't support iOS 12 or later). It uses the new brand CSS by default.

    Key differences from the old library:

    • Supports the new configuration/message-driven features that let you both build and modify web pages dynamically.
    • Can load an entire UI from a JSON file (or JSON response from a web server). Can also do incremental loads and dynamic changes.
    • Incorporates the socket.io client library so you don't need to worry about it ever again!
    • Requires a modern(ish) browser.
    • Has to be loaded as an ES Module.
    • No built-in VueJS features, use the new msg._ui features instead.
    • No need for uibuilder.start() in your code any more (nearly always). Often no code needed at all in fact! (Other than loading the library of course).
    • uibuilder.eventSend() now has a lot more information attached. It also now uses the msg._ui property to hold all of the information (except for the payload which is as-before). This brings it into line with the other _ui handling. Attributes, classes, clientId and custom properties are all now included.
    • New function uibuilder.ui({...}) allows passing the same data as msg._ui from front-end code.
    • The "client connect" uibuilder control msg that is output on port #2 when a client (re)connects, now has additional details from the client: client version, clientId, client ip, number of connections since the client last (re)loaded the page. Use to work out whether the client is new or a reconnection. Used by the updated uib-cache node.

    See the uibuilder.module.md page in the tech docs for all of the features and details for the new library.

    • Clients now report how many times they have connected since last page load. This lets uibuilder know whether the client is reconnecting or connecting for the first time.

    Please use the uibuilder.esm.min.js in preference to the uibuilder.esm.js version which is only for people needing to do their own bundling. The min version includes a map so that debugging is as good as (actually better than) using the non-min version.

  • New IIFE Module front-end client library (uibuilder.iife.min.js)

    This is the same as the ES Module client version above but is wrapped as as a standard JavaScript IIFE function which means that it can simply be loaded as a script link (as per the orgiginal uibuilderfe.js client library). You should not attempt to load this version of the new library as an ES Module.

    As with the module version above, when using this version, you should no longer manually load the Socket.IO client library and should hardly ever need to call uibuilder.start.

    All of the features of the ESM version should work as expected but please note that testing on this client has been limited so far. Please report any errors so that they can be corrected.

  • New Node - uib-list

    Consider this to be the first experimental node in what will hopefully be a series. It can be sent a message who's payload is an array of strings or an array of an array of strings.

    The node creates a new <ul>, <ol>, or <dl> HTML list according to the settings. In the case of it being sent an array of arrays, the outer array creates a new list entry and the inner array is joined as a comma-separated list. A <dl> list however must be given an array of arrays and the first entry in the inner array becomes the <dt> entry with the 2nd becoming the <dd> entry.

    The node also requires you specify the uibuilder URL that the node links to along with a required HTML element id that is used to identify the element. Optionally, you can also set a parent element by specifying a CSS selector, the list will be attached ot the end of that parent as a new child. Note that if the selector is not unique, only the first found element will be used.

    Instead of outputting to the uibuilder node, you can instead output a message that contains the appropriate msg._ui configuration used by the new front-end ES Module library. You can use this to help you build larger and more complex UI's and to help learn about how the configuration-driven UI features work. Such a message could be further processed and then sent to an appropriate uibuilder node.

    One additional feature is that the configuration is retained in the node (until Node-RED is restarted or you re-deploy the node/flow) and whenever a new client connects to the matching uibuilder instance, it will send the complete configuration to the new client. This ensures that client browsers connecting after you have created the configuration will all receive it and so will have matching UI's.

  • Runtime

    • Each uibuilder node instance issues a tiEvent when:

      • Instance setup is completed (node-red-contrib-uibuilder/${url}/instanceSetupComplete). The node object is passed as data.
      • A client (re)connects (node-red-contrib-uibuilder/${url}/clientConnect). The control msg is passed as data.
      • When a client disconnects (node-red-contrib-uibuilder/${url}/clientDisconnect). The control msg is passed as data.

      These can be used by any other node that uses the @totallyinformation/ti-common-events module. Such as the experimental uib-list node.

Bug Fix and Documentation Updates

09 Apr 18:55
Compare
Choose a tag to compare

Fixed

  • Loading pages from sub-folders without adjusting the uibuilder.start() parameters was failing. Now fixed. See also FAQ: uibuilder - multiple pages from 1 node.
  • Accidentally made use of a node.js v14 feature (Optional Chaining) but base version is specified as v12. Changed code to v12 compatible until v14 becomes the base.

Changes

  • Tech Docs sidebar menu:

    • Link to beginners walkthrough document added to Tech Docs sidebar.
    • Add link icons to external pages.
    • Remove redundant link to GitHub project page.
  • uibindex page:

    • Changed to use new CSS (light/dark enabled).
    • Configuration Files section needs updating.
    • Further improvements and tweaks.
  • Tech Docs updates

    • NEW PAGE: Configuring uibuilder nodes [incomplete]
    • NEW PAGE: Creating Templates [incomplete]
    • Updates for Configuring uibuilder page

Bug fix release

05 Apr 00:21
Compare
Choose a tag to compare

Fixed

  • When no settings.js:uibuilder property exists, initial report doesn't have ip/port. Also get (node:2888) [DEP0118] DeprecationWarning: The provided hostname "undefined" is not a valid hostname, and is supported in the dns module solely for compatibility. as well as http://null:undefined or http://localhost:undefined/

    Fixes applied to uibuilder.js and web.js

v5.0.0 - The big one!

02 Apr 18:22
Compare
Choose a tag to compare

WARNING: v5 is a very major release and WILL break some deployments. Please check through the changes before deploying. In most cases, opening each uibuilder node in the Node-RED Editor, clicking Done and re-deploying will be enough.

BREAKING

  • Clear client cookies - You may get some odd results if you don't because cookie handling as been significantly reworked.

  • Installation of packages for use in your front-end code has been moved from the userDir to uibRoot.

    Note that only packages installed into the uibRoot folder will be recognised.

    Unfortunately, this means that you will need to re-install your packages in the correct location. You should uninstall them from the userDir.

    By default: userDir = ~/.node-red/, uibRoot = ~/.node-red/uibuilder/. However, both can, of course, be moved elsewhere.

    uibuilder will automatically create a suitable package.json file in uibRoot. That file not only lists the installed packages but also has a custom property uibuilder that contains metadata for the uibuilder modules. Specifically, it lists all of the necessary detailed data for the installed packages.

    The files <uibRoot>/.config/packageList.json and <uibRoot>/.config/masterPackageList.json are no longer used and may be deleted.

    You can now install not only packages from npmjs.com but also from GitHub and even local development packages. @scopes are fully supported and versions, tags, and branches are supported for both npmjs and GitHub installs.

  • Removal of Security Processing - The built-in security features of uibuilder have now been removed.

    This is because I was not getting any closer to a design that was robust and safe and it was having a serious impact on development.

    The recommendation is that you use external security processing via a reverse proxy service (e.g. NGINX). I will be trying to provide some documentation for this.

    Alternatively, you can still provide security processing by making use of the various middleware features - see the <uibRoot>/.config folder for templates.

    Because of this, the security settings part of the Editor config panel has been removed. This included the use security flag, session length, JWT secret and auto-extend flag. If you have been using the vNext development branch, the Security tab has been removed.

  • Peer installation of VueJS and bootstrap-vue yet again removed. Since these now need to be in the uibRoot folder which
    we don't necessarily know at preinstall time.

    We will be looking at another alternative method. Now that template switching is even more powerful and so is
    package management, it is likely that we will build something into the template installation process.

    Until then, please install the vue and bootstrap-vue packages via the uibuilder library manager if you need them.

  • .config folder templates - In previous versions, any files in the master templates for the <uibRoot>/.config folder would be copied when Node-RED (re)starts - however, they would not overwrite existing files. From v5, the master .config templates have been renamed to end with .js-template and these will now ALWAYS overwrite whatever is in the <uibRoot>/.config folder whenever Node-RED (re)starts. That way, you always have easy access to the latest templates.

    In addition, some of these templates have significant changes and you should review the new templates before going live with uibuilder v5. You can (and should) also safely delete any .config/* files you are not using.

    In particular, the masterPackageList.json and packageList.json files are no longer needed or used and should be deleted.

  • URL cannot be "uibuilder" - As this url is now used by various services, allowing it would potentially create name clashes and hard to debug errors. If you have an endpoint named "uibuilder", please rename it to prevent problems.

  • Clear any old cookies - Cookie handling has changed for v5 (see the details below). New cookies are clearer and last only for the current browser tab session. You should clear out any old cookies that have been saved by your browser for each uibuilder app URL.

  • Minimum Node.js version supported is now v12.20. Minimum browser version remains the same and must be one that supports ES6.

  • New Dependency - I've finally given in and included the socket.io-client package in the dependencies. The reason for this is that the server does not correctly include the client package as expected. While it works if you are including the client using a <script src="..."> line in your index.html, it does not work if you are using web components or a build step with an import statement. So in that instance, you should use.

    Note the change of path when writing your HTML:

    <script src="../uibuilder/vendor/socket.io-client/socket.io.min.js"></script>

    Though the old path works as well.

    However, if you want to use uibuilder with web modules or with a build step and wish to import socket.io client, you must not load via a script tag. Instead, in your JavaScript or framework code:

    import { io } from '../uibuilder/vendor/socket.io-client/socket.io.esm.min.js'

    Better still, use the module compatible version of the uibuilderfe client uibuiderfe.mod.min.js or uibuiderfe.mod.js which will import the correct socket.io client for you.

New

  • New layout for the Editor panel

    This is a much cleaner and clearer layout. It also blocks access to parts of the config that don't work until a newly added node has been Deployed for the first time so that its server folder has been created.

    There are also some additional error and warning messages to make things clearer.

  • New node uib-sender - this node allows you to send a msg to any uibuilder instance's connected front-end clients.

    That means that it is pretty much the same as sending a message directly into a uibuilder node.

    You select the instance of uibuilder you want to use by selecting an existing uibuilder URL from the dropdown.

    You can also select whether you want input messages to go straight to the output port as well.

    Or, more usefully, you can allow "return messages". This allows a front-end client to send a message to node-red with some pre-defined metadata added that will route the message back to the uib-sender node. In this way, the sender node can be used as a semi-independent component.

    Note that this same method can be used by ANY custom node, check out the code to see how it works. It requires the use of an external, shared event module @TotallyInformation/ti-common-event-handler. The msg metadata looks like: { _uib: {originator: <sender_node_id>}, payload: ... }. The sender node id is just that, the Node-RED node id for the sender node instance.

    The uibuilderfe.js library has been updated to allow easy use of the originator property for uibuilder.send(). See below for details.

    There is a new page in the Tech Docs on using the sender node.

  • New node uib-cache - this node allows you to cache input messages in various ways and recognises uibuilder's
    cache control messages so that a client browser (re)connecting to a web page will automatically get a copy of the cached pages.
    See the Tech Docs for details. An example flow is included in the uibuilder examples library.

    Note that you can use this node without uibuilder if you want to.

    There is a new example flow demonstrating the use of the cache node.

  • New Feature Msg send middleware. You can now add a custom middleware file <uibRoot>/.config/sioMsgOut.js. The exported function in it will be called every time any msg is sent from any uibuilder node to any connected client. Please see the template file for more details. This rounds out the ExpressJS and other socket.io middleware (connect and on msg receipt) and helps make up for the removal of the uibuilder security features by allowing you to create your own bespoke identity and authorisation processing.

  • New Feature Instance API's. You can now define your own API's to support your front-end UI. These run as part of the Node-RED server and can be called
    from your UI, or indeed from anywhere with access to the Node-RED server's user endpoints.

    You can add any number of *.js files to a folder <uibInstanceRoot>/api/. Each file will be loaded into the uibuilder instance and tested to make sure that it contains either a single function or an object containing functions who's property names match either an HTTP method name (get, put, etc) or the generic use.

    Such functions are added to the instances router. See the Tech Docs for more information on how to use the instance API's.

    Note that, because such API definitions reside in a potentially user-facing folder and may be significant security risks, their use is controlled by a flag in Node-RED's settings.js file uibuilder.instanceApiAllowed. This must be set to true for API's to be loaded.

  • New Feature - Added a version checker that allows uibuilder to notify users if a node instance must be updated due to a change of version.

  • New Feature - A default CSS style sheet has been introduced. Either include in your index.css file as @import url("./uib-styles.css");. Or in your index.html before the reference to ./index.cssas`.

    Currently this contains some :root classes defining colours and a switcher that picks up whether your browser is set to light or dark themes.

    It also has a number of classes that style the toast notifications if you are not using bootstrap-vue.

    Add th...

Read more

Minor Release

08 Aug 13:40
Compare
Choose a tag to compare

New

  • Issue #151If the advanced option to "Show web view of source files" is selected, also show a link to the webpage.

Changed

  • Issue #149 If security is turned on, you can now run without Node-RED using TLS even in production. This is because you may wish to provide TLS via a reverse proxy.

    You still get a warning in the editor though.

  • Moved back-end libraries from nodes folder to nodes/libs to keep things tidier (especially if additional nodes added in the future)

  • Add simple debug function to web.js to allow the ExpressJS routing stack to be dumped to stdout

Fixed

  • Issue #150 Switching between src and dist folders now works without having to restart Node-RED. Existing routes are removed first then re-added.
  • Common folder is only served once (previously it was been added to the ExpresJS router stack once for each node instance).

Small feature release with bugfix

22 Jul 19:12
Compare
Choose a tag to compare

New

  • Add drop-down to adv settings that lets the served folder be changed between src and dist. #147

    • If the <uibRoot>/<servedFolder> folder does not exist, it will be silently created.
    • If the <uibRoot>/<servedFolder>/index.html file does not exist, a warning will be issued to the Node-RED log & the Node-RED debug panel.
  • Allow front-end code to update the msg. #146

    This allows your front-end code to be its own test harness by pretending that a msg has been sent from Node-RED. It would also let you have a single processing method even if you wanted to use a non-Node-RED data input (e.g. a direct MQTT connection or some other API).

    uibuilder.set( 'msg', { topic:'my/topic', payload: {a:1, b:'hello'} } )

    When using this feature, the uibuilder.onChange('msg', function(msg) { ... }) function is still triggered as expected.

Fixed

  • #148 Editor node config cannot escape https check when not running in development mode

Minor bugfix

18 Jul 15:43
Compare
Choose a tag to compare

Fixed

  • Minor bug stopping the logoff msg processing from working.

Updated

  • All dependencies and dev-dependencies updated

Major release

18 Jul 15:42
Compare
Choose a tag to compare

Major Changes

  • Node.js v12+ is the minimum supported environment for Node-RED.

  • Only "modern" browsers are now supported for both the Editor and the uibuilderfe front-end library as ES6 (ECMA2015) code is used.

    Let me know if this is a problem and I can build a backwards compatible version.

Template handling is significantly changed in this major release

New instances of uibuilder nodes will only be given the "blank" template which uses no front-end frameworks.

You can load a different template using the "Template Settings" in the Editor.

Loading a new template WILL overwrite any files with the same name. A warning is given though so even if you press the button, you can still back out.

You can choose from the following internal templates:

  • VueJS & bootstrap-vue - The previous default template.
  • Simple VueJS - A minimal VueJS example.
  • Blank - The new default.
  • External - See below.

But, you can now also chose an EXTERNAL template! This will let you choose from any remote location supported by degit. You can use TotallyInformation/uib-template-test as an example (on GitHub).

NOTE: When using an external template, no check is currently done on dependencies, you must install these yourself. I will try to add this feature in the future.

Changing the uibRoot folder

You can now set uibuilder's root folder - that stores configuration, common, security and each node's front-end code - to a different location. The default location is in your userDir folder in a sub-folder called uibuilder. If you are using projects, the sub-folder will be in your projects root folder. See docs/changing-uibroot.md for more detail.

Updated

  • Update fs-extra to v10. No longer supports node.js v10, requires v12+.

  • Make some class methods private in web.js and socket.js. Requires node.js v12 as a minimum as it uses an ECMA2018 feature.

  • web.setup and socket.setup can only be called once.

  • Socket.IO updated from v2 to v4.

  • Added Admin API check for whether a url has a matching instance root folder. (Was an outstanding to-do)

  • Reworked the info block that is printed to the log on startup. Much neater and with added info on the webserver being used.

  • Technical Docs have been improved in line with some other work I did recently on enterprise standards.

    The docsify configuration has been greatly improved with a new theme and some automation for dates and document front-matter.

    Added a new page on changing the uibRoot folder.

    Updated the front page with links and explanations of the different sections.

New

  • In the technical documentation, you can now access and search the main README as well as the current and archive changelogs (v1 & v2) in addition to everything else.

    Don't forget that you can access the tech docs on the Internet from GitHub AND locally from within Node-RED.

  • nodes/web.js - Added web.isConfigured to allow a check to see whether web.setup has been called.

  • nodes/sockets.js - Added socket.isConfigured to allow a check to see whether socket.setup has been called.

  • Add a new icon to the main readme that allows editing of uibuilder code using VSCode either via a remote repository or via a Docker container.

Fixed

  • Node-RED edge-case for credentials was causing node to be marked as changed whenever "Done" button pressed even if no changes made. Turns out to be an issue if you don't give a password-type credential an actual value (e.g. leave it blank). Gave the JWTsecret a default value even when it isn't really needed.
  • Instance details page - CSS now loads correctly even if using a customer server port. Some Socket.IO details that were missing now returned.
  • web.js - specifying a custom server port caused uibuilder to crash. Now fixed.
  • Lots of tidying up of log messages, especially TRACE level.
  • Accidentally include a node.js v14+ issue, now removed.
  • Additional try/catch blocks to force better reporting if there is an error in the uibuilder module files.

Features, Bug Fixes and Code Refactoring

14 May 12:47
Compare
Choose a tag to compare

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).
  • Add new function to uibuilderfe.js - uibuilder.clearEventListeners() - Will forcably clear any onChange event listeners that have been created. Partial update for Issue #134.
  • 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.
  • Update security.js template to remove simple false return if authentication fails - this is no longer valid.

Please note that the security features in uibuilder are still not complete and are not well tested. They also have some debug output. Other items on the backlog are currently taking preference.

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 check for uibuilder.start() having already been called and prevent it being run more than once. Partial update for Issue #134.
    • Add new function uibuilder.clearEventListeners() - see details in New above.
    • 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

    • The refactoring has removed several hundred lines of code from the main js file and
      simplified quite a few function calls.

    • 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.

      But it does mean that, in theory at least, 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. However, a slight caveat to that would be that
      loading order would be important and you really must deploy uibuilder before any other node that might want to use the module.

    • Started moving ExpressJS web server handling to its own Singleton class module

      Again, this will mean that any module running in Node-RED could potentially tie into the module
      and be able to access/influence uibuilders web server capability.

      Works similarly to the Socket.IO class above. So it has to be initialised using a number of properties
      from the core uibuilder node.

      Currently, only the core ExpressJS app and server references are handled by the class. More work
      is required to move other processing into it.

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