Open TomokiMiyauci opened 2 months ago
Apart from the HMR API, the WebSocket esm-hmr protocol should also be clearly specified.
esm-hmr
As an example, GraphQL over WebSocket protocol specification is helpful.
According to this, and based on the current implementation, it is as follows:
hotAccept
Direction: Client -> Server
interface HotAcceptMessage { type: "hotAccept"; id: string; }
reload
Direction: Server -> Client
interface ReloadMessage { type: "reload"; }
update
interface UpdateMessage { type: "update"; url: string; }
You may want to unify the id and url fields.
id
url
Apart from the HMR API, the WebSocket
esm-hmr
protocol should also be clearly specified.As an example, GraphQL over WebSocket protocol specification is helpful.
According to this, and based on the current implementation, it is as follows:
Message Types
hotAccept
Direction: Client -> Server
reload
Direction: Server -> Client
update
Direction: Server -> Client
You may want to unify the
id
andurl
fields.