Hi all, thanks Greg for the introduction and for the great work here. I think you made an excellent task in bringing this project to live :).
Crux is an important piece for all of us trying to make a complex application. Until now the Royale option for this kind of "microarquitecture" was PureMVC (I think the only MVC available out there). In Flex we had Cairngorm too, but then other frameworks based on Metadata, IoC and Injection of dependencies came to dominate this kind of necessity, I think Parsley and Swiz was two of the most known and used but many others was there to fill that gap. These days JS frameworks bring something similar with libraries very well crafted like Redux (for React). We needed this kind of library so much to grow our codes in the right way. While doing our first Royale real app we tried other ways (like using a bead system), but finally it was clear that we needed a framework to fill the gap. So in other to grow we found that we need to bring something like this before continue expanding the code in our real Royale app. The main problem we discover is that while beads works great at component level, and to hold a model for a concrete instance, we need to "inject" instances to share models, controllers and communicate different parts of the application with events but sharing different unique models, controllers and other application unique instances. So the problem is certainly different at component level we want to dispatch events and communicate via strand. At application level we want different parts of application have common pieces and be able to share events across all different application pieces. And all of this with the less code possible. So here comes Swiz "Inject", "Dispatcher" and "EventHandler" are the key metadata that make all very easy. I always liked Swiz due to its simplicity, tiny code that does great things and solve many problems and want to have something like that here in Royale. In 2016 we tried to bring Swiz to Apache Flex. We even had Chris Scott (original Swiz author) baking this movement. But was a problem since we needed the rest of the authors agreement although Swiz was in ALv2. what was nearly impossible since most of the authors were unavailable vía the email accounts we could gather for them. This time is different. We're not trying to bring/donate Swiz to Apache Royale. Swiz does not run at all in Royale. If we still want to try that we still need to do that in Apache Flex since Swiz is for Flex. We need to create a new framework (hence the new name Crux) but based on parts of Swiz (thanks to ALv2). So Crux looks in many aspects like Swiz, but is not Swiz anymore. IOW, if Swiz will be live this days we wouldn't able to add this big changes to the latest Swiz version, since Swiz was for Flex and this new framework is for Royale. So this is an important point that we all need to know. Crux is derivative work from Swiz that changes many internal things to make it work in Royale and shares names and in most of the cases internal structure but its target is a completely different technology, so Swiz could continue (if someone resurrect it) evolve on its own to continue working for Apache Flex, while Crux will need its own roadmap, changes and evolution to work for Apache Royale. In the other hand, in this process we was again in contact with Chris Scott (I want to thank him for begin so collaborative with us) that is aware of our intention of creating this new codebase based on his Swiz called Crux and are supporting it. He's completely aligned with the movement, and we want to give him and the rest of the original Swiz team the credit and want to make all know(in our docs, examples, and social networks as we can share this news) that Crux comes from the concepts and original code of Swiz, and we was able to have this today thanks to the current work done by Greg, and of course to the work Swiz developers did in the past for Flex. To end. I think this is a first commit and I'm sure there will be many issues as normal. Hope we can merge this branch soon and continue finding and fixing issues we found and as well looking at the scenarios still not tested. For example, will work Modules with Crux?...there's still things to be cleared, but this is a great starting point without doubt. For me this was the latest needed piece to use Royale in big applications and systems, and I think we can start using it as today :). Thanks! Carlos El jue., 4 jul. 2019 a las 8:11, Greg Dove (<greg.d...@gmail.com>) escribió: > Hi all, > > Just a quick advance notice that we are getting something very similar to > Swiz before too long. > There is a new branch called feature/Crux > > We can still explore other possible ways to incorporate Swiz code in Royale > (we have looked at having the code donated in the past), but for now at > least it is as a derivative work, differentiated by name as 'Crux' and > hence the name of the branch. 'Crux' means a main or pivotal point - > something important - and a common English expression that can express that > is when someone says ""the crux of the matter" - it means an important > thing to focus on. > > The name is what it is now - it is short and has a powerful meaning. But > certainly we can review that too. > > The branch has the beginnings of the original Swiz functionality which > supports metadata driven Injection (including runtime Binding Injection), > EventHandlers, main Dispatcher etc. > Those things are already shown in 3 examples [1] in examples/crux in the > branch, (but I did not check the ant builds for those yet- I will get to > that). Beyond those features, I have not ventured far yet, and perhaps some > of the others may not be relevant for Royale. > > In case it's useful elsewhere, there is also a new JSStageEvents 'stage > events' simulator bead which works from the main application level, and > provides bubbling 'addedToStage' events which Crux listens to at the top > level. These can be filtered (so not everything generates the events, for > example). Not sure if that might be useful for other things, just > mentioning it for now... It does dispatch 'removedFromStage' as well, but > too late for bubbling, so I will investigate if I can do something a bit > sneaky to see if I can make that work. Otherwise it is always possible to > add removedFromStage listeners directly to the target of interest inside > an 'addedToStage' listener. > > I expect there will be bugs, and I of course there will be many things I > can continue to improve, so this is just an early announcement for your > awareness. Carlos sponsored a large chunk of my time on this, so you have > him to thank for that, but I have also contributed a lot of my own time, > and will continue to do so. Thanks also to Alex for recent guidance on > licencing issues, this was uncharted territory for me. > > Anyhow, Carlos will, I am sure, provide more info, he is very familiar with > Swiz from the past. > > -Greg > > > 1. https://github.com/apache/royale-asjs/tree/feature/Crux/examples/crux > -- Carlos Rovira http://about.me/carlosrovira