1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    20
    Vote Rating
    0
    sujeetkr is on a distinguished road

      0  

    Default Unanswered: how to package(minify) two extjs files

    Unanswered: how to package(minify) two extjs files


    Hi,
    As per earlier suggestion, I have divided the application into two part :
    1) login.html => to handle login/authentication [Written in Extjs]
    2) main.html => user dashboard [Written in Extjs]

    How will I deploy above application? Do I have to minify both login.html and main.html and deploy ? Or I have to minify only one file and then deploy?

    Thanks,
    Sujeet

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,984
    Answers
    662
    Vote Rating
    455
    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


    Separate your HTML and JS and minify your JS code. You should only have 1 html file. Splitting your JS code is however recommended and then minify into 1 file.

    Scott.

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    20
    Vote Rating
    0
    sujeetkr is on a distinguished road

      0  

    Default


    Thanks for reply.

    I have made one html file. But after minimizing this it still needs the app folder.

    I was under the impression that after minimizing, it only needs
    1) app-all.js
    2) all-classes.js
    3) app.jsb3

    But when I deleted the app folder, it gives error? Does it still needs app folder after minimization or I am doing it wrong?

    I was following the instruction of http://docs.sencha.com/ext-js/4-0/#!...etting_started to minimize it.


    sencha create jsb -a http://localhost/helloext/index.html -p app.jsb3
    sencha build -p app.jsb3 -d .


    Thanks,
    Sujeet

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Location
    Switzerland
    Posts
    6
    Vote Rating
    0
    Swissbite is on a distinguished road

      0  

    Default Check the jsb3 file

    Check the jsb3 file


    Hi Sujeet

    First tip: Check if all files are listened in the jsb3 file. Sometimes there are some requirements who are not defined but still needed. I fixed this with either:
    - check the jsb3 file, and add the missing files manually
    or
    - Add requirements to the app.js file

    Additionally: Check that the ext.js file is linked and dynamic lode is enabled.

    Then recreate the jsb3 file and regenerate the app.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    20
    Vote Rating
    0
    sujeetkr is on a distinguished road

      0  

    Default


    Hi,
    Thanks for reply.

    When I checked the jsb3 file, it does not include the controllers that are loaded dynamically.

    How can I include dynamically loaded controllers in the jsb3 file?
    --- I don't want to add every controller manually, as there are many controllers.

    If I put "requires" in the app.js and put all the the dynamically loaded controllers in it, then the application doesn't load ?

    added requires : "App.controller.Test" in app.js
    -----
    Also if I write all the dynamically loaded controller in the requires => it will first load these controller => Then the whole purpose of dynamically loaded controllers is defeated.

    Bye,
    Sujeet

  6. #6
    Sencha User
    Join Date
    Nov 2011
    Location
    Switzerland
    Posts
    6
    Vote Rating
    0
    Swissbite is on a distinguished road

      0  

    Default Define controllers in controllers[]

    Define controllers in controllers[]


    Hi,

    Controllers have to be defined in the array controllers[]. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.app.Application

    That should work.

    Edit: This property does not exist before version 4.1
    Last edited by Swissbite; 30 Aug 2012 at 5:48 AM. Reason: API

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    20
    Vote Rating
    0
    sujeetkr is on a distinguished road

      0  

    Default


    Hi,
    Earlier I defined the controllers in the array controllers. But as the number of controllers increased, the application takes significantly more time to load. To overcome this problem, I decided to load controllers dynamically. But now I can't minify the application as controllers are not mentioned in the controllers[].

    Thanks,
    Sujeet

Thread Participants: 2

Tags for this Thread