Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification of the WebSocket esm-hmr protocol #29

Open
TomokiMiyauci opened this issue Jun 25, 2024 · 0 comments
Open

Specification of the WebSocket esm-hmr protocol #29

TomokiMiyauci opened this issue Jun 25, 2024 · 0 comments

Comments

@TomokiMiyauci
Copy link

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

interface HotAcceptMessage {
  type: "hotAccept";
  id: string;
}

reload

Direction: Server -> Client

interface ReloadMessage {
  type: "reload";
}

update

Direction: Server -> Client

interface UpdateMessage {
  type: "update";
  url: string;
}

You may want to unify the id and url fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant