1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    simonwittber is on a distinguished road

      0  

    Default 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?

  2. #2
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,939
    Vote Rating
    64
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    Sencha Cmd v3 is vastly improved see http://docs.sencha.com/ext-js/4-1/#!/guide/command
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    simonwittber is on a distinguished road

      0  

    Default


    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.

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    301
    Vote Rating
    16
    worthlutz will become famous soon enough

      0  

    Default


    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.

    Worth

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    simonwittber is on a distinguished road

      0  

    Default


    Hmm sadly this doesn't work for me.

    When I follow your method exactly, Architect complains about not being able to save some files.

    When I copy the architect project over a generated project manually, I get further, however the built project complains with some javascript errors. The generated index.html is a little different to the architect app.html...

    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...

  6. #6
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,939
    Vote Rating
    64
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    You'll need to simply add the includes from the app.html to index.html as sencha build needs the microloader (afaik)
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  7. #7
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,939
    Vote Rating
    64
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    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.
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team

  8. #8
    Sencha User
    Join Date
    Aug 2012
    Posts
    12
    Vote Rating
    0
    simonwittber is on a distinguished road

      0  

    Default


    OK, so to be clear, the current advice is that Cmd will not work with ExtJS projects right now?

  9. #9
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    301
    Vote Rating
    16
    worthlutz will become famous soon enough

      0  

    Default


    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.

    Worth

  10. #10
    Sencha - Architect Dev Team Phil.Strong's Avatar
    Join Date
    Mar 2007
    Location
    Olney, MD
    Posts
    1,939
    Vote Rating
    64
    Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice Phil.Strong is just really nice

      0  

    Default


    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
    Phil Strong
    @philstrong
    #SenchaArchitect
    Sencha Architect Development Team