-
Notifications
You must be signed in to change notification settings - Fork 22
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: call graph #132
Comments
Hello @Klemensas, thanks for the feedback.
Yes, sure thing but it depends on the use case. Many things could be exposed by skott to hook into the core and extend its range of features, but skott was thought to be centered around dependencies and for now there is no further static analysis within the script to know how dependencies are used, at least in the core, but that could be done through plugins.
Could you please provide me examples of static call graphs and how this would be useful? I'm aware of call graphs but mostly dynamic ones, that could be done at the runtime level. Statically this would be hard as you would need to trace all branches of code and all that, I'm not sure what type of information we could extract from it. For now, skott only keeps the information of the module Import Literal (the imported module) to establish relationships, but does not keep what is imported from the module that is all the Imports Specifiers ( Let's take a small example a.js import { someFunction } from "./b.js"; For now, skott only keeps the information of "a.js" importing "b.js" hence creating For your specific use case we could discuss is providing inversion of control for the entire script in addition to the module resolution part that can be already done. That way, skott would help you traverse all the module tree starting from the entrypoints and then you would have to do the work on your own using your own plugin that would have access to the entire graph context. |
Hello, nice tool, thank you for that 馃殌
Summary
Would you consider extending the library to support call graph visualizations for specified entry points?
Details
Would you be for making this tool a more generalized one, to cover a broader range of use cases?
I understand that currently, the emphasis is on dependency handling, which works great (besides marking TS type imports as cyclical). For my use case, I also need an advanced tool for visualizing call graphs, ideally with dynamically configurable entry points. A cursory search for what's available didn't show anything promising, and I'm thinking of building something for myself, using largely similar things that are used here - estree and mermaid. But maybe it could be a feature of skott.
Standard questions
Please answer these questions to help us investigate your issue more quickly:
The text was updated successfully, but these errors were encountered: