docs: correct compiler and server references#7662
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1ee57888f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Code Review
This pull request updates documentation and type definitions to clarify the use of the Rspack compiler and the Node.js http2 module for HTTPS. Feedback was provided to correct the timing description of the onBeforeCreateCompiler hook in the type definitions to ensure consistency with the documentation. Additionally, incorrect URL anchors in the links to the external Node.js documentation were identified for correction.
Deploying rsbuild with
|
| Latest commit: |
36fab0b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://93ed6b29.rsbuild-v2.pages.dev |
| Branch Preview URL: | https://chenjiahan-docs-correct-comp.rsbuild-v2.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR refines Rsbuild documentation and API comments to more precisely describe compiler/server behavior (Rspack Compiler hooks, HTTPS server implementation, and middleware terminology).
Changes:
- Clarifies that
onBeforeCreateCompiler/onAfterCreateCompilerrefer to the Rspack Compiler lifecycle. - Updates
server.httpsdocs to referencehttp2.createSecureServer(HTTP/2) instead ofhttps.createServer. - Aligns server setup docs wording around default middleware registration timing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/shared/onBeforeCreateCompiler.mdx | Clarifies hook timing before creating the Rspack Compiler (Chinese docs). |
| website/docs/zh/shared/onAfterCreateCompiler.mdx | Clarifies hook timing after creating the Rspack Compiler (Chinese docs). |
| website/docs/zh/config/server/https.mdx | Updates HTTPS certificate docs to reference http2.createSecureServer (Chinese docs). |
| website/docs/en/shared/onBeforeCreateCompiler.mdx | Fixes hook description to “before Rspack Compiler is created” (English docs). |
| website/docs/en/shared/onAfterCreateCompiler.mdx | Updates wording around the Rspack Compiler creation phase (English docs). |
| website/docs/en/config/server/setup.mdx | Makes middleware execution-order wording consistent (“default Rsbuild middlewares”). |
| website/docs/en/config/server/https.mdx | Updates HTTPS certificate docs to reference http2.createSecureServer (English docs). |
| packages/core/src/types/plugin.ts | Adjusts JSDoc comments for compiler-related hooks in the public plugin API typings. |
Comments suppressed due to low confidence (1)
packages/core/src/types/plugin.ts:621
- The
onBeforeCreateCompilerJSDoc still says the hook is triggered after the compiler has been created, which contradicts the hook name and the actual call site (it runs beforerspack(...)is invoked increateCompiler). Please update the description to state it runs before the Rspack Compiler instance is created.
* A callback function that is triggered after the Rspack Compiler instance has been
* created, but before the build process begins. This hook is called when you
* run `rsbuild.startDevServer`, `rsbuild.build`, or `rsbuild.createCompiler`.
*/
onBeforeCreateCompiler: PluginHook<OnBeforeCreateCompilerFn>;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
This PR corrects docs and API comments where compiler and server APIs were described imprecisely. It clarifies that compiler hooks use the Rspack Compiler instance, points
server.httpscertificate options to Node.jshttp2.createSecureServer, and uses consistent middleware wording in the server setup docs.