feat(core): support inspector mode for worker pool#919
Conversation
Summary of ChangesHello @fi3ework, 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 introduces significant improvements to the debugging experience for worker pools within the Rsbuild core. By extending the Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request enhances debugging support for worker pools by allowing the inspector to be enabled for workers. The changes involve updating pluginInspect to check for --inspect flags in pool.execArgv and passing these arguments from the Rsbuild preparation step. The implementation is clean and achieves the goal. I have one minor suggestion to improve code clarity by removing an unnecessary optional chaining operator, aligning the code more closely with the existing type definitions.
There was a problem hiding this comment.
Pull request overview
This PR extends the inspect/debugging support so that tests running in a worker pool can benefit from the same inspector-friendly bundler configuration as single-process runs.
Changes:
- Extend
prepareRsbuildto readnormalizedConfig.pooland passpool.execArgvinto the inspect plugin. - Enhance
pluginInspectto accept optionalpoolExecArgvand enable itself when either the current process is being inspected or the worker pool execArgv contains--inspectflags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/core/src/core/rsbuild.ts | Wires normalizedConfig.pool.execArgv into pluginInspect so the Rsbuild config reflects worker pool inspect flags. |
| packages/core/src/core/plugins/inspect.ts | Updates the inspect plugin to detect inspect mode from both inspector.url() and poolExecArgv, enabling better debugging for pool-based workers. |
💡 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>
1bee6ec to
0bacd8f
Compare
Summary
pluginInspectto detect--inspectflags inpool.execArgvpool.execArgvtopluginInspectduring Rsbuild preparationRelated Links
Checklist