Skip to content

Update handleHotUpdate example to use server.hot API #21317

@ZaidQtaish

Description

@ZaidQtaish

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

ThehandleHotUpdate code example in the Plugin API guide currently uses server.ws.send. Since Vite 5.1+, server.ws has been deprecated in favor of the server.hot API.

Updating this snippet ensures that users are following modern HMR (Hot Module Replacement) practices and helps avoid confusion regarding which communication API to use.

Your Suggestion for Changes

Update the code snippet under the handleHotUpdate section to use server.hot.send

Reproduction

N/A (Documentation issue)

Steps to reproduce

Visit the Vite Plugin API documentation.

Observe that the handleHotUpdate example still uses the server.ws property.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions