RFE: Javascript Compressor

I like this plugin. It is nice to be able to trim space out of my scripts. I still have users non-high speed connections, so any savings in space is a good thing.

Now a couple of requests.

1. Being able to designate separate directories for the source and the compressed scripts.
2. Being able to choose your own prefix and/or suffix for the source files.

Personally, I would rather put the source in one directory and have the compressed scripts go to antoher directory.

3. An option to run compress on all javascript files in a directory.


And, I think there is a small bug in the script. The documentation that it generates when there is no -source file doesn't reference the -source file, but the compressed file(which was orignally the source file).

Again, thanks for the script compressor.

5 comments

Oh, and to be complete greedy, I would like to make the comments optional or customizable. On smaller files, the documentation probably uses up the space that is saved by compressing.

0

More suggestions for the plug-in:

1. Remove function names. This is of course possible only if the
functions are hanging off of a prototype and used that way.

2. Rename variables inside a function to shorter names.

3. Package several files (according to a predetermined list, files
directory, etc.) to one file.

4. Provide an ANT task to do the same. This would make it possible to
use the compressor during a build regardless of IntelliJ.

Amnon

0

Doesn't your webserver have the option to compress textual responses? And needing to compress javascripts by removing blanks.. how much can that save? 10-15%? I bet that does a lot.

0

It does, if the customer is on a slow connection and there is a lot of javascript. The entire world is not supplied with high speed Internet(much less the infrastructure to support high speed Interent), even in the business world.

Also, not all of us have control over our servers(app, web, or otherwise) and are at the mercy of those who make up the rules. I have had to recode perfectly good programs in order to make them work in the latest environment with the latest rules.

So, if I can gain 10% to 15% for a user, especially with little effort, I will take it.

I will also take 10% to 15% on my 401K; it eventually adds up. :)

0

zmbs wrote:

It does, if the customer is on a slow connection and there is a lot of javascript. The entire world is not supplied with high speed Internet(much less the infrastructure to support high speed Interent), even in the business world.

Also, not all of us have control over our servers(app, web, or otherwise) and are at the mercy of those who make up the rules. I have had to recode perfectly good programs in order to make them work in the latest environment with the latest rules.

So, if I can gain 10% to 15% for a user, especially with little effort, I will take it.

I will also take 10% to 15% on my 401K; it eventually adds up. :)


I think it is more than that, as JavaScript is an interpreted language,
so the more fluff you take out of it (comments, spaces, long variable
names, function names where applicable, etc.) the interpreting engine
will have less to do. That is not covered by gzip, which merely saves
some bandwidth, which I agree that is not the bottleneck in many cases
(but it still is in some as zmbs wrote).

Amnon

0

Please sign in to leave a comment.