PDA

View Full Version : [OPEN] deprecated Observable.addEvents



brian_d
9 Apr 2014, 9:55 AM
addEvents (and several other methods) have been removed from Observable. Is there no longer a need to register custom events before firing them now?

mdlincoln
9 Apr 2014, 10:38 AM
That is correct. The addEvents() method will still work for the time being but you should probably remove it in due course.

Mark

LesJ
9 Apr 2014, 10:46 AM
addEvents (and several other methods) have been removed from Observable. Is there no longer a need to register custom events before firing them now?

Calling addEvents is also optional in 4.x

brian_d
9 Apr 2014, 11:06 AM
Actually, no, it doesn't still work. It raises an Ext.Error which crashes my app. I've had to implement a custom version of addEvents so that my apps can work with 5.0 beta and still be compatible with 4.2.2. It would be nice if all it did was log a deprecation message rather than crash the app.

mankz
9 Apr 2014, 11:15 AM
Actually, no, it doesn't still work. It raises an Ext.Error which crashes my app. I've had to implement a custom version of addEvents so that my apps can work with 5.0 beta and still be compatible with 4.2.2. It would be nice if all it did was log a deprecation message rather than crash the app.



+1

evant
9 Apr 2014, 11:33 AM
It's worth noting that 4.2.x never required addEvents either, so it was essentially just ignored. Typically the compatibility changes are based around:

1) How easy is it to change - Reasonably easy, since the exceptions throw when there are problems and it's fairly simple to remove the offending parts
2) What impact will it have on the code - addEvents was essentially a no-op in 4.x, so removing calls to it have pretty much no impact

Carun
9 Apr 2014, 1:06 PM
It becomes tricky when user extensions or 3rd party components are involved. Now in order to get the app to work, not only do we have to remove it from our app code, but have to do so from those files as well or wait for those user extensions to be updated to work with Ext JS 5. Something not every author/company of those components might do at least in the time frame we are looking to perform feasibility on an upgrade.

Since addEvents is not doing anything anyway, why not leave it there and raise a warning? It will make upgrading a little more painless.

dongryphon
9 Apr 2014, 2:05 PM
I moved this to Bugs - we should have a function there when compatibility layer is enabled. Just checked and it is "null".

dongryphon
9 Apr 2014, 2:05 PM
Thanks for the report! I have opened a bug in our bug tracker.

_alex
7 Jul 2015, 7:09 AM
will this ever be fixed ?
really annoying and so easy to fix by replacing null with an empty function ...