Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Why are some classes being downloaded when I'm not using them?

  1. #1
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default Answered: Why are some classes being downloaded when I'm not using them?

    I built an app with sencha cmd - "sencha build production" and when I run my app through Fiddler I can see it downloading /ext/classic/classic/src/picker/Date.js and /ext/classic/classic/src/form/field/Date.js, and also in my classic.json file that gets compiled I can see references to pickers in there too.

    I'm not "requiring" those classes anywhere in my app, so I thought CMD was only spuposed to include files required for the app to run? Am I doing something wrong or do I have to specifically "exclude" files in build.xml that I don't want included in the build?

  2. Have you set a web server with the contents of /build/production/YourProject?

    If you are just using "sencha app watc..."(banned word o_O) or using a web server serving /, then you are using the development files although you did a build production. And development loads tons of stuff.
    When you do "sencha app build ..." it just basically creates the files at /build/... nothing more.
    Try setting your web server to /build/production/YourProject

    If I am not wrong.

    P.S.: Why T F is watc-h word banned? I can't submit the answer!

  3. #2

    Default

    Have you set a web server with the contents of /build/production/YourProject?

    If you are just using "sencha app watc..."(banned word o_O) or using a web server serving /, then you are using the development files although you did a build production. And development loads tons of stuff.
    When you do "sencha app build ..." it just basically creates the files at /build/... nothing more.
    Try setting your web server to /build/production/YourProject

    If I am not wrong.

    P.S.: Why T F is watc-h word banned? I can't submit the answer!

  4. #3
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default

    I think you nailed it. When I do a sencha build production it puts the files in a ${ext.dir}/build directory. I had to take all of those files and copy them to a different directory, then copy over the bootstrap.js and index.html files to that directory - then it works! That certainly isn't made clear in the CMD documentation if that's the process that's required.... Many thanks!

  5. #4

    Default

    Quote Originally Posted by a344254 View Post
    I think you nailed it. When I do a sencha build production it puts the files in a ${ext.dir}/build directory. I had to take all of those files and copy them to a different directory, then copy over the bootstrap.js and index.html files to that directory - then it works! That certainly isn't made clear in the CMD documentation if that's the process that's required.... Many thanks!
    Happy to see it works

    But as far as I know, you don't have to copy over the bootstrap.js and index.html back.

    You just use the index.html at ${ext-dir}/build/production/YourProject/index.html
    The bootstrap.js is embedded in ${ext-dir}/build/production/YourProject/microloader.js

    You will see that ${ext-dir}/build/production/YourProject/index.html has now a reference:

    Code:
    <scri pt  id="microloader" data-app="78f7114b-8d0a-41b3-a82a-d8ec26f4e264" src="microloader.js"></scri pt>
    and not your bootstrap.js from development.



    P.S.: WHY T F "scri _ pt" word is banned?!

  6. #5
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default

    I thought that perhaps I should be able to use the index.html at ${ext-dir}, but it was blank.

    I'm also having trouble posting due to potential forbidden words, so I'll try a line at a time until I find the culprit

  7. #6
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default

    Also my index.html has the line

    scri(forbiddinword?)pt id="microloader" src="bootstrap.js"

    and bootstrap.js was missing. Is that the wrong line to have in index.html?

  8. #7

    Default

    My /index.html has this line:

    Code:
    <!-- The line below must be kept intact for Sencha Cmd to build your application -->
    <scri(banned) id="microloader" data-app="78f7114b-8d0a-41b3-a82a-d8ec26f4e264" type="text/javasc(banned)" src="bootstrap.js"></scri(banned)>
    while my /build/production/MyProject/index.html has the following line, substituted by sencha command when building:

    Code:
    <scr(banned)  id="microloader" data-app="78f7114b-8d0a-41b3-a82a-d8ec26f4e264" src="microloader.js"></scri(banned)>
    As you can see, it changes bootstrap to microloader in the build process.

  9. #8
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default

    I don't see a microloader.js file in my build directory. I tried replacing bootstrap.js with microloader.js anyways to see if it was embedded somewhere but it fails with a 404 code.

  10. #9

    Default

    I have it, as you can see here:

    Selección_070.png

    -- edit:

    Do you have this in app.json? :

    Selección_072.png

  11. #10
    Sencha Premium Member
    Join Date
    Dec 2010
    Posts
    14

    Default

    No, my app.json has this

    "production": {
    "output": {
    "appCache": {
    "enable": false,
    "path": "../cache.appcache"
    }

    },
    "loader": {
    "cache": "${build.timestamp}"
    },
    "cache": {
    "enable": false
    }
    },

    I'll try replacing it with what you have and see what I get. Is there much difference in the microloader.js to the bootstrap.js - performance or otherwise? Everything seems to be working with with bootstrap.js

Page 1 of 2 12 LastLast

Similar Threads

  1. Reference to Raw Image downloaded using Ext.Img
    By happybirthday in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 16 Apr 2015, 2:17 PM
  2. Chart related classes rae not present in downloaded touch 2.0.1
    By himgp in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 12 Apr 2013, 7:04 AM
  3. Replies: 2
    Last Post: 18 Mar 2013, 5:07 AM
  4. Treegrid example downloaded but not working
    By megaskins in forum Community Discussion
    Replies: 5
    Last Post: 12 Jan 2010, 2:05 PM
  5. Downloaded Ext 2.2: now what?
    By |Norman| in forum Community Discussion
    Replies: 6
    Last Post: 14 Nov 2008, 4:08 AM

Tags for this Thread

Posting Permissions

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