I have this idea burning a hole in my head, and since I've no time to work on it I need to write it up so I can focus on other things.
I'll walk through my thinking in bullet-points:
In essence, Node-RED is just a way of structuring Node.js into flows which are more natural to think about. I assume everyone here thinks this is an improvement over weaving function calls through a giant wall of text
Front-end javascript suffers from this same problem, so why not use the same solution?
Now, if I were you I would be rolling my eyes at this point but hear me out:
I'm not suggesting to run Node-RED fully in the browser, that is nonsense totally feasible, RE: PageNodes, lol.
What if you were to dream up a set of nodes that have meaning in the browser context (http request, button clicks, html appends, cookies, etc...) and made "hollow" / logic-less nodes for these purposes, just so you can architect it out in NR.
Then, what if you had a script that interpreted the flows.json file in the browser context and executed the flow as it would be intended in the browser.
Very interesting, I didn't realize some of this was even possible (mqtt, bluetooth, midi, all in-browser very impressive)
Unfortunately not quite what I was looking for.
I'm thinking of something where you want to design logic for an html application (think something like a TiddlyWiki for example), but instead of writing thousands of lines of javascript you want to write it in flows.
I imagine the only Node-RED asset you would use in this application is the flows.json file, then a magical all-knowing script reads this as JSON and says "aha, I know what these nodes mean, I can see how they're connected, I have control of your HTML, let's do it!" and ta-da, you have programmed arbitrary front-end logic using NR.
I've actually not much doubt that a simplified Node-RED runtime COULD run in the browser. It would play nicely with the discussion about a future Dashboard.
All it takes is someone with the knowledge and the time to make it happen
Well congratulations, Matthew -- now you have managed to "infect" my brain with this hole-in-the-head-burning train of thought... especially with the idea of incorporating a TiddlyWiki non-linear single-page app page flow! I had forgotten how much I enjoyed generating TiddlyWiki pages from database queries -- so it's a reasonable next step to just build it from flows.json data, right?
Darn you... now I'll never get any of my paid work done! *sigh
I guess I'll sleep in the afterlife...
If you take a look at the source code of app.html, you can see there is no connection to a node-red server, only the flows.json which is embedded into the page: