Hybrid View
-
27 Nov 2012 11:34 AM #1
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:
When I load this page Firebug clearly show in the console a get request requesting my various models, stores, and views.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>
Thanks for your help!
James
-
27 Nov 2012 1:47 PM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
If app-all.js has all you code and ext, there is no need for extjs/ext.js to be included.all-classes.js and app-all.js look like they contain my JS files and looked to be minified in the app-all.js
Scott.
-
28 Nov 2012 6:33 AM #3
I've adjusted my code. Here is what it looks like now:
Now Firebug and the Chrome JS Console is telling me: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>
Here is what I did to bundle/build my code just in case I did something wrong there:PHP Code:ReferenceError: Ext is not defined
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.PHP Code:sencha create jsb -a http://location_to_app/index.html -p app.jsb3
sencha build -p app.jsb3 -d .
James
-
29 Dec 2012 2:10 PM #4
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.
-
4 Jan 2013 7:14 AM #5
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
-
4 Jan 2013 7:53 AM #6Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,185
- Vote Rating
- 194
- Answers
- 433
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.


Reply With Quote