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.

Layer violations in Structure101

See original GitHub issue

In the process of testing our plugin/flavour for Structure101/g which parses JS/TS projects, we identified a few problems with the layering in VSCode 08b92738094. In a private channel, @egamma asked us to enter this issue.

Steps to Reproduce:

  1. Install Structure 101/g Studio
  2. Install the flavour/plugin net.betterdeveloper.javascript.imports 1.1.2
  3. Get the VSCode commit hash 08b92738094 (to make sure it is the same src I looked at)
  4. File->New, choose the right flavour/plugin above, and run pointing at the VS Code src dir and the tsconfig file, like this: image

When the conversion finishes, you will get some layer violations:

  1. platform is using editor. “/platform/browser/contextScopedHistoryWidget.ts imports /editor/contrib/suggest/suggest.ts”. This violation was reported in private and issue #140856 was entered by @egamma image

  2. bootstrap-amp.js uses “vs” and vice-versa:

bootstrap-amd.js	imports	vs/base/common/performance.js		
bootstrap-amd.js	imports	vs/loader.js		

vs/editor/test/common/model/benchmark/bootstrap.js	imports	bootstrap-amd.js		
vs/server/cli.js	imports	bootstrap-amd.js		
vs/server/main.js	imports	bootstrap-amd.js		
image
  1. base uses platform: (although that seems due to the fact that test code is stored in the same folder as production code. We will send another analysis with synthetic model transformation to emulate tests in a separate dir tree)
/base/parts/ipc/test/node/ipc.net.test.ts	imports	/platform/product/common/product.ts		
/base/test/parts/quickinput/browser/quickinput.test.ts	imports	/platform/list/browser/listService.ts		
image

I will enable/explain Model Transformations and enter a separate comment for that mode (extracting tests out into a separate structure).

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:24 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
alexdimacommented, Jan 19, 2022

@sglebs I am trying on a MacBook Pro 2019, 32GB RAM.

There must have been some unlucky timing, maybe you were releasing 1.1.3rc-1 exactly when I was trying to install it. Now, on macOS I see 1.1.3rc-1, but when I tried earlier I only saw 1.1.0, so the macOS Out-Of-Memory occurred with 1.1.0. I also pointed to vscode instead of vscode/src.

I then switched to a Windows 11 VM with 8GB, where I could see 1.1.3rc-1, but which failed to install the first few times (I think the zip was being uploaded at the same time I was trying to download/install it). Also here I pointed to vscode instead of vscode/src when the Out-Of-Memory occurred.

But after correcting and pointing to vscode/src, the analysis runs fine now for me 💯 .

1reaction
alexdimacommented, Jan 19, 2022

did you point s101 at the sources in vscode/src ? Or did you point it at the root dir “vscode”?

🤦 That was the problem! Sorry about that, I’m now able to run the analysis. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Define architecture - Structure101
Violations of the layering, i.e. dependencies in the mapped physical code-base that break the specified layering, are shown on the diagram (conformant ...
Read more >
Fat Classes - Structure101
Dependencies should comply with the Structure Spec. SonarQube Rule Description. A Spec Dependency Violation breaks the layering and/or ...
Read more >
Diagram editor - Structure101
The violations displayed on the diagram will generally change as the code that maps to the diagrams changes, but the diagram itself remains...
Read more >
An Overview of Structure101 Architecture Diagrams
Once the mapping is established, any dependencies that violate the architecture is shown on the diagram as a curved dotted line as shown...
Read more >
Monolith to Modular, Part 3 – Managing Violations
The Action List plus Structure Spec captures the target module architecture in Structure101 Studio. Publication of the Actions and Spec ...
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