-
Notifications
You must be signed in to change notification settings - Fork 191
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
package dependency graph has cycles #4645
Comments
Is this looking at just IMO we should avoid cyclic |
Good question. Here's an analysis of what's left after #4647
Agree with a qualification. Cycles in devDependencies need not to forbidden, but can often be a smell. For example, the generic utils like There's also the pragmatic consideration of the tools we have available, which don't distinguish between dependency types: lerna/lerna#1198 |
Describe the bug
Running a Lerna command warns,
To Reproduce
Steps to reproduce the behavior:
yarn lerna --reject-cycles run lint
Expected behavior
No cyclic dependencies among packages.
Prioritization Analysis
This problem is not catastrophic nor urgent. Here are the reasons to do it anyway:
The cycles in the dependency graph muddy the code architecture. It's not always clear where to put something and we end up moving things around as the boundaries become apparent. This suggests a lack of overall architectural clarity. We also sometimes hack around the irrational boundaries, such as #5232
We can speed up CI and pre-push testing by only examining what has changed. For example,
lerna run test --since=main
will only run tests on packages that have changed since master. With cycles in the dependency graph it infers everything changed.This is less relevant in CI where we run everything in parallel. We waste work but we don't waste wall time except for jobs like
deployment-test
which is very long and could automatically be skipped when it's known not to be affected.When concerns are mixed in a package, a breaking change to one part implies a breaking change to the whole package.
Because the Endo bundler don't yet have tree shaking, the lax package factoring can cause unnecessarily large bundles.
Lerna bumps a version when its dependency bumps.
Tasks
The text was updated successfully, but these errors were encountered: