Results 1 to 7 of 7

Thread: app.json builds with 4 letter names don't work

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631

    Default app.json builds with 4 letter names don't work

    I created a build named "aria" and the microloader tries to fetch aria instead of aria.json and tracked down why. Looking at bootstrap.js the url code below the comparison ends up being -1 === -1 so it doesn't append .json to the url.

    Code:
                run: function() {                Microloader.init();
                    var manifest = Ext.manifest;
    
    
                    if (typeof manifest === "string") {
                        var extension = ".json",
                            url = manifest.indexOf(extension) === manifest.length - extension.length
                                ? manifest
                                : manifest + ".json",
                            key = getStorageKey(url),
                            content = LocalStorage.retrieveAsset(key);

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Hi--,

    Running some tests against this now. After adding the "aria" to your build targets did you do a an "app refresh" then try running your watch?

    Bryan

  3. #3
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Ok, was able to get this working from my side.

    I can't tell from your post but if you're running an "app watch" to develop using this build you'll need to specify the target during the watch (i.e "sencha app watch aria"). By default it will load the first build target you've defined.

    From there, when accessing in the browser you'll need to determine the manifest to load. Try loading via
    PHP Code:
     http://localhost:1841/?aria 
    Bryan

  4. #4
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631

    Default

    I did an app refresh and then 'sencha app build development'. I changed everything to 'classicaria' and it works now because the name isn't 4 characters.

    Set a breakpoint on this line in the run() method and you'll see why 4 characters doesn't append the '.json'.

    Code:
                            url = manifest.indexOf(extension) === manifest.length - extension.length
                                ? manifest
                                : manifest + ".json",
    This is what my beforeLoad has to detect new profile (this one is working).

    Code:
        Ext.beforeLoad = function (tags) {
            var s = location.search,  // the query string (ex "?foo=1&bar")
                    profile;
    
    
            // For testing look for "?classic" or "?modern" in the URL to override
            // device detection default.
            //
            if (s.match(/\bclassic\b/)) {
                profile = 'classic';
            }
            else if (s.match(/\bmodern\b/)) {
                profile = 'modern';
            }
            else if (s.match(/\bclassicaria\b/)) {
                profile = 'classicaria';
            }
            else {
    //            profile = tags.desktop ? 'classic' : 'modern';
                profile = tags.phone ? 'modern' : 'classic';
            }
    
    
            Ext.manifest = profile; // this name must match a build profile name
    
    
            // This function is called once the manifest is available but before
            // any data is pulled from it.
            //
            //return function (manifest) {
            // peek at / modify the manifest object
            //};
        };
    And my app.json (again the working version)

    Code:
        "builds": {
            "classic": {
                "toolkit": "classic",
                "theme": "wp-theme-architect-desktop",
                "sass": {
                    // "save": "classic/sass/save.scss"
                }
            },
    
    
            "classicaria": {
                "toolkit": "classic",
                "theme": "theme-aria",
                "sass": {
                    // "save": "classic/sass/save.scss"
                }
            }
    
    
    
    
            //        "modern": {
    //            "toolkit": "modern",
    //            "theme": "theme-neptune",
    //            "sass": {
    //                // "save": "modern/sass/save.scss"
    //            }
    //        }
        },

  5. #5
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631

    Default

    Here's a working sample of 'aria' not working. You'll need to add ext framework to the app. Here is the console showing it trying to download aria instead of aria.json.

    bootstrap.js:850 GET http://localhost:1841/aria?_dc=1467146293044 404 (Not Found)
    Attached Files Attached Files

  6. #6
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631

    Default

    BTW in the sample above I'm running 'sencha app watch' and have added 'aria' detection to index.html.

  7. #7
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    631

    Default

    I see this isn't marked as a bug yet - have you tried my example?

Similar Threads

  1. [FIXED] Adhoc builds do not work
    By abicabot in forum Sencha Touch 2.x: Bugs
    Replies: 6
    Last Post: 16 Jul 2012, 12:19 PM
  2. GXT3: Field names in JSON vs. internal names
    By BayerBusiness in forum Sencha GXT Q&A
    Replies: 0
    Last Post: 1 Feb 2012, 1:21 PM
  3. Adhoc builds do not work
    By abicabot in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 5 Dec 2011, 10:49 AM

Posting Permissions

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