Injectable mixin required?

92 views
Skip to first unread message

Jacob

unread,
Jul 21, 2014, 4:39:02 PM7/21/14
to def...@googlegroups.com
I'm just trying out now the mixin_conversion branch (on original DeftJS), and it seems that classes are requiring the Injectable mixin in order to specify injections. DeftJS used to automatically inject on any class without explicitly specifying the Injectable mixin. Is that a new requirement?

Brian Kotek

unread,
Jul 21, 2014, 5:30:56 PM7/21/14
to deftjs
It's a new requirement going forward (definitely for Deft 5, possibly for Deft 0.9.x if we merge the changes into master). Sencha dropped support for custom class preprocessors, so mixins are the only option now to provide this behavior.


On Mon, Jul 21, 2014 at 4:39 PM, Jacob <ja...@fareclock.com> wrote:
I'm just trying out now the mixin_conversion branch (on original DeftJS), and it seems that classes are requiring the Injectable mixin in order to specify injections. DeftJS used to automatically inject on any class without explicitly specifying the Injectable mixin. Is that a new requirement?

--
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/0fb1963b-4341-4768-bfbe-9e901ec5b2ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob

unread,
Jul 21, 2014, 5:50:16 PM7/21/14
to def...@googlegroups.com
Thanks Brian. Two more questions:

1) Was the requirement already put into the original DeftJS 0.9? It seems so for the mixin_conversion branch.
2) I presume that means 0.9 views now explicitly require Controllable mixin?

Brian Kotek

unread,
Jul 21, 2014, 6:04:03 PM7/21/14
to deftjs
No, it's not a requirement in the current 0.9.1 release. The mixin conversion branch was something I started (and actually got nearly complete), just before the closed Ext JS 5 alpha was announced. So it wasn't ever vetted and released as 0.9.2 (or 1.0 more likely). It has enough things in it that are nullified by Ext 5 (things like view controller inheritance of control blocks, companion view controllers, etc.) that it's probably a bad idea to make it an official release. Which is a bit frustrating for me, because some of the stuff I added was quite complicated to do...but such is life. 


Jacob

unread,
Jul 21, 2014, 6:08:45 PM7/21/14
to def...@googlegroups.com
Thanks Brian. I'm confused then, because the mixin conversion branch seems to require me to explicitly define mixins in order to do injections and view controllers.

Brian Kotek

unread,
Jul 21, 2014, 6:17:32 PM7/21/14
to deftjs
It does. But the mixin conversion branch is just a feature branch. It hasn't been released in any form, and probably isn't going to be (for the reasons I touched on earlier). So the only reason for you to look at it would be your own personal curiosity. Beyond that, you can ignore it.


Jacob

unread,
Jul 21, 2014, 6:24:45 PM7/21/14
to def...@googlegroups.com
Ok, I guess I was going to try to use it, because an earlier thread seemed to say that it works well and passes the unit tests. I'm running into some class design issues, and the companions sounds like it would solve my problem.

Brian Kotek

unread,
Jul 21, 2014, 7:29:25 PM7/21/14
to deftjs
Yeah, the problem is that the idea of companion VCs is pretty much nuked in Ext 5, because the resolution of declarative view listeners stops as soon as the first reference holder is encountered. So there's really no way (other than a lot of effort and hackery) to cascade those lookups to companion VCs. 


Jacob

unread,
Jul 21, 2014, 8:54:26 PM7/21/14
to def...@googlegroups.com
If I use it for Ext 4, do you think it will work well? I'm not too concerned yet with Ext 5, because my current plan is to wait until 5.1.1 comes out. From experience with Ext 4, it didn't really stabilize until 4.1.1. But I am having some issues now with robust multiple inheritance in Ext 4.

Brian Kotek

unread,
Jul 21, 2014, 9:51:16 PM7/21/14
to deftjs
All the unit tests were passing the last time I checked, so it should probably work. Just be aware that it will make your upgrade to Ext 5 harder later on, if you plan to upgrade at some point.


Jacob

unread,
Jul 21, 2014, 10:23:06 PM7/21/14
to def...@googlegroups.com
Sorry I don't mean to be a nag, but why will it be harder? Doesn't Deft5 support companions?

Brian Kotek

unread,
Jul 22, 2014, 1:13:00 AM7/22/14
to deftjs
Correct. More specifically, Ext JS 5 won't allow it to work.


Jacob

unread,
Jul 22, 2014, 8:33:53 AM7/22/14
to def...@googlegroups.com
Ok, I guess you're saying that Deft 5 will work with Ext 4, and companions feature is only for Ext 4. I didn't realize that. I read in a blog you wrote that you were looking at putting companions into Ext 5. I guess I'll perhaps look at trying to solve my problem using encapsulation by creating more widgets with view controllers.

I'm curious as to overall how you would compare Ext 5.0 stability/quality/performance to what Ext 4.0 was?

Thanks.

Brian Kotek

unread,
Jul 22, 2014, 11:24:18 AM7/22/14
to deftjs
Deft 5 only works with Ext JS 5, mainly due to switching over to extending Sencha's ViewController class. 

I did investigate getting companions working with Deft JS 5 and Ext JS 5, but it won't work because the Ext JS 5 event handling paradigm has changed from using pre-defined event listeners to scope lookups using reference holders (http://docs.sencha.com/extjs/5.0.0/whats_new/5.0/whats_new.html#References_and_Listeners).


Jacob

unread,
Jul 22, 2014, 11:31:50 AM7/22/14
to def...@googlegroups.com
Thanks again Brian.
Reply all
Reply to author
Forward
0 new messages