docs: clarify hot.send and sockWrite API docs#7477
Conversation
Deploying rsbuild with
|
| Latest commit: |
4743822
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://453ed9bf.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://chenjiahan-docs-javascript-a.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for the JavaScript API to reflect the transition from sockWrite to the recommended hot.send API for HMR messages. It renames the SockWrite type to HotSend and moves detailed usage examples for full-reload and custom events to the environment API section. Feedback was provided regarding the Chinese translation in the server API documentation to improve grammatical flow.
There was a problem hiding this comment.
Pull request overview
This PR updates the documentation to clarify that environment.hot.send is the recommended JavaScript API for sending HMR messages, and moves the detailed message contract docs from server.sockWrite to the Environment API page.
Changes:
- Rename the documented send type from
SockWritetoHotSend. - Move detailed
full-reload/custommessage documentation underhot.sendin the Environment API docs. - Replace detailed
sockWritedocs with a tip pointing readers tohot.send.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| website/docs/zh/api/javascript-api/server-api.mdx | Renames the documented send type and points sockWrite readers to hot.send (ZH). |
| website/docs/zh/api/javascript-api/environment-api.mdx | Adds detailed hot.send docs and updates the type name (ZH). |
| website/docs/en/api/javascript-api/server-api.mdx | Renames the documented send type and points sockWrite readers to hot.send (EN). |
| website/docs/en/api/javascript-api/environment-api.mdx | Adds detailed hot.send docs and updates the type name (EN). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR clarifies the recommended JavaScript API for sending HMR messages. It moves the detailed
hot.senddocumentation to the Environment API page, renames the exposed type toHotSend, and updates thesockWritedocs to point readers to the new recommended API.Related Links