Time for action—exploring the MooTools Core Builder

To explore the MooTools Core Builder, perform the following steps:

  1. Go to the MooTools Core Builder webpage by navigating to: http://mootools.net/core.
  2. Notice that the MooTools Core is subdivided into 7 sections. Each section has 2 to 6 JavaScript libraries associated with it. Take the time to read each description to help you get a better understanding of what each file does.
    Time for action—exploring the MooTools Core Builder
  3. Click on the Event component. Notice that several other components were automatically selected for you. This ensures that you also include the dependency files that are required for the Event component to run.
    Time for action—exploring the MooTools Core Builder
  4. Notice the different compression types. YUI Compressor is selected by default.
Time for action—exploring the MooTools Core Builder

What just happened?

We just covered how to roll your own MooTools Core file and learned about the MooTools Core structure by exploring the MooTools Core builder. Once you're comfortable with how MooTools works, you should use the MooTools Core Builder to create a MooTools Core file that includes only the components you need.

Have a go hero — — explore the MooTools Core Builder output

Try to download the previous example with the Events component checked. After downloading your own version of the MooTools Core, open the file in your favorite text editor. Also open the MooTools Core file that you downloaded earlier. Notice that the one you just downloaded is significantly shorter; that's because you only downloaded the Events component and its dependency files.

Have a go hero — — explore the MooTools Core Builder output

The entire uncompressed MooTools Core is close to 4,000 lines long (and has a file size of 96 KB).

Have a go hero — — explore the MooTools Core Builder output

In comparison, the Core Builder output where only Events and its dependencies are included is just a little over 1,000 lines of code (and weighing only 24 KB).

MooTools More

The second part of the MooTools framework is simply called More. As the name implies, it is a collection of useful plugins, functions, classes, and methods that extends the MooTools Core.