1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    411
    Vote Rating
    2
    parky128 is on a distinguished road

      0  

    Default Deployment Best Practices

    Deployment Best Practices


    Hi,

    For an MVC structured Touch application, whats the best way of deploying the script files that reside in the model, view and controller folders? Can you for example minify them into one js file or do you have to minify each separately and they stay in those folders?

    I hope this makes sense!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There will be tutorials on this for the next release.

    For views, it is best to put all required classes that that view uses in the requires array property.

    Code:
    Ext.define('MyView', {
        ....
        requires : [
            'Ext.TitleBar',
            'Ext.dataview.List'
        ],
        ....
    });
    It can be any class, not just other view components.

    For controllers, you should specify your controlleres in your Ext.application:

    Code:
    Ext.application({
        ....
        controllers : [ 'Main' ]
        ....
    });
    It will interate through that and prepend the name of your app (<name>) and controller: <name>.controller.Main. You can do the same with model, stores, and views

    Within a controller you can specify the models, stores, and views array:

    Code:
    Ext.define('MyContoller', {
        ....
        models : [ 'User' ],
        stores : [ 'Users' ],
        views : [ 'Users' ]
        ....
    });
    Just like in Ext.application, it will prepend <name>.model, <name>.store, <name>.view to those classes depending which property it is in.

    You can use the requires in Ext.application, any of your controllers, models, stores, and views. The class you are extending (or overriding) will automatically be required.

    If you need things loaded upfront, you can use Ext.require and pass in a class name string or an array of class name strings. One thing to note is the path for your Ext.application is not entered so if you Ext.require a class that stems from your application's name, the path will be unresolvable.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    40
    Vote Rating
    2
    clubby is on a distinguished road

      0  

    Default


    I found this link helpful. It describes how to use Sencha's SDK tools to consolidate/minify all of your application files into one file. http://robertdougan.com/posts/packag...ncha-sdk-tools

    I ran into a few problems where the path to some files was incorrect, but I fixed it by revising my folder structure and changing the paths in my app.jsb3 file.

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2008
    Posts
    8
    Vote Rating
    1
    chdig is on a distinguished road

      0  

    Default Ext.Require placement

    Ext.Require placement


    Quick follow up question: Where exactly is the best place to put the Ext.Require(), when you want to load things upfront?

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Before the Ext.application call
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.