-
-
Notifications
You must be signed in to change notification settings - Fork 34
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] Make the node radius respect the package size #132
Comments
I've thought about this previously when I first noticed the For example tl;dr: I'm open to the idea, but I think we need a better "size" metric. |
The “app bundle” size is only relevant for fronted packages. The Install Size is still relevant and you can see there are quite a few people using Package Phobia to measure Install Size and Publish Size. https://github.com/styfle/packagephobia The graph view would be a nice addition to narrowing down, where in the tree the bloat is coming from. That said, a toggle between bundle size and package size would be great too! |
What's the difference between "Install Size and Publish Size"? Also, when I go to https://packagephobia.com/result?p=uuid, it says it's 120KB. That is (conveniently) also the same as
Conspicuously missing from this list is anything that adds up to 120KB. The other thing I struggle with here - and this is really the bigger problem - is that no matter how we define "size", we're not really addressing the main question users have: "How does [dependency X] affect the size of my project?" The actual impact a dependency has on a project depends on how it interacts with the project's other dependencies. For example... graph TD
m1["m1 (1kb)"]
m2["m2 (2kb)"]
m3["m3 (4kb)"]
m4["m4 (8kb)"]
m5["m5 (16kb)"]
a[My Project] -->|dep1| m1
a -->|dep2| m2
a -->|dep3| m3
m1 --> m4
m1 --> m5
m2 --> m5
m2 --> m3
style m1 fill:#f99
style m2 fill:#9f9
style m3 fill:#99f
style m4 fill:#f99
style m5 fill:#ff9
Ignoring what the "kb" size here is measuring (file system footprint, size of imported files, tree-shaken code size... whatever), there is no definition of "size" that will properly account for the following:
This sort of "massaging" of dependencies is, I think, what's really of most interest. I'd love to have a way for |
It explains in the footer
The disk size can vary depending on how your block size. See Why is the size different than size on disk? in the readme
True for install size but publish size (aka unpacked size) is predictable and that is what I'm suggesting adding to npmgraph. |
IMO this should be integrated with BundlePhobia (https://bundlephobia.com/), which measures the size of the dependency once bundled. The package size or the install size at the end of the day are just noise and irrelevant. |
Bundle size depends on your choice of bundler and is not relevant for dependencies that never ship to the frontend (and are therefore never bundled). |
@styfle it depends on the blunder but if some bundler gives you 50% larger bundles on average or something it's probably broken. Bundle size is potentially also not irrelevant for server-side things, for example if your cli app load 2mb of code it isn't going to start quickly. It's less important though, sure. |
This project is actively maintained so more likely to get a size feature to land. ### Related - anvaka/npmgraph.an#27 - npmgraph/npmgraph#132
Drive-by update...
On the topic of UI for this ... I had actually intended to say this was going to be tricky, but it looks like varying the ... which is actually pretty compelling (I think). The one downside to this is that it doesn't communicate any information about the absolute size of things. Does this represent a 100KB install or a 100MB install? It's unclear. There's the existing TreeMap display used for BundlePhobia data in the Module Pane, though, which does convey that information. So... maybe some combination of the two. The upshot of this is that if I'd be open to a PR for this. Otherwise I'll try get around to this in my spare (ha!) time. |
Oh I just realized that the "Bundle Size" actually does work for some existing packages so probably keep that but just add the "Unpacked Size" |
BTW, this feature is controlled by the |
It would be great if there was a way to view package size visually.
This could be achieved by reading the
unpackedSize
prop from the registry and then rendering the node radius larger or smaller in the graph.The text was updated successfully, but these errors were encountered: