Skip to content

fix: should handle name convention of css compose#12202

Merged
LingyuCoder merged 2 commits intomainfrom
fix/css-compose-convention
Nov 18, 2025
Merged

fix: should handle name convention of css compose#12202
LingyuCoder merged 2 commits intomainfrom
fix/css-compose-convention

Conversation

@LingyuCoder
Copy link
Copy Markdown
Contributor

Summary

fix #11854

Related links

Checklist

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

Copilot AI review requested due to automatic review settings November 14, 2025 08:21
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 14, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 14, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit b784065
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6916e67b31c9580009ce72fe

Copy link
Copy Markdown
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 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 composes declarations
  • Added a test case to verify CSS module compose works correctly with naming conventions
  • Enabled the clean/ignore-hook test by removing its filter and refactoring it to use the cleaner clean.keep configuration 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.

@LingyuCoder LingyuCoder requested a review from JSerFeng November 14, 2025 08:26
@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing b784065 to refactor: split module_graph into ModuleGraphRef and ModuleGraphMut (#12199) by hardfist

❌ Size increased by 1.75KB from 47.45MB to 47.46MB (⬆️0.00%)

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Nov 14, 2025

CodSpeed Performance Report

Merging #12202 will not alter performance

Comparing fix/css-compose-convention (b784065) with main (711cb55)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder enabled auto-merge (squash) November 18, 2025 05:28
@LingyuCoder LingyuCoder merged commit b96b353 into main Nov 18, 2025
77 of 79 checks passed
@LingyuCoder LingyuCoder deleted the fix/css-compose-convention branch November 18, 2025 05:31
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]: native css modules composes feature doesn't work with exportsConvention: 'camel-case'

3 participants