Skip to content

Comments

docs: clarify custom message handling#7048

Merged
chenjiahan merged 1 commit intomainfrom
custom_msg_doc_0126
Jan 26, 2026
Merged

docs: clarify custom message handling#7048
chenjiahan merged 1 commit intomainfrom
custom_msg_doc_0126

Conversation

@chenjiahan
Copy link
Member

Summary

Expanded the explanation that Rsbuild extends the on() method on Rspack’s import.meta.webpackHot.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 26, 2026 05:46
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chenjiahan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the clarity and detail of the documentation related to custom message handling within the Rsbuild development server API. The changes provide a more precise understanding of how to send custom messages using the custom type and offer a more comprehensive explanation of Rsbuild's integration with and extension of Rspack's Hot Module Replacement (HMR) API for listening to these events on the client side. These updates aim to make the documentation more informative and easier to follow for developers.

Highlights

  • Documentation Clarity: The documentation for custom message handling in Rsbuild's dev server API has been enhanced for better clarity, specifically detailing the use of the custom type when sending messages.
  • HMR API Extension Explanation: The explanation of how Rsbuild extends Rspack's import.meta.webpackHot.on() method for client-side custom event handling has been expanded, including a direct link to the relevant Rspack documentation for more context.
  • Code Block Title Correction: Minor corrections were made to code block titles in the Chinese documentation, changing 'server' to 'server.js' and 'client' to 'client.js' for consistency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages
Copy link

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

Latest commit: b927b69
Status: ✅  Deploy successful!
Preview URL: https://aa0dbefe.rsbuild-v2.pages.dev
Branch Preview URL: https://custom-msg-doc-0126.rsbuild-v2.pages.dev

View logs

Copy link
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 provides a helpful clarification to the documentation on custom message handling for the dev server API. The changes in both the English and Chinese documents explain that Rsbuild extends the on() method of import.meta.webpackHot, which is a valuable piece of information for users. The addition of via custom type and the consistency fix for code block titles in the Chinese document are also good improvements. Overall, these changes make the documentation clearer and more accurate. Well done.

Copy link
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 improves the documentation for custom message handling in the dev server API by clarifying that Rsbuild extends Rspack's native HMR API.

Changes:

  • Enhanced explanation that Rsbuild extends the on() method on Rspack's import.meta.webpackHot object
  • Added reference link to Rspack's HMR documentation
  • Added descriptive titles to code blocks for better context

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/en/api/javascript-api/dev-server-api.mdx Updated English documentation to clarify custom message handling with improved descriptions and code block titles
website/docs/zh/api/javascript-api/dev-server-api.mdx Updated Chinese documentation to match English version with equivalent clarifications and improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit 09d465f into main Jan 26, 2026
13 checks passed
@chenjiahan chenjiahan deleted the custom_msg_doc_0126 branch January 26, 2026 05:52
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.

1 participant