When playing around with the app, I saw some vite dev server behavior I wasn't sure on and then the logs (somewhat lacking) made it more confusing to me. I wasn't sure if we had tried to re-boot it, or what. I also didn't see anything about it shutting down. Then I noticed some websocket events were firing multiple times.
This PR:
Removes the duplicated websocket events
Fixes a bug where we are replying to a specific connection rather than broadcasting during the lifetime of a running preview server. This has a couple issues:
That connection may no longer exist (e.g., user refreshes page)
This would only forward output to one client. If I have multiple tabs open, I wouldn't see the output in the other tab(s).
Adds consistent logging for the preview server states (booting, running, stopping)
Cleans the logs. Adds a "srcbook" source to differentiate from vite or other output.
Initial boot
Stopped the server which caused it to auto-restart
When playing around with the app, I saw some vite dev server behavior I wasn't sure on and then the logs (somewhat lacking) made it more confusing to me. I wasn't sure if we had tried to re-boot it, or what. I also didn't see anything about it shutting down. Then I noticed some websocket events were firing multiple times.
This PR:
Initial boot
Stopped the server which caused it to auto-restart