Skip to content

docs: clarify hot.send and sockWrite API docs#7477

Merged
chenjiahan merged 2 commits intomainfrom
chenjiahan/docs-javascript-api-clarify
Apr 10, 2026
Merged

docs: clarify hot.send and sockWrite API docs#7477
chenjiahan merged 2 commits intomainfrom
chenjiahan/docs-javascript-api-clarify

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

This PR clarifies the recommended JavaScript API for sending HMR messages. It moves the detailed hot.send documentation to the Environment API page, renames the exposed type to HotSend, and updates the sockWrite docs to point readers to the new recommended API.

Related Links

Copilot AI review requested due to automatic review settings April 10, 2026 07:18
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 10, 2026

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread website/docs/zh/api/javascript-api/server-api.mdx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SockWrite to HotSend.
  • Move detailed full-reload / custom message documentation under hot.send in the Environment API docs.
  • Replace detailed sockWrite docs with a tip pointing readers to hot.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.

Comment thread website/docs/en/api/javascript-api/environment-api.mdx
Comment thread website/docs/zh/api/javascript-api/environment-api.mdx
Comment thread website/docs/zh/api/javascript-api/server-api.mdx Outdated
@chenjiahan chenjiahan merged commit 68ab08b into main Apr 10, 2026
6 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/docs-javascript-api-clarify branch April 10, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants