Customization/Developer mode on Nodes #51
Replies: 1 comment 3 replies
-
Hi @hgill , we prefer suggestions to be discussed in the forum or slack first. This discussion list is for items we're already working on or being considered. I'm not convinced this is addressing an problem that justifies the amount of work needed to realise it. I could see having a specific custom node type that lets you edit more of its fundamental code via the editor might be interesting. That could then be exported as a set of 'real' node files. Although the Function node does let you do most of that today (just not the export as .js/.html bit). I also don't see how this would work for existing node types - unless you mean it would expose the existing source code? Even then, given all the different ways a node could be written, I don't see how this would be practical to do. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Team
I have a design suggestion which may help make contrib node development faster. I've developed 1 and customized 2 node-red-contrib nodes so far, the experience is good and structured but I wish there was a way to make changes without needing to redeploy all of node-red.
Apart from actually registering a new node in the palette using RED.nodes.registerType, perhaps much of other code dev happens to be about on-init, on-input or on-close blocks.
Design Idea: Have a toggle button on nodes, called "Customize" or "Developer Mode" button similar to and next to Enabled/Disabled button, but this one will be disabled by default.
Working: I could think of 2 ways to implement this. Essentially, when you enable this mode,
In the first approach, node-red server won't have to be restarted as the customize event can be called on node init rather than node registration. So, changes should work after re-deploying the current flow, and should functionally not be any different from changing a config param.
In the second approach, even the node won't have to be restarted, and minor customizations can potentially be done without changing node code or registering completely new node types, etc.
Use cases:
Caveat:
One would of course have to understand the original node's source code to know what to change, as completely overriding functionality is a useless capability - it's of course much better to create new nodes. Also, I haven't tested if this method works, and there may be more elegant ways to customize node functionalities.
Beta Was this translation helpful? Give feedback.
All reactions