|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: Version 2.1 released |
| 4 | +author: nick |
| 5 | +--- |
| 6 | + |
| 7 | +Node-RED 2.1 is now available to [install](https://npmjs.org/package/node-red). If upgrading, please read the [upgrade instructions](http://nodered.org/docs/getting-started/upgrading.html). |
| 8 | + |
| 9 | +The [Change Log](https://github.com/node-red/node-red/blob/21304a695c3450fbf80cee69c84fe71ce753b076/CHANGELOG.md) has the full list of changes in this release, but here are the highlights. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +<iframe width="560" height="315" src="https://www.youtube.com/embed/5DHs7y0zSZo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +- [Highlights](#highlights) |
| 18 | + - [New Welcome Tour Guide](#new-welcome-tour-guide) |
| 19 | + - [Hiding tabs](#hiding-tabs) |
| 20 | + - [Dynamic MQTT nodes](#dynamic-mqtt-nodes) |
| 21 | + - [Auto-complete in `msg` TypedInputs](#auto-complete-in-msg-typedinputs) |
| 22 | + - [New Link Call node](#new-link-call-node) |
| 23 | + - [Edit & Arrange menus](#edit--arrange-menus) |
| 24 | + - [Flow/Group level environment variables](#flowgroup-level-environment-variables) |
| 25 | +- [Other node updates](#other-node-updates) |
| 26 | + - [Debug sidebar options](#debug-sidebar-options) |
| 27 | + - [Deep copy option on Change node](#deep-copy-option-on-change-node) |
| 28 | + - [Delay node updates](#delay-node-updates) |
| 29 | + - [Join node reset timeout](#join-node-reset-timeout) |
| 30 | + - [TCP Request node can return Strings](#tcp-request-node-can-return-strings) |
| 31 | + - [File nodes renamed](#file-nodes-renamed) |
| 32 | +- [Documentation Updates](#documentation-updates) |
| 33 | +- [What's next?](#whats-next) |
| 34 | + |
| 35 | + |
| 36 | +## Highlights |
| 37 | + |
| 38 | +### New Welcome Tour Guide |
| 39 | + |
| 40 | +The first time you open the editor with 2.1.0, you will be greeted with a new Welcome Tour. This will highlight a lot of the new features in this version. |
| 41 | + |
| 42 | +The Tour will only be shown the first time you open any particular version of Node-RED - and you can opt-out of seeing them in the future in the User Settings dialog. |
| 43 | + |
| 44 | +If you embed Node-RED in your own application and don't want the tour to be shown to your users, then it can also be disabled in the settings file. |
| 45 | + |
| 46 | +The underlying framework for creating the Welcome Tour can be reused to create other interactive tours/tutorials/guides. We'll have more on this area in the future. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +### Hiding tabs |
| 51 | + |
| 52 | +We often hear from users who have a *lot* of flows. To make it a bit easier to manage, you can now hide their tabs in the editor. |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | +The Info sidebar still lists them all, and indicates which are currently hidden. It also allows them to be shown with a single click. |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +There's also a new tab menu that provides more options around managing the tabs. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +For this first release of the feature, the hidden state of a tab is stored in user preferences within the editor - it is *not* a property of the flow itself. This means you can't share a set of flows with another user and have some of the tabs pre-hidden. It is an open point of discussion as to whether we want to allow that behaviour. |
| 65 | + |
| 66 | +Whilst talking about managing the tabs, shift-clicking on the workspace tab bar scroll arrows will now jump immediately to the start/end of the tab list. |
| 67 | + |
| 68 | + |
| 69 | +### Dynamic MQTT nodes |
| 70 | + |
| 71 | +The MQTT In node now includes a 'Dynamic subscription' option. When selected, the node gets an input so you can pass it messages. Those messages can be used to: |
| 72 | + |
| 73 | + - connect/disconnect the broker |
| 74 | + - subscribe to topics |
| 75 | + - unsubscribe from topics |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | +The MQTT Out node also supports the connect/disconnect messages as well. |
| 81 | + |
| 82 | +The MQTT Broker configuration node has a new 'connect automatically' option - which is enabled by default. If you disable that, it won't connect until one of the flow nodes receives a connect message. |
| 83 | + |
| 84 | +Full details of the formats of those messages are in the node help and summarised in the [pull-request here](https://github.com/node-red/node-red/pull/3189). |
| 85 | + |
| 86 | +### Auto-complete in `msg` TypedInputs |
| 87 | + |
| 88 | +The `msg` TypedInputs are used widely throughout Node-RED. To make life a bit easier, they now provide auto-complete when typing message property names. |
| 89 | + |
| 90 | +For now, it offers completions from the list of well-known properties the core nodes use. |
| 91 | + |
| 92 | +In the future, it will be possible for contrib nodes to register the properties they use so they can be offered as completions as well. |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +We're also thinking about how best to apply this to flow/global inputs - auto-completing based on the current contents of context. |
| 97 | + |
| 98 | +### New Link Call node |
| 99 | + |
| 100 | +The new Link Call node can be used alongside the Link-In/Out nodes to create subroutine-like flows. |
| 101 | + |
| 102 | +If you have a flow that starts with a Link-In node and ends with a Link-Out node that has been put into its new 'return' mode (giving the node a different icon), the Link Call node can be used to pass that flow a message and the result is passed back to the calling node. |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | +As an alternative to using subflows, this is great for creating little utility flows that you want to reuse in multiple places. |
| 107 | + |
| 108 | + |
| 109 | +### Edit & Arrange menus |
| 110 | + |
| 111 | +The main menu now has Edit and Arrange submenus. |
| 112 | + |
| 113 | +The Edit menu has the actions you'd expect - Undo, Redo, Copy and Paste etc. |
| 114 | + |
| 115 | +The Arrange menu adds tools to help arrange your nodes. |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +All of the menus now also show any keyboard shortcuts that have been set. |
| 120 | + |
| 121 | +### Flow/Group level environment variables |
| 122 | + |
| 123 | +We have supported Environment Variables being set within Subflows for a while now. With this release, you can now also set them at the Flow or Group level. |
| 124 | + |
| 125 | +## Other node updates |
| 126 | + |
| 127 | +### Debug sidebar options |
| 128 | + |
| 129 | +The Debug sidebar options have been reworked. |
| 130 | + |
| 131 | +The filter options are now a drop-down menu of options, rather than the sliding panel. |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | +The 'clear messages' button now also has a drop-down that lets you change it to 'clear filtered messages' instead. That option is useful if you have the 'current flow' filter enabled, and you want to clear the message for the current flow without clearing messages from other flows. |
| 136 | + |
| 137 | +In other good news, both of these options are now stored in the editor settings - so they are remembered between editor reloads. |
| 138 | + |
| 139 | + |
| 140 | +### Deep copy option on Change node |
| 141 | + |
| 142 | +The Change node's "set" action has a new option to create a deep copy of the value when copying from `msg`, `flow` or `global`. |
| 143 | + |
| 144 | +In the case of Objects and Arrays, this creates a proper clone of the value, rather than creating a reference to the same object. |
| 145 | + |
| 146 | +We've also updated the label of the "set" action to hopefully help users get the 'from' and 'to' fields the right way around. |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | +### Delay node updates |
| 151 | + |
| 152 | +When in rate limiting mode, the Delay node supports two new features: |
| 153 | + |
| 154 | + - if `msg.toFront` is set, a message is put to the front of the queue of messages waiting to be sent |
| 155 | + - there's a new option to send rate limited messages to an optional second output on the node. This is useful if you need to rate limit messages *and* do some further processing for the messages that have been rate limited, rather than just have them discarded. |
| 156 | + For example, if you are creating a rate limited HTTP endpoint, you still want to be able to respond to the rate limited requests rather than just letting them time out. |
| 157 | + |
| 158 | +### Join node reset timeout |
| 159 | + |
| 160 | +If the Join node has a timeout running and it receives a message with `msg.restartTimeout` set, it will restart the timeout. |
| 161 | + |
| 162 | + |
| 163 | +### TCP Request node can return Strings |
| 164 | + |
| 165 | +The TCP Request node can now be configured to return Strings rather than raw Buffers. This matches the functionality already available with the TCP In node. |
| 166 | + |
| 167 | +### File nodes renamed |
| 168 | + |
| 169 | +The `file` and `file in` nodes have new palette labels to make it clearer which writes to files and which reads from files. Even after all this time, I would have to double check which was which. |
| 170 | + |
| 171 | +## Documentation Updates |
| 172 | + |
| 173 | +Whilst not really part of the release, we've also published lots of updates to the [API documentation](https://nodered.org/docs/api/) on the website. |
| 174 | + |
| 175 | +This includes the hooks and library store APIs in the runtime. |
| 176 | + |
| 177 | +The docs now cover more of the APIs available to nodes and plugins to [extend the UI](https://nodered.org/docs/api/ui/). |
| 178 | + |
| 179 | +There is also documentation on creating custom [Theme plugins](https://nodered.org/docs/api/ui/themes/). |
| 180 | + |
| 181 | + |
| 182 | +## What's next? |
| 183 | + |
| 184 | +This release has got us back on schedule for our [release plan](/about/releases/). With that plan, the next release, 2.2 is scheduled for the end of January. |
| 185 | + |
| 186 | +There are a few features already in development for that release, including tooling to help package subflows as npm modules directly from the editor. |
| 187 | + |
| 188 | +As ever, if there are any particular features you're interested in, now is a great time to jump into the [forum](https://discourse.nodered.org) to share your feedback. |
0 commit comments