🎉 Node-RED 4.0.0-beta.2 released

:tada: The second beta release of Node-RED 4.0 is now available!

Node-RED 4.x requires at least Node 18.x. We recommend using Node 20

This release addresses all of the issues that had been highlighted against the previous beta, and throws in some new features. Here are the highlights.

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

  • None yet!

Introducing Multiplayer Mode

This release has a super early iteration of our work to improve the user experience when multiple people have the editor open at the same time. This is the first step in a longer journey, but we wanted to start getting feedback on it.

When enabled (see below), the editor will now show who else has the editor open currently.

For this early version, when you click on their icon, it tells you where in the editor they are. As I said, this is a small step forward, but it gets lots of the plumbing sorted out under the covers to get this to work. The next iteration will make the location information more useful.

This new mode is not enabled by default. To turn it on, you need to set editorTheme.multiplayer.enabled property to true in your settings file. We've added a placeholder in the default settings file, but for an existing install, you'll need to add it yourself. You can see how/what it should look like here.

New Config Node selection UI

Following this discussion we've updated the UI around config node selection to simplify the task of adding a new config node.

There is now a dedicated add button alongside the selection.

Plugins listed in Palette Manager

The Palette Manager now lists what plugins you have installed alongside the regular node modules you have. Previously, it only listed modules that include palette nodes.

Remembering the palette state

The editor now remembers what palette categories you have expanded or collapsed, as well as any filter you may have applied. The filter now also behaves better if you have collapsed categories - previously it would always expand everything after the filter was cleared.


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

So on a Pi you'd do:

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

Docker images

The beta images are available under nodered/node-red-dev:v4.0.0-beta.2 - with the default image being based on node 20.

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

We're still on track for the full 4.0 release at the end of April. The new multiplayer feature has a long way to go and we'll see how far it gets in that time frame.

There are also a number of open issues and PRs that we're working through for the release. We'll have another beta refresh is a couple weeks time.

9 Likes

Just ran that on my Linux Mint setup and restarted NR but got this

Welcome to Node-RED
===================

5 Apr 15:34:09 - [info] Node-RED version: v4.0.0-beta.2
5 Apr 15:34:09 - [info] Node.js  version: v20.11.1
5 Apr 15:34:09 - [info] Linux 6.5.0-1016-oem x64 LE
5 Apr 15:34:10 - [info] Loading palette nodes
5 Apr 15:34:10 - [debug] logger Node logging turning on logging next 111 log points
5 Apr 15:34:10 - [info] logger Node Copyright 2020 Jaroslav Peter Prib
5 Apr 15:34:10 - [debug] logger Node test active
5 Apr 15:34:11 - [info] Settings file  : /home/simon/.node-red/settings.js
5 Apr 15:34:11 - [info] Context store  : 'default' [module=localfilesystem]
5 Apr 15:34:11 - [info] User directory : /home/simon/.node-red
5 Apr 15:34:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
5 Apr 15:34:11 - [info] Flows file     : /home/simon/.node-red/flows.json
5 Apr 15:34:11 - [info] Server now running at http://127.0.0.1:1880/
5 Apr 15:34:11 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

5 Apr 15:34:11 - [info] Starting flows
5 Apr 15:34:11 - [info] Started flows
5 Apr 15:34:11 - [info] [tcp in:d7c0249d3f58dd78] listening on port 2883
5 Apr 15:34:11 - [info] [udp in:b429a00a6c19aa83] udp listener at 0.0.0.0:39988
5 Apr 15:34:11 - [info] [udp out:Playroom .30] udp re-use socket: 39988 -> 192.168.0.30:38899
5 Apr 15:34:11 - [info] [udp out:Sky switch .34] udp re-use socket: 39988 -> 192.168.0.34:38899
5 Apr 15:34:11 - [info] [udp out:Garden .40] udp re-use socket: 39988 -> 192.168.0.40:38899
5 Apr 15:34:11 - [warn] [alexa-remote-account:Win11Alexa] ENOENT: no such file or directory, open 'd:\alexa180923c.txt'
5 Apr 15:34:11 - [info] [alexa-remote-account:Win11Alexa] intialising "Win11Alexa" with the PROXY method and NO saved data...
5 Apr 15:34:11 - [warn] [alexa-remote-account:Win11Alexa] open localhost:3456 in your browser
5 Apr 15:34:11 - [info] [mqtt-broker:192_168_0_23] Connected to broker: mqtt://192.168.0.23:1883
5 Apr 15:34:11 - [red] Uncaught Exception:
5 Apr 15:34:11 - [error] Error: ENOENT: no such file or directory, opendir '/tmp/node-watch-9c7ad5d76c632/node-watch-16c82eaeaca68'

