fix(core): preserve options when restarting#8161
Conversation
📝 WalkthroughWalkthroughRestart contexts now include the options used by the triggering build or development-server operation. Core restart handling preserves these options and adds watched file paths, while CLI restart execution reuses them. The 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@website/docs/en/shared/onRestart.mdx`:
- Line 34: Update the options description in
website/docs/en/shared/onRestart.mdx at line 34 to mention
rsbuild.createDevServer() alongside rsbuild.startDevServer(), clarifying that
only StartDevServerOptions-compatible fields are exposed; apply the equivalent
clarification in website/docs/zh/shared/onRestart.mdx at line 34.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7e62ff10-95b6-4a81-be6c-4ba4aec2b809
📒 Files selected for processing (16)
e2e/cases/javascript-api/dev-server-restart/index.test.tse2e/cases/javascript-api/restart-option/index.test.tse2e/cases/javascript-api/restart-preserve-options/index.test.tse2e/cases/javascript-api/restart-preserve-options/src/index.jse2e/cases/javascript-api/restart-watch-files/index.test.tspackages/core/src/build.tspackages/core/src/cli/init.tspackages/core/src/createRsbuild.tspackages/core/src/restart.tspackages/core/src/server/devServer.tspackages/core/src/types/hooks.tspackages/core/tests/restartHook.test.tswebsite/docs/en/api/javascript-api/core.mdxwebsite/docs/en/shared/onRestart.mdxwebsite/docs/zh/api/javascript-api/core.mdxwebsite/docs/zh/shared/onRestart.mdx
Summary
JavaScript API restarts previously fell back to the default
build()orstartDevServer()options. This PR snapshots the original options, exposes them through the action-specificRestartContext, and reuses them when the CLI restarts the task. It also updates the related documentation and regression coverage.