1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    4
    Vote Rating
    0
    georgevaccaro is on a distinguished road

      0  

    Default Unanswered: Deployment of app assets to an absolute/fixed path

    Unanswered: Deployment of app assets to an absolute/fixed path


    I'm using the "sencha" build tool to build/minify my final sencha touch 2 application but have a somewhat unique challenge.

    I'm hosting the app in a Sitecore CMS such that pages returned will all have different paths and depths of paths. Every request will return the single same app just with a different context variable set to let it know the path of the item it should display. Our sencha 2 app is built to handle that. For example:

    visiting www.website.com/ProductsList.aspx yields:
    var path='/ProductsList';

    or

    visiting www.website.com/Products/SpecificProduct1.aspx
    var path='/Products/SpecificProduct1';

    The app then uses the path variable to get the context it needs.

    The challenge is that the resources (including the app.js itself) are, I think, assumed to be relative to the html page's path, such that in the first scenario the microloader will be looking for app.js at /app.js while in the second scenario it will be looking for it at /Products/app.js .

    I thought perhaps the app.config would allow resource specification with absolute paths, but it mentions right in there to use relative paths.

    I know I can manually load the sencha js files but I want to benefit from the build process to lighten the load of the resources. I've also managed to mangle the post-build app.json and index.html generated javascript to hardcode the absolute path, but this seems cumbersome. It would be nice if the absolute deployed path for the app.js, resources etc could be specified in the app.json and handled nicely at build time.

    Any help would be much appreciated. Thanks!

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


    Agreed, in the meantime I have set symbolic links and it builds just fine for me.
    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
    May 2010
    Posts
    4
    Vote Rating
    0
    georgevaccaro is on a distinguished road

      0  

    Default Follow up...

    Follow up...


    Mitchell, it seems like you are talking about build time which is not really my issue. The issue is run time resolution of the paths to the app.js, app.json and other assets. Also I imagine if folks were to try to host an app in sharepoint (yes another MS monster) or on a CDN they might have a similar challenge.

    There are clear workarounds for example using mod_rewrite (isapi_rewrite for IIS) for each of the assets or folders, but clearly it would be more direct, simple and maintainable to have this be a deployment parameter that gets baked into the production deployment.

    Is there a place I can directly post feature requests for the "sencha" packaging tool?

    Thanks.