I recently heard that there are some major changes coming up with 4.2 concerning the way a MVC application work. I downloaded the beta but the API seems all in all the same. Can anyone explain me the upcoming changes and what thats all about? Do I need to fear that all my controllers will stop working if I update?
Yes, I would call the changes we've made to MVC in 4.2 pretty major; however backwards compatibility has always been our priority. I do acknowledge that prior to 4.2 there were many long unsolved problems with MVC implementation and that prompted people to jump through all kinds of hoops to do what they needed. We've been trying to resolve these and streamline MVC experience, along with adding several features aimed at devs who have big apps on their hands. 4.2 beta 2 will include most of these, and we'd love to hear your feedback on them.
I plan to write up on these improvements before 4.2 is released, but here's a quick list:
Ext.app.EventBus
, like @sra mentioned, is now a singleton, and is always available in your application - although it doesn't make much sense to use it directlyExt.app.Controller
no longer depends on Ext.app.Application
to do things, and can be instantiated without bringing up the whole dependency tree - which means you can unit test your Controllers!Ext.app.Application
, and include your logic in this classExt.application()
no longer does unspeakable black magic; when passed your Application class name it just instantiates it. If you pass it a config object like before, it will declare new Application class with these config options, and instantiate it - same logic as above, a bit different executionExt.application()
no longer requires all your dependency tree synchronously (it used to), so that's one thing to watch forExt.app.Application
now deals properly with its own ancestry and can be used as a top level Controller in your applicationThere were some more little improvements and hacks for backwards compatibility, mostly concerned with dependency tracking. These should not trip you if you don't do something overly crazy. If you do, that's what Betas are for. :)
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With