1. #1
    Sencha User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    zxcvbgfdsa8 is on a distinguished road

      0  

    Default Unanswered: Extjs 4.0.7: Sencha SDK minified app still loading individual JS files.

    Unanswered: Extjs 4.0.7: Sencha SDK minified app still loading individual JS files.


    Hey, I'm trying to deploy my application in a minified manner and I am following these instructions:
    http://docs.sencha.com/ext-js/4-0/#!...rted-section-3

    All the produced files look good. all-classes.js and app-all.js look like they contain my JS files and looked to be minified in the app-all.js. However, when I try to include just my app-all.js the webpage tries to dynamically load my other JS files. So even though my ExampleStore.js is in/defined by my app-all.js the webpage tries to load my ...sencha_bundled/app/store/ExampleStore.js?_dc=1354044172696

    Am I missing some configuration option or is my understanding of what the Sencha SDK tool is suppose to do incorrect? Here is my index.html:
    PHP Code:
    <html>
    <
    head>
        <
    title>Hello Ext</title>

        <
    link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
        <
    script type="text/javascript" src="extjs/ext.js"></script>
        <script type="text/javascript" src="app-all.js"></script>
    </head>
    <body></body>
    </html> 
    When I load this page Firebug clearly show in the console a get request requesting my various models, stores, and views.

    Thanks for your help!

    James

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,078
    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


    all-classes.js and app-all.js look like they contain my JS files and looked to be minified in the app-all.js
    If app-all.js has all you code and ext, there is no need for extjs/ext.js to be included.

    Scott.

  3. #3
    Sencha User
    Join Date
    Jun 2009
    Posts
    3
    Vote Rating
    0
    zxcvbgfdsa8 is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    If app-all.js has all you code and ext, there is no need for extjs/ext.js to be included.

    Scott.
    I've adjusted my code. Here is what it looks like now:
    PHP Code:
    <html
      <
    head>     
        <
    title>Hello Ext</title>
        <
    link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
        <
    script type="text/javascript" src="app-all.js"></script>
      </head> 
      <body></body>
     </html> 
    Now Firebug and the Chrome JS Console is telling me:
    PHP Code:
    ReferenceErrorExt is not defined 
    Here is what I did to bundle/build my code just in case I did something wrong there:
    PHP Code:
    sencha create jsb -a http://location_to_app/index.html -p app.jsb3
    sencha build -p app.jsb3 -
    I used Sencha Architect to build my application. At first 'sencha create' would create a .jsb3 file that had no files to include. I then downloaded and placed ExtJS 4.0.7 into my application directory and changed my code to point to the 'local' ext files instead of the cachefly version. This seemed to build the .jsb3 files corrrectly.

    James

  4. #4
    Sencha User
    Join Date
    Dec 2012
    Posts
    3
    Vote Rating
    0
    sgr is on a distinguished road

      0  

    Default


    I have the same issue. If I include the minified app-all.js file, then the browser complains 'Ext is not defined'. Then I replaced app-all.js with not-minified all-classes.js to look at the source code. It turned out that all-classes.js starts with

    Ext.define('Ext.util.Observable', {

    /* Begin Definitions */

    requires: ['Ext.util.Event'],

    statics: {
    /**
    * Removes **all** added captures from the Observable.
    *
    * @param {Ext.util.Observable} o The Observable to release
    * @static
    */
    releaseCapture: function(o) {
    o.fireEvent = this.prototype.fireEvent;
    },

    /**
    * Starts capture on the specified Observable. All events will be passed to the supplied function with the event
    * name + standard signature of the event **before** the event is fired. If the supplied function returns false,
    * the event will not fire.
    *
    * @param {Ext.util.Observable} o The Observable to capture events from.
    * @param {Function} fn The function to call when an event is fired.
    * @param {Object} scope (optional) The scope (`this` reference) in which the function is executed. Defaults to
    * the Observable firing the event.
    * @static
    */
    capture: function(o, fn, scope) {
    o.fireEvent = Ext.Function.createInterceptor(o.fireEvent, fn, scope);
    },


    You can see that all-classes.js which is supposed to include all ExtJS dependencies together with my application dependencies, doesn't include Ext.define function.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Posts
    32
    Vote Rating
    1
    igoberman is on a distinguished road

      0  

    Default


    Can someone from Sencha support reply to this question? I have spent a several frustrating hours trying to get my application production ready. I have all my and ExtJS classes in app-all.js. Where is the documentation on how to get this basic and very important task to work?
    Thanks

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,078
    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


    If your app is still making calls to other files .. check the following:
    -Make sure you have all your files included
    -Make you included all the 'requires' needed in each module
    -Make sure you are loading (compressing) your files in the correct order

    Run your application in uncompressed mode and use ext-dev.js and see if there are any warnings in the console that need to be corrected.

    Scott.

  7. #7
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,078
    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


    It is also recommended that you upgrade to 4.1.3 and use Sencha Cmd
    http://www.sencha.com/blog/all-new-sencha-cmd/

    Scott.

  8. #8
    Sencha User
    Join Date
    Aug 2011
    Posts
    32
    Vote Rating
    1
    igoberman is on a distinguished road

      1  

    Default


    Scott, have you tried to make one of you sample applications to use 'app-all.js' with BOTH application classes and ExtJS classes and also do not load ExtJS classes using dynamic loader? I suspect it is not possible.
    Now this is what I experienced in the last days:
    I first read http://docs.sencha.com/ext-js/4-1/#/...etting_started. It states that "The newly-introduced Sencha SDK Tools makes deployment of any Ext JS 4 application easier than ever.". So far from the truth! First of all the link does not lead to the SDK Tools download. But once I found it via google, it stated that SDK Tools is deprecated (so much for the newly-introduced). I then decided to download Sencha Cmd. What a convoluted tool. After poking around for an hour, I was unable to find equivalent of the "sencha create jsb -a index.html -p app.jsb3" command and installed deprecated/newly-introduced "SDK tools". Any chance for a migration guide from SDK Tools to Sencha Cmd?
    My application is based on the "Web Desktop" sample. You would think it should be easy to generate app-all.js. I first tried to generate jsb3 from the html file. It hanged. I then tried to generate it from Url. This time it worked, but paths to the js files were not correct, so I had manually fix these. Now I was finally able to generate app-all.js. The file looked good: all ExtJS classes and my classes looked present. But this is when the new round of frustration begin: it just keeps loading all ExtJS classes one by one even though I have these in app-all.js. Why? No answer...

    This is what I have now in the html. Does it look correct?
    <script type="text/javascript" src="../libs/ext-4.1.1a/ext.js"></script>
    <script type="text/javascript" src="app-all.js"></script>

    By the way, if I use ext-dev.js instead of ext.js, I get the warning below. I was able to trace it to one of the ExtJS classes, so it is not in my code. I found a bug report: http://www.sencha.com/forum/archive/...t-247413.html?, but it has no workaround.
    [Ext.Loader] Synchronously loading 'Ext.data.reader.Json'; consider adding Ext.require('Ext.data.reader.Json') above Ext.onReady



    Also, what is 4.1.3 release? Where can I access it. It is not a latest release. The latest one is 4.1.1a as far as I understand.

  9. #9
    Sencha User
    Join Date
    Aug 2011
    Posts
    32
    Vote Rating
    1
    igoberman is on a distinguished road

      0  

    Default


    I was able to kind of figure out what was going on. There is a dependency bug in the 'Ext.grid.property.Property'. It required dependency on 'Ext.data.writer.Json'. I edited my local version of ExtJS 'Ext.grid.property.Property' class, regenerated app-all.js and the problem got fixed - no more loading of each ExtJs classes in separate request.

    I still do not understand why I cannot generate .jsb3 file from file - it only worked for the url.