14.1. How to Use This Chapter
MochiKit comes with very good documentation. But, it's reference documentation. It tells you what you need to know to use a specific function. That's certainly valuable, and this chapter doesn't try to reproduce that.
The goal of this chapter is to provide more background around the features of MochiKit with the perspective of Python programmers in mind.
At the time of this writing, MochiKit 1.4 has not yet been released. Much of the development appears to have been done already, but it is possible that there will be some variation between the functions presented here and the final 1.4 version. This will be most true for MochiKit.Style and MochiKit.Visual.
14.1.1. MochiKit's Packaging
MochiKit is packaged up as a single, packed MochiKit.js file that contains all of the features. Note, however, that the features covered in "The Wow Factor" section of Chapter 15, "Effective Ajax with MochiKit," have not yet been packaged into a full MochiKit.js. You can use those modules separately now and you will still be able to do so after MochiKit 1.4 is released.
In addition to the single .js file format, you can use just the parts of MochiKit that you need. MochiKit's documentation provides a clear indication for each module of which modules are required, and MochiKit makes sure that the requirements are met. If you use MochiKit.Iter without including MochiKit.Base, for example, an exception is thrown.
14.1.2. MochiKit's Interactive Shell
The examples in this chapter can all work within the "mochiexamples" project that comes with this book (www.turbogearsbook.com). To try these examples, go into the mochiexamples directory and run the following:
You'll find the interactive interpreter at http://localhost:8080/interpreter.