RtkDev:Tools
From RevTK
Juicer
Juicer is used to "build" the front end code (javascript and stylesheets). It can concatenate javascript and stylesheet components to a single output file, used on the production site. In the process, variables can be substituted, and all required assets (images) are copied to the web document root.
In other words, Juicer manages dependencies, and allows for a much more organized and reusable-friendly way of developing front end code.
It was written in early December 2009 and is available as a separate project on Github.
To support a future chinese version (Reviewing the Hanzi) and an offline application, it is hugely important to avoid duplicate code! Any front end component that's not too application specific should go into coreJs. With Juicer, those components can be included into the front end source files of RevTK, RevTH, or any other future project.
If you contribute front end components in this way; it means your code is also reusable by you or any other project! (taking in account the base YUI 3 requirement).
See the README file from the Github repository for the full documentation.
YUI Compressor
YUI Compressor is the tool we use to minify the javascrips and stylesheets for the production site. Minification is the process of removing all blank space, comments and optionally rewriting local variables and doing other optimizations, in order to reduce the file size.
Since all front end code will go through Juicer, that means we use YUI Compressor to "minify" the output of Juicer. Minification is part of the deployment of the site, it is usually not done while working on the development version.
On top of this minification, the files are also gzipped in the web response (currently handled by the /web/version/cache.php).
Last but not least we also do some file name "revisioning", which coupled with far future expire headers, ensures clients cache the files for a long time, AND also refresh their cache to the newer version when the file contents have changed (the versioning used by RevTK is also explained in the Juicer README file).
- YUI Compressor's README file
YUI Compressor does not remove C-style comments starting with /*! (note exclamation mark). This is useful to preserve copyright/license information for third party libraries in the production files.
