Chapter 14. Builds

While developing the FindACab app, you might have noticed all the JavaScript classes that are loaded in the memory (see Figure 14-1). This is a mix of Sencha Touch framework classes and the custom classes you wrote yourself (i.e., everything that’s in the FindACab namespace). Obviously, this is not what you want for production environments, given that every JavaScript file is a separate network request and it can be a huge performance hit, especially on a mobile connection.

All the Sencha Touch JavaScript classes that are loaded in the memory during development
Figure 14-1. All the Sencha Touch JavaScript classes that are loaded in the memory during development

This is why you want to create a build package, a small package with only the absolutely necessary code for running your app. The package concatenates (joins) all the JavaScript classes that you use in the correct order, whether these are custom classes or Sencha Touch framework classes, and also minifies them to reduce the file size smaller. The creation of the build package is called the build process. You’ll use the Sencha Cmd tool for this. Remember the process for writing a Sencha Touch application with code? The last step in this process is to create a build with Sencha Cmd (see Figure 14-2). If you have used Sencha Cmd to generate your application, building the app is a piece of cake.

Figure 14-2. The process for writing a Sencha Touch application

Tip

You didn’t use Sencha Cmd ...

Get Hands-On Sencha Touch 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.