Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

@LingyuCoder LingyuCoder commented Dec 24, 2025

Summary

fix #12413

This pull request use get_outgoing_connections to get all connections for cycle detection. And removed the allowAsyncCycles which is never implemented.

To support allowAsyncCycles, we may need a big refactoring of CircularDependencyRspackPlugin so I think we should handle it in the future.

Checklist

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

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

netlify bot commented Dec 24, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit d9a3689
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/694bbeba4346670008c6b63d
😎 Deploy Preview https://deploy-preview-12552--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: refactor labels Dec 24, 2025
@LingyuCoder LingyuCoder changed the title refactor: remove allowAsyncCycles option and use get_outgoing_connections for circular dependency detection refactor: remove allowAsyncCycles option and detect all dependencies of modules Dec 24, 2025
@LingyuCoder LingyuCoder changed the title refactor: remove allowAsyncCycles option and detect all dependencies of modules fix: remove allowAsyncCycles option and detect all dependencies of modules Dec 24, 2025
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) and removed release: refactor labels Dec 24, 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 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 allowAsyncCycles option from plugin configuration across TypeScript, Rust, and binding layers
  • Updated the dependency collection logic to use get_outgoing_connections from 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 allowAsyncCycles option

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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 823.4 KB 0
react-5k 2.7 MB 0
rome 984.3 KB 0
ui-components 2.1 MB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

📦 Binary Size-limit

Comparing d9a3689 to fix: include import attributes in context module identifier (#12551) by harpsealjs

🙈 Size remains the same at 47.90MB

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 24, 2025

CodSpeed Performance Report

Merging #12552 will not alter performance

Comparing refactor/circular-dependency-plugin-async-handling (d9a3689) with main (08772c3)

Summary

✅ 16 untouched
⏩ 1 skipped1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2025

📝 Benchmark detail: Open

Name Base (2025-12-24 e20de02) Current Change
10000_big_production-mode_disable-minimize + exec 23.6 s ± 549 ms 23.5 s ± 564 ms -0.20 %
10000_development-mode + exec 1.32 s ± 13 ms 1.3 s ± 27 ms -1.43 %
10000_development-mode_hmr + stats 232 ms ± 4.6 ms 228 ms ± 2.2 ms -1.71 %
10000_development-mode_noop-loader + exec 2.22 s ± 110 ms 2.22 s ± 254 ms +0.03 %
10000_production-mode + exec 1.36 s ± 39 ms 1.32 s ± 19 ms -2.68 %
10000_production-mode_persistent-cold + exec 1.49 s ± 13 ms 1.47 s ± 18 ms -1.57 %
10000_production-mode_persistent-hot + exec 1.04 s ± 15 ms 1.01 s ± 18 ms -3.43 %
arco-pro_development-mode + exec 1.59 s ± 163 ms 1.45 s ± 29 ms -9.22 %
arco-pro_development-mode_hmr + stats 36 ms ± 0.71 ms 34 ms ± 0.76 ms -5.28 %
arco-pro_production-mode + exec 2.93 s ± 93 ms 2.78 s ± 61 ms -5.20 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 2.97 s ± 64 ms 2.87 s ± 118 ms -3.27 %
arco-pro_production-mode_persistent-cold + exec 2.97 s ± 85 ms 2.87 s ± 80 ms -3.45 %
arco-pro_production-mode_persistent-hot + exec 1.67 s ± 31 ms 1.63 s ± 72 ms -2.58 %
arco-pro_production-mode_traverse-chunk-modules + exec 2.91 s ± 94 ms 2.83 s ± 110 ms -2.64 %
large-dyn-imports_development-mode + exec 1.62 s ± 62 ms 1.61 s ± 84 ms -0.77 %
large-dyn-imports_production-mode + exec 1.75 s ± 42 ms 1.72 s ± 40 ms -1.66 %
threejs_development-mode_10x + exec 1.27 s ± 25 ms 1.3 s ± 67 ms +2.08 %
threejs_development-mode_10x_hmr + stats 240 ms ± 3.9 ms 233 ms ± 5.7 ms -2.74 %
threejs_production-mode_10x + exec 3.93 s ± 297 ms 3.86 s ± 41 ms -1.88 %
threejs_production-mode_10x_persistent-cold + exec 3.96 s ± 21 ms 4.02 s ± 139 ms +1.59 %
threejs_production-mode_10x_persistent-hot + exec 3.48 s ± 216 ms 3.47 s ± 121 ms -0.30 %
10000_big_production-mode_disable-minimize + rss memory 5305 MiB ± 279 MiB 5350 MiB ± 133 MiB +0.85 %
10000_development-mode + rss memory 569 MiB ± 18.5 MiB 578 MiB ± 29.4 MiB +1.54 %
10000_development-mode_hmr + rss memory 729 MiB ± 14.8 MiB 741 MiB ± 25 MiB +1.59 %
10000_development-mode_noop-loader + rss memory 864 MiB ± 10.8 MiB 869 MiB ± 29.5 MiB +0.57 %
10000_production-mode + rss memory 594 MiB ± 46 MiB 605 MiB ± 21.4 MiB +1.84 %
10000_production-mode_persistent-cold + rss memory 689 MiB ± 60.2 MiB 701 MiB ± 47.7 MiB +1.79 %
10000_production-mode_persistent-hot + rss memory 687 MiB ± 21.3 MiB 666 MiB ± 58.6 MiB -3.14 %
arco-pro_development-mode + rss memory 479 MiB ± 43.7 MiB 501 MiB ± 40.3 MiB +4.54 %
arco-pro_development-mode_hmr + rss memory 407 MiB ± 18.8 MiB 436 MiB ± 4.95 MiB +7.19 %
arco-pro_production-mode + rss memory 614 MiB ± 32.3 MiB 653 MiB ± 47.1 MiB +6.29 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 622 MiB ± 41.1 MiB 644 MiB ± 58.3 MiB +3.54 %
arco-pro_production-mode_persistent-cold + rss memory 656 MiB ± 35 MiB 690 MiB ± 58.6 MiB +5.13 %
arco-pro_production-mode_persistent-hot + rss memory 482 MiB ± 69.6 MiB 496 MiB ± 72.9 MiB +2.95 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 634 MiB ± 46 MiB 635 MiB ± 46.2 MiB +0.16 %
large-dyn-imports_development-mode + rss memory 583 MiB ± 5.75 MiB 585 MiB ± 5.12 MiB +0.29 %
large-dyn-imports_production-mode + rss memory 546 MiB ± 5.62 MiB 544 MiB ± 8.91 MiB -0.29 %
threejs_development-mode_10x + rss memory 532 MiB ± 16.1 MiB 525 MiB ± 27.5 MiB -1.29 %
threejs_development-mode_10x_hmr + rss memory 766 MiB ± 37.8 MiB 780 MiB ± 39 MiB +1.84 %
threejs_production-mode_10x + rss memory 732 MiB ± 36.3 MiB 719 MiB ± 83.1 MiB -1.74 %
threejs_production-mode_10x_persistent-cold + rss memory 733 MiB ± 26.2 MiB 754 MiB ± 42.3 MiB +2.81 %
threejs_production-mode_10x_persistent-hot + rss memory 596 MiB ± 53.8 MiB 602 MiB ± 31.4 MiB +0.94 %

@LingyuCoder LingyuCoder enabled auto-merge (squash) December 24, 2025 12:52
Copy link
Member

@chenjiahan chenjiahan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@LingyuCoder LingyuCoder merged commit 5a48eea into main Dec 25, 2025
55 checks passed
@LingyuCoder LingyuCoder deleted the refactor/circular-dependency-plugin-async-handling branch December 25, 2025 02:16
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]: CircularDependencyRspackPlugin does not work

3 participants