Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

Summary

This PR fixes a bug where compilation.fileDependencies and other compilation dependency objects were missing standard Set methods (keys(), values(), entries(), delete(), size). This caused the utils/lazy-set test case to fail with "keys is not a function" error.

The fix extends the createFakeCompilationDependencies function to implement these missing Set methods, making the compilation dependencies objects behave like a proper Set. This ensures compatibility with code that expects Set-like behavior.

Checklist

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

* docs: refactor `module.rules` documentation into a dedicated page

* docs: fix
Copilot AI review requested due to automatic review settings December 15, 2025 11:09
@netlify
Copy link

netlify bot commented Dec 15, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit c42743a
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/693fec66bfe4dd0008cfe9be

@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 Dec 15, 2025
@LingyuCoder LingyuCoder requested a review from SyMind December 15, 2025 11:11
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 compilation dependency objects (fileDependencies, contextDependencies, missingDependencies, buildDependencies) were missing standard Set methods, causing the utils/lazy-set test to fail. The fix extends createFakeCompilationDependencies to implement the complete Set interface.

Key Changes:

  • Implemented missing Set methods (keys(), values(), entries(), delete(), size) in the fake compilation dependencies
  • Added deletedDeps tracking to support the delete() operation without backend propagation
  • Removed test filter that was blocking the lazy-set test case

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/rspack/src/util/fake.ts Core implementation - adds Set methods and deletion tracking to fake compilation dependencies
tests/rspack-test/configCases/utils/lazy-set/test.filter.js Removes the test filter that was previously disabling the failing test
packages/rspack/etc/core.api.md Updates API documentation to reflect the new Set methods in compilation dependencies

The implementation is well-designed and correctly handles the Set interface requirements. The deletedDeps Set provides client-side deletion tracking without requiring backend removal support, which is appropriate given that no removal callback is provided to the function. The code correctly handles edge cases like deleting pending additions, re-adding deleted items, and maintaining consistency across the iterator and size methods.


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

@github-actions
Copy link
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 project(s) in monorepo.

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.7 MB - -
📄 JavaScript 5.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 823.6 KB - -
📄 JavaScript 823.6 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 rome

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 984.3 KB - -
📄 JavaScript 984.3 KB - -
🎨 CSS 0 B - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

📁 ui-components

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

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.1 MB - -
📄 JavaScript 2.0 MB - -
🎨 CSS 83.0 KB - -
🌐 HTML 0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing c42743a to refactor: extract common utility functions to rspack_util (#12447) by harpsealjs

🙈 Size remains the same at 48.21MB

@LingyuCoder LingyuCoder enabled auto-merge (squash) December 15, 2025 11:19
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 15, 2025

CodSpeed Performance Report

Merging #12459 will not alter performance

Comparing fix/add-set-methods-to-compilation-dependencies (c42743a) with main (1282da9)1

Summary

✅ 17 untouched

Footnotes

  1. No successful run was found on main (6fde634) during the generation of this report, so 1282da9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@LingyuCoder LingyuCoder merged commit bb35281 into main Dec 16, 2025
85 of 87 checks passed
@LingyuCoder LingyuCoder deleted the fix/add-set-methods-to-compilation-dependencies branch December 16, 2025 02:25
@CPunisher CPunisher mentioned this pull request Dec 17, 2025
2 tasks
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.

4 participants