fix: should handle name convention of css compose#12202
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the handling of CSS export naming conventions when using the composes feature in CSS modules. The main issue was that when applying naming conventions (like camel-case) to CSS class names, the compose functionality wasn't properly applying the same convention to both the composed class and the target class.
Key Changes:
- Modified the CSS parser to apply naming conventions to both source and target classes in
composesdeclarations - Added a test case to verify CSS module compose works correctly with naming conventions
- Enabled the
clean/ignore-hooktest by removing its filter and refactoring it to use the cleanerclean.keepconfiguration API
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_plugin_css/src/parser_and_generator/mod.rs |
Updated compose handling to apply naming conventions to both the class being composed and the target class using export_locals_convention |
tests/rspack-test/configCases/css/convention-compose/test.config.js |
Test configuration that disables test execution (build-only test) |
tests/rspack-test/configCases/css/convention-compose/style.module.css |
CSS module file demonstrating compose with kebab-case class names |
tests/rspack-test/configCases/css/convention-compose/rspack.config.js |
Test configuration that validates both kebab-case and camelCase exports work with compose |
tests/rspack-test/configCases/css/convention-compose/index.js |
Entry point that exports the CSS module (contains a naming conflict bug) |
tests/rspack-test/configCases/clean/ignore-hook/test.filter.js |
Removed to enable the previously disabled test |
tests/rspack-test/configCases/clean/ignore-hook/rspack.config.js |
Refactored to use clean.keep configuration instead of hook-based API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Binary Size-limit
❌ Size increased by 1.75KB from 47.45MB to 47.46MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12202 will not alter performanceComparing Summary
|
Summary
fix #11854
Related links
Checklist