Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Dec 23, 2025

Summary

relate to web-infra-dev/rslib#1401

This PR refactors the case-sensitive checking logic by extracting it from the compiler core into a dedicated plugin. The has been renamed to and now handles both module and asset case-sensitive checks in a unified way.

The main changes include:

  • Renamed to for better clarity
  • Moved case-sensitive asset check logic from compiler to plugin
  • Plugin now handles both module case-sensitive warnings (in hook) and asset case-sensitive warnings (in hook)
  • Updated test cases to use the new plugin API

This refactoring improves code organization by separating concerns and makes the case-sensitive checking functionality more modular and easier to maintain.

Checklist

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

- Rename WarnCaseSensitiveModulesPlugin to CaseSensitivePlugin
- Move case-sensitive asset check from compiler to plugin
- Plugin now handles both module and asset case-sensitive checks
- Update test cases to use new plugin
Copilot AI review requested due to automatic review settings December 23, 2025 06:49
@netlify
Copy link

netlify bot commented Dec 23, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 990f6b3
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/694a551d7195810008470cfc
😎 Deploy Preview https://deploy-preview-12532--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Dec 23, 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 refactors the case-sensitive checking logic by extracting it from the compiler core into a dedicated plugin. The WarnCaseSensitiveModulesPlugin has been renamed to CaseSensitivePlugin and now handles both module and asset case-sensitive checks in a unified way.

  • Renamed plugin from WarnCaseSensitiveModulesPlugin to CaseSensitivePlugin with backward compatibility alias
  • Moved asset case-sensitive check logic from compiler's emit_assets method to the plugin's emit hook
  • Plugin now handles both module warnings (in compilation.seal hook) and asset warnings (in compiler.emit hook)

Reviewed changes

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

Show a summary per file
File Description
crates/rspack_plugin_case_sensitive/src/lib.rs Renamed struct, added CompilerEmit hook handler for asset checking, and new create_sensitive_assets_warning method
crates/rspack_plugin_case_sensitive/Cargo.toml Updated package name and description, added itertools dependency
crates/rspack_core/src/compiler/mod.rs Removed inline asset case-sensitive checking logic and related imports
crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs Updated plugin enum name and import references
crates/rspack_binding_api/Cargo.toml Updated dependency name from rspack_plugin_warn_sensitive_module to rspack_plugin_case_sensitive
crates/node_binding/napi-binding.d.ts Updated TypeScript type definition for enum value
Cargo.toml Updated workspace dependency name
Cargo.lock Reflected dependency name changes
packages/rspack/src/builtin-plugin/CaseSensitivePlugin.ts Renamed export from WarnCaseSensitiveModulesPlugin to CaseSensitivePlugin
packages/rspack/src/builtin-plugin/index.ts Updated export to reference new plugin file
packages/rspack/src/exports.ts Exported CaseSensitivePlugin with backward compatibility alias as WarnCaseSensitiveModulesPlugin
packages/rspack/etc/core.api.md Updated API documentation to reflect plugin rename and alias
tests/rspack-test/errorCases/error-case-sensitive.js Updated diagnostic code in test expectation from "Sensitive Modules Warn" to "Sensitive Warn"
tests/rspack-test/configCases/errors/case-emit/rspack.config.js Added test configuration that explicitly uses CaseSensitivePlugin
tests/rspack-test/configCases/errors/case-emit/warnings.js Added test expectations for asset case-sensitive warnings
Comments suppressed due to low confidence (1)

crates/rspack_plugin_case_sensitive/src/lib.rs:143

  • The comment is outdated and incomplete. It only mentions case sensitive modules and the compilation.seal hook, but the plugin now also handles case sensitive assets in the compiler.emit hook. The comment should be updated to reflect both functionalities.

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2025

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 1 project with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 823.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB +474.0 B (0.0%)
📋 Detailed Reports (Click to expand)

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

📌 Baseline Commit: 769e045fc8 | PR: #12529

Metric Current Baseline Change
📊 Total Size 2.1 MB 2.1 MB +474.0 B (0.0%)
📄 JavaScript 2.0 MB 2.0 MB +474.0 B (0.0%)
🎨 CSS 83.0 KB 83.0 KB 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: ui-components Bundle Diff

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 23, 2025

📦 Binary Size-limit

Comparing 990f6b3 to fix: optimize CSS runtime requirements logic (#12529) by harpsealjs

❌ Size increased by 2.88KB from 47.87MB to 47.87MB (⬆️0.01%)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 23, 2025

CodSpeed Performance Report

Merging #12532 will not alter performance

Comparing refactor/extract-case-sensitive-check-to-plugin (990f6b3) with main (769e045)

Summary

✅ 16 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@chenjiahan chenjiahan enabled auto-merge (squash) December 23, 2025 08:39
@chenjiahan chenjiahan merged commit 650a863 into main Dec 23, 2025
53 checks passed
@chenjiahan chenjiahan deleted the refactor/extract-case-sensitive-check-to-plugin branch December 23, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: refactor team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants