PDA

View Full Version : Designer falsely claims Ext.Loader is not enabled



Sottilde
7 Mar 2012, 1:05 PM
All I have to say is, thank God for version control.

I luckily checked in my project just before the most recent upgrade a half hour ago. Designer has been giving me (incorrect) errors saying:

Message: Ext.Loader is not enabled, so dependencies cannot be resolved dynamically. Missing required class: MyApp.data.proxy.Rest



This crashes the metadata rebuild in the new version and left me with a project containing a single Model, no more.

I am using a requires and a mixins statement in my Models - this appears to be causing the issue.

aconran
7 Mar 2012, 1:17 PM
Could you send us an archive of your project so that we can fix this problem?

You can send it to us privately at designer.feedback@sencha.com

Phil.Strong
7 Mar 2012, 1:54 PM
Thank you for using version control. We recommend it!

Phil.Strong
7 Mar 2012, 1:56 PM
I am using a requires and a mixins statement in my Models - this appears to be causing the issue.

Or just paste in the code for this model

Phil.Strong
7 Mar 2012, 2:32 PM
Ok so looks like if you remove the requires and mixins properties from the .metadata/ directory for all of your Models this doesn't happen. We'll be restricting the user of those properties now in the generated class.'

Let me know and I'll send you the upgraded project if you'd like

Sottilde
7 Mar 2012, 2:34 PM
Ok so looks like if you remove the requires and mixins properties from the .metadata/ directory for all of your Models this doesn't happen. We'll be restricting the user of those properties now in the generated class.'

Let me know and I'll send you the upgraded project if you'd like

Thanks - I have already done that and added them to the override classes. Unfortunately, override classes are not loaded properly.

Just my opinion - it seems the proper solution would not be to restrict usage of these options, as they should be in the properties list anyway. Instead it would make more sense to fix whatever is saying that Ext.Loader is disabled, as it is clearly enabled by default in every project (and is not configurable).

aconran
7 Mar 2012, 2:41 PM
Unfortunately, override classes are not loaded properly.

Please explain and give us a test case


Just my opinion - it seems the proper solution would not be to restrict usage of these options, as they should be in the properties list anyway. Instead it would make more sense to fix whatever is saying that Ext.Loader is disabled, as it is clearly enabled by default in every project (and is not configurable).

While I can see your point, there are a number of technical reasons that we can't easily accomplish this.

Mixins, requires, etc should go in your overrides if you need them.

Sottilde
7 Mar 2012, 5:35 PM
Mixins, requires, etc should go in your overrides if you need them.

Unfortunately it seems that because of the nature of an override, this is going to be a lot more complicated than that.

I wanted to define a mixin in my models. I added to the overridden class:

mixins : {
myMixin: "Myapp.model.mixin.MyMixin"
}

This unfortunately completely overrides the original definition of mixins in Ext.data.Model. This produces an error on load in Ext.data.Model where it tries to load Ext.util.Observable, which no longer exists after the override. This provides the error "TypeError: Cannot read property 'constructor' of undefined", as it tries to initialize Observable.

Please advise - how best should I initialize mixins now?

Additionally: Overriding other attributes of a Model like fields also appears to create problems - overriding fields apparently kills the getFields() method which causes another internal error. I was hoping to overcome the bugs in 309 and get my project working again but it appears I will have to recover 298 from my laptop and restart.

Sottilde
8 Mar 2012, 8:38 AM
I ended up downgrading to 298 as the bugs in 309 made my project unusable and I burned nearly a day trying to find workarounds.

On Linux it is as simple as deleting ~/.local/share/data/Sencha, Inc./Sencha Designer 2.0/xds-2.0.0.000309.ion.

aconran
8 Mar 2012, 8:48 AM
While I don't recommend this approach, the .ion files for the respective operating systems can be found here:

Windows XP
C:\Documents and Settings\<username>\Local Settings\Application Data\Sencha, Inc\Sencha Designer 2.0\

Windows Vista/7
C:\Users\<username>\AppData\Local\Sencha, Inc\Sencha Designer 2.0\

Linux
~/.local/share/data/Sencha, Inc./Sencha Designer 2.0/

Mac OS X
~/Library/Application Support/Sencha, Inc./Sencha Designer 2.0/

Sottilde
9 Mar 2012, 6:08 AM
Do you have any feedback on my post above regarding initializing mixins in an override class? While it's not a big deal to add things like Ext.util.Observable when adding mixins to a Model, it is not intuitive and takes a while to track down the error.

Phil.Strong
9 Mar 2012, 6:38 AM
Talking about it with Aaron today.

Sottilde
12 Mar 2012, 8:13 AM
Has there been any progress on this? I am finding that when creating an override class to define mixins, I get the worst of both worlds - my defined mixins don't work, and the program crashes completely if I don't define Ext internal classes like Ext.util.Observable.

311/309 have different behavior in comparison to 298 regarding mixins. 298 would complain about Ext.Loader but ignore it if I clicked ignore. 311/309 stop loading the project at that point and I am left with a project that contains a single Model and no Views or Controllers.