<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Filter_Minify_Javascript is a filter to minify Javascript code, reducing it's size while keeping all functionality intactZend Framework: Zend_Filter_Minify_Javascript Component Proposal
Proposed Component Name
Zend_Filter_Minify_Javascript
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Filter_Minify_Javascript
Proposers
Nick Daugherty
Zend Liaison
TBD
Revision
1.0 - 23 April 2010: Initial Draft. (wiki revision: 15)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
Minifying Javascript leads to faster load times on the client by reducing the overall size of Javascript code. This component aims to perform the work of removing comments, extra whitespace, etc while retaining the familiar Zend_Filter interface.
This component can be integrated into other framework components, such as HeadScript view helper for automatic Javascript minification.
The component is used like any other Zend_Filter_* component, passing the string to be minified to the filter() method.
6. Milestones / Tasks
- Milestone 1: Working prototype checked into the incubator supporting minification of Javascript strings
- Milestone 2: Working prototype checked into the incubator supporting minification of Javascript files (and optionally writing output to a file)
- Milestone 3: Unit tests exist, work, and are checked into SVN.
- Milestone 4: Initial documentation exists.
7. Class Index
- Zend_Filter_Minify_Javascript
- Zend_Filter_Minify_Javascript_JsMin
- Zend_Filter_Minify_Interface
8. Use Cases
| UC-01 Minifying a string of javascript |
|---|
4 Comments
comments.show.hideMay 23, 2010
Daniel Knell
<p>Instead of exclusively using crockfords JSMin what about splitting this class into several components, with others delegating to googles closure compiler or yahoos yui compressor? Both of those tools generate a significantly smaller file in my experience.</p>
May 24, 2010
Nick Daugherty
<p>This is a good suggestion. We should have an adapter system for the actual minification, allowing the user to choose the minification method at runtime. So classes like Zend_Filter_Minify_Javascript_Adapter_Yui...we'll need to choose what the default adapter will be.</p>
Jul 12, 2010
Christoph, René Pardon
<p>A few days ago i found this component: <a class="external-link" href="http://farhadi.ir/works/smartoptimizer">http://farhadi.ir/works/smartoptimizer</a><br />
You may be interested in it.</p>
Aug 24, 2010
Ryan Mauger
<ac:macro ac:name="note"><ac:rich-text-body><p><strong>Community Review Team Recommendation</strong></p>
<p>The CR Team recommends this component be included as is for 1.11 and 2.0 into the Zend_Filter_Minify namespace</p>
</ac:rich-text-body></ac:macro>