Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork503
Add "Import Chain" into hoverstate for module.#567
-
Feature descriptionCurrently 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 For example if module 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 Work involved would be: add issuerPath as a property on Module on the |
BetaWas this translation helpful?Give feedback.
All reactions
👍 5
Replies: 11 comments
-
@bregenspan this might be interesting to you, as it seems to overlap a bit with#265 |
BetaWas this translation helpful?Give feedback.
All reactions
-
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 |
BetaWas this translation helpful?Give feedback.
All reactions
-
@TheLarkInn I think it's a duplicate for#41, right? |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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 |
BetaWas this translation helpful?Give feedback.
All reactions
-
@bregenspan yes, that was one of the use cases for the context menu I was talking about in your PR ;) |
BetaWas this translation helpful?Give feedback.
All reactions
-
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:
|
BetaWas this translation helpful?Give feedback.
All reactions
-
@TheLarkInn that sounds good to me! For the semi-related issue#265 (but to do with displayingchunk graph, as opposed tomodule 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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
One other avenue for this that could make sense (and would limit the number of UI changes needed) is to add integration withhttps://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). |
BetaWas this translation helpful?Give feedback.
All reactions
-
@th0r@valscion |
BetaWas this translation helpful?Give feedback.
All reactions
-
@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 😞 |
BetaWas this translation helpful?Give feedback.
All reactions
-
it would be super dope to have this feature. Trying to optimize build for seo and it's taking hours to go through dependencies one by one in reverse order to try to figure out why a specific class ended up in the bundle. Or maybe someone knows of a good approach/plugin for that? |
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #269 on February 23, 2023 09:11.
