Results 1 to 7 of 7

Thread: How to do Ext JS app build production and still keep the line numbers?

  1. #1
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,294

    Default How to do Ext JS app build production and still keep the line numbers?

    I tried to edit .sencha\app\production.properties with:
    Code:
    build.options.logger=no
    build.options.debug=false
    build.css.compress=true
    And also .sencha/.sencha/app/app.defaults.json from:
    Code:
        "production": {
        "compressor": {
                "type": "yui"
            }
        }
    to

    Code:
        "production": {
        "compressor": {
                "type": "none"
            }
        }
    But my build\production\MyApp\app.js is still not human usable:
    extjs compressed.PNG

    In case it's important I make a case for this, well, in Java I keep my line numbers in my compiled code, in .Net and C++ I put symbols in productions so I get line numbers in stacks. Be able to support production issues is kind of important... so I need to know which line of my JavaScript throw a an error due a to a null reference.

  2. #2
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    Source Maps are a way to achieve this on Javascript (https://developer.chrome.com/devtool...ng#source-maps). We're evaluating the chance of adding this feature to Sencha Cmd natively: http://www.sencha.com/forum/showthread.php?269033
    Israel Roldán | Senior Software Engineer (Framework tools)

  3. #3
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,294

    Default

    Thanks to makes me aware of that feature. However, I do not care about optimizing the size of my JavaScript by removing some spaces and return of lines, that file will be parsed then cached by the browser. What I care the most is that my stack has line numbers on all browsers supported by Ext JS 5, which include IE 8. The stacks are sent to a server, from customers's browser.So I'm looking for the best Sencha Cmd that will do everything 'production' like, except it keeps the return of lines, and I guess some tabs/spaces.What is that command? I tried many things like I have mentioned above but even options that sound exactly what I want doesn't work, and no warning or error from Sencha Cmd telling me my options doesn't make sense or are not supported, so I need your help since Sencha Cmd is somehow a black box.

  4. #4
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    The closure compiler does more than just removing whitespace (for example inlining functions, reusing variables and pre-compute contsats), but I understand what you mean. In this case, using the testing build should be your best option. The testing and production builds differ on a few things: production being processed by a compressor (YUI or the Closure compiler) and having delta updates enabled (if configured).
    Israel Roldán | Senior Software Engineer (Framework tools)

  5. #5
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,294

    Default

    Can I still use the closure compiler but keep the whitespace and return of line? Similar discussion here -> http://stackoverflow.com/questions/1...object-literal

  6. #6
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    You could try it (using the testing build's app.js and compiling it manually) but just as the SO thread somehow concludes, this is not a standard approach, all these tools are meant to minify and compress your code for production usage. The examples you give as motivation are all server side (Java, .Net, C++), where the approach to compiling/running code is very different.
    Israel Roldán | Senior Software Engineer (Framework tools)

  7. #7
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,294

    Default

    I was looking for the way to configure Sencha Cmd to do that closure call that is still pretty print. I'm not familiar with the way to configure closure compiler.

    Also the 'testing' build still keep the comments, what is the tiny flag of Sencha Cmd that could at least remove the comments?

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
  •