🎉 Node-RED 3.1.0-beta.1 released

:tada: Surprise! The first beta release of Node-RED 3.1 is now available.

This is a long overdue release, but here it is at last.

Node-RED 3.x requires at least Node 14.x, but that reaches end-of-life in a couple months. These days you should really be using Node 16 at least or even 18.

Here are the highlights for this release.

The Change Log has the full list of changes.

Note: if any issues are reported against the beta, we'll update this post to list them here. If you hit a problem, please do check back here before adding a comment.

Known Issues

Updated Context Menu

We've massively expanded the usefulness of the Context Menu added in the last release. There are now lots more commonly used options available in the menu, which also provides better options related to what you clicked on to open the menu.

This includes right-clicking on the tab bar at the top of the workspace to get flow-specific options:

If you look closely at that image you'll see a new option that leads us on to...

Locking Flows

You can now lock a flow (tab in the editor) to prevent it from being modified. Whilst locked you cannot edit the nodes, add new nodes, modify the wiring... anything.

Why is that useful? You may have a 'mission critical' flow that you want to be super careful not to change by accident. You may want to collaborate on some flows with others, but mark some of them as 'off limits'.

With this release anyone is able to lock and unlock flows, but it lays the ground work for a future release where particular users may not have permission to unlock flows - allowing them to only edit the flows they are allowed to.

The options to lock/unlock flows are available in the right-click context menu - as well as a new padlock button in the Info sidebar explorer.

locking-flows

image

Important note for the beta: to make this work, we've modified how 'nodes' are managed inside the editor to prevent them being modified on locked flows. No apis have changed, but it does mean certain calls might fail if they are attempted on a locked flow. This has had a fair amount of testing across all of the core features of the editor, but 3rd party node authors are a creative bunch and it is possible someone is doing something sneaky unexpected with their node implementation that gets tripped up by this. So if you see any odd/inconsistent behaviour with this feature, please do let us know (and definitely have ready any error messages from the browser's JavaScript console).

Hiding Flows

We added the ability to hide flows a couple releases ago. This was done use the 'eye' icon that appeared when you hovered over the tab.

We got plenty of feedback, including our own experience, that it was way too easy to accidentally click that button and make things disappear without realising it.

So for this release we've gotten rid of that button on the tab. Flows can still be hidden, but you do so via the context menu option when you right-click on the tab bar. You can still use the eye button in the Info sidebar explorer.

Adding images to node/flow descriptions

All nodes and flows have a Description tab in their edit dialog. This lets you write docs (using markdown) that gets displayed in the Info sidebar when the thing is selected.

With this release you can now drag images directly into the markdown editor and they will get inlined. This is done by base64 url encoding the image directly into the description property.

Mermaid Diagrams

We've also added support for Mermaid diagrams. These are diagrams that can be defined directly in the markdown and then rendered out as images when displaying in the sidebar. GitHub recently added support for them, and I've found them to be super-useful when documenting things when plain text isn't quite enough.

Global Environment Variables

We've supported defining environment variables scoped to individual flows, subflows or groups for a while. But the only way to define an environment variable available to all flows was to do it via your settings file. That wasn't very accessible or portable.

So with this release you can now define global env vars via the User Settings dialog:

Under the covers these get added to your flow as a new core configuration node type. That will mean importing a flow from 3.1 with global env vars into an earlier version of Node-RED will lead to an unrecognised node warning - something to be aware of.

Node Updates

There is a long list of node fixes, doc updates and minor enhancements in the changelog.

One in particular I want to highlight is a long awaited fix for the MQTT nodes that would fail, in some circumstances, to reconnect to a broker if you did a Modified Flows/Nodes type of deploy.

We've also updated the label of the Join and Batch nodes to provide a bit more of a hint in how they are configured - to save you opening the edit dialog to check.

Check the full changelog to see what else has been happening.


Be sure to read through the Change Log to see what else is in there.

Installing the beta

If you want to try out the beta, you will need specify node-red@next when you use npm to update. Without the @next you'll still get 3.0.x

So on a Pi you'd do:

sudo npm install -g --unsafe-perm node-red@next

Reporting problems

