Giter Site home page Giter Site logo

Comments (7)

hughsk avatar hughsk commented on August 19, 2024 1

So the problem with gzip, as I understand it, is that it requires all of the content to get an accurate result. Once you've got the content gzipped, there's no clear indicator for how much of the final bundle is taken up by an individual file as parts might be shared across multiple files, and you're working with an unparseable binary at that point.

@Raynos @ForbesLindesay any suggestions on how to make this work?

from disc.

jasonkarns avatar jasonkarns commented on August 19, 2024 1

I see two different features here. It's certainly useful to see the impact individual modules have on the final minified/gzipped size. And this could be accomplished as @Raynos described above.

But a much more simple metric could cover 60% of the use case. That is, just include the total filesize of the entire gzipped bundle in the output report. Personally, I would be happy to make my decisions per module/filesize based on the uncompressed ratios and existing graphs. But then my changes can be validated by seeing the gzipped filesize continue to drop after making changes.

So I would be happy just to see the gzipped filesize of the single bundle. That's good enough for me.

from disc.

Raynos avatar Raynos commented on August 19, 2024

this would be great behind an options flag.

from disc.

hughsk avatar hughsk commented on August 19, 2024

Definitely - I need to rewrite file-size-tree so that it can handle extra metrics. After that this should be easy to add as a flag, and/or a toggle so that you can compare minified/unminified size :)

from disc.

josephg avatar josephg commented on August 19, 2024

👍 would be sweet

from disc.

Raynos avatar Raynos commented on August 19, 2024

@hughsk it would work for minified stuff.

from disc.

Raynos avatar Raynos commented on August 19, 2024

@hughsk as an unreliable heuristic I would recommend gzipping all "packages", i.e. all files in each package. Then adding that up, which will be bigger then the bundle gzipped.

Then show percentages i.e. which package contributes more.

The heuristic is that most of the sharing happens for files within a package, and that showing the break down at a per package level might be a useful rough count

from disc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.