Skip to content
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

column meanings #28

Open
boneskull opened this issue Jun 6, 2017 · 3 comments
Open

column meanings #28

boneskull opened this issue Jun 6, 2017 · 3 comments

Comments

@boneskull
Copy link

It would be helpful to have tooltips or documentation to explain the significance of "weighted" vs. "size", and "dependants" vs "imports".

@ryan953
Copy link
Contributor

ryan953 commented Jun 6, 2017

I think tooltips rolls in nicely together #29, so look out for those together.

I do also have a task for myself to add a glossary (https://github.com/pinterest/bonsai/projects/1#card-3221025) so look out for that.

Briefly though, here are some definitions to unblock you:

  • Size is the file size on your disk. not-minified, full of debugging, not transpiled. Checkout Are dependency sizes post-minification? #14 for some background.
  • Dependents is the count of the things that require() or import
  • Imports is the count of the thing that this file requires or imports.
  • Weighted is the magic score I give to files. It's approximately the sum of the size of the dependencies shared between dependants.

Or put another way: I need to explain Weighted better. I hope it's an approximation for how many unique require() statements there are, and the file size of those modules being required, accounting for code reuse across the whole chunk.

@boneskull
Copy link
Author

Thanks for explanation.

I think part of my confusion is due to the tabular representation of ultimately hierarchical data.

It'd be a bit more clear to me if modules were not repeated at the top level. So if deep A wants lodash and deep B wants lodash, assuming there's only one version in the bundle, I should not see lodash in the top level of the table twice.

there should be some cross-reference between lodash and those modules which require it. likewise if you were to "remove" module A using the tool, it should be clear that A imports lodash and you won't get its bytes back because B still imports it.

it should be more clear that the reported sizes aren't minified--it isn't necessary IMO-- webpack-bundle-analyzer can show us that data, but it won't help us refactor our bundles.

I still don't understand what I am to do with "weighted". is it really needed? can it be a different unit (numeric score?) instead of bytes?

great work & thanks.

@ryan953
Copy link
Contributor

ryan953 commented Jun 6, 2017

@boneskull are you seeing modules repeated in the tables? That shouldn't be happening. Each module should only be listed once on the page, in your example of A and B both requiring lodash there should only ever be three rows visible between the two tables.

If you Ignore a module, Bonsai will recursively look at each dependency, and if there are no other references it'll mark that dependency as ignored as well. So lodash would not appear in the Ignored list until both A and B were also ignored.

You're right that it's hierarchical data in a tabular form, which means we're hiding information that's inherent to the data. On the other hand, I've seen some projects with hundreds and thousands of modules (Pinterest has ~1000 per page) included in the bundles, some of the other analyzers get really noisy or fail to render all that data. So, that's my starting point for tables...

I really do appreciate all the feedback. So many things that I thought were clear turned out to be really confusing to everyone except me (and John, who is sitting next to me, so can't count that) which just means I have more simplification to put into it in order to make it more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Docs
TODO
Development

No branches or pull requests

2 participants