Updated Design: external file for function and templates nodes (markdown)

Nathanaël Lécaudé 2017-05-15 10:47:42 -04:00
parent 91e452122f
commit 346afd9412
1 changed files with 2 additions and 2 deletions

@ -7,9 +7,9 @@ Doing diffs and merging flow files with a large number of functions or templates
We know some third party nodes do this but we think this should be integrated in the code. The main downside of using third party nodes is they need to be kept up to date with the core to reflect changes in the function or template nodes which is not always the case. Having this in the core would ensure that everything it up to date.
## Proposition
We propose the addition of a checkbox named `Load from external file` just above the code field. Checking this checkbox would make a field appear where the user can type the path to a file, similar to the `file-in` node. Given the fact some cloud environment are not compatible with a traditional file system, a setting named `allowExternalFiles` could be added in `settings.js` to disable this feature entirely.
We propose the addition of a checkbox named `Load from external file` just above the code field. Checking this checkbox would make a field appear where the user can type the path to a file, similar to the `file-in` node. Given the fact some cloud environment are not compatible with a traditional file system, a setting named `allowExternalFiles` could be added in `settings.js` to disable this feature entirely. The feature could be disabled by default to avoid confusing new users.
In that mode, the code editor could show the code but in greyed out mode, similar to how the Arduino IDE works when using external files. Another option would be to be able to start prototyping a function in Node-RED's editor and have the option to then save it to file. That would imply the user could use the built-in editor to edit the file.
In that mode, the code editor could show the code but in greyed out mode, similar to how the Arduino IDE works when using external files. Another option would be to be able to start prototyping a function in Node-RED's editor and have the option to then save it to file. Once save to disk, the editor would be in read-only mode and the file contents would update when the file is saved externally.
## Exporting flows
This brings one problem, what happens when someone exports a flow ? We propose the addition of a checkbox in the flow export dialog named `Embed external files` that would embed the external file contents within the exported flow making sharing of that flow possible.