Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

  • Fix devServer.hot: false not work when using Rspack CLI, the normalizeHotOption method should not return true by default.
  • Add test cases for disabling HMR functionality

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 21, 2025 08:16
@chenjiahan chenjiahan requested a review from hardfist as a code owner November 21, 2025 08:16
@netlify
Copy link

netlify bot commented Nov 21, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit e864405
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69201ff669c66100088ec2ab

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: bug fix release: bug related release(mr only) labels Nov 21, 2025
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 fixes a bug where setting devServer.hot: false in the configuration was ignored when using Rspack CLI. The fix ensures that the normalizeHotOption function properly respects the user's configuration instead of defaulting to true.

Key changes:

  • Modified normalizeHotOption to return the value as-is if it's not a string, preventing unwanted defaults
  • Extracted default hot value to a constant (DEFAULT_SERVER_HOT) for better maintainability
  • Added comprehensive test coverage for the disable HMR functionality

Reviewed Changes

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

Show a summary per file
File Description
packages/rspack-cli/src/commands/serve.ts Fixed normalizeHotOption logic to properly handle false values; refactored code for better readability with renamed variables and removed empty lines
packages/rspack-cli/src/constants.ts Added DEFAULT_SERVER_HOT constant to centralize the default hot value
packages/rspack-cli/tests/serve/disable-hot/serve-flags.test.ts Added new test to verify that HMR can be disabled via devServer.hot: false
packages/rspack-cli/tests/serve/disable-hot/rspack.config.js Configuration file for the disable-hot test case
packages/rspack-cli/tests/serve/disable-hot/src/index.js Sample entry file for the disable-hot test case
packages/rspack-cli/tests/serve/flags/serve-flags.test.ts Changed it.concurrent to test for consistency (note: should be reverted)
packages/rspack-cli/tests/serve/flags/rspack.config.js Refactored onListening from function expression to method shorthand

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing e864405 to feat: support SRI with experiments.css and CssExtractRspackPlugin (#12239) by harpsealjs

🙈 Size remains the same at 47.63MB

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 21, 2025

CodSpeed Performance Report

Merging #12261 will not alter performance

Comparing disable_hot_1121 (e864405) with main (5322cc8)

Summary

✅ 17 untouched

@chenjiahan chenjiahan enabled auto-merge (squash) November 21, 2025 09:02
@chenjiahan chenjiahan merged commit 5c09e49 into main Nov 21, 2025
80 of 82 checks passed
@chenjiahan chenjiahan deleted the disable_hot_1121 branch November 21, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: devServer.hot: false doesn't disable HMR

3 participants