Build shiny app using node?

If you're still interested in using Shiny-

Something simple but effective could be to use a file watcher that automatically rebuilds your Javascript bundle and outputs it somewhere. Then you could refresh the page to see new UI changes, or use Shiny's autoreload feature if the bundle is in the app directory.

Getting hot reloading to work on React app changes would be much trickier, but I think it's possible. You would have to run a separate development server that serves and hot reloads the UI, and proxies everything else (including WebSocket requests) to Shiny.

Here's an example project where I've set this up using webpack-dev-server:

For development, the Shiny app runs with live reloading on server-side changes, while Webpack dev server runs with hot reloading on React app changes (see the Shiny app config and Webpack dev server config).

Hot reloading has some quirks so you still need a full refresh sometimes, but I think this allows for really quick iteration on both the server and UI.

5 Likes