[wp-trac] [WordPress Trac] #19592: Automate script and style compression and bumps
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 3 08:17:40 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 soulseekah):
Replying to [comment:24 nacin]:
> If someone is willing to patch all of these, I can make it so bumpbot
posts comments to tickets that cause warnings.
Most of the warnings are "try to use only one {{{ --> var <-- }}}".
Readability of JS code is severely impaired when fixing these. Refer to
the experimental diff resolving all WARNINGs in ''/wp-
admin/js/theme.dev.js'' and ''/wp-admin/js/tags.dev.js''
Most of these are best left alone, not really worth chasing down the 3
extra bytes here and there, although there are cases where it's possible
to fix up two or three of these without much movement around. Is it worth
the hunt? By removing all of them we can potentially save around 480 bytes
(160 single var warnings * 3 bytes).
Replying to [http://core.trac.wordpress.org/attachment/ticket/19592
/bumpbot-warnings.txt#L75 bumpbot-warnings.txt L75]
> ['./wp-admin/js/widgets.dev.js'] => [WARNING] The symbol isRTL is
declared but is apparently never used.
isRTL is used in the [http://core.trac.wordpress.org/browser/trunk/wp-
admin/js/widgets.dev.js#L6 same line]. By expanding breaking down the
lines and not using defining later, the error magically goes away. Doesn't
make sense.
Replying to [http://core.trac.wordpress.org/attachment/ticket/19592
/bumpbot-warnings.txt#L93 bumpbot-warnings.txt L93]
> ['./wp-includes/js/jcrop/jquery.Jcrop.dev.js'] => [WARNING] The variable
obj has already been declared in the same scope... =function(obj,opt){var
---> obj <--- =obj,opt=opt;if(typeof
{{{ obj }}} is the argument [http://core.trac.wordpress.org/browser/trunk
/wp-includes/js/jcrop/jquery.Jcrop.dev.js#L35 already], makes no sense to
{{{ var obj = obj }}}, no? Do we optimize third party libraries? This
Jcrop library is one of the largest warning generators.
Replying to [http://core.trac.wordpress.org/attachment/ticket/19592
/bumpbot-warnings.txt#L335 bumpbot-warnings.txt L335]
>WARNING] The variable t has already been declared in the same scope...
(this.use_gebi&&e){var ---> t <--- =e.originalTarget;while(t.parentNode
Patched up some of the relevant
[http://core.trac.wordpress.org/attachment/ticket/19592/bumpbot-
warnings.txt#L296 colorpicker warnings], it did have an unused variable.
Overall should we be listening to some sort of Lint instead of a
compressor, the main purpose of which is to keep the bytecount down?
+ Today got a couple of warnings from the newer:
> 53/64: ./wp-includes/js/customize-controls.dev.js
> [WARNING] Found an undeclared symbol: wp
> (exports,$){var api= ---> wp <--- .customize;api.Previewer=api.Messenger
Parts are still in very active development so no point in touching them
yet.
Also, attached is a stripped-down bumpbot for local use, if anyone one
wants to run on local trunks for debugging and patching. Where can I get
the latest bumpbot source code, btw?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19592#comment:25>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list