-
Notifications
You must be signed in to change notification settings - Fork 249
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
Feature request: Filter based on React (or other) Component imports #343
Comments
yup, my alternative to |
Or actually, another implementation possiblity is to filter only files that depend on yeah, adding a new option to IIncludeOnlyType like |
Actually, i'd probably still want to do this, but spin it out to a separate module, and pull in dependency-cruiser's rendering internals. My solution in #344 wasn't perfect, because it still runs afoul of the index.tsx issue, which just re-exports other dependencies, which lead to this mess (rendered using xdot, as it was the only piece of existing software that highlights the edges on hover -- something else i'd want to make, a better visualized dot output. alas.) |
(On of the things on the wish list: have incoming and outgoing dependencies highlighted when hovering over nodes.) |
Perfect! Thanks for mentioning it, I was looking around for something like that to wrap the svg output, and ended up taking longer looking for something than it would have taken to write something quick and dirty also, ortho definitely does help with my graph. thanks for the tip! |
@forivall the fact you couldn't find this quick enough is a clear sign the doc needs to get a different information-archi (and maybe Thanks for the PR in any case! |
Yeah, adding a mention to --init would definitely help, as that's the main thing i was working off of to get myself acquainted with the project. |
Context
I'm trying to use static analysis to determine the possible component tree within a large application, but omit all of the util / data / etc. cruft.
Expected Behavior
Example:
enum.ts
a.tsx
b.tsx
with this option, the graph would be like
and ignore the enum import
An even better use case would be to trace the actual component name, but that's a lot harder to decipher.
Current Behavior
This feature doesn't exist, although it's similar to
tsPreCompilationDeps
Possible Solution
Analyse the code, and only count it as a dep if the import is used as a component in JSX. (This wouldn't cover all component uses, but it's most of them)
Considered alternatives
Alternative is to use storybook, and then use react devtools to look at the tree, but that takes a lot of setup, and the thing i'm looking at is stuff we want to remove.
Other alternative i just thought of is to include only component files -- ie, only .tsx files. i'll be doing that instead for now.
The text was updated successfully, but these errors were encountered: