On further consideration is anyone aware of any issues using the YUI compressor?
Quote
Uses YUI Compressor to clean whitespace and rename internal variables to shorter strings. Does not use eval.
And finally, does anyone know off the top of their head which bits we could omit for the manager. I’m fairly certain we don’t need every available option from the mootools download page: http://mootools.net/download
Regarding YUI compressor issues. The current bug list is
here (Edit: To get the YUI errors type "compressor" in the trackers search form in the right upper side of the page)
Regarding the performances between packed and unpacked solutions, I find this
french recent study which compares 8 packed solutions :
YUI Compressor1, Dojo ShrinkSafe2, Packer3, JS Utility v24, LZ77 JS Compressor5, MemTronic JS Cruncher6, JS Min7, and Crunchy8. Look at this study, results are explained in French but figures are understandable by everybody. This study shows that two type of solutions exists :
- soft solution which simply removes spaces, carriage returns, useless characters and renaming of name variables by shorter variable names.
- heavy solution like packer which rewrites the js code by changing the coding base.
- YUI Compressor1, Dojo ShrinkSafe and JS Min are soft solutions.
- Packer3, JS Utility v24, LZ77 JS Compressor5, MemTronic JS Cruncher6, and Crunchy8 are heavy solutions
Before gzip, heavys are the fasters
But the gzip paradox is that after gzipping by the brower the results are opposites and any cases not so differents : Yui compressor results are well compressed rather the code of js utility do not improve more the compression.
Another point is the time of loading. The soft solution are the best as they haven’t change the structure of the code. So at the end, is it the conclusion of this study, with a gzip compressing by the brower
prefers the YUI solutions rather the heavy solution.
For MODx, an option (I don’t know if it is easy or not to implement) could be to select during the installation process the mootools library type that the user wants and by default choose the no-documentation library rather than the YUI compressed library.
And If we are going a bit too far ("poussser le bouchon" in French) we can dream that during the installation process, the selection of the snippets and plugins define the list of required functions of mootools
In any cases, i suggest to do many tests ...