-
Notifications
You must be signed in to change notification settings - Fork 294
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
Circular dependencies / Tangles between modules #10152
Comments
While moving towards the ideal infrastructure, we might find our changes/PRs get really large even for fixing a single layer breaking relationship (e.g., remove Separate feature and infra code
Layer protections
Eslint rules
Extend top componentsCurrently components which depend on multiple primitive components (
With above tasks finished, we could have eslint rules proposed in #9891 by @rchiodo . |
Discussed with @rchiodo offline about how we measure the success of the refactoring. The strategy we are talking here is clear (mostly adapting the eslint rules #9891 for layer protection and ensure we have minimal bundle size #10307), we would have better code structure and smaller bundle size (meaning faster download and activation) but at the same time we could use a few other metrics to validate how the refactoring goes. This is not scientific and we will explore what other potentials the refined architecture can give us in return.
|
With refactoring of the top components and eslint rules established for layers, we now have a wiki page for the source code organization https://github.com/microsoft/vscode-jupyter/wiki/Source-Code-Organization. However a bunch of my refactorings are moving files to where they ideally should be but I didn't always dig deep into the components and figure out if their internal architecture is well decoupled and tangle-less. By using structure101, here is what each component looks like now: platform notebooks interactive-window |
Does it matter how the internal code of the individual components reference each other? Probably something for discussion in standup. |
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 microsoft/vscode#140874 about if/why/how of using structure101 to analyze and improve VS Code's code base.
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. |
@rebornix please could you check if there's more work remaining here, if there is please could you document this so that we can resolve them and close this issue |
@DonJayamanne we can sit together and revisit this issue later this month. |
Given that we're not doing anything actively in this space, lets close this for now. |
As we introduced the top/primitive components via #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
notebooks
/iw
/webview
inplatform
iw
in notebookstelemetry
to feature components.notebooks
/iw
/webview
depends ontelemetry
but not the other way aroundWith above items tackled we could end up with an ideal architecture like below (we still need to revisit if it fits)
The text was updated successfully, but these errors were encountered: