1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
    _piotr is on a distinguished road

      0  

    Default Unanswered: Microloader, localStorage, cache.manifest

    Unanswered: Microloader, localStorage, cache.manifest


    Hi,

    I have following code in app.json:
    Code:
    "js": [        
    {
             "path": "app.js",
             "bundle": true,  
             "update": "delta"
         }        
    ],
    and in cache.manifest:
    Code:
    # d5db6d2b81a9dda1c37d6f6ce071f8892396f0fe
    app.js
    which changes if I update the file.

    After the file has been stored in localStorage it doesn't update although a hash with new delta in cache.manifest changes. In the result a new version of my app doesn't show up in the browser (Chrome).

    The app was build with sencha tools with command: sencha app build production

    Do I miss something?

    Thanks in advance for help.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,344
    Answers
    3541
    Vote Rating
    847
    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


    You shouldn't put app.js in the cache.manifest, app.js will be stored in localStorage
    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 User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
    _piotr is on a distinguished road

      0  

    Default


    Ok, I've removed it from cache.manifest, but it goes to localStorage and has not been updated thou.

    HTML5 documentation says at when cache.manifest changes, files are going to be refreshed. Does it not work similar in Sencha with localStorage caching?

    Here http://www.sencha.com/learn/taking-s...-apps-offline/ James Pearce shows an example of cache manifest:
    CACHE MANIFEST
    index.html
    app/app.js
    lib/touch/sencha-touch.js
    lib/touch/resources/css/sencha-touch.css
    and he puts <html manifest="app.manifest"> at the top of index.html. Should I add it manually after Sencha SDK Tool does its jobb or should I leave it as it is.

    Thanks for help!

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,344
    Answers
    3541
    Vote Rating
    847
    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


    The localstorage mechanism makes an Ajax request to app.json and if successful it sees if there are any delta updates. If so then it attempts to load them. Once they are loaded it will prompt the user to refresh the page as there was an update applied.
    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.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Norway
    Posts
    23
    Vote Rating
    1
    _piotr is on a distinguished road

      0  

    Default


    Ok, so I see at there is an issue with external resources. I've read at it is impossible in Sencha to request external url in the way: http://url.toexternalscript.com/scripts/s.js or /scripts/s.js if it is on the same server.

    When I am building an app I am getting an error at:
    Code:
    ENOENT, no such file or directory 'C:\[path]\m\scripts\s.js'
    or
    Code:
    Uncaught ReferenceError: Ext is not defined
    When I edit already minified app.json.

    I hope you can help me with that. I've searched forum and google it but I've never found good unswer to solve the problem. Then everyone could find the way how to fix that problem.

    Greetings

Thread Participants: 1

Tags for this Thread