question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Circular dependencies / Tangles between modules

See original GitHub issue

As we introduced the top/primitive components via https://github.com/microsoft/vscode-jupyter/issues/8976 and moved the moduels/helpers to their logical folders, we had circular dependencies between the top components. Below is a simplified version of component dependnecies generated by Structure101

We want to gradually remove the dependencies in wrong directions, including

  • No dependencies on notebooks/iw/webview in platform
  • No dependencies on iw in notebooks
  • Move feature code/helpers from telemetry to feature components. notebooks/iw/webview depends on telemetry but not the other way around

With above items tackled we could end up with an ideal architecture like below (we still need to revisit if it fits)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rebornixcommented, Jun 27, 2022
image image
0reactions
rebornixcommented, Jun 28, 2022

Does it matter how the internal code of the individual components reference each other?

My short answer is not always. The tangles from structure101 can be used as indicators for how decoupled a component is and can be used as one approach to improve the code. There are good discussions in VS Code https://github.com/microsoft/vscode/issues/140874 about if/why/how of using structure101 to analyze and improve VS Code’s code base.

I didn’t think they are not components in their own right, hence I do’nt think they are governed by the same rules.

I agree and I don’t think we should enforce any layering concepts inside top components. 0 tangle is also not what we would try to archive. The goal IMHO should be better readability.

Based on my experience of the last two weeks, the tangles shown by structure101 (or a super-restrict eslint rule) helped find code that are placed in wrong folders/modules.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Is there any way to get around circular dependencies in ...
I have two modules in my package, call them Module1 and Module2 . Module1 has a dependency on Module2 and would prefer to...
Read more >
Circular dependencies between modules - Microsoft Learn
Circular references between modules, constants, and user-defined types aren't allowed. This error has the following cause and solution:.
Read more >
Why cyclic dependency errors occur - a look into the Python ...
In simplest terms, a circular import occurs when module A tries to import and use an object from module B, while module B...
Read more >
Cyclic dependencies are evil (2013) - Hacker News
circular dependencies at runtime are not really a problem and often necessary. circular dependencies at build time/between modules are evil.
Read more >
java - Cyclic dependency in this project design
The dependencies are in form of method calls to classes located inside the modules A and B. An extraction would be possible but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found