There is only one Javascript file in core that is packed, and that's jQuery. jQuery is not ours, and doesn't have to be modified by us. The packed file is essentially a compiled binary. All the other files are readable and well-commented.

In the interest of easy development and bugfixing, could we avoid obfuscating our own Javascript files in contrib too? The CVS repository should hold a readable (and patchable) source. As I see it, committing compiled code defeats the idea of the patch/CVS workflow and no performance benefit can offset this.

For this reason, I would argue that the following commit should be reverted:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/dhtml_menu/...

Comments

brmassa’s picture

Arancaytar,

its not compiled and its not binary, its plain text! its not exactly obisfuscation, coz is not intended to avoid public eyes.

i didnt changed the jQuery or any Drupal file. i compressed the module javascript only. any javascript can (and on my opinion, should) be compressed. the packer is now very reliable and doesnt affect the speed.

the DEV-dhtml_menu.js contains the exactly same file, now uncompressed. anyone can create a patch against DEV-dhtml_menu.js and its only the matter of using the packer again. its not big deal. it might not gain much using this (few kbs). but every user that downloads it will consume band.

regards,

massa

merlinofchaos’s picture

This is fine in Drupal 5, but do not do this in Drupal 6 which will do javascript aggregation and whitespace compression.

brmassa’s picture

Category: bug » task
Priority: Critical » Normal

Earl,

the aggregator is good to reduce the http requests. but the compressor doesnt matter.

the d6 compressor, as far i can tell, only removes the useless whitespaces, deducing a file to 80% ftom the original size. the packer i used removes comments and also does a series of code compression, reaching 45% from the original size. so i can make many comments the JS code but the final user will get only the compressed one. i believe its still worthy.

cheers,

massa

cburschka’s picture

Sorry, I didn't see the -dev Javascript file.

I'm still unsure about this, but that stems mainly from it not being used anywhere else.

brmassa’s picture

Status: Active » Fixed

With the new minifier created by Yahoo, the files can be even smalled.

Anonymous’s picture

Status: Fixed » Closed (fixed)