[edit]started NR a 2nd time and that worked without error

Nice work @knolleary (and team)

But help me gain focus, and not stair into the abyss.

ic = Dave
Dave = ic

:man_shrugging:

Hah, I wondered if anyone would pickup on that... I needed to add user profile images to my local test users, and just threw some Flowfuse avatar URLs in which include a hash to generate the right initials... I just didn't bother working out the right hashes for my test users... But now we have this beta available on FlowFuse Cloud, I can get some real screenshots with all the correct initials :wink:

1 Like

Got it!

The avatars for non FlowFuse installs might need some massaging? like the first and last letter off the username?

unless you plan to add some meta for users into the core of Node RED?

Right now, the default icon for all users is the generic fa-user icon - but then everyone will look the same. Some better auto-generated avatars is something I'm considering, as well as the use of colour. Lots of options to consider.

Don't want to worry you but even Microsoft screw this up in Office 365. Let's hope you have more inspiration than their devs! :grinning:

2 Likes

Would you please - in the course to prepare for NR4.0 - as well consider to alter the scoring algorithm of the flows library? It's quite annoying to still get (as of today) a penalty for not-supporting Node 12.x

??? v12 hasn't be a valid version of Node.js since 30 Apr 2022 and the score is supposed to track against the live version of Node-RED.

I wonder whether, since NR 3.x still supports node v12, that if you specify that the node supports NR3.x then you must support node v12. Which isn't actually a logical requirement.

What does the command node-red-dev say about your node? See Introducing the Node Scorecard : Node-RED

Also noting that node-red-dev will need updating to include Node-RED v4.

Also spotted at least one "opportunity for improvement" in the getNodeDefinitions function. :slight_smile: .

