PDA

View Full Version : If ExtJS LLC has any pull



mschwartz
12 Jun 2009, 9:11 AM
Let's get zipped javascript files added to the standards.

Java has .jar and .war type files, they're simply .zip files with different extensions. Why not for javascript?

Imagine you have an Ext project broken out into 50 files. Instead of having to run some packer on them to optimize for download speed, just zip them up and use a script tag:
<script src="myproject.zip"></script>

It's been on my wish list for a while now.

If this did make it into the standards, we'd have to wait for enough browsers to support it for it to be worthwhile. But better to start now than never ...

arthurakay
12 Jun 2009, 10:30 AM
Wow, that's a cool idea! I wish that was actually a possibility.

At the Ext conference in April, Douglass Crockford spoke about standards, and where JS is heading... I'd love to hear his opinion on it.

Lobos
15 Jun 2009, 9:08 AM
It does sound good - but, it seems to be bringing in "compiling", be it only in the way that you have to zip your file before it will work. ie you would need to rezip every time you changed something!

in effect if you make your mind think of a folder as a zip file you will see that all your files are contained neatly in one area... from there it is trivial to have [yourChoiceOfServerScript] zip up the file if compression is required

what I would like to see is some kind of standard like google gears where you can have open the opportunities of offline data storage and such, or even some kind of organised caching added to the browser javascript engine as a standard...

there is always Adobe Air if you want ext to be compiled into one file

mschwartz
15 Jun 2009, 9:12 AM
It does sound good - but, it seems to be bringing in "compiling", be it only in the way that you have to zip your file before it will work. ie you would need to rezip every time you changed something!

in effect if you make your mind think of a folder as a zip file you will see that all your files are contained neatly in one area... from there it is trivial to have [yourChoiceOfServerScript] zip up the file if compression is required

what I would like to see is some kind of standard like google gears where you can have open the opportunities of offline data storage and such, or even some kind of organised caching added to the browser javascript engine as a standard...

there is always Adobe Air if you want ext to be compiled into one file

You only need to use the .zip archive for production... This is my concern.

I think you can freshen an archive by updating only the files that have changed in it (compared to the file system).

jay@moduscreate.com
15 Jun 2009, 10:13 AM
what about on the fly gzip compression?

jay@moduscreate.com
15 Jun 2009, 10:14 AM
Btw, the common practice is concatenate, minify, compress, etc.

mschwartz
15 Jun 2009, 10:14 AM
what about on the fly gzip compression?

Web servers (apache) can be configured to do that, all you'd have to do is join all your sources together, something like this:

cat *.js >foo.js

<script src="foo.js"></script>

jay@moduscreate.com
15 Jun 2009, 10:35 AM
I say "Value not found"

mschwartz
15 Jun 2009, 10:41 AM
cat *.js > foo.js
doesn't always work

Especially if you end a file with a line without a ; or don't have a newline at end of file.

And zip is handier way to pass things around to others. They don't cat -R * >extjs-all.txt and let you download that (for a reason).

~o)

jay@moduscreate.com
15 Jun 2009, 10:49 AM
That's why you use a minification tool. Concatenating and minifying are the first steps.

mschwartz
15 Jun 2009, 10:51 AM
That's why you use a minification tool. Concatenating and minifying are the first steps.

You don't need concatenation and minifying if you can just send a zip. You should get 10:1 compression or better with plain old zip.

Minification makes sense if you are doing obfuscation at the same time, but good luck sending any kind of remote configuration to heavily obfuscated javascript.

By obfuscation, I mean:

Ext.Toolbar(config)

gets replaced with

x(y)

EVERYWHERE in the code.

And that's smaller (less to compress), too.

jay@moduscreate.com
15 Jun 2009, 10:54 AM
Concat+Min == everyone can read it, even those who do not support gzip on the fly. It reduces the number of synchronous JS calls to the sever.

Again, on the fly compression is an added benefit to the mix.

jay@moduscreate.com
15 Jun 2009, 10:54 AM
Btw, i'm going to stop posting in this thread ;) we're just going in circles :(.

http://farm2.static.flickr.com/1149/761428854_abbd9d7de5.jpg