Development¶
Abstract¶
This chapter introduces and documents common developer tasks.
Please make sure that you set up your development environment correctly as detailled in Quickinstall (Apple Mac) or Quickinstall (Windows).
Virtualenv¶
All the shell commands listed here assume that you activated your virtualenv.
Building the App¶
On a Mac, do:
$ fab build
On Windows, do:
C:> grunt build
Both commands will rebuild the App, which involves:
- Compiling CoffeeScript to JavaScript
- Regenerating the ExtJS Theme
Creating a production build¶
On a Mac, the build task defaults to production mode:
$ fab build
On Windows, do:
C:> grunt coffee
C:> cd static
C:> sencha app build production
The minimized, compacted build will be placed in the build folder in the static directory.
Serving the Web App locally for development¶
On a Mac this will serve the development version and open a webbrowser with the correct URL:
$ fab serve
On Windows:
C:> cd static
C:> python -m SimpleHTTPServer
And open http://localhost:8000 in a web browser.
Developing and Live Reloading¶
This setup needs two shells:
- One shell to watch for changes and compile&reload them
- One shell to serve the application
Watching (same for Mac and Windows):
grunt watch
For Serving (2nd shell), see above.
This will have Grunt watch for file changes in the source directory. Grunt will recompile changed files and reload them by pushing the changes directly to the browser using web sockets. For this to work, your browser needs to support web sockets. We use Google Chrome.