PDA

View Full Version : Documentation for generating builds



clubby
6 Apr 2012, 1:10 PM
Does anyone know of any good documentation for how to generate and implement builds using the SDK? And if there isn't any, when it might be available?

I'm running into various snags, and am wondering if I should wait for some docs or keep fighting through it. I've seen "Sencha Command" and "Using and Creating Builds", but there isn't much info on:


how do I configure app.json
what do I do after I excute "sencha app build -e production" (e.g. load files using microloader?)
what does a microloader do, is it necessary, and what's the difference between development/production/testing

Jacky Nguyen
6 Apr 2012, 11:57 PM
how do I configure app.json


app.json has inline documentation for each and every item. Which item you don't understand?



what do I do after I excute "sencha app build -e production" (e.g. load files using microloader?)


Upload the output directory to your production server



what does a microloader do, is it necessary, and what's the difference between development/production/testing


The Sencha Command guide (http://docs.sencha.com/touch/2-0/#!/guide/command) does explain the difference between them at the high level. If you want to understand more on what's actually going on behind the scene, watch out for a newsletter article coming out in the next few days.

clubby
7 Apr 2012, 12:08 PM
Thanks for the info Jacky.

For app.json:

Which files should I list in the "cache" section of "appCache". Just index.html, or do I also list app.js, app.css, etc.
Deploying:

I see in the Touchtweets example, that the html tag is "<html manifest="" lang="en-US">". Should I actually be listing the path to the manifest? "<html manifest="build/production/cache.manifest" lang="en-US">"
In my <head> section, do I include references for each app file in the build/production folder (e.g. app.js, app.css)? Or is the microloader supposed to take care of that? This seemed to be the case when I included the development.js file, but not when I included the production.js file.

Jacky Nguyen
7 Apr 2012, 1:22 PM
For a basic application, there's nothing you have to do. The build process takes care of everything, it just works. Based on your question it seems like you didn't use Sencha Command to generate your application from the beginning. Instead you're trying to create everything manually from scratch. If that's the case, don't. Follow the guide to generate an app and build it in just 2 commands, and see everything works right out of the box. A production build is, well, fully production ready. All you have to do is to upload the output directory to your public server.



For app.json:

Which files should I list in the "cache" section of "appCache". Just index.html, or do I also list app.js, app.css, etc.


No. Only extra images / videos that you want to make available offline. Note that there's a size limit, google and read more on HTML 5 Application Cache. All JavaScript / CSS files are automatically handled by the micro-loader using localStorage.



I see in the Touchtweets example, that the html tag is "<html manifest="" lang="en-US">". Should I actually be listing the path to the manifest? "<html manifest="build/production/cache.manifest" lang="en-US">"


This is done automatically by Sencha Command



In my <head> section, do I include references for each app file in the build/production folder (e.g. app.js, app.css)? Or is the microloader supposed to take care of that? This seemed to be the case when I included the development.js file, but not when I included the production.js file.


No the micro-loader takes care of that. Generally you should not touch index.html at all. The only thing you have to do is to maintain your list of assets inside "js" and "css" items of app.json

clubby
9 Apr 2012, 1:09 PM
Thanks for the information Jacky - this is helpful. I used sencha app create to make the app, but made changes to my index.html file, which is probably causing issues. I'll give it another try.