Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    62
    Vote Rating
    1
    zzhouag is on a distinguished road

      0  

    Default Answered: Include only required classes in ext-all.js

    Answered: Include only required classes in ext-all.js


    Hi, I want to reduce the size of ext-all.js.
    Refer to some posts, I think the proper way is to generate a jsb file of my project and build an app-all.js only include required classes, then use ext.js instead of ext-all.js.

    My project architecture as below

    Code:
    app
         --module1
              --controller
              --model
              --store
              --view
         --module2
              --controller
              --model
              --store
              --view
         ......
    extjs-4.2
    app.js
    main.html
    ......
    Is that possible to achieve that under sencha cmd 3.1.2? Are there some examples? Thank you!

  2. Sencha Cmd does this automatically ... it reads your classes and then creates and all-classes.js that includes the required classes for your app, as well as your app.

    You can always use the 'sencha compile' aspect of Cmd to create custom versions. This is low level and usually not required.

    If you are moving from JSB (tools) to Cmd .. you will need to generate a new app with your namespace and the move your existing files over to the new;y generated app, as there is metadata that is created for Cmd. You would need to then run 'sencha refresh' after you have moved your app files over to update your meta with the app classes.

    If you run sencha app generate and sencha app build, that will create you a full working example.

    Code:
    sencha -sdk /path/to/sdk generate app MyApp /path/to/myapp
    sencha app build
    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,080
    Answers
    674
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    Sencha Cmd does this automatically ... it reads your classes and then creates and all-classes.js that includes the required classes for your app, as well as your app.

    You can always use the 'sencha compile' aspect of Cmd to create custom versions. This is low level and usually not required.

    If you are moving from JSB (tools) to Cmd .. you will need to generate a new app with your namespace and the move your existing files over to the new;y generated app, as there is metadata that is created for Cmd. You would need to then run 'sencha refresh' after you have moved your app files over to update your meta with the app classes.

    If you run sencha app generate and sencha app build, that will create you a full working example.

    Code:
    sencha -sdk /path/to/sdk generate app MyApp /path/to/myapp
    sencha app build
    Scott.

  4. #3
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    62
    Vote Rating
    1
    zzhouag is on a distinguished road

      0  

    Default


    Hi scottmartion, thank you for your reply, it's what I looking for. But when I generate my app, the following errors occur...

    ......
    [INF] [x-property-file] Updating property file: /Volumes/zzgHD/ASTRI/HEMS/hems/fe/web/.sencha/app/sencha.cfg
    [ERR]
    [ERR] BUILD FAILED
    [ERR] java.lang.NullPointerException
    [ERR]
    [ERR] Total time: 1 second
    [ERR] com.sencha.exceptions.BasicException
    [ERR] com.sencha.exceptions.BasicException

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,080
    Answers
    674
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can you post your generate command?

    What if you generate to a local path? Is your path a LAN drive?

    Scott.

  6. #5
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    62
    Vote Rating
    1
    zzhouag is on a distinguished road

      0  

    Default


    My path is my local drive, the commands as below:

    ZZGs-MacBook-Pro:/ ZZG$ cd /Volumes/zzgHD/ASTRI/HEMS/hems/fe/extjs-4.1.3
    ZZGs-MacBook-Pro:extjs-4.1.3 ZZG$ sencha generate app HEMS /Volumes/zzgHD/ASTRI/HEMS/hems/fe/web

  7. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,080
    Answers
    674
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if you get a better result with specifying the SDK

    Code:
    sencha -sdk /Volumes/zzgHD/ASTRI/HEMS/hems/fe/extjs-4.1.3 generate app HEMS /Volumes/zzgHD/ASTRI/HEMS/hems/fe/web
    Scott

Thread Participants: 1