Jan 28 2008

YUI Compressor Version 2.3 Now Available

Published by Julien Lecomte at 3:17 pm under Uncategorized

This new version of the compressor fixes a few bugs and implements a few additional micro optimizations. Please refer to the CHANGELOG file for a complete list of changes, and don’t hesitate to report any issue you may experience with this version of the YUI Compressor.

Download version 2.3 of the YUI Compressor

19 Responses to “YUI Compressor Version 2.3 Now Available”

  1. Jurriaan Persynon 28 Jan 2008 at 4:57 pm

    Thanks for this update. Using it and liking it.

  2. Roberton 29 Jan 2008 at 8:43 am

    Thanks for your continued work on this. I use it on my website World of Solitaire to compress all my JavaScript and CSS files and I’ve never once had a problem with the YUI Compressor.
    It’s the best one out there in my book and I intend to use it in all future web projects.

    Thanks again for working on it :)

  3. DLemson 30 Jan 2008 at 1:59 am

    Thank you for your excellent compressor. We are using your compressor on our webapplication and thereby cutting the javascript size in half!
    While using the new version I noticed a problem with the following rulechange “Transform ‘foo’: … into foo: … whenever possible, saving 2 bytes.”. The problem occurs when you use the keyword ‘class’ instead of ‘foo’. IE will generate a runtime error “Error: Expected identifier, string or number”. It looks like IE does not like keywords in object notation. Is there a way to overcome this problem?
    Thanks.

  4. Julien Lecomteon 30 Jan 2008 at 10:46 am

    @DLems

    Thanks for the bug report. Version 2.3.1 (now available for download) fixes that minor issue.

    Regards

  5. Jordi Hernandezon 07 Feb 2008 at 8:39 am

    Hi Julien. I am developing a java solution that does combination and minification on javascript and CSS files in web applications.
    The project is called Jawr (btw, in the docs there is a guide to use Jawr with the Yahoo! UI library).
    I currently use JSmin for the minification process and I would like to add the excellent YUI compressor to my library.
    The thing is, my project uses Maven and I haven’t found the YUI compressor at any Maven repository.
    I checked the source for the Yui compressor Maven Mojo and they have included your source code along with theirs. Would you allow me to do the same thing? Or, if not, are there any plans to publish the YUI compressor via Maven?

    Thank you very much in advance.

  6. Tonyon 07 Feb 2008 at 9:47 am

    You are the man! Keep up the excellent work on this. Could you please add an additional param to strip the /*! comments?

  7. Hani Suleimanon 07 Feb 2008 at 7:16 pm

    Ever since v2.2.5 onwards, I’ve had problems using the compressor. The issue is when compressing the ext-base.js file from extjs.com. You can find a copy (providing a direct link to make your life a bit easier!) at http://trac.symfony-project.com/browser/plugins/sfExtjs2Plugin/trunk/web/adapter/ext/ext-base.js?rev=7166&format=txt

    The problem seems to be on this line:
    var header = headerStr.split(’\n’);

    The compressed js seems to treat \n as-is, and shows up as:
    split(”
    ” //note how the close quote ends up on the next line, and the \n is added as-is to the output

  8. Julien Lecomteon 08 Feb 2008 at 9:59 am

    @Hani

    First of all, the file you refer to is already minified using the YUI Compressor. Second, I cannot reproduce your issue using the YUI Compressor v. 2.3.4. Are you running the compressor from an Ant script?

  9. Hani Suleimanon 08 Feb 2008 at 10:26 am

    Apologies, here’s the right link:

    http://extjs.com/deploy/dev/source/adapter/ext-base.js

    I’m not invoking it from ant, I have a servlet that compresses js on the fly (and deals with boring things like caching and gzipping).

  10. Vinamraon 09 Feb 2008 at 3:41 pm

    Hi Julien,

    I too have the same problem as that of Hani and I use Ant build. It’ll be great if you can solve this issue or give us a direction.

    Thanks and Regards
    Vinamra

  11. Matton 10 Feb 2008 at 10:18 am

    It looks like the javascript option for –preserve strings is no longer available. I am using version 2.3.5.

  12. Jordi Hernandezon 11 Feb 2008 at 2:21 am

    Hi again Julien. Was this the wrong place to ask? If so I am sorry. But, please, could you tell me what can I do to get some feedback on my question? I’d really like to use your compressor in my tool. Thanks.

  13. tomaPon 11 Feb 2008 at 7:44 am

    It would be a good idea to “solve this problem” :
    when compressing swfobject 2RC1, the conditionnal arguments are preserved, but obfuscation is disabled.
    Enabling obfuscation + preserving conditional arguments would be interesting in this case.

  14. Julien Lecomteon 11 Feb 2008 at 9:33 am

    @Jordi

    This is what you are looking for:

    http://alchim.sourceforge.net/yuicompressor-maven-plugin/team-list.html

    I don’t have any additional information. Sorry.

  15. Julien Lecomteon 11 Feb 2008 at 9:35 am

    @Matt

    There is now a –disable-optimizations flag that disables all micro optimizations at once. No individual flags anymore for simplicity.

    Regards

  16. Julien Lecomteon 11 Feb 2008 at 9:37 am

    @Hani

    I still cannot reproduce your problem. Do you have the original version of rhino somewhere in your class path? (look for a js.jar) If so, that is the problem! The YUI Compressor uses a modified version of rhino and there might be some class naming conflicts.

    Regards

  17. Jordi Hernandezon 11 Feb 2008 at 10:19 am

    Sorry, I think I didn’t explain myself correctly. What I am asking for is to use and include the YUI compressor sources in my project. I don’t intend to use anything from the maven mojo. Just your code. Can I please do that? The Maven mojo is doing it, that’s the reason why I mentioned them.
    Thank you and regards

  18. Julien Lecomteon 11 Feb 2008 at 3:47 pm

    @Jordi

    The YUI Compressor is licensed under the BSD License. Please read the terms of this license at:

    http://developer.yahoo.net/yui/license.txt

    Regards

  19. Hani Suleimanon 11 Feb 2008 at 4:26 pm

    Aha! It works if I remove the rhino jar from my project. I didnt realise yuicompressor.jar includes the rhino classes too. Thanks for the fix!