On Feb 11, 2006, at 5:27 PM, [EMAIL PROTECTED] wrote:


I am quite pleased with MochiKit.

Javascript is showing up everywhere. And modules like MochiKit.DateTime
MochiKit.Format are particularly helpful in these cases. Is there a
good way to separate the generally useful javascript parts such as
these from the ones only useful to the web. Is it best to just modify
MochiKit.js for my own use? Do I just edit the
MochiKit.MochiKit.SUBMODULES global?

If you take a look at the docs, you'll see that DateTime and Format don't have any dependencies (not even Base). That means you can use them as-is without any other parts of MochiKit. If you put them individually in a script tag, they will just work.

I realize AJAX and the web are probably the priorities, however I am
curious where MochiKit for general purpose Javascript fit in projected
future of the library.  I, for one, would like to see more general
helpers or more guidence to whatever exists already in places like
Base.

Will these or can these be separated out and distributed in a fashion
where mochikit may be used more off line, as well. I suggest a way to
only load what you want or (possible) have a base MochiKit separate
from the modules.

What do you mean by "off line"? If you're talking about out-of- browser JavaScript, then take a look at scripts/spidermochi.js in the trunk. If you study what the script does, you'll see what needs to be done in order to bootstrap a couple mock objects so that 100% of MochiKit will load in any JavaScript environment.

The base of MochiKit is.. MochiKit.Base! MochiKit is just a name without the modules.

The packing script can create a custom distribution, but that's not really supported at this time. You need to know which modules you need and you need to know a correct order to load it in. For example:

scripts/pack.py Base Async > MochiKit-Async.js

I might change the procedure a bit such that packed versions of each script are individually kept in the repository, and one of the examples would know how to concatenate them in the right order so that you could copy+paste a distribution containing what you want. I have other priorities right now, though, so don't hold your breath.

-bob

Reply via email to