If you hit any problems, please report them either as a reply on this topic, or in the #core-dev slack channel. Please do not post new topics to the forum regarding the beta as that could confuse users who are not using the beta.

Outstanding work

This release is long overdue, but that doesn't mean we want to rush it out of the beta phase.

We don't have any other major features we want to get into the release, so at this point it will be case of responding to any issues or feedback the beta generates.

23 Likes

Testing it out now on my windows install now :slight_smile:

One thing I would like is the ability to remove and reconnect to be available as a right-click

Because I can never remember what key sequence it is

[edit] Loving the group/ungroup/copy styles :slight_smile:

Right click on a node pops up the context menu. Right click on the menu pops up the macOS menu

macOS Ventura v13.1 happens in Safari v16.2, Firefox v109.0.1, Chrome v109.0.5414.119

@zenofmud thanks - have captured and added to known issues.

How to install beta in only one instance on my windows computer?

Summary
3 Feb 16:21:24 - [info] Node-RED version: v3.0.0
3 Feb 16:21:24 - [info] Node.js  version: v16.16.0
3 Feb 16:21:24 - [info] Windows_NT 10.0.19044 x64 LE
3 Feb 16:21:26 - [info] Loading palette nodes
3 Feb 16:21:28 - [info] Settings file  : C:\Users\OEEHo\.node-red\settings.js
3 Feb 16:21:28 - [info] Context store  : 'default' [module=memory]
3 Feb 16:21:28 - [info] User directory : \Users\OEEHo\.node-red
3 Feb 16:21:28 - [warn] Projects disabled : editorTheme.projects.enabled=false
3 Feb 16:21:28 - [info] Flows file     : C:\Users\OEEHo\.node-red2\flows.json

Do a local install:

mkdir node-red-310
cd node-red-310
mkdir node_modules
npm install node-red@next 

That gets you the beta installed in its own directory. To run it you can then do:

# From inside the node-red-310 directory
npx node-red 

You will want to add whatever extra arguments you use to run one of your Node-RED instances to point it at the right settings and flows file.

1 Like

Awesome adders - nice work!

I will extensively use mermaid diagrams, so really appreciate that!!!

2 Likes

Ubuntu, nodejs v18, chrome 109.0.5414.119

When a flow is locked and you try to view the debug node properties (debug window) an error occurs via browser console. After that none of the other node properties can be view until the page is reloaded. Also noticed a debug node properties can be viewed only if "node status (32 characters)" is selected, no error via console.

console output:

red.min.js?v=3.1.0-beta.1:16 Uncaught Error: Cannot modified property 'statusType' of locked object 'debug:452e874cd7e77479'
    at Object.set (red.min.js?v=3.1.0-beta.1:16:58015)
    at HTMLInputElement.<anonymous> (<anonymous>:495:37)
    at HTMLInputElement.dispatch (vendor.js?v=3.1.0-beta.1:2:43090)
    at v.handle (vendor.js?v=3.1.0-beta.1:2:41074)
    at Object.trigger (vendor.js?v=3.1.0-beta.1:2:71513)
    at HTMLInputElement.<anonymous> (vendor.js?v=3.1.0-beta.1:2:72108)
    at Function.each (vendor.js?v=3.1.0-beta.1:2:2976)
    at s.fn.init.each (vendor.js?v=3.1.0-beta.1:2:1454)
    at s.fn.init.trigger (vendor.js?v=3.1.0-beta.1:2:72084)
    at t (red.min.js?v=3.1.0-beta.1:18:409651)
