Packaging an Architect project
I'm attempting to package my Architect ExtJS 4.1 project for a web deployment, in order to reduce the number of HTTP downloads and script size.
I'm using SDK Tool beta 3.
First I run this command in my project folder.
sencha create jsb -a app.html -p app.jsb3
I then run:
sencha build -p app.jsb3 -d .
After that I create an index.html file and change the script locations for the new files.
After they I load the index.html in chrome, and the project doesn't work. The console shows me that for some reason my class files are still trying to be loaded from a folder that doesn't exist (seems related to the namespace of my application).
Is this known to be broken or am I missing something?
Ah I see I was using the wrong tool.
The package command seems to be aimed at Touch projects, I'm trying to minimise a build for the web (ExtJS).
Do these same commands work with ExtJS? After following the steps, I don't see any .json files generated which I can use with the sencha package command. The sencha compile concatenate commands seems to be what I need to use, however the generated file doesn't appear to work when I use it in my app.html file.
More documentation and some examples would help us all.
Here is what I have figured out over the last two days.
From the ExtJS SDK directory generate an application directory with
sencha generate app MyApp ~/Sencha/projects/MyApp
Use your own path to the "MyApp" directory.
Then save the Architect project to that directory.
Actually I think that I opened my Architect project first and then deleted the directory where the architect project was and recreated it with the "sencha generate app" command. And then resaved the project into that directory.
Then I ran
sencha app build
to get the built application which will be in the "build" directory.
This assumes that you have all the parts installed correctly.
Sorry if this seems sketchy but I wrote it quickly as I'm still trying to figure out the complete picture.
If this is the wrong information, I hope the Sencha devs will pipe in and correct me.
Hmm sadly this doesn't work for me.
When I follow your method exactly, Architect complains about not being able to save some files.
However when I copy app.html over index.html and do a rebuild, I get a 0 byte all-classes.js.
Not sure what to try next...
You'll need to simply add the includes from the app.html to index.html as sencha build needs the microloader (afaik)
Note that we'll be adding Ext JS support w/ Cmd in a later release. For now we only support sencha package build and sencha package run (touch only). We've built it in such a way that at some point down the line we'll enable you to run the whole suite of sencha command.
OK, so to be clear, the current advice is that Cmd will not work with ExtJS projects right now?
Of course it will work you just don't get hand holding by Architect yet. Using the docs for Ext JS and Cmd from the command line should work just fine