Skip to content

docs: correct compiler and server references#7662

Merged
chenjiahan merged 3 commits into
mainfrom
chenjiahan/docs-correct-compiler-references
May 17, 2026
Merged

docs: correct compiler and server references#7662
chenjiahan merged 3 commits into
mainfrom
chenjiahan/docs-correct-compiler-references

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

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.https certificate options to Node.js http2.createSecureServer, and uses consistent middleware wording in the server setup docs.

Copilot AI review requested due to automatic review settings May 17, 2026 05:27
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/core/src/types/plugin.ts Outdated
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 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.

Comment thread packages/core/src/types/plugin.ts Outdated
Comment thread website/docs/en/config/server/https.mdx
Comment thread website/docs/zh/config/server/https.mdx
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 17, 2026

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

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

View logs

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 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 / onAfterCreateCompiler refer to the Rspack Compiler lifecycle.
  • Updates server.https docs to reference http2.createSecureServer (HTTP/2) instead of https.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 onBeforeCreateCompiler JSDoc still says the hook is triggered after the compiler has been created, which contradicts the hook name and the actual call site (it runs before rspack(...) is invoked in createCompiler). 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.

Comment thread website/docs/en/shared/onAfterCreateCompiler.mdx Outdated
Comment thread website/docs/en/config/server/https.mdx
Comment thread website/docs/zh/config/server/https.mdx
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 17, 2026 13:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread website/docs/en/shared/onAfterCreateCompiler.mdx
@chenjiahan chenjiahan merged commit 4ae6073 into main May 17, 2026
6 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/docs-correct-compiler-references branch May 17, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants