1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    117
    Vote Rating
    11
    Sottilde will become famous soon enough

      2  

    Default 2.1: Overrides included within a class are loaded async - not good for builds

    2.1: Overrides included within a class are loaded async - not good for builds


    In Architect 2.0, when defining an override, a requires[] statement was added to app.js so the override is loaded first.

    In Architect 2.1, that statement was removed in favor of a requires[] statement inside the overridden class itself, which causes Ext.Loader to attempt to load the override asynchronously.

    This is fine in a development environment but causes problems in production. The Sencha build tools prioritize the order of a build by the order in which they are loaded by Ext.Loader. This means I see the following in my jsb3:

    Code:
    ...
    {
        "clsName": "MyApp.store.AllEvents",
        "name": "AllEvents.js",
        "path": "./app/store/"
    },{
        "clsName": "MyApp.store.override.AllEvents",
        "name": "AllEvents.js",
        "path": "./app/store/override/"
    },
    ...
    This causes AllEvents to be loaded first, which then attempts to asynchronously load the override because it hasn't been registered yet.

    In my production build this is causing errors in the JS console. It doesn't appear to be adversely affecting functionality, but the borked AJAX call and the resulting error can be avoided.

    Edit: Great job on 2.1! That was one of the smoothest upgrades I've ever had for Architect, and one of the most feature-packed as well.

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,346
    Vote Rating
    134
    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


    @Sottilde -

    The structure used in Architect 2.1 is what you might call a "partial class": the (generated) class requires its other (custom) parts to complete itself.

    This build ordering issue is a problem with the current Sencha Command V2 (aka "SDK Tools") which will be corrected in the next release. The next version is currently in private beta and we should be announcing some pretty exciting stuff in that area very soon.
    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!"

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    117
    Vote Rating
    11
    Sottilde will become famous soon enough

      0  

    Default


    Quote Originally Posted by dongryphon View Post
    @Sottilde -

    The structure used in Architect 2.1 is what you might call a "partial class": the (generated) class requires its other (custom) parts to complete itself.

    This build ordering issue is a problem with the current Sencha Command V2 (aka "SDK Tools") which will be corrected in the next release. The next version is currently in private beta and we should be announcing some pretty exciting stuff in that area very soon.
    That's great, I've been using a personally hacked together version of Beta 3 (that actually works quite well). Do you have any suggestions on how to work around this? Adding the requires[] statement to Application is not fixing the issue, as it is actually loaded after the base class that requires the override.'


    Edit: I fixed this by finding a way around needing the override. It would be helpful to have a fix for this for those of us who cannot use a workaround, however.

    The 'nuclear' option would seem to be to define the override as a JS resource, write it yourself, and include it.

  4. #4
    Sencha Premium Member zmagyar's Avatar
    Join Date
    Mar 2012
    Location
    Budapest
    Posts
    91
    Vote Rating
    2
    zmagyar is on a distinguished road

      0  

    Default


    Unfortunately I couldn't work this around on the above way as we can not get rid of the overrides. My temp fix was to remove the the override class from require:[] in the generated and combined app.js.

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,346
    Vote Rating
    134
    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


    Is this causing problems other than noise in the console? According to the above post, there was no effect beyond that.
    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!"

  6. #6
    Sencha Premium Member zmagyar's Avatar
    Join Date
    Mar 2012
    Location
    Budapest
    Posts
    91
    Vote Rating
    2
    zmagyar is on a distinguished road

      0  

    Default


    See point 2) of http://www.sencha.com/forum/showthread.php?237279-Override-problems-in-2.1

    I
    OW currently we can not build application created in SA 2.1. I think it is a bit more serious than some noise in the console.

  7. #7
    Sencha User
    Join Date
    Feb 2012
    Posts
    117
    Vote Rating
    11
    Sottilde will become famous soon enough

      0  

    Default


    Quote Originally Posted by dongryphon View Post
    Is this causing problems other than noise in the console? According to the above post, there was no effect beyond that.
    The noise and the aborted ajax load appears to be the only effect of this so far. Since then I've just killed the override. If I need to include one in SA2.1 I'll just be adding it to my index.html / build myself.

  8. #8
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    taher@youvisit.com is on a distinguished road

      0  

    Default


    This is more serious than just console errors. Our app in production is not loading because it cannot find the override classes.

    If I reorder the includes in the .jsb3 file manually by placing the overrides before their parent class then it works.

    Please fix

  9. #9
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    thomaskantaras is on a distinguished road

      0  

    Default The problem is thill there

    The problem is thill there


    It still causes trouble when packaging an app that uses overrides with the sdk tools. Is there any way to get around this?

    thanks

  10. #10
    Sencha User
    Join Date
    Feb 2012
    Posts
    117
    Vote Rating
    11
    Sottilde will become famous soon enough

      0  

    Default


    Quote Originally Posted by thomaskantaras View Post
    It still causes trouble when packaging an app that uses overrides with the sdk tools. Is there any way to get around this?

    thanks
    I haven't updated my build tools - does this still occur with Command V3?

    To get around this issue, I include my overrides in a separate build task in my .jsb3. I bundle them up with all the other libs I use, e.g. underscore, jQuery, and so on. This prevents you from writing the override within Architect but if you really need it - that's your only option.