Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83
    Vote Rating
    3
    el.weilando is on a distinguished road

      0  

    Question Compile only dependencies?

    Compile only dependencies?


    Is it possible to collect with sencha compile only the dependencies for an application?
    I set the classpaths to the src files of my app and with --sdk-path the path to the ExtJS-src.


    After compile, the compiled file has all classes from my src and the sdk-src, although not all sdk-src files are necessary.


    Can I set an option like the Ext.Loader. that knows who the sdk-files are and includes only a a file, if it's required?

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,403
    Vote Rating
    148
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Can you post the command you are running? In general, the "--sdk-path" option is only used to generate app command and has some issues when used in application calls. The way the compiler works is based on a classpath, so the command you are using will help clarify what you are running into.
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83
    Vote Rating
    3
    el.weilando is on a distinguished road

      0  

    Default


    I try to concatenate my src folder without to create my app with the "sencha generate app" command . The structure of my project don't match with the from from "sencha generate app" created structure. All my ExtJS logic lies in this src folder and I need compile to compress and concatenate all these, to save loading time and size.

    Code:
    sencha compile  -classpath= /develop/htdocs/res/jsdev/ concatenate  -out=out.js
    Gives me this failure

    HTML Code:
    [INF]        Processing classPath entry : /develop/htdocs/sencha-compile-temp-dir
    [INF]        Processing classPath entry : /develop/htdocs/res/jsdev/
    [INF]        Processing class inheritance graph
    [ERR]        Failed to resolve dependency Ext.data.Model for file mb2c.models.SliderStoreModel
    [ERR]        com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.data.Model
    If I run

    Code:
    sencha -sdk-path=/develop/ext-4.1.2a/ compile  -classpath= /develop/htdocs/res/jsdev/ concatenate  -out=out.js
    There are no failures, but the generated out.js has all files from the Ext-Framework.

  4. #4
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,403
    Vote Rating
    148
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    We need the classpath in your second example to know that we have a complete app, but you can exclude whatever you want from the concat using the set operations provided by the compiler.

    See http://docs.sencha.com/ext-js/4-1/#!...mmand_compiler for coverage of this topic.

    In your case, try something like this:

    Code:
    sencha -sdk-path=/develop/ext-4.1.2a/ \
        compile \
            -classpath=/develop/htdocs/res/jsdev/ \
            exclude \
                -namespace=Ext \
            and \
            concatenate  \
                -out=out.js
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  5. #5
    Ext JS Premium Member rex.staples's Avatar
    Join Date
    Jul 2007
    Location
    Austin, TX
    Posts
    35
    Vote Rating
    1
    rex.staples is on a distinguished road

      0  

    Default


    Don,

    I am having similar trouble getting only dependencies to be included in the all-classes.js output file. In my old build process with sencha-sdk-2.0.0 I could issue this command:

    Code:
    sencha create jsb -a index-dev.html -p app.jsb3
    In the resulting app.jsb3 I would set debug:false and compress:true and then the follow-up with:

    Code:
    sencha build -p app.jsb3 -d build
    That produces a build with only the ExtJS dependencies my application requires (and my application's javascript) -- in my case about 249 ExtJS classes.

    Today I upgraded to the sencha-sdk-3.0.0.250 build and I am trying to craft a similar command. I have come up with:

    Code:
    sencha compile -classpath=ext/src,app-config.js,app.js,app \
              -option=debug:false \
              page -yui -in=index-dev.html -out=build/index.html
    That command produces a build with all 432 ExtJS classes found in the ext/src folder (and my application's javascript).

    The "Trimming the Excess" section from http://docs.sencha.com/ext-js/4-1/#!...and_app_single says:

    The page command then determines the subset of files used by "index.php".
    Could you please provide some guidance on what is needed to invoke the dependency analysis and build an application that only includes those classes required by the application?

    As it is the sencha-sdk-3.0.0.250 command generates an all-classes.js file that is 25% larger than the sencha-sdk-2.0.0.

    Thanks!

  6. #6
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,403
    Vote Rating
    148
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    The page command looks for the x-compile section of your markup file to make this determination, so if you could post that here I would be glad to see if there is anything ado there.
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  7. #7
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,403
    Vote Rating
    148
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    Another useful thing is to use "sencha -debug compile ..." to get a log of the dependency scan to get blow-by-blow on what is being determined. This can be a lot of output but if you are looking for specific files you can always search to see where they show up.
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  8. #8
    Ext JS Premium Member rex.staples's Avatar
    Join Date
    Jul 2007
    Location
    Austin, TX
    Posts
    35
    Vote Rating
    1
    rex.staples is on a distinguished road

      0  

    Default


    Thanks for the debug tip, Don. I will give that a look later. For my index-dev.html page I copied the x-compile section from the Sencha cmd Single Page Apps Guide:

    Code:
    <!-- <x-compile> -->
        <!-- <x-bootstrap> -->
            <script src="ext/ext-dev.js" type="text/javascript"></script>
        <!-- </x-bootstrap> -->
    
        <script src="app-config.js" type="text/javascript"></script>
        <script src="app.js" type="text/javascript"></script>
    <!-- </x-compile> -->
    My first script includes the application configurations and the second the typical ExtJS mvc application. I don't do any kind of wildcard includes anywhere in the application.

  9. #9
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83
    Vote Rating
    3
    el.weilando is on a distinguished road

      0  

    Default


    Quote Originally Posted by dongryphon View Post
    We need the classpath in your second example to know that we have a complete app, but you can exclude whatever you want from the concat using the set operations provided by the compiler.

    See http://docs.sencha.com/ext-js/4-1/#!...mmand_compiler for coverage of this topic.

    In your case, try something like this:

    Code:
    sencha -sdk-path=/develop/ext-4.1.2a/ \
        compile \
            -classpath=/develop/htdocs/res/jsdev/ \
            exclude \
                -namespace=Ext \
            and \
            concatenate  \
                -out=out.js
    Perfect

  10. #10
    Ext JS Premium Member rex.staples's Avatar
    Join Date
    Jul 2007
    Location
    Austin, TX
    Posts
    35
    Vote Rating
    1
    rex.staples is on a distinguished road

      0  

    Default


    I realize now my issue is that I was executing the sencha cmd against ExtJS 4.1.2 and not ExtJS 4.1.1a or ExtJS 4.1.2a ... I started from scratch with one of the 'a' sdks and everything seems to be working great.

    Thanks!

Thread Participants: 2