-
Notifications
You must be signed in to change notification settings - Fork 0
Design: Palette Management UI
Target: 0.15
The runtime admin api provides methods for managing the nodes in the runtime. Add/Remove (by npm module name) and Enable/Disable (at the module and node-set level).
We need to add a suitable UI component to the editor that allows the user to manage their palette.
It needs to provide the following capabilities:
- See what nodes are currently installed - and the module that provides them
- Enable/Disable any of those nodes - bearing in mind the granuality of enable/disable is the nodeset
- Uninstall any of those nodes - at the module level
- Browse a catalog of available nodes and install any of them
- Allow custom catalogs to be provided - via
settings.js- either in addition to, or in replacement of the default catalog - ??? Allow the user to provide a custom catalog url in the editor and then browse its catalog
Secondary considerations
- modify node loading lifecycle so it only loads 'active' nodes - to maximise memory saving
How a catalog advertises what is available.
Two high-level approaches:
-
catalog url points to a json file that provides the content of the catalog. Returns complete catalog every time. The use of ETags on the request/response can be used to prevent unnecessary transfers. All searching etc is then done on the client side. GitHub pages (now) enables CORS, so we could easily host the file via github.
-
catalog url points to a REST api that can be used to list/pagenate results and do search on the server side.
The former approach is the one taken by the Arduino library ecosystem. It just requires hosting a file (that can be generated via whatever means necessary). The latter is what npm does and would potentially put a much higher dependency and load on flows.nodered.org.
I'm inclined to stick with option 1 - but would welcome feedback.
The actual structure of the file is tbd - but must include, for each node:
- name
- description (short - not full readme)
- version
- license (?)
- ...
How the user manages their palette. Three distinct views:
- enable/disable/remove what they currently have
- browse and install available nodes
- configure the available catalogs (could be hardcoded in
settings.jsfor initial version)
Most pieces should already be in place. Need to review whether there should be a hook into storage to deal with add/remove nodes; so it could maintain a package.json file for the user.