-
-
Notifications
You must be signed in to change notification settings - Fork 757
fix: remove allowAsyncCycles option and detect all dependencies of modules #12552
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: remove allowAsyncCycles option and detect all dependencies of modules #12552
Conversation
…ions for circular dependency detection
✅ Deploy Preview for rspack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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 pull request removes the allowAsyncCycles configuration option from the CircularDependencyRspackPlugin and refactors the implementation to use get_outgoing_connections instead of get_dependencies for building the module dependency graph. The change simplifies the plugin's API while maintaining the behavior where asynchronous imports (such as dynamic imports) are automatically excluded from circular dependency detection through the existing is_asynchronous_only() check.
Key Changes:
- Removed the
allowAsyncCyclesoption from plugin configuration across TypeScript, Rust, and binding layers - Updated the dependency collection logic to use
get_outgoing_connectionsfrom the module graph - Added test case to verify that synchronous cycles within dynamically imported modules are still properly detected
- Updated documentation to remove references to the
allowAsyncCyclesoption
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
website/docs/en/plugins/rspack/circular-dependency-rspack-plugin.mdx |
Removed documentation for the deprecated allowAsyncCycles option and its usage example |
website/docs/zh/plugins/rspack/circular-dependency-rspack-plugin.mdx |
Removed Chinese documentation for the deprecated allowAsyncCycles option and its usage example |
packages/rspack/src/builtin-plugin/CircularDependencyRspackPlugin.ts |
Removed allowAsyncCycles from the TypeScript plugin options type and adjusted indentation in the callback functions |
packages/rspack/etc/core.api.md |
Removed allowAsyncCycles from the public API documentation (also includes unrelated whitespace changes) |
crates/rspack_plugin_circular_dependencies/src/lib.rs |
Refactored build_module_map to use get_outgoing_connections instead of get_dependencies and removed allowAsyncCycles from options |
crates/rspack_binding_api/src/raw_options/raw_builtins/raw_circular_dependency.rs |
Removed allowAsyncCycles field from the raw options struct |
crates/node_binding/napi-binding.d.ts |
Removed allowAsyncCycles from the TypeScript binding definitions |
tests/rspack-test/diagnosticsCases/plugins/circular-dependency-plugin/rspack.config.js |
Added new test entry point for dynamic circular dependency test case |
tests/rspack-test/diagnosticsCases/plugins/circular-dependency-plugin/dynamic-circular/*.js |
Added new test files demonstrating that synchronous cycles within dynamically imported modules are still detected |
tests/rspack-test/diagnosticsCases/plugins/circular-dependency-plugin/stats.err |
Updated expected warning output to include the new dynamic circular dependency warning |
tests/rspack-test/diagnosticsCases/plugins/circular-dependency-plugin/raw-warning.err |
Updated expected warning count to include the new dynamic circular dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Rsdoctor Bundle Diff AnalysisFound 5 projects in monorepo, 0 projects with changes. 📊 Quick Summary
Generated by Rsdoctor GitHub Action |
📦 Binary Size-limit
🙈 Size remains the same at 47.90MB |
CodSpeed Performance ReportMerging #12552 will not alter performanceComparing Summary
Footnotes
|
|
📝 Benchmark detail: Open
|
chenjiahan
left a comment
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.
LGTM 👍
Summary
fix #12413
This pull request use
get_outgoing_connectionsto get all connections for cycle detection. And removed theallowAsyncCycleswhich is never implemented.To support
allowAsyncCycles, we may need a big refactoring ofCircularDependencyRspackPluginso I think we should handle it in the future.Checklist