Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2008
    Posts
    11
    Vote Rating
    3
    Kupuyc is on a distinguished road

      3  

    Exclamation Preprocessors does not works in build version

    Preprocessors does not works in build version


    Ext version tested:
    • Ext 4.2.2

    Sencha CMD version tested:
    • Sencha Cmd v4.0.2.67

    Browser versions tested against:
    • ALL

    DOCTYPE tested against:
    • <!DOCTYPE HTML>

    Description:
    • Code of preprocessors stops work after build by CMD (in both modes: production or testing).

    Steps to reproduce the problem:
    • generate worspace: sencha generate workspace preProcessorTest
    • generate application: sencha -sdk /path/to/sdk generate app TestApp1 preProcessorTest/extApp1
    • write code of preprocessor which will fire for property "preprocessorProperty"
    • add property "preprocessorProperty" in TestApp1.view.Main class
    • launch application in browser - code of preprocessor runs
    • build application by command "sencha app build testing"
    • launch application from build folder in browser - code of preprocessor does not runs

    The result that was expected:
    • expected that code of preprocessor must work after build by Sencha CMD

    The result that occurs instead:
    • code of preprocessor does not runs - console.log in preprocessor function never called


    Ready for reproduce code in archive - preProcessorTest.zip (30Mb).
    Code of preprocessor located in TestApp1.component.ClassWithPreprocessor.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,797
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Is the file being included in the build?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2008
    Posts
    11
    Vote Rating
    3
    Kupuyc is on a distinguished road

      0  

    Default


    Yep. But seems like in production build only:
    Code:
    (Ext.cmd.derive('TestApp1.component.ClassWithPreprocessor', Ext.Base, {singleton: true, method: function() {
      console.log('ClassWithPreprocessor: method called.');
    }}, 0, 0, 0, 0, 0, 0, [TestApp1.component, 'ClassWithPreprocessor'], function() {
      console.log('ClassWithPreprocessor', 'onCreate');
      Ext.Class.registerPreprocessor('preprocessorProperty', function(cls, data, hooks, fn) {
      console.log('ClassWithPreprocessor', 'preprocessor body');
      Ext.Function.interceptAfter(hooks, 'onCreated', function(classInterface) {
      console.log('ClassWithPreprocessor', 'preprocessor hook', Ext.getClassName(classInterface));
      if (!classInterface.prototype.hasOwnProperty('initComponent')) 
      {
        classInterface.addMembers({initComponent: function() {
      this.callParent(arguments);
    }});
      }
      Ext.Function.interceptBefore(classInterface.prototype, 'initComponent', function() {
      this.style = this.style || {};
      this.style.fontSize = 5;
    });
    });
      if (fn) 
      {
        fn.call(this, cls, data, hooks);
      }
    }, 0);
    }));

  4. #4
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,339
    Vote Rating
    132
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    The processors property is marked as private and Cmd's optimizer takes advantage of that to streamline the class processor steps knowing that all required classes have been ordered ahead of the classes that need them. This of course presumes that we also know of all processors.

    See http://docs.sencha.com/extjs/4.1.1/#...-preprocessors

    Be aware that use of private API's is not supported nor are they guaranteed to remain as they are currently defined - they can change even in minor/patch releases.

    In Ext JS 5 we are making onClassExtended and onClassMixedIn public so that you can extend class semantics in safe ways. See http://docs.sencha.com/extjs/4.1.1/#...nClassExtended for an example. We have some other enhancements in this area for v5 but these two methods have existed since 4.0 and just not been declared as public. These are being made public because folks have asked for a supported way to extend class declarations (that will also work with Cmd optimizations).

    All disclaimers and warnings aside ... this Cmd feature can be disabled by adding this property to your build.properties file in .sencha/app/build.properties:

    Code:
    build.optimize=
    In Cmd v5 this particular optimization can be disabled while leaving others enabled like so:

    Code:
    build.optimize.defines=0
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  5. #5
    Sencha Premium Member
    Join Date
    Feb 2008
    Posts
    11
    Vote Rating
    3
    Kupuyc is on a distinguished road

      0  

    Default


    Thank you, dongryphon, for your reply. I turned off optimization and all is works.

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi