feat: keep dev server alive during HMR updates
This commit is contained in:
1 parent
cf4c3723c5
commit
577c38a965
62 files changed
+281
-169
No files matched your search
@@ -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