Skip to content

fix: use match resource first when generating css local ident name#12040

Merged
LingyuCoder merged 1 commit intomainfrom
fix/match-resource-in-local-ident
Oct 30, 2025
Merged

fix: use match resource first when generating css local ident name#12040
LingyuCoder merged 1 commit intomainfrom
fix/match-resource-in-local-ident

Conversation

@LingyuCoder
Copy link
Contributor

Summary

  • should use match resource first when generating css local ident name
  • should not load css link if document is not exists
  • enable more test cases according behavior of rspack

Related links

Checklist

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

Copilot AI review requested due to automatic review settings October 30, 2025 08:10
@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 2ef6e53
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/69031d73ffe72a0008a82382

@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 Oct 30, 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 enables and fixes several previously disabled CSS-related test cases in rspack. The changes address issues with CSS loading, module path resolution, and test expectations to align with rspack's actual behavior.

Key changes:

  • Fixed CSS loading in universal (web + node) target environments by handling document availability checks
  • Updated CSS module path resolution to use match resources correctly
  • Converted snapshot-based tests to file-based snapshots for better maintainability

Reviewed Changes

Copilot reviewed 46 out of 51 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/rspack_plugin_css/src/runtime/css_loading_with_loading.ejs Added document availability check to prevent errors in non-browser environments
crates/rspack_plugin_css/src/parser_and_generator/mod.rs Updated to use match resource for CSS module resolution
crates/rspack_core/src/parser_and_generator.rs Added module_match_resource field to ParseContext
crates/rspack_core/src/normal_module.rs Passes match resource to parser context
tests/rspack-test/configCases/css/*/test.filter.js Removed test filters that were blocking tests
tests/rspack-test/configCases/css/*/index.js Updated test expectations and switched from snapshot to file-based snapshots
tests/rspack-test/configCases/css/*/rspack.config.js Updated configuration to reflect rspack's CSS handling behavior
Various CSS files Fixed formatting (added newlines at end of files)

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

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing 2ef6e53 to fix(wasm): add another SharedArrayBuffer instance check (#12037) by CPunisher

❌ Size increased by 256bytes from 47.81MB to 47.81MB (⬆️0.00%)

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 30, 2025

CodSpeed Performance Report

Merging #12040 will not alter performance

Comparing fix/match-resource-in-local-ident (2ef6e53) with main (046bae4)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder requested a review from JSerFeng October 30, 2025 08:40
@LingyuCoder LingyuCoder enabled auto-merge (squash) October 30, 2025 08:42
@LingyuCoder LingyuCoder merged commit c8e97e5 into main Oct 30, 2025
53 checks passed
@LingyuCoder LingyuCoder deleted the fix/match-resource-in-local-ident branch October 30, 2025 08:59
@h-a-n-a h-a-n-a mentioned this pull request Nov 5, 2025
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.

2 participants

Comments