-
-
Notifications
You must be signed in to change notification settings - Fork 489
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Add "Import Chain" into hoverstate for module. #269
Comments
@bregenspan this might be interesting to you, as it seems to overlap a bit with #265 |
This would be a neat feature. I wonder what would be a nice UI for that? True, showing this information in the tooltip could be a start, but we could probably do more |
@TheLarkInn I think it's a duplicate for #41, right? |
Now that there's a context menu concept in place, maybe that could be a good place to trigger this sort of thing. (The current context menu only relates to the bundle, not the specific module selected in the bundle, but this could be changed). Something like opening context menu via right-click/Ctrl-click on a module, clicking "show reasons for inclusion", and this opening a new UI panel with the |
@bregenspan yes, that was one of the use cases for the context menu I was talking about in your PR ;) |
So I also discussed this with @sokra and it turns out that the data point that should be used is
After learning this, I definitely agree that
@bregenspan What if you take the same approach that we use in webpack/webpack: In our default stats output, we show all the modules used in a bundle output (as seen below): We display the top 4 modules index in the chain and then we hide the rest (I think we cap at like 10). What if we take this same approach:
|
@TheLarkInn that sounds good to me! For the semi-related issue #265 (but to do with displaying chunk graph, as opposed to module graph details) , I started down this path of showing a simple list of parent chunk names in the tooltip: bregenspan@ea912c7. I could see it making sense to use similar UI both for displaying module graph details (when hovering a module) and chunk graph details (when hovering a chunk) - some small preview in the tooltip followed by context menu interaction to get more details. Maybe with potential to add some hotkeys later on to obviate need for opening context menu at all. |
One other avenue for this that could make sense (and would limit the number of UI changes needed) is to add integration with https://github.com/webpack/analyse since it already offers the richer context that a number of feature requests are asking for. I'm imagining something like:
Currently the Analyse tool requires selecting the stats.json file for analysis via UI. To allow for the integration described above, the Analyse tool would need to be updated to add an interface that allows for programmatically accepting stats.json output instead (whether that happens at build time or runtime). |
@netanel89 sorry, but I'm very busy right now so I'm afraid I can't provide even an approximate date when I'll be able to finish this PR 😞 |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Feature description
Currently there is no way to see "why did this module end up in my bundle". It is one of the next actionable items for a developer to solve when they are triaging their JavaScript bundles.
Today, the webpack stats object does provide this information through an API attached to the module called
issuerPath
.module.issuerPath
will provide an array of modules that caused the currentmodule
to be imported or added to the bundle.For example if module
c
was imported byb
andb
was imported bya
: TheissuerPath
for modulec
will be[{id: a}, {id: b}]
(always starting with the entry).I believe that we should display this information when a developer hover's over the module in question they are curious about.
I spent some time last Friday to explore the
./client
app which would drive the UI in the analyzer and it looks like the data is "massaged" in a way that extra data noise is removed from the "moduletree data".Work involved would be: add issuerPath as a property on Module on the
anaylseStats
fn/side of the app, and then include markup in the ModuleTree to incorporate this feature....
The text was updated successfully, but these errors were encountered: