Skip to content
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

Suppress Circular Dependencies Warnings related to D3 #1501

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

rajsite
Copy link
Member

@rajsite rajsite commented Sep 7, 2023

Pull Request

🀨 Rationale

The d3 library chooses to intentionally keep circular dependencies: d3/d3-selection#168

Rollup reports circular dependencies as warnings but to limit verbosity only show the first few so all we see are warnings related to d3. Example:

> rollup --bundleConfigAsCjs --config


dist/esm/all-components.js β†’ dist/all-components-bundle.js...
(!) Circular dependencies
../../node_modules/d3-selection/src/selection/index.js -> ../../node_modules/d3-selection/src/selection/select.js -> ../../node_modules/d3-selection/src/selection/index.js
../../node_modules/d3-selection/src/selection/index.js -> ../../node_modules/d3-selection/src/selection/selectAll.js -> ../../node_modules/d3-selection/src/selection/index.js
../../node_modules/d3-selection/src/selection/index.js -> ../../node_modules/d3-selection/src/selection/filter.js -> ../../node_modules/d3-selection/src/selection/index.js
...and 12 more
created dist/all-components-bundle.js in 12.3s

If we introduce circular dependencies or add a library that introduces additional circular dpendencies they may be missed.

πŸ‘©β€πŸ’» Implementation

Implemented a rollup onwarn handler that can filter out the d3 libraries circular dependency warnings.

πŸ§ͺ Testing

Validated locally that choosing a more specific prefix like d3-selection will filter only warnings for that subset and let others through.

βœ… Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@rajsite rajsite changed the title Supress-d3-circular-dep-warnings Suppress Circular Dependencies Warnings related to D3 Sep 7, 2023
@rajsite rajsite enabled auto-merge (squash) September 7, 2023 18:25
@rajsite rajsite merged commit 4a306be into main Sep 7, 2023
9 checks passed
@rajsite rajsite deleted the supress-d3-circular-dep-warnings branch September 7, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants