feat: keep dev server alive during HMR updates
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
* { type: "css" } -> the browser hot-swaps the stylesheet (no reload)
|
||||
* { type: "reload" } -> the browser asks for fresh HTML over the HMR socket
|
||||
*
|
||||
* Server-logic changes (pages/api/middleware/realtime) are NOT broadcast here:
|
||||
* they require a fresh process, so the child exits and the supervisor respawns
|
||||
* it. The browser then reconnects and performs a soft DOM morph automatically.
|
||||
* Page/component/API/middleware/realtime changes invalidate their modules and
|
||||
* broadcast `reload` without closing the server or WebSocket. The browser asks
|
||||
* the same process for fresh HTML and performs a soft DOM morph.
|
||||
*/
|
||||
|
||||
export type HmrMessage = { type: "css"; version: number } | { type: "reload"; version: number };
|
||||
|
||||
Reference in New Issue
Block a user