30 Oct 2012 10:16 PM #1
Packaging an Architect project
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?
6 Nov 2012 3:36 PM #2
6 Nov 2012 6:56 PM #3
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.
7 Nov 2012 9:11 AM #4
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.
7 Nov 2012 6:32 PM #5
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...
8 Nov 2012 7:26 AM #6
8 Nov 2012 7:27 AM #7
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.
8 Nov 2012 7:54 AM #8
OK, so to be clear, the current advice is that Cmd will not work with ExtJS projects right now?
8 Nov 2012 4:42 PM #9
It is working for me on a test project. I can run the project from my project directory and the loader loads each .js file.
Then I do "sencha app build" and in the build directory is a new directory with the .js files combined together into one file. I even have some external components which I have included using overrides and requires and they included in the app.js also. The build runs and loads faster to boot.
I do not think that I have modified much to get this to work.
I am working on ubuntu 12.04 linux and did have to work a bit to get compass installed. Problems were related to how ubuntu handles ruby gems. Again I did not write this down and have not been able to get it work on my laptop. I'm writing down all steps taken now so I can reproduce things! My new private wiki is my friend.
I was on the road today and not in the office and do not have access to my computer where all this is located. I'm sorry my instructions above were limited but I spent a good bit of time figuring out how to do this and am not sure of all the steps I took. It was a lot of trial and error. I will try an set up another project and document what I did but it will not happen tomorrow. Sorry current work prevails.
13 Nov 2012 3:00 PM #10