Hi all, this topic stems from An idea for third-party UI in ui-builder - #5 by jackcarey. It is intended to garner some ideas about how the development of good quality custom nodes could be eased and simplified for everyone.
Some opening "issues" that might be good to try and deal with:
-
Writing the edit panel for a node requires:
- A (relatively) complex mix of two different parts of HTML (or HTML and Markdown) and JavaScript. This makes it very hard to manage as the node gets more complex. It also makes it hard to lint correctly - especially since the HTML for the Editor is in the same folder as the JavaScript for the runtime.
- A lot of boilerplate HTML (often 4 or more lines per input field.
- Long element ID references that can be confusing to read and write.
- More complex nodes can require a lot of boilerplate Javascript code and a reasonable understanding of the complex processing that Node-RED does.
- Typed input fields require a lot of boilerplate JavaScript code
-
Writing the runtime for a node requires:
- A good understanding of the complex interactions between different parts of the runtime code. What does what and when and what objects exist at different parts of the process.
I've some thoughts about how we might be able to improve some of these issues but I would like to see if others have thought of things I've missed and start to get different ideas into 1 place.
Please note that I don't believe all of the possible improvements would necessarily need to be part of core, though that might be a desired eventual outcome. Some of what I'm thinking about could certainly be offered up as stand-alone enhancements for developers to use.
Anyway, time for tea (or dinner if you are that way inclined!) so I'll come back to this later. Happy to include further issues into the above list so that we have them in 1 place.