Feature request: View parent references for a given module
Issue description
I love this plugin; this is an absolutely awesome way to understand the contents of a bundle, but once we see the things making our bundle huge, we end up asking how it even got there. A lot of times, especially in large projects, it isn't obvious.
It would be AWESOME to be able to click on a module box and somehow get a list of other modules that reference said thing. Then those things could be expanded to see things that reference them.
This would definitely help in knowing which require statements needs to be translated into "ensures" so that they can be deferred.
Great idea! It might be possible to extract this information the webpack stats reason field. It can be seen from this example stats file.
Would those details present in the reason fields contain the information you'd like to see, @dzearing?
@valscion yes that's exactly it. Imagine some ui like, hover of specific module and says:
Included from:
- ModuleA (cjs require)
- ModuleB (require.context)
etc
Which can be expanded in the ui somehow that we can drill the whole graph path. If you expand and there is a linear list, it expands all the children. If there is a node that was pulled from more than 1 module, it stops expanding at that point.
That would be nice. It also sounds like a use case for a separate reporter UI, if we'll get #32 done at some point :).
I don't think we're able to do the reporter changes ourselves easily here, as the treemap reporter we're using is not controlled by us, if I've understood correctly.
I would already be happy if I could hover over a module and the consumers were colored one way, and the deps another way. Maybe that is easier to achieve…
I fear that we can't do much with the current treemap visualization, as it seems to be a demo version of some commercial code. We only have the minified/obfuscated treemap code available.
Having it would be awesome! Wouldn't it be possible to just reflect the reasons field from the JSON export in the popover window (with the sizes and so on)? This would not be perfect but would really help on this topic I think.
Thanks for this amazing tool!
Hopefully once I've got #97 figured out, we could have user-land implementations of this :). Right now implementing this faces same problems as https://github.com/th0r/webpack-bundle-analyzer/pull/85#issuecomment-313622625
Hi! Thanks for continuing work on this PR :) I'd like you to know that we haven't forgotten about this PR. It's just that this has lots of new changes, and we don't have any proper UI tests, that adding new features to the UI is starting to be much more scary maintainability-wise.
Would you happen to have any ideas on how we could possibly add even rudimentary UI tests for this?