set @ red.min.js?v=3.1.0-beta.1:16
(anonymous) @ VM496:495
dispatch @ vendor.js?v=3.1.0-beta.1:2
v.handle @ vendor.js?v=3.1.0-beta.1:2
trigger @ vendor.js?v=3.1.0-beta.1:2
(anonymous) @ vendor.js?v=3.1.0-beta.1:2
each @ vendor.js?v=3.1.0-beta.1:2
each @ vendor.js?v=3.1.0-beta.1:2
trigger @ vendor.js?v=3.1.0-beta.1:2
t @ red.min.js?v=3.1.0-beta.1:18
R @ red.min.js?v=3.1.0-beta.1:18
open @ red.min.js?v=3.1.0-beta.1:18
n @ red.min.js?v=3.1.0-beta.1:19
show @ red.min.js?v=3.1.0-beta.1:19
edit @ red.min.js?v=3.1.0-beta.1:18
(anonymous) @ red.min.js?v=3.1.0-beta.1:18
dispatch @ vendor.js?v=3.1.0-beta.1:2
v.handle @ vendor.js?v=3.1.0-beta.1:2
trigger @ vendor.js?v=3.1.0-beta.1:2
(anonymous) @ vendor.js?v=3.1.0-beta.1:2
each @ vendor.js?v=3.1.0-beta.1:2
each @ vendor.js?v=3.1.0-beta.1:2
trigger @ vendor.js?v=3.1.0-beta.1:2
_trigger @ vendor.js?v=3.1.0-beta.1:10
(anonymous) @ red.min.js?v=3.1.0-beta.1:18
dispatch @ vendor.js?v=3.1.0-beta.1:2
v.handle @ vendor.js?v=3.1.0-beta.1:2

Problem with Junction - wire goes missing

Add an inject and debug node and connect them with a wire.
insert a junction on the wire and you have this:
Screenshot 2023-02-05 at 4.35.18 AM
move the nodes and you can see they are connected to the junction:
Screenshot 2023-02-05 at 4.39.55 AM
select the nodes, wires and junction and do a copy/paste back to the same tab and you get this:
Screenshot 2023-02-05 at 4.42.23 AM

Some findings here:

Locking a flow doesn't set the status of the editor buttons correctly:

LockFlow


The same happens when unlocking the flow. The buttons are not updated. They keep their disabled style until you click on them or the node...


Additionally, locking / unlocking a flow just lightens up the Deploy button. There's no additional indication (e.g. any blue ball) what's the cause of the need to deploy. Sticking with the blue color, I propose to either of the following:

  • color the flow tab label (plus the lock in case it's locked) in blue
  • give the flow tab the blue ball "something has changed here" indicator

It's possible to

  • do changes to a flow without deploying them
  • then lock the flow
  • then press Deploy

This deploys the changes first & then locks the flow. While one could argue, it's technically correct - it looks strange to me to have the lock displayed on the flows tab & the blue balls for undeployed changes at the same time.

Thanks for the feedback @ralphwetzel

A change indicator for the tabs is something I've held off doing in the past, but I can see if would be useful - regardless of the locking feature.

That said, I think the expected behaviour would be for it to indicate changes not just to the flow object itself, but also its contents. That is a bit harder to achieve, but we can look at it for sure.

1 Like

Not able to reproduce this on mine Win11/Vivaldi

May I ask, why is that a problem?
IMHO that's the only way to reach the context menu, if someone needs it. (With "double right click".)

2 Likes

The issue with the context menu is also present on the current Node-RED 3.0.2 version (using Firefox 109 on Linux).

However, I never thought of it as a bug, but a feature. I'd just leave it that way. :slightly_smiling_face:

@knolleary,
Thank you so very much for the flow lock feature.

Hi @lepgithub

I've tried reproducing the error you've reported, but not had any luck.

Can I clarify exactly what you mean here? Are you doubling clicking to open the node's edit dialog? Or something else?

You should not be able to open the edit dialog for any nodes on a locked flow.

Something I have noticed in 3.0 is that on Linux the scrolling of the flows/workspaces bar at the top runs the wrong direction. E.g., if I push on the scroll wheel of the mouse with the finger the bar scrolls to the end (i.e. slides left). But "pushing" on the scroll wheel normally scrolls to the start of the document, not the end. Using firefox, which also allows scrolling of its tab bar, works as expected, i.e., the reverse of node-red.
I couldn't find a docker image for 3.1 beta, so I can't easily test whether this has been fixed.

@tve this thread is more for reporting issues in the beta itself, rather than reporting existing issues that may or may not be resolved in the beta.

That said, this is one of those issues that has been sitting around for a long time just waiting for someone to flip a - to + in the code... now done: Reverse direction of tab scroll to expected direction by knolleary · Pull Request #4064 · node-red/node-red · GitHub

2 Likes

Cool!!!
Is there a reason there's no docker image for the 3.1 beta? It makes checking it out so much easier...