Packing on the function level

0 views
Skip to first unread message

Eoghan

unread,
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..

Fredrik

unread,
Feb 9, 2010, 12:55:16 PM2/9/10
to MochiKit
This should be possible using the Google Closure compiler:
http://code.google.com/closure/compiler/
(Some issues to watch out for: http://code.google.com/closure/compiler/docs/api-tutorial3.html#dangers)

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.

Regards
// Fredrik

Eoghan

unread,
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

unread,
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?

Cheers,

/Per

> --
> You received this message because you are subscribed to the Google Groups "MochiKit" group.
> To post to this group, send email to moch...@googlegroups.com.
> To unsubscribe from this group, send email to mochikit+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages