-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: add Set methods to compilation dependencies #12459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add Set methods to compilation dependencies #12459
Conversation
* docs: refactor `module.rules` documentation into a dedicated page * docs: fix
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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
deletedDepstracking to support thedelete()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.
Rsdoctor Bundle Diff AnalysisFound 5 project(s) in monorepo. 📁 react-10kPath:
📁 react-1kPath:
📁 react-5kPath:
📁 romePath:
📁 ui-componentsPath:
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 48.21MB |
CodSpeed Performance ReportMerging #12459 will not alter performanceComparing Summary
Footnotes |
Summary
This PR fixes a bug where
compilation.fileDependenciesand other compilation dependency objects were missing standard Set methods (keys(),values(),entries(),delete(),size). This caused theutils/lazy-settest case to fail with "keys is not a function" error.The fix extends the
createFakeCompilationDependenciesfunction 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