DeftJS 5, Ext JS 5, and Sencha Cmd 5

496 views
Skip to first unread message

Mike Suiter

unread,
Jul 9, 2014, 3:33:43 PM7/9/14
to def...@googlegroups.com
Our current Ext JS 4.2.2 app only uses DeftJS for promises. We use Sencha Cmd and have our packages plus Deft 0.9.0 package. I'm in the processing of upgrading our app to Ext JS 5. I've left Deft 0.9.0 there and 'sencha app refresh' fails with this

[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Failed to find any files for D:\Workspaces\wp-architect-java\wp-architect-java\web-
app\wp-architect\packages\deft\src\js\mixin\Controllable.js::ExtRequire::data.controller

I tried putting de...@5.0.0 but it can't find anything. 

I've read the DeftJS promises are working with ExtJS 5. What's the best way to get them into our app using Sencha Cmd?

Brian Kotek

unread,
Jul 9, 2014, 3:41:23 PM7/9/14
to deftjs
Right, Deft 5 won't be added to the Sencha Cmd repository until it is ready for release.

Not sure what's up with your error though...do you see the Controllable.js file at src\js\mixin? You might try 0.9.1 just to make sure it's not something that was handled in that point release.


--
Deft JS home page: http://deftjs.org/
Wiki: https://github.com/deftjs/DeftJS/wiki
For rules and tips on asking questions on the Deft JS mailing list: https://github.com/deftjs/DeftJS/wiki/Asking-Questions-on-the-Mailing-List
---
You received this message because you are subscribed to the Google Groups "Deft JS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deftjs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/deftjs/88d5618d-c2a6-498b-9e60-8205847575c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Suiter

unread,
Jul 9, 2014, 4:20:12 PM7/9/14
to def...@googlegroups.com
So my Deft version is 0.9.1 and that file does exist. Here is the line highlighted it's complaining about:

  Deft.Class.registerPreprocessor('controller', function(Class, data, hooks, callback) {
    var self;
    Deft.Class.hookOnClassCreated(hooks, function(Class) {
      Class.override({
        constructor: createControllerInterceptor()
      });
    });
    Deft.Class.hookOnClassExtended(data, function(Class, data, hooks) {
      Deft.Class.hookOnClassCreated(hooks, function(Class) {
        Class.override({
          constructor: createControllerInterceptor()
        });
      });
    });
    self = this;
    Ext.require([data.controller], function() {
      if (callback != null) {
        callback.call(self, Class, data, hooks);
      }
    });
    return false;
  }, 'before', 'extend');


In your docs for using with Sencha Cmd I see this:

  1. Cmd's new "define-rewrite" optimization breaks any user-defined class pre-processors (such as those used by Deft JS). Until we can arrive at a solution with Sencha, this must be disabled. Edit .sencha/app/production.properties so it uses build.optimize=, with no value. Note this has been fixed in the Deft JS 5 release for Ext JS 5 only.
With Cmd 5 changing files, I see this in defaults.properties:

build.optimize.disable=
build.optimize=${build.optimize.disable}

And this in production.defaults.properties:

build.optimize=${build.optimize.disable}


So it appears the build.optimize has no value. Any idea on what to try next?

Brian Kotek

unread,
Jul 9, 2014, 5:13:09 PM7/9/14
to deftjs
Ah, your view controller class is probably not being required. Can you confirm that the view controller class is listed in the requires list of the view that uses that view controller?


Mike Suiter

unread,
Jul 9, 2014, 5:40:58 PM7/9/14
to def...@googlegroups.com
I'm not using any ViewControllers. The only piece of DeftJS we are currently using are promises.

Brian Kotek

unread,
Jul 9, 2014, 6:19:20 PM7/9/14
to deftjs
Hmm, looks like an conflict with Ext 5 then. It looks like the "controller" field on the view(s) is triggering the Deft ViewController preprocessor to run. Definitely seems like a conflict, and it's things like this that mean using Deft 0.9 with Ext 5 may be difficult. We definitely didn't think it would be forward-compatible with Ext 5, given then changes Sencha has made (particularly the addition of Sencha's ViewController class).

You may be able to edit the Deft code yourself to remove that Ext.require() call (or even the whole registerPreprocessor() block)?


Mike Suiter

unread,
Jul 10, 2014, 8:41:55 AM7/10/14
to def...@googlegroups.com
Brian - that's exactly what I did yesterday was to comment out the entire block and got my build to work. Now I'm trying to get the correct scripts in my dynamic GSP since I don't use the static index.html. I'll let you know if the promises work once I get the app running. Thx for your help. 

Any ETA on production-quality version of DeftJS 5? We have decided to move to Ext JS 5 before our first release and I would love to use IoC/DI of DeftJS in addition to the Promises. 

Brian Kotek

unread,
Jul 10, 2014, 9:42:15 AM7/10/14
to deftjs
Very good. I don't have an ETA on Deft 5 but from a code and unit testing standpoint it seems to be in a good place and passes all the tests we have using Ext 5, including the build using the latest Cmd. The holdup (at least on my end) is that all the real-world work I'm doing is still on Ext 4.2, so I haven't had much time to actually USE Deft 5 and Ext 5 to build something. So I'd like to try and find time to build at least one sample app (or convert the Phoenix sample app) to use the new libraries. John and Isaac are pretty much in the same boat, where between jobs and life, there hasn't been a lot of time to really put the new stuff through its paces the way we'd like to.

That said, my hope is that we should have a release ready in the near future. 




Reply all
Reply to author
Forward
0 new messages