Results 1 to 4 of 4

Thread: Architect and the wonderful world of hand-coded tricks and helpers.

  1. #1
    Sencha User
    Join Date
    May 2011
    Melbourne, Australia

    Default Architect and the wonderful world of hand-coded tricks and helpers.

    Reading some of the fantastic articles posted by Deities of the Sencha realm, there are a plethora of handy helpers and techniques which would be fantastic to apply in Architect.

    A great example Mitchell Simoens' Guide for adding code to casually control elements of differing build environments, such as http://localhost/ to (intentional non-standard potential eviron).

    Even the simple use of:
    dev environment code only
    has been displayed often as a fantastic resource for helping with staging.

    Is there any means of using this technique with Architect currently, or is the only real way things like this can be processed is through build configs and/or ant scripts?
    Last edited by Greg Arnott; 3 Apr 2013 at 10:29 PM. Reason: BB-code vs Preview clean-up

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007


    Greg -

    Most users are using build configs/ant scripts now. We have some plans to enhance the workflow of working between dev, staging and production that will come down the line.

    Any specific requests?
    Aaron Conran

  3. #3
    Sencha User
    Join Date
    May 2011
    Melbourne, Australia


    Ability to apply "//<debug>" tags around particular elements, such as local configs and functions. Perhaps a component option for applying development / testing configuration, perhaps as a checkbox that applies a debug wrapped function which calls a config update; ie:
    function () {
            localUrl : "http://localhost",
            testOpt  : "gruntfile.js",
            devStore : {
                users : "users.json",
                auth  : "auth.json",
                data  : "data.json"
    Store alternative urls.
    ie: url: '/api/data', altUrl: 'data.json'
    Where altUtl overrides url in development, and has an implied "debug" status that drops it from the code when a production build is performed.

    Resources alternative paths.
    ie: fileName: 'style.css', devPath: 'resources/css', prodPath: 'styles/mobile/css'

    SCSS builds use compass with the config.rb file capable of providing so many of these settings, albeit only for generating css. Setting this file up for some unique settings is very straightforward. I'd love to either know the key/values expected for sencha.cfg, else have an input option in Architect which applies them for you.
    Example extended config.rb:
    # Get the directory that this configuration file exists in
    dir = File.dirname(__FILE__)
    # Load the sencha-touch framework automatically.
    load File.join(dir, "..", "..", "..", "touch", "resources", "themes")
    # Paths
    sass_path = dir
    project_path = "/"
    http_path = (environment == :production) ? "" : ""
    # Set to true for relative paths, false for absolute paths
     relative_assets = (environment == :production) ? true : false
    # Stylesheet configs
    css_path = File.join(dir, "..", "..", "resources", "css")
    css_dir = "resources/css"
    http_stylesheets_path = http_path + "/styles/mobile/css"
    # Images
    images_path = File.join(css_path, "..", "images")
    images_dir = "resources/images"
    http_images_path = http_path + "/styles/mobile/images"
    # Output
    output_style = (environment == :production) ? :compressed : :expanded
    if environment != :production
        sass_options = {:debug_info => true}
    Last edited by Greg Arnott; 4 Apr 2013 at 5:32 PM. Reason: clarification and layout

  4. #4


    Is there any enhancement on being able to apply //debug tags with Architect on a config definition? The problem is the logger config in Application. We can not put it between the //debug tags. And when we make a build for Android using Cordova, the application doesn't go beyond the loading indicator.

    If we can not put them between //debug tags then we have to remove it before every build.

    Thanks in advance

Tags for this Thread

Posting Permissions

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