peerigon / alamid

Framework for RESTful JavaScript web applications that run both on the server- and clientside.
http://www.alamidjs.com
MIT License
23 stars 3 forks source link

Bundle-Compression #133

Closed meaku closed 11 years ago

meaku commented 11 years ago

We might provide an option to compress the bundle in production mode. The Bundler should have an option for that.

JsMin works pretty good, with nodeclass and webpack. Compression-ratio 47%.

UglifyJs doesn't work so far.. might need some fine-tuning.

sokra commented 11 years ago

With webpack 0.8 I switched to UglifyJs 2, which is pretty good and the author is pretty fast in fixing compression bugs :)

meaku commented 11 years ago

Should be part of #144.

jhnns commented 11 years ago

Is the compression working now?

meaku commented 11 years ago

I enabled "minimize" in production mode. Works out of the box now.

File-sizes compared (app.js)

awesome! :octocat:

The only thing that needs to be changed is the bundle-serving in production mode. If you had your app running in development-mode and there is a uncompressed bundle residing in /bundle this one would be served even if you change to production mode. In the future the bundle will always be created initially even if running in production mode, to get the suitable bundle-created.

jhnns commented 11 years ago

Cool! But 310kb is still quite big. We need to loose weight :hamburger: :facepunch:

meaku commented 11 years ago

I think 310kb is alright for the default compression. Further compression should be up to the developers using alamid. They could always compress with their own preferred settings to achieve better results.

So i won't invest more time in compression. We should rather try to get rid of boileplate code, duplicates and big-fat-ass modules like jQuery.

Am 14.01.2013 um 11:26 schrieb Johannes notifications@github.com:

Cool! But 310kb is still quite big. We need to loose weight

— Reply to this email directly or view it on GitHub.

jhnns commented 11 years ago

That's what I meant. Compression is ok, but we should loose dependencies.