Packing on the function level

Skip to first unread message


Feb 9, 2010, 12:25:57 PM2/9/10
to MochiKit
Has anyone made an attempt to pack up MochiKit omitting functions that
are not used?
e.g. include DateTime.toISODate but not DateTime.toPaddedAmericanDate
if the latter doesn't happen to be called in a given file.

I realise this would be non trivial to do automatically..


Feb 9, 2010, 12:55:16 PM2/9/10
to MochiKit
This should be possible using the Google Closure compiler:
(Some issues to watch out for:

I hope to find time to try this myself also, please report back about
your progress! Would be nice if MochiKit can be verified to be
compilable using Closure.

// Fredrik


Feb 10, 2010, 10:57:02 AM2/10/10
to MochiKit
Thanks Fredrik, that's exactly what I'm looking for..

No luck compiling a packed version of MochiKit (1.5) and trying to
connect a signal - I get an error "MochiKit.i is undefined". The
closure inspector isn't working for me (FireBug 1.5.0) so I'm afraid I
can't further investigate at this time :-(

Per Cederberg

Feb 10, 2010, 3:54:53 PM2/10/10
to MochiKit
Don't want to send stop-energy around, but is it really worthwhile to
pack MochiKit like that? I mean, the full MochiKit.js is only 197,5 kB
uncompressed. And the customizer we already have lets you pick quite
freely on the module level.

Have you double-checked what type of performance increases you'll see
in you load times if packing a smaller JS file? Perhaps just gzipping
the file will give you a similar speedup?



> --
> You received this message because you are subscribed to the Google Groups "MochiKit" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Reply all
Reply to author
0 new messages