Skip to content

Commit e27a145

Browse files
authored
Merge pull request node-red#28 from node-red/0150
Update for 0.15.0
2 parents 188333b + b297c0f commit e27a145

File tree

12 files changed

+293
-13
lines changed

12 files changed

+293
-13
lines changed
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
layout: blog
3+
title: Version 0.15 released
4+
---
5+
6+
Node-RED 0.15 is now available to [download](https://github.com/node-red/node-red/releases/download/0.15.0/node-red-0.15.0.zip) or [npm install](https://npmjs.org/package/node-red).
7+
8+
If upgrading, please read the [upgrade instructions](http://nodered.org/docs/getting-started/upgrading.html).
9+
10+
If you are using the pre-installed version on Raspberry Pi Jessie, the repositories will be updated in the near future.
11+
12+
---
13+
14+
### Editor Updates
15+
16+
17+
#### Palette editor
18+
19+
It's now possible to manage your palette from within the editor. This lets you
20+
browse a catalogue of all available nodes and install any of them without having to
21+
restart Node-RED.
22+
23+
![](/blog/content/images/2016/10/palette-editor.gif)
24+
25+
Under the covers, this triggers an npm install of the node module into your user
26+
directory - by default, `$HOME/.node-red`. Note that if the node has any dependencies
27+
beyond the standard npm dependencies, you'll need to resolve them manually. It also
28+
requires you to have `npm` installed, which, if you're using the Raspberry Pi
29+
preinstall image, you may not have - check [the docs](http://nodered.org/docs/hardware/raspberrypi.html#adding-nodes) for how to get it.
30+
31+
32+
#### Scrollable tabs
33+
34+
Having let you reorder your workspace tabs in the last release, we knew there was
35+
more to be done. A common complaint was how the editor handled flows with lots of tabs;
36+
we would squeeze them all into the view making it virtually impossible to jump to the
37+
right tab first time. It also made the Flows menu unusable as to grew beyond the bottom
38+
of the page.
39+
40+
With this release, we now behave much more sensibly and allow the tab bar to scroll
41+
so the tabs never become too small. That ensures their labels are always legible.
42+
We've also removed the list of tabs from the Flows menu.
43+
44+
![](/blog/content/images/2016/10/scrolling-tabs.gif)
45+
46+
47+
48+
But wait a minute, I hear you say, how can you quickly navigate between tabs if
49+
they are now scrolled off screen and there's no menu entry? Well, I reply, you
50+
want to see the new search box...
51+
52+
53+
#### Search box
54+
55+
We've added a search box that makes it easy to quickly find any tab or node. You
56+
can access it from the 'Search flows' option in the menu, or simply hit `Ctrl+.` (`Cmd+.` on Mac). As you type, it shows a list of possible matches, either click
57+
on the one you want, or use the cursor keys and hit enter.
58+
59+
If you select a flow or subflow, it will switch to the appropriate tab. If you pick
60+
a node in the flow, it switches to the appropriate tab, scrolls to ensure the node
61+
is visible and flashes its border so you can spot it. If you pick a configuration node,
62+
it will reveal it in the config node sidebar.
63+
64+
![](/blog/content/images/2016/10/flow-search.gif)
65+
66+
#### Import/Export improvements
67+
68+
The Import and Export dialogs have had a few small updates. When importing a flow,
69+
you can now choose to have it import into a new flow rather than the current one.
70+
71+
The export dialog gives you more options on what gets exported - whether the selected
72+
nodes, the current flow or all flows. You can also pick if the export should be
73+
prettified or minified.
74+
75+
![](/blog/content/images/2016/10/import-dialog.png)
76+
![](/blog/content/images/2016/10/export-dialog.png)
77+
78+
A couple of other new features on import:
79+
- we avoid duplicating subflows if you import one you already have in the palette
80+
- you can now include credentials in the flow json you import
81+
82+
83+
#### Other things
84+
85+
- As you switch between flows, we update the url in the browser so you can link
86+
straight into a particular flow or subflow:
87+
88+
![](/blog/content/images/2016/10/flow-url.png)
89+
90+
91+
- We've changed the default scope of new config nodes. When we introduced the idea
92+
of scoping config nodes to a particular flow we defaulted to the current flow you're
93+
on. This has caused quite a bit of confusion as user's don't necessary understand
94+
what the scoping is doing and end up creating identical config nodes on each tab.
95+
With this release, we now set config nodes to be global by default.
96+
97+
98+
### Runtime Updates
99+
100+
#### Encrypting credentials
101+
102+
We've always taken care to ensure any credential properties are not stored in the
103+
main flow file and put them in a dedicated credentials file. This means the main
104+
flow file can be version controlled without fear of leaking anything sensitive.
105+
However we can't avoid the fact that credentials really need to be kept in sync
106+
with the flows and only version controlling one doesn't make sense.
107+
108+
As we're building up to adding version control support to Node-RED, we needed to
109+
do something to protect the credentials whilst enabling them to be version controlled.
110+
111+
As such, we now encrypt the credentials by default. This will mean you can no
112+
longer hand-edit the credentials file unless you choose to explicitly disable
113+
encryption. The exact details of how we do this are on the wiki [here](https://github.com/node-red/node-red/wiki/Design%3A-Encryption-of-credentials).
114+
115+
116+
#### Preventing overwrite protection
117+
118+
In anticipation of version control support, the `/flows` admin api has been updated
119+
to include a revision identifier along with the flows.
120+
When you hit the deploy button, the editor can now check if the flows in the runtime
121+
are those it loaded originally. Why is that useful? It means if someone deploys some
122+
changes whilst you're still working on yours, the editor will warn you when you
123+
come to deploy. In this release, we give you the option to deploy anyway (over-writing
124+
whatever changes had been made), or cancel the deploy.
125+
126+
We've already started work on being able to see what changes have been made so you
127+
can merge them into your changes before deploying, but it didn't make the cut for
128+
this release.
129+
130+
As the changes to `/flows` are not backward compatible, we've added a new custom
131+
HTTP header to identify what version of the API should be used. That means any existing
132+
use of the `/flows` api will continue to work, but can easily opt-in to the new
133+
behaviour. The documentation for this new api will get updated later this week.
134+
135+
### Node 0.10
136+
137+
Finally, we need to talk about Node.js 0.10. At the [end of this month](https://github.com/nodejs/LTS/blob/75bd36a060be3b965e696bc0c53f799089ad0f52/README.md), it will no long receive _any_ updates - including security updates. This end-of-life means it is hard for us to justify maintaining support for it. There
138+
is a growing list of modules that have already dropped support for both 0.10 and
139+
0.12 which leaves us stuck if a critical issue was to be found in them.
140+
141+
The _only_ reason we've held onto 0.10 for so long is the fact its the version that
142+
Debian Stable ships - and thus it's the only version available as part of our
143+
Raspberry Pi preinstall image. Debian Stable isn't due to update for quite some
144+
time yet, so we're at a bit of an impasse.
145+
146+
Having explored a wide range of options we've made the decision that the 0.15 stream
147+
will be the last one to support node 0.10 *and* 0.12.
148+
149+
**The next milestone release, 0.16, will require Node 4.x.**
150+
151+
This means, for now, the Raspberry Pi preinstall will be fixed at 0.15.
152+
To make life easier, we already include a script on the preinstall image called
153+
`update-nodejs-and-nodered` that updates node.js to the latest LTS version using the
154+
NodeSource repositories and then reinstalls node-red on top. See [the documentation](http://nodered.org/docs/hardware/raspberrypi.html#upgrading-nodejs) for more information - including instructions for doing that upgrade manually if you so
155+
choose.
156+
157+
#### Serial node
158+
159+
One of the more painful parts of the node.js world is handling binary dependencies.
160+
It can be a real headache when upgrading between versions to make sure such dependencies
161+
continue to work as expected.
162+
163+
We're serving notice that in the 0.16 release **we will be removing `node-red-node-serialport` as a default
164+
dependency**.
165+
166+
That means we'll no longer include the Serial node as part of the core
167+
install.
168+
169+
It will remove a lot of hardware/platform dependant code, speeding up the install
170+
time and shrinking the runtime footprint for users who have no need of the node.
171+
172+
It will also make upgrading more reliable as the serial port code will no longer be buried within Node-RED and can be upgraded just like any other node.
173+
174+
This will mean if you are using the serial port nodes you'll need to manually
175+
install them after upgrading to 0.16 - we'll share more details when we get to
176+
that release.
177+
178+
### And finally...
179+
180+
Keep a look out for some announcements next week... we have some exciting news
181+
to share!
27.4 KB
Loading
800 KB
Loading
17.9 KB
Loading
16.2 KB
Loading
802 KB
Loading
Loading

docs/api/admin/errors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Status Code | Reason
1212
`400` | Bad request - see response format below
1313
`401` | Not authorized - see [Authentication](oauth)
1414
`404` | Not found - a resource wasn't found
15+
`409` | Version mismatch - see [`POST /flows`](methods/post/flows)
1516
`500` | Server Error - something went wrong on the server
1617

1718
### Error response
@@ -38,3 +39,4 @@ Code | Description
3839
`settings_unavailable` | The storage system does not support changing settings
3940
`module_already_loaded` | The requested module is already loaded
4041
`type_in_use` | The request is attempting to remove/disable a node type that is currently being used
42+
`invalid_api_version` | The request specified an invalid api version in the `Node-RED-API-Version` header

docs/api/admin/methods/get/flows/index.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ Requires permission: <code>flows.read</code>
99

1010
### Headers
1111

12-
Header | Value
13-
----------------|-------
14-
`Authorization` | `Bearer [token]` - if authentication is enabled
12+
Header | Value
13+
-----------------------|-------
14+
`Authorization` | `Bearer [token]` - if authentication is enabled
15+
`Node-RED-API-Version` | (*Since 0.15.0*) The api version being used. Defaults to `v1` if not set.
1516

1617
### Response
1718

18-
Status Code | Reason | Response
19-
------------|----------------|--------------
20-
`200` | Success | An array of node objects. See example response body
21-
`401` | Not authorized | _none_
19+
Status Code | Reason | Response
20+
------------|---------------------|--------------
21+
`200` | Success | `v1` An array of node objects <br/> `v2` A flow response object that includes the current revision identifier of the flows
22+
`400` | Invalid API version | An [Error response](/docs/api/admin/errors)
23+
`401` | Not authorized | _none_
2224

25+
26+
#### `v1` - array of node objects
2327
{% highlight json %}
2428
[
2529
{
@@ -29,3 +33,17 @@ Status Code | Reason | Response
2933
}
3034
]
3135
{% endhighlight %}
36+
37+
#### `v2` - flow response object
38+
{% highlight json %}
39+
{
40+
"rev": "abc-123",
41+
"flows": [
42+
{
43+
"type": "tab",
44+
"id": "396c2376.c693dc",
45+
"label": "Sheet 1"
46+
}
47+
]
48+
}
49+
{% endhighlight %}

docs/api/admin/methods/post/flows/index.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Header | Value
1313
---------------------------|----------
1414
`Authorization` | `Bearer [token]` - if authentication is enabled
1515
`Content-type` | `application/json`
16+
`Node-RED-API-Version` | (*Since 0.15.0*) The api version being used. Defaults to `v1` if not set.
1617
`Node-RED-Deployment-Type` | `full`, `nodes`, `flows` or `reload`
1718

1819

@@ -29,11 +30,68 @@ is performed.
2930

3031
### Arguments
3132

32-
The request body must be a new full configuration JSON string.
33+
The format of the request body will depend on the Node-RED API version being used:
34+
35+
#### `v1` - array of node objects
36+
37+
{% highlight json %}
38+
[
39+
{
40+
"type": "tab",
41+
"id": "396c2376.c693dc",
42+
"label": "Sheet 1"
43+
}
44+
]
45+
{% endhighlight %}
46+
47+
48+
#### `v2` - flow response object
49+
50+
The `rev` property, if provided, should reflect the revision of flows that was returned by `GET /flows`.
51+
52+
{% highlight json %}
53+
{
54+
"rev": "abc-123",
55+
"flows": [
56+
{
57+
"type": "tab",
58+
"id": "396c2376.c693dc",
59+
"label": "Sheet 1"
60+
}
61+
]
62+
}
63+
{% endhighlight %}
3364

3465
### Response
3566

36-
Status Code | Reason | Response
37-
------------|----------------|--------------
38-
`204` | Success | _none_
39-
`401` | Not authorized | _none_
67+
Status Code | Reason | Response
68+
------------|---------------------|--------------
69+
`200` | `v2` Success | The new `rev` for the active flows. See below.
70+
`204` | `v1` Success | _none_
71+
`400` | Invalid API version | An [Error response](/docs/api/admin/errors)
72+
`401` | Not authorized | _none_
73+
`409` | Version mismatch | An [Error response](/docs/api/admin/errors). See below.
74+
75+
If `v1` of the API is being used, a successful request contains no response body.
76+
77+
If `v2` of the API is being used, the request should include `rev` property that
78+
is set to the latest `rev` value known to the requestor. If this value matches
79+
the `rev` value of the active flows in the runtime, the request will succeed.
80+
81+
If it does not match, this indicates the runtime is using a newer version of flows
82+
and the request is rejected with a `409` status code. This allows the requestor to
83+
resolve any differences and resubmit the request.
84+
85+
If the requestor wishes to force deploy, the `rev` property should be omitted from
86+
the request.
87+
88+
On a successful request, the response provides the new `rev` value:
89+
90+
{% highlight json %}
91+
{
92+
"rev": "def-456",
93+
}
94+
{% endhighlight %}
95+
96+
*Note*: the `rev` property is a string, but no other assumptions should be made
97+
as to its format.

docs/api/admin/types.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ runtime. It is represented as a flat array of Node objects. This is the main flo
8888
]
8989
{% endhighlight %}
9090

91+
*Since 0.15.0*, the `/flows` api supports a new format if the `Node-RED-API-Version`
92+
header is set to `v2`. This format provides the array of nodes as above, and includes
93+
an optional revision identifier for the flows:
94+
95+
{% highlight json %}
96+
{
97+
"rev": "abc-123",
98+
"flows": [
99+
{
100+
"id": "1234",
101+
"type": "inject"
102+
},
103+
{
104+
"id": "5678",
105+
"type": "debug"
106+
}
107+
]
108+
}
109+
{% endhighlight %}
110+
111+
91112
### Single Flow configuration
92113

93114
A Single Flow configuration represents what gets presented in the editor as a tab.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2>A visual tool for wiring the Internet of Things</h2>
3232
<div class="col-1-2">
3333
<div class="content feature" style="margin-top: 40px;">
3434
<iframe style="box-shadow: 10px 10px 30px #999;" width="445" height="250" src="https://www.youtube.com/embed/vYreeoCoQPI" frameborder="0" allowfullscreen></iframe>
35-
<p>Latest version: <a href="https://www.npmjs.com/package/node-red"><span class="node-red-latest-version">v0.14.6</span> (npm)</a></p>
35+
<p>Latest version: <a href="https://www.npmjs.com/package/node-red"><span class="node-red-latest-version">v0.15.0</span> (npm)</a></p>
3636
</div>
3737
</div>
3838
</div>

0 commit comments

Comments
 (0)