-
14 Aug 2012 1:19 PM #1
2.1: Overrides included within a class are loaded async - not good for builds
2.1: Overrides included within a class are loaded async - not good for builds
In Architect 2.0, when defining an override, a requires[] statement was added to app.js so the override is loaded first.
In Architect 2.1, that statement was removed in favor of a requires[] statement inside the overridden class itself, which causes Ext.Loader to attempt to load the override asynchronously.
This is fine in a development environment but causes problems in production. The Sencha build tools prioritize the order of a build by the order in which they are loaded by Ext.Loader. This means I see the following in my jsb3:
This causes AllEvents to be loaded first, which then attempts to asynchronously load the override because it hasn't been registered yet.Code:... { "clsName": "MyApp.store.AllEvents", "name": "AllEvents.js", "path": "./app/store/" },{ "clsName": "MyApp.store.override.AllEvents", "name": "AllEvents.js", "path": "./app/store/override/" }, ...
In my production build this is causing errors in the JS console. It doesn't appear to be adversely affecting functionality, but the borked AJAX call and the resulting error can be avoided.
Edit: Great job on 2.1! That was one of the smoothest upgrades I've ever had for Architect, and one of the most feature-packed as well.
-
14 Aug 2012 1:42 PM #2
@Sottilde -
The structure used in Architect 2.1 is what you might call a "partial class": the (generated) class requires its other (custom) parts to complete itself.
This build ordering issue is a problem with the current Sencha Command V2 (aka "SDK Tools") which will be corrected in the next release. The next version is currently in private beta and we should be announcing some pretty exciting stuff in that area very soon.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
14 Aug 2012 1:46 PM #3
That's great, I've been using a personally hacked together version of Beta 3 (that actually works quite well). Do you have any suggestions on how to work around this? Adding the requires[] statement to Application is not fixing the issue, as it is actually loaded after the base class that requires the override.'
Edit: I fixed this by finding a way around needing the override. It would be helpful to have a fix for this for those of us who cannot use a workaround, however.
The 'nuclear' option would seem to be to define the override as a JS resource, write it yourself, and include it.
-
15 Aug 2012 10:48 AM #4
Unfortunately I couldn't work this around on the above way as we can not get rid of the overrides. My temp fix was to remove the the override class from require:[] in the generated and combined app.js.
-
15 Aug 2012 11:49 AM #5
Is this causing problems other than noise in the console? According to the above post, there was no effect beyond that.
Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
15 Aug 2012 12:33 PM #6
See point 2) of http://www.sencha.com/forum/showthread.php?237279-Override-problems-in-2.1
IOW currently we can not build application created in SA 2.1. I think it is a bit more serious than some noise in the console.
-
20 Aug 2012 7:14 AM #7
-
20 Aug 2012 9:38 AM #8
This is more serious than just console errors. Our app in production is not loading because it cannot find the override classes.
If I reorder the includes in the .jsb3 file manually by placing the overrides before their parent class then it works.
Please fix
-
25 Oct 2012 12:10 PM #9
The problem is thill there
The problem is thill there
It still causes trouble when packaging an app that uses overrides with the sdk tools. Is there any way to get around this?
thanks
-
25 Oct 2012 12:17 PM #10
I haven't updated my build tools - does this still occur with Command V3?
To get around this issue, I include my overrides in a separate build task in my .jsb3. I bundle them up with all the other libs I use, e.g. underscore, jQuery, and so on. This prevents you from writing the override within Architect but if you really need it - that's your only option.


Reply With Quote