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

Feature: Javascript Minify #55

Closed
TisRyno opened this issue Jul 13, 2013 · 11 comments
Closed

Feature: Javascript Minify #55

TisRyno opened this issue Jul 13, 2013 · 11 comments
Labels

Comments

@TisRyno
Copy link

TisRyno commented Jul 13, 2013

Just started using Koala for my lesscss compilation, really awesome interface and enjoy the options to compress the outputted files. It lead me to the idea of also allowing javascript files to be minified?

It'd be really handy to have a tool that does all your compression in one go!

@zaygraveyard
Copy link
Collaborator

Hi, I'm glad you liked it.
We are currently working on adding javascript minification, and it will hopefully be in the next version.
Any preferred javascript minifier?

Cheers

PS: I just started contributing to this project.

@TisRyno
Copy link
Author

TisRyno commented Jul 15, 2013

I've never really done Javascript minification before, I always find there are too many tools and they all seem to do different things, I have a few links that could help you make a choice though.

http://closure-compiler.appspot.com/home <- worth looking into calling their REST API?
http://stephenwalther.com/archive/2009/10/16/using-the-new-microsoft-ajax-minifier

@oklai
Copy link
Owner

oklai commented Jul 15, 2013

Thanks.
I have a plan, develop a new interface to do the compression function. Generally, we compress the static files only in the final stages, not necessary to real-time compression when the file has been modified.
I imagine features include the follow:

  • compress image, css, javascript
  • ftp or remote directory sync after compression

Have any Suggestions?

@TisRyno
Copy link
Author

TisRyno commented Jul 15, 2013

I like this concept of compressing all the images, css and javascript. That'll be really handy. For image compression look into http://kraken.io
Kraken is known for having the really good image compression, although I believe there is a size limit for uploads which could cause an issue.

As for the remote directory/ftp sync, it's a good idea but might not be useful for everyone, e.g. I use Git and SVN for my projects but that doesn't mean I'd want any new features instantly being committed to my repository as they are just a work in progress.

@zaygraveyard
Copy link
Collaborator

@TisRyno
Thanks for the suggestions but I'm leaning more towards an offline library/framework/executable and it must be cross platform (win, mac, and linux)

  • 'using-the-new-microsoft-ajax-minifier' Windows only I guess since Microsoft
  • 'kraken.io' has a "50 images per day, up to 500 KB each" limitation.

@oklai
I too like this concept of compressing all the images, css and javascript.
And I like only once compression, but does it affect the possibility of later adding a "live preview" or "live reload".
And as for the remote sync feature I think we can allow the user to specify a script (batch, bash, node, or ruby) that syncs.

Cheers

@oklai
Copy link
Owner

oklai commented Jul 15, 2013

Here the compression component.

Javascript:

Css:

Image:

  • OptiPNG
  • PNGOUT
  • libjpg
  • libjpeg-turbo

@TisRyno
Copy link
Author

TisRyno commented Jul 16, 2013

@zaygraveyard
The Microsoft ajax minifier technically is Windows only but it could be ported to work for linux and mac.
I did not notice the 50 images per day part for Kraken.io, I don't really use it unless I really need images to be compressed.

@oklai
Nice list of compression software there, glad to see this will be implemented!

@fogil
Copy link

fogil commented Aug 10, 2013

Just a warning, for compressing JS the closure compiler using advanced optimizations will have a chance to break your script because it will shorten function names to as small as possible. The upside is, if it doesnt break your script -- the optimizations will allow your script to initialize and run faster than all the other compressors.

YUI compressor is a bit slower than Uglify.

@zaygraveyard
Copy link
Collaborator

Hi @zeltice, you might want to check-out issues #62 where we discuss js minification and imports in js, we currently use UglifyJS2 for concatenation and minification of js.
And from the looks of it, you know a lot about minifiers and we (or at least I) could use your knowledge, so if you have any suggestions let us know.

Cheers

@dannystyleart
Copy link

Hi ppl, I'm using Koala since a month and I love it. In paralell I'm learning grunt on node.js and I have a comparison about Koala & Grunt

  • On windows, Koala runs a bit slower (~10-20 ms difference on the same compilation) but much easier.
  • On linux both the same.
  • Quality of the optimization and minification I thing the same, but the way to create compiling options I think on Koala is easier because of UI.
  • Extensibility is both nice.

Do you planning to make image compressor as native compiling option or have a plan for it?

Anyway, thanks for this prog! It made my life easier and better :)

@oklai
Copy link
Owner

oklai commented Apr 25, 2014

aha, image compression feature in our next development plan. Let us discuss here #220.

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

No branches or pull requests

5 participants