I’m already getting question about this, so here’s some more info on top of what’s in the docs. To use a JS framework like React or Svelte, you first need to export a basic plugin. This will create the plugin binary, and the self-contained folder where the web front-end will be served from. By default, it will export the files needed to run a native Cabbage interface. The file structure looks like this:
The only file you really need is the cabbage.js file which includes functions that allow you to pass events to your plugin from the web interface. If you want to receive data from your plugin check out the event handler in main.js. A ‘widgetUpdate’ event message will be sent to the UI whenever a widget is updated through a call to the cabbageSet opcode. So you can basically remove all of these files and replace them with your own. The index.html will be served inside the plugin window and hey presto, custom interface.
This is all somewhat theoretical as I’ve yet to try it myself. If anyone wants to give it a go (I’m looking at you @hdale94!) please do and let me know how it goes. It may need some tweaking to get it to work.