New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Third Party Widget Support #351
Conversation
vite preview doesn't really apply, default action is to build while watching and access via node-red
Should always be using scoped to prevent leak across components
Tests are broken, I believe due to unrelated changes, but handling back to @joepavitt for any finishing toushes. |
FYI @bartbutenaers and @jtalbourdet just getting this on your radar as I know you're both actively looking at third-party widget support. This will be an overhaul of the way we integrate (apologies its come so quickly after the first pass), but given the feedback we had in #307 felt it was required. This new approach will utilise With this, you can define any number of Vue Components, dependencies, etc. and it will all get packaged up. You will also be able to write full vue components as you should be able to, and will be consistent with core. A few use cases I still need to iron up:
I will then be getting documentation fully up to date, including the updated |
Example updates to reflect all (I think) cases of customisation/integration that would be required. This also shows 2 x instances of the same third-party widget being deployed to show that they stay separated from each other. The custom event wasn't shown as it was just console logging something in the Node-RED terminal, but is fully functional. Screen.Recording.2023-11-17.at.18.46.10.movOnly outstanding item remains to be accessing the Dashboard datastore from within the |
This is all now fully functional - just need to update the documentation |
Description
Adds support for third party widgets with full Vue support in NR dashboard as per the example widget implemented in FlowFuse/node-red-dashboard-2-ui-example#3.
This works by loading the third party Vue components over HTTP and using UMD to bind those components to
window
, as well are using the same instance of vue in both places (viawindow.Vue
)In practice that looks like this*:
*Where all of the visible widgets were in fact loaded over HTTP and not in the main bundle
The documentation will need to be updated to reflect this new way to build third party nodes and their corresponding widgets, developers should follow the example (and Vite config) in https://github.com/FlowFuse/node-red-dashboard-example-node to get started.
Related Issue(s)
For #307
Pairs with: FlowFuse/node-red-dashboard-2-ui-example#3
Follow up to: #336
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
backport
labelarea:migration
label