[wp-trac] [WordPress Trac] #19592: Automate script and style compression and bumps

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 3 21:02:52 UTC 2012


#19592: Automate script and style compression and bumps
-------------------------+------------------
 Reporter:  nacin        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  3.4
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------

Comment (by azaozz):

 Replying to [comment:25 soulseekah]:
 > Most of the warnings are "try to use only one {{{ --> var <--  }}}".
 Readability of JS code is severely impaired when fixing these...
 >
 > Most of these are best left alone, not really worth chasing down the 3
 extra bytes here and there...

 This is rather a question of coding standards not of trying to save few
 bytes. It is a good practice to declare all local variables at the
 beginning of each scope (i.e. have one `var ...;` at the top of each
 function). This actually helps readability and is preferred in most (all?)
 IDEs that have JS support. (It also seems to simplify the actual minifying
 in YUI Compressor).

 > Overall should we be listening to some sort of Lint instead of a
 compressor...

 The YUI Compressor uses [http://www.mozilla.org/rhino/ Rhino] to actually
 execute the JS in java, not just "look through" the code. Seems most
 warnings are generated from there. It would also catch fatal errors, etc.
 making it better than other "lint" processors.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19592#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list