It uses a regex <script.+?type=['"]text\/javascript['"].*?>([\S\s]*?)<\/script> which is incorrect. JavaScript script tags do not need a type="javascript" and haven't done for a long time, I never use them in my code as they are not the recommended standard for HTML.

When running, we only get back Unable to parse nodes/uibuilder/uibuilder.js - because no error message is included, we cannot know why it didn't parse.

Thank you for proposing to check w/ node-red-dev.

To give the full picture, those are the definitions in package.json:

"node-red": {
    "version": ">=2.0.0 <4.1.0",
[...]
"engines": {
    "node": ">=14.17.0"
},

node-red-dev output:

:white_check_mark: Compatible with Node-RED v3.1.8
› Warning: P06 NOT Compatible with Node-RED v1.3.7
:white_check_mark: Compatible with Node-RED v2.2.3
› Warning: P07 Minimum Node version is not compatible with minimum supported Node-RED Version Node v14.0.0

P06 doesn't give a penalty score. Fine for me.
P07 is inconsistent. Looks like Node v14.0.0 (yet not Node v12, as I guessed!) is referenced as minimum (to be) supported Node-RED version. The output doesn't change, even if the package claims to support NR v1.

Based on the explanation given by the scorecard ...

This SHOULD satisfy the current minimum supported version of the latest Node-RED release.

... this is wrong even for NR v3 - as the latest release demands Node v16 (according to the official installation script).

Long story short - back to my request: Please consider as well to correct the scoring algorithm of the flows library. :+1:

1 Like

About showing installed plugin-only packages: I noticed that on installing the themes collection, the popup mentions "Nodes added to palette:" followed by a list of the themes that get installed. Afterwards, I can now see the list of themes in the Palette Manager.

That's a very nice addition, but maybe the popup should be configured to say 'Plugins added to palette:' or something like that.

I seem to have got node-red into a permanent crash on restart with out of memory on restarting. I don't think it is anything in the flows, I think I instantiated an instance of a subflow, edited edited the help text of that subflow and deleted the instance. It doesn't fail if I run node-red --safe though.

I have no time at the moment to investigate further at the moment, will have another look later.

Welcome to Node-RED
===================
10 Apr 17:03:04 - [info] Node-RED version: v4.0.0-beta.2
10 Apr 17:03:04 - [info] Node.js  version: v20.5.1
10 Apr 17:03:04 - [info] Linux 5.15.0-102-generic x64 LE
10 Apr 17:03:04 - [info] Loading palette nodes
10 Apr 17:03:04 - [info] Node-RED Contrib Theme Collection version: v3.1.11
10 Apr 17:03:05 - [info] Dashboard version 3.6.5 started at /ui
10 Apr 17:03:05 - [info] Settings file  : /home/colinl/.node-red/settings.js
10 Apr 17:03:05 - [info] Context store  : 'memoryOnly' [module=memory]
10 Apr 17:03:05 - [info] Context store  : 'file' [module=localfilesystem]
10 Apr 17:03:05 - [info] User directory : /home/colinl/.node-red
10 Apr 17:03:05 - [warn] Projects disabled : editorTheme.projects.enabled=false
10 Apr 17:03:05 - [info] Flows file     : /home/colinl/.node-red/flows.json
10 Apr 17:03:05 - [info] Server now running at http://127.0.0.1:1880/
10 Apr 17:03:05 - [info] Starting flows
10 Apr 17:03:05 - [info] [ui-base:Dashboard] Node-RED Dashboard 2.0 (v1.7.1) started at /dashboard
10 Apr 17:03:05 - [info] [ui-base:Dashboard] Created socket.io server bound to Node-RED port at path /dashboard/socket.io
<--- Last few GCs --->
[34216:0x730da50]    19774 ms: Mark-Compact (reduce) 1952.1 (2084.0) -> 1950.4 (2084.0) MB, 559.88 / 0.00 ms  (average mu = 0.204, current mu = 0.212) allocation failure; GC in old space requested
[34216:0x730da50]    20484 ms: Mark-Compact (reduce) 1950.7 (2084.0) -> 1949.9 (2084.3) MB, 562.55 / 0.00 ms  (average mu = 0.206, current mu = 0.208) allocation failure; GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xc98550 node::Abort() [node-red]
 2: 0xb700a7  [node-red]
 3: 0xebae80 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node-red]
 4: 0xebb167 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node-red]
 5: 0x10cc7d5  [node-red]
 6: 0x10e4658 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
 7: 0x10ba771 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node-red]
 8: 0x10bb905 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node-red]
 9: 0x1097f46 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node-red]
10: 0x1089a44 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node-red]
11: 0x108bd45 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawOneByteInternalizedString(int, unsigned int) [node-red]
12: 0x109c045 v8::internal::Factory::NewInternalizedStringImpl(v8::internal::Handle<v8::internal::String>, int, unsigned int) [node-red]
13: 0x13d4594 v8::internal::Handle<v8::internal::String> v8::internal::StringTable::LookupKey<v8::internal::InternalizedStringKey, v8::internal::Isolate>(v8::internal::Isolate*, v8::internal::InternalizedStringKey*) [node-red]
14: 0x13d475f v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [node-red]
15: 0x14fd7db v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::StoreOrigin, v8::Maybe<v8::internal::ShouldThrow>) [node-red]
16: 0x14fee6b v8::internal::Runtime_SetKeyedProperty(int, unsigned long*, v8::internal::Isolate*) [node-red]
17: 0x7f9e37ed9ef6
nodered.service: Main process exited, code=dumped, status=6/ABRT
nodered.service: Failed with result 'core-dump'.
nodered.service: Consumed 41.824s CPU time.
nonodered.service: Scheduled restart job, restart counter is at 4.

I am an idiot. I had accidentally placed an instance of a subflow in the edit page of the subflow itself! Not surprisingly this caused a bit of a problem at run time.

The editor probably shouldn't allow that, otherwise we may break the space time continuum :exploding_head:

1 Like

It never used to... but something has changed. Hmm, will investigate.

Phew - I guess the space time continuum is safe now :rofl:

Sorry, but I am reading the changelog.

runtime
Upgrade to JSONata 2.x (#4590)

Just looking and wanting to know if that should be JSONdata.....?
(Or something else)

(also that name is used in maintenance release 3.1.7)

@Trying_to_learn,
It is correct. Here is the official page.
It is about the JSONata expressions that you can use e.g. in the Change node:
image

1 Like