Results 1 to 4 of 4

Thread: Evaluating cmd to my use case.

  1. #1
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    378

    Question Evaluating cmd to my use case.

    Hi. I have developed a web application that I have just ported from ExtJs 3 to 4. It is still using ext-all.js and is not in the MVC pattern.
    I would like to have some feedback from more experimented users in the matter of try to switch to cmd style or not.


    My app works like that:
    - Every button of my menu, calls a JS file containing all the code to open a new tab or window and do some stuff.
    - When I click that menu button, my app checks and, if it is the first time this button was clicked, it do a GET on the JS file and run it.
    - Subsequent clicks will just run it, because the file content is already loaded.
    - The same thing happens to localized files. They are loaded just once and just when they are needed for the first time.
    - I load then by doing a AJAX request on then and adding a script tag to the DOM with the file content.


    Now my doubt:
    I undestand that the cmd build process would concatenate all the JS files in one big app.js, right?
    It is always like that or can I choose to not concatenate my "app modules" and localization JS files so my application can keep loading this files on demand?


    You can see the web app running at http://websys.ghsix.com.br/?comp=2.
    By clicking on Help (Ajuda) on the menu and clicking the options there, you can see the files being loaded on demand and just once.


    Thank you for any clarification on that matter.
    LAMPE (Linux / Apache / MySQL / PHP / ExtJs)

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    It's recommended to have your javascript compiled into a single file and then cache the file so only the first load is to download the file otherwise the browser will retrieve from it's cache which is fast.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium Member ethraza's Avatar
    Join Date
    Jun 2007
    Location
    Brazil
    Posts
    378

    Default

    So, it's optional to what JS files CMD will concatenate? There is some docs about it?
    LAMPE (Linux / Apache / MySQL / PHP / ExtJs)

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    Quote Originally Posted by ethraza View Post
    So, it's optional to what JS files CMD will concatenate? There is some docs about it?
    Not sure I follow.

    It's optimal to have all files compiled into a single file which is what Cmd will do unless you setup several compile commands.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •