mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Page:
Design: Function Library node
Pages
API Reference
Architecture Overview
Architecture: Cluster Multi Process
Contribution Process
Dashboard layout tool
Definitions
Deprecated: Message properties overriding set node properties
Design Notes
Design: dynamic palette
Design: API Token management
Design: CLI tool to produce a node skeleton
Design: Concurrent editing
Design: Custom Node admin route handling
Design: Dynamic MQTT node
Design: Dynamic node's icon
Design: Editable port labels
Design: Editor Events
Design: Editor Themes
Design: Editor UI Customisation
Design: Encryption of credentials
Design: Enhancements to Split Join nodes
Design: Flow Linter
Design: Flow Manipulation API
Design: Flow file format v2
Design: Function Library node
Design: Library Sidebar
Design: Logging Framework
Design: Node Generator
Design: Node Messaging API
Design: Node blacklist whitelist function
Design: Node module lifecycle
Design: Node settings
Design: Palette Management UI
Design: Persistable Context
Design: Platform Specific Nodes
Design: Projects
Design: Runnable Project
Design: Runtime Editor Split
Design: Runtime Events
Design: Runtime extension points
Design: Subflow Enhancements
Design: Subflow Instance properties
Design: Subflow Node modules
Design: Usage telemetry
Design: Using environment variables
Design: Version Control
Design: adminAuth User Management
Design: external file for function and templates nodes
Design: i18n de
Design: i18n
Design: msg.parts description of usage
Design: multiuser
Design: subflows vNext
Design: subflows
Design:Shared Global Context
Editor Mouse Actions
Editor Runtime API
Flow Format
Flow testing
Home
Input node feature definitions
Live runtime information
Node Design Guidelines
Node documentation guide
Node msg Conventions
Output node feature definitions
Pluggable Message Routing
Query node feature definitions
ReadMe Raspberry Pi Advanced
Runtime Editor Comms protocol
Technical Interchange 2018 04 13
Technical Interchange Meetings
Testing
UI testing
Watch node feature definitions
Web Nodes outline
adminAuth Credential Authentication
dynamic palette
join in auto mode
npm installable nodes
0
Design: Function Library node
Nick O'Leary edited this page 2018-08-29 00:18:28 +01:00
This is a work in progress. Do not start implementing anything without discussing with @knolleary first
We have seen a growing number of users who are inserting JavaScript into global context so it can be readily reused amongst the Function nodes in a flow. This is not a great developer experience and something we could improve.
The basic concept of this feature is to introduce a new Function Library configuration node (from here on referred to as func-lib
to save typing... not necessarily the final name) This would be a node that can hold common code accessible to regular Function nodes.
Some initial thoughts:
- each func-lib node contains some code. It should be structured as a node module - so it declares the functions/members it exports. It has a mandatory name field.
- a function node can then
require
the module by its name - just as you would in node.js code. Whether this is done by introducing therequire
keyword needs thinking about. Maybe something likenode.require()
to reduce confusion over the top-levelrequire
. - this will mean the function has an implicit dependency on the func-lib config node - not an explicit dependency (unless we try to code-parse to spot the require statements). All of the func-lib config nodes will then appear as unused and trigger the associated warnings on deploy. This feature could introduce a new flag on config nodes that identifies them as 'userless' - that it is okay to not have any nodes explicitly depend on it.
- however, not knowing the explicit dependency will mean exporting the function node won't include the func-lib nodes it needs... so maybe the function node does need to have someone to declare its dependencies...
- the expanded JS editor introduced in 0.19 could be extended to a more useful IDE; with a list of all Function and func-lib nodes that can be used to quickly switch between them whilst editing. This would remove the need to close the dialog of one Function node and open another - reducing the disruption when trying edit multiple function nodes together.