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

min.js file may not be the last in the file list, and there could be multiples #14

Closed
dmethvin opened this issue Dec 23, 2012 · 8 comments

Comments

@dmethvin
Copy link
Contributor

Now that jQuery core has a map, the map file comes last. I think we can make the map file come second but it seems unnatural to do that. I'm never sure which assumptions are safest to make.

https://github.com/rwldrn/grunt-compare-size/blob/184f038119b4c4a0afba8a743d83bee755bda8bd/tasks/compare-size.js#L82

@rwaldron
Copy link
Owner

grunt-compare-size didn't tell jQuery to reuse a an array of file paths... we (jQuery) just did that. https://github.com/jquery/jquery/blob/master/Gruntfile.js#L21-L22 We could just make this it's own list? Or only .js?

@rwaldron
Copy link
Owner

The more I think about it, the more I actually hate both the jQuery list re-use and the grunt-compare-size assumption that the list item in the list is the gzip item.

@dmethvin
Copy link
Contributor Author

Yeah i know what you're saying. I would actually be happier if we just reported the gzip size of the min.js file in a one-line compact format, at least that would be short.

@gibson042
Copy link
Collaborator

I'd like to address this by accepting a compressor function in the task options and sending all files through it; output would look something like:

Sizes
  9363   gz:2895 tasks/compare-size.js                                          
  2687   gz:1139 dist/source.js                                                 
   305    gz:208 dist/source.min.js                                             

Compared to last run
    -4     gz:-3 tasks/compare-size.js                                          
     =      gz:= dist/source.js                                                 
     =      gz:= dist/source.min.js

@dmethvin, @rwldrn: thoughts?

@dmethvin
Copy link
Contributor Author

dmethvin commented Mar 5, 2013

I'd like to see a more compact format. How about this?

Sizes     Diff
  9363     -4    gz:2895 tasks/compare-size.js                                          
  2687      =    gz:1139 dist/source.js                                                 
   305      =    gz:208 dist/source.min.js                                             

Also the thing where it compared the size to every branch you have locally was waaaaay too verbose for the case where you're landing lots of other people's stuff. I was getting two screens full of diff info and having to blow away the branch .sizecache often. Perhaps it could use an activity (last commit) date to avoid spamming the console. Or we could just show the min/gz number since that's all we care about on the other branches?

@gibson042
Copy link
Collaborator

Multiple branch verbosity is a separate issue (literally so: gh-15), but regarding this, don't we want size comparisons against both uncompressed and gzipped versions of the files? In jQuery's case it'll be three lines per entry:

Compared to last run
    -4     gz:-3 dist/jquery.js
    -1     gz:-1 dist/jquery.min.js

Edit: plus three lines for "Sizes", which I now realize is probably what you're trying to avoid:

Sizes
235540  gz:69653 dist/jquery.js
 82725  gz:29538 dist/jquery.min.js

@dmethvin
Copy link
Contributor Author

dmethvin commented Mar 5, 2013

Yeah, that looks more compact. We could remove the gz: prefix and just make column headers to save a bit more.

@scottgonzalez
Copy link

For reference, this is what the Closure Compiler UI shows:

Original Size:  13.54KB (4.3KB gzipped)
Compiled Size:  6.18KB (2.32KB gzipped)
Saved 54.33% off the original size (46.03% off the gzipped size)

Which is probably closer to what @dmethvin wants (values spread across columns instead of rows).

gibson042 added a commit to gibson042/grunt-compare-size that referenced this issue Mar 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants