[theme-reviewers] Heavily Commented Javascript Files.

Dion Hulse (dd32) wordpress at dd32.id.au
Tue Jul 5 03:40:54 UTC 2011


To be quite honest: I'm not up to speed on the theme review standards.

That being said, WordPress core uses the YUI compressor for JS and CSS with
the --no-munge param. I believe some are considering experimenting with
other compressors however (but they're not in use on core files)

Definately be careful when it comes to minifying the code however, as the
Theme review team would need to verify that the javascript isnt inserting
something malicious (I'm not sure what standards/rules are applied to JS..),
You may find simply striping comments and leaving the rest as-is will result
in enough of a size drop to be acceptable to you. If it's just striping
comments, a compressor mention wouldn't be needed.

The reason i suggested adding a compressor comment was so people could
verify the minified file, is infact, equal to the full file.

On 5 July 2011 13:32, Michael Fields <michael at mfields.org> wrote:

> Thanks for the tips! I knew about the enqueue part already, but adding the
> compressor info was not something that I really considered. Will definitely
> do this for release. Can you suggest a good compressor to use that is in
> compliance with theme review standards?
>
> Thanks!
> -Mike
>
>
> On Jul 4, 2011, at 8:28 PM, Dion Hulse (dd32) wrote:
>
> Just remember to use best practices in doing so.
>  * If you minify the file rather than just strippings comments, don't munge
> it.  To keep people happy, mentioning in the dev version what compressor and
> settings were used would probably be appreciated.
>  * Default to the minified/commentless file, but enqueue the dev version
> when the SCRIPT_DEBUG constant is set, this is what core uses to use the
> non-minified files, makes it easier to debug that way IMO.
> (Those apply to plugins as equally as to Themes)
>
> On 5 July 2011 13:24, Chip Bennett <chip at chipbennett.net> wrote:
>
>> All else being equal and being implemented properly, I don't see any
>> reason why that should cause a problem.
>>
>> Given that you're not actually required to provide a version of the JS
>> file with inline documentation (i.e. the condensed version would be
>> perfectly valid on its own), providing a second, documented version is
>> an example of going above and beyond. IMHO anything that adds
>> documentation to a Theme should be encouraged.
>>
>> Chip
>>
>> On 7/4/11, Michael Fields <michael at mfields.org> wrote:
>> > I've been working on integrating some javascript functionality into my
>> next
>> > public theme. Thing is, I've grown quite accustomed to documenting my
>> code
>> > over the past year and this applies to javascript as well. The file in
>> > question is almost 200 lines long and I only see it grown. Fully
>> documented,
>> > it could easily become 3-400 lines. I'm projecting about 50% of the code
>> > will be documentation when all is said and done.
>> >
>> > I would like to include it into the theme much the same way that
>> WordPress
>> > included js. Having a "dev" version and a "live" version. The live
>> version
>> > would contain the same functional code minus excess whitespace and
>> comments.
>> > I would not use any compression or package application to obfuscate the
>> > code.
>> >
>> > Just wondering if this is something that would pass theme review. I know
>> > questions like this have been asked before, but I honestly can not
>> remember
>> > the outcome.
>> >
>> > Here's the script:
>> > https://github.com/mfields/nighthawk/blob/master/dropdowns.js
>> >
>> > Best wishes,
>> > -Mike
>> > _______________________________________________
>> > theme-reviewers mailing list
>> > theme-reviewers at lists.wordpress.org
>> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >
>>
>> --
>> Sent from my mobile device
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110705/d1e18c9b/attachment.htm>


More information about the theme-reviewers mailing list