Results 1 to 2 of 2

Thread: Deprecated functionality does not log correctly

    You found a bug! We've classified it as TOUCH-5022 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    21

    Default Deprecated functionality does not log correctly

    Hi,


    I don't know whether the bugs forum is the correct place to put this, but it concerns an issue I have with the Sencha Touch source code so I decided to post it here.


    Ext version tested:
    Sencha Touch 2.3 GPL

    Browser versions tested against:
    Chrome v30.0.1599.69m

    Description:
    After upgrading to ST 2.3 I am trying to find all the places in my code where I am using deprecated functionality from the Touch core. There is a system in place that will output warning messages for properties or methods marked as deprecated, but only if they have been marked with the Ext.deprecate* group of functions. This is apparently not the case in at least several classes. See the below code snippet for an example.

    Steps to reproduce the problem:
    Put this snippet in your newly generated Sencha Touch 2.3 app:
    Code:
    // EXAMPLE 1:
    // should log a deprecated warning but doesn't 
    // (the isWithin function is documented as deprecated)
    Ext.create('Ext.util.Point').isWithin(Ext.create('Ext.util.Point'), 1);
    // If this function call is inserted ... 
    Ext.deprecateClassMethod(Ext.util.Point, 'isWithin', 'isCloseTo');
    // ... it behaves as intended (logs a warning to the console)
    Ext.create('Ext.util.Point').isWithin(Ext.create('Ext.util.Point'), 1);
    
    
    // EXAMPLE 2:
    // should log a deprecated warning but doesn't 
    // (the tabBarDock config is documented as deprecated)
    Ext.create('Ext.tab.Panel', { tabBarDock: 'bottom' });
    
    
    // EXAMPLE 3:
    // correctly logs a deprecated warning
    Ext.create('Ext.Button', { badge: 'test' });
    // also correctly logs a deprecated warning
    Ext.create('Ext.Button', {}).setBadge('test2');
    (see the sources of Ext.util.Point, Ext.tab.Panel and Ext.Button for details on how the deprecation is handled respectively)

    The result that was expected:
    • warning message for 'Ext.util.Point.isWithin()'
    • warning message for 'Ext.util.Point.isWithin()'
    • warning message for 'Ext.tab.Panel.tabBarDock'
    • warning message for 'Ext.Button.badge'
    • warning message for 'Ext.Button.setBadge()'
    The result that occurs instead:
    • nothing
    • warning message for 'Ext.util.Point.isWithin()'
    • nothing
    • warning message for 'Ext.Button.badge'
    • warning message for 'Ext.Button.setBadge()'
    Possible fix:
    Correctly Ext.deprecate all instances that do not show the desired behavior.



    I realize this is somewhat of a minor problem, but the challenge of having to update old code is made much tougher if you cannot rely on the deprecation system for sencha touch functionality working correctly (because it is not applied consistently in the touch sources).

    Note that the examples I have given have been selected rather randomly by searching for "deprecate" in the touch source code and picking the first three places that seemed interesting. I may have found the only two places that don't work correctly, but I would guess there are a lot more of them (the above mentioned text search for "deprecate" returns 669 matches).
    Last edited by gruese; 11 Oct 2013 at 2:57 AM. Reason: Changed code snippet for better readability

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •