Skip to content

Commit 575e51c

Browse files
Merge branch 'node-red:master' into master
2 parents a01ca28 + 78ce134 commit 575e51c

File tree

10 files changed

+93
-12
lines changed

10 files changed

+93
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ First time you run jeykll you need to do bundle install 1st for the dependencies
2323

2424
cd node-red.github.io
2525
bundle install
26-
jekyll serve -w
26+
bundle exec jekyll serve -w
2727

2828
Once the site is built and running you can preview it at [`http://127.0.0.1:4000/`](http://127.0.0.1:4000/).

_includes/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<li><a href="https://twitter.com/nodered">Twitter</a></li>
2626
<li><a href="https://discourse.nodered.org">Forum</a></li>
2727
<li><a href="/slack">Slack</a></li>
28+
<li><a rel="me" href="https://social.nodered.org/@nodered">Mastodon</a></li>
2829
</ul>
2930
</div>
3031
</div>

docs/api/ui/typedInput/index.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ chosen, including options for string, number and boolean types.
1616
- [Events](#events)
1717
- [Types](#types)
1818
- [Examples](#examples)
19-
19+
- [Runtime handling of typed values](#runtime-handling-of-typed-values)
2020

2121
<div class="widget">
2222
<div style="clear:both">
@@ -125,6 +125,34 @@ $(".input").typedInput({
125125
});
126126
```
127127

128+
When used in a Node-RED node, this value can be stored as a node property by adding
129+
an entry for it in the node's `defaults` object. This ensures the type is saved
130+
along with the value in the node configuration.
131+
132+
```html
133+
<div class="form-row">
134+
<label>Example:</label>
135+
<input type="text" id="node-input-myField">
136+
<input type="hidden" id="node-input-myFieldType">
137+
</div>
138+
```
139+
```javascript
140+
RED.nodes.registerType('example', {
141+
defaults: {
142+
myField: { value: "" },
143+
myFieldType: { value: "str" }
144+
},
145+
...
146+
oneditprepare: function () {
147+
$("#node-input-myField").typedInput({
148+
typeField: "#node-input-myFieldType"
149+
});
150+
}
151+
})
152+
```
153+
154+
155+
128156
### Methods
129157

130158
<a name="methods-type"></a>
@@ -369,6 +397,52 @@ $("#node-input-example5").typedInput({type:"fruit", types:[{
369397
<div class="red-ui-editor"><input type="text" id="node-input-example5"></div>
370398

371399

400+
### Runtime handling of typed values
401+
402+
Due to the way the `typedInput` enhances a regular HTML `<input>`, its value is
403+
stored as a string. For example, booleans are stored as `"true"` and `"false"`.
404+
405+
When stored as node properties, it is necessary for the runtime part of the node
406+
to parse the string to get the typed value.
407+
408+
A utility function is provided to handle the built-in types provided by the TypedInput.
409+
410+
```javascript
411+
RED.util.evaluateNodeProperty(value, type, node, msg, callback)
412+
```
413+
414+
Property | Type | Required | Description
415+
---------|---------|----------|-------------
416+
`value` | string | yes | The property to evaluate
417+
`type` | string | yes | The type of the property
418+
`node` | Node | yes, for certain types | The node evaluating the property
419+
`msg` | Message Object | yes, for certain types | A message object to evaluate against
420+
`callback` | Callback | yes, for `flow`/`global` types | A callback to receive the result
421+
422+
For most types, the function can be used synchronously without providing a callback.
423+
424+
```javascript
425+
const result = RED.util.evaluateNodeProperty(value, type, node)
426+
```
427+
428+
For `msg` type, the message object should also be provided:
429+
430+
```javascript
431+
const result = RED.util.evaluateNodeProperty(value, type, node, msg)
432+
```
433+
434+
To handle `flow` and `global` context types, the node needs to be provided as well as
435+
a callback function due to the asynchronous nature of context access:
436+
437+
```javascript
438+
RED.util.evaluateNodeProperty(value, type, node, msg, (err, result) => {
439+
if (err) {
440+
// Something went wrong accessing context
441+
} else {
442+
// Do something with 'result'
443+
}
444+
})
445+
```
372446

373447

374448
<script src="/js/jquery-ui.min.js"></script>

docs/faq/node-versions.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ title: Supported Node versions
55
slug: node versions
66
---
77

8-
Node-RED currently recommends **Node 14.x LTS**.
8+
Node-RED currently recommends **Node 16.x LTS**.
99

1010
Version | Support Level | Notes
1111
-----------|-----------------|------
12-
< 8.x | *Unsupported* |
13-
**8.x** | *Supported* | Node-RED 1.x or earlier only
14-
**10.x** | *Supported* | Node-RED 1.x or earlier only
15-
**12.x** | *Supported*. |
16-
**14.x** | **Recommended** |
17-
**16.x** | Supported |
12+
< 10.x | *Unsupported* | Node-RED 1.x or earlier only
13+
**12.x** | *Supported* | Node-RED 2.x or earlier only
14+
**14.x** | Supported |
15+
**16.x** | **Recommended** |
16+
**18.x** | Supported |
1817

1918
We try to stay up to date with Node.js releases. Our goal is to support
2019
the [Maintenance and Active LTS releases](https://nodejs.org/en/about/releases/).

docs/getting-started/raspberrypi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ to review the contents of the script first, you can view it [on Github](https://
2525
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
2626
```
2727

28-
There are extra parameters you can pass to the script. Add `--help` to the above command to see them.
28+
There are extra parameters you can pass to the script. Add ` --help` to the end of the above command to see them.
2929

3030
<div class="doc-callout">
3131
<div style="float: left; margin-right: 10px; margin-bottom: 30px;">
@@ -40,7 +40,7 @@ first to ensure npm is able to fetch and build any binary modules it needs to in
4040
This script will:
4141

4242
- remove the existing version of Node-RED if present.
43-
- if it detects Node.js is already installed, it will ensure it is at least v12. If less than v12 it will stop and let the user decide whether to stay with Node-RED version 1 - or upgrade Nodejs to a more recent LTS version. If nothing is found it will install the current Node.js LTS release using the [NodeSource](https://github.com/nodesource/distributions/blob/master/README.md) package.
43+
- if it detects Node.js is already installed, it will ensure it is at least v14. If less than v14 it will stop and let the user decide whether to stay with Node-RED version 1 - or upgrade Nodejs to a more recent LTS version. If nothing is found it will install the Node.js 16 LTS release using the [NodeSource](https://github.com/nodesource/distributions/blob/master/README.md) package.
4444
- install the latest version of Node-RED using npm.
4545
- optionally install a collection of useful Pi-specific nodes.
4646
- setup Node-RED to run as a service and provide a set of commands to work with
@@ -50,10 +50,12 @@ This script will:
5050
<div style="float: left; margin-right: 10px;margin-bottom: 40px;">
5151
<img src="/images/logos/raspberrypi.svg" height="30">
5252
</div>
53+
5354
Node-RED has also been packaged for the Raspberry Pi OS repositories and appears in their
5455
list of 'Recommended Software'. This allows it to be installed using
5556
<code>apt-get install nodered</code> and includes the Raspberry Pi OS-packaged version
5657
of Node.js, but <em>does not</em> include <code>npm</code>.
58+
5759
<p><b>Note</b>: at this time the default node.js included with RaspiOS Bullseye is still v12. This means that the latest Node-RED version that can be installed is the 2.x branch. While using these packages is convenient at first, we <b>strongly recommend</b> using the install script above instead.</p>
5860
</div>
5961

docs/user-guide/nodes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ If you are looking at intervals greater than one day - consider using a schedule
4242
The `interval between times` and `at a specific time` options use the standard cron system. This means that 20 minutes will be at the next hour, 20 minutes past and 40 minutes past - not in 20 minutes time. If you want every 20 minutes from now - use the `interval` option.
4343

4444
*Since Node-RED 1.1.0*, the Inject node can now set any property on the message.
45+
4546
***
4647

4748
<img alt="Debug node" style="float: right; margin-top: 20px;" src="/docs/user-guide/images/node_debug.png" width="169px">

docs/user-guide/runtime/securing-node-red.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ The `strategy` property takes the following options:
197197
- `label`/`icon` - used on the login page. `icon` can be any FontAwesome icon name.
198198
- `options` - an options object passed to the passport strategy when it is created.
199199
Refer to the strategy's own documentation for what it requires. See below for a
200-
node on the `callbackURL`.
200+
note on the `callbackURL` and `callbackMethod`.
201201
- `verify` - the verify function used by the strategy. It must call `done` with
202202
a user profile as the second argument if the user is valid. This is expected
203203
to have a `username` property that is used to check against the list of valid
@@ -209,6 +209,8 @@ redirect to following an auth attempt. It must be the URL of your Node-RED edito
209209
with `/auth/strategy/callback` added to the path. For example, if you access the
210210
editor at `http://localhost:1880`, you would use `http://localhost:1880/auth/strategy/callback`.
211211

212+
By default, the `callbackURL` will listen for `GET` requests. To use `POST` requests
213+
instead, set `callbackMethod` to `POST`.
212214

213215
#### Setting a default user
214216

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ <h4>In the cloud</h4>
122122
<div class="content">
123123
<h3>Who's using Node-RED?</h3>
124124
<ul id="user-list">
125+
<li><a href="https://www.ubos.tech/"><img src="users/ubos.jpg"/></a></li>
126+
<li><a href="https://www.bitpool.com/"><img src="users/bitpool.png"/></a></li>
125127
<li><a href="https://smartconnect.international/"><img src="users/connect.png"/></a></li>
126128
<li><a href="https://www.umh.app/"><img src="users/united-manufacturing-hub.png"/></a></li>
127129
<li><a href="https://www.simocowirelesssolutions.com/products/velocity/"/><img src="users/simoco.jpg"/></a></li>

users/bitpool.png

13.5 KB
Loading

users/ubos.jpg

45.9 KB
Loading

0 commit comments

Comments
 (0)