🎉 Node-RED 2.2.0 released

Node-RED 2.2.0 has been released!

Full details of what's in the release available on the blog - Version 2.2 released : Node-RED

Thanks to everyone who contributed to this release and helped test the beta.

12 Likes

Sorry Nick, quick question. The new environment variables in the function node - are those available to the instance function inside a custom node? I know that the node id and name are available directly from this and you've added the _path as well. But what about the containing group?

Also, groups can be nested - I assume there is no direct way of getting that nesting? Not sure there is a good reason for doing that by the way, just interested.

As always, a very nice set of updates. Thanks.

@TotallyInformation the proper way for a node to access Env Vars is:

const value = RED.util.getSetting(node, envVar);

The ensures it is resolve at the right 'scope'.

I assume there is no direct way of getting that nesting?

No, groups are not exposed in the runtime in any meaningful way - they are primarily an organisation tool in the editor. That has blurred slightly now you can set env vars on a group (since 2.1.0) - but we haven't added any particular apis in the runtime for a node to know about groups.

1 Like

Thanks for that Nick.

By the way, I don't think I mentioned it because it took me a while to realise the power - but the env vars in groups is great! Extremely useful to be able to set some standard data at the group level. Or indeed to be able to create a hierarchy of information by setting the same environment variable at different levels - e.g. flow, outer and inner groups.

1 Like

How do I detach a node without assigning it a shortcut key please?

The release notes say Ctrl & delete (or drag).
Is that not working for you?

1 Like

Slight oddity in the detach feature.

If you detach and then undo with the cursor in a slightly different place, the result is that the detached node ends up somewhere it didn't start BUT the Editor doesn't know and doesn't mark the node as changed. So if you then reload the Editor it goes back to its original location.

That deletes rather than detach. Ctrl-drag does nothing.

As far as I can tell, you have to have a shortcut defined. I replaced ctrl-d (deploy) to do it. Though whether I'll ever remember is another matter! :grinning:

OK

Like the idea of ctrl-d(etach)

Maybe it'd be possible in future versions to use ctrl and drag to do this

Note - I had to remove ctrl-d from my browser shortcuts (Vivaldi - it was used to do Bookmarks)

2 Likes

I didn't need to remove it from my browser but it only worked when set as a global rather than workspace shortcut.

I would recommend you dont apply any muscle memory to CTRL+D for that action.

CTRL+D is a fairly well known and super useful multi cursor timesaver

Code_mYzzg8U2Eh

1 Like

Do I do any coding? :slight_smile:

Ah hahaha. Yes I forgot haha.

:joy::joy::joy:

I can never remember that stuff!!

I've a few key combinations that I always remember because I've done them forever. Everything else has to be really simple to remember. :older_adult: I so rarely do multi-cursor edits, there is no way I'd remember that.

3 Likes

I can never remember the Monaco shortcuts.... not even the shortcut to display the shortcuts :thinking:

4 Likes

I've come back to this and I've switched to ctrl-e(xtraction)

So I can re-instate using ctrl-d for all those times I'm in need of a mutli-cursor timesaver..... :slight_smile:

1 Like

I installed this on a brand new install of Bullseye (literally released today)..

I was hoping to get nodejs v16... i keep getting 12.22.5

I thought there was an option that could be added to the default node-red install script for raspberry pi to force the absolute latest node.js and even npm ... but I can't find it.

What script are you using to install node red? The install script in the node red docs should default to 14 (unless 12 is already installed) or you can add --node16 to force version 16.

1 Like

Or --help to see all options

1 Like

I've been having a (dangerous I know) think about this again and switched back to ctrl-d as the action is called Detach and not Extract

Surely, in this day and age etc, NR should be clever enough to work out that you are inside the editor and switch to using specific Monaco shortcuts when in that mode?

1 Like

I haven't checked but yes you are right.

It was more about committing muscle memory to that action.