Results 1 to 5 of 5

Thread: Ext.Loader requires over 200 files for Ext.Component?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83

    Default Ext.Loader requires over 200 files for Ext.Component?

    hi!

    I need to minimize an ExtJs application by building an production-file with only the needed ExtJs classes.
    If I use ext-core and Ext.Loader, ExtJs loads for this
    Code:
            Ext.create('Ext.Component',{
                html:'test',
                renderTo: Ext.getBody()
            });
    over 200 files.

    When this is compressed and obfuscated, the final app-all.js has 660 KB. With the ext-core.js the complete app has, only for displaying an div with "test", 860 KB.

    Is there an option to select only the files with Ext.Loader which I really need?

    ExtJs is a very nice framework for big applications. But if want to use only some elements in a website, it generates, compared with other frameworks, a huge traffic.

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Chennai, India
    Posts
    92
    Answers
    8

    Default

    Quote Originally Posted by el.weilando View Post
    Is there an option to select only the files with Ext.Loader which I really need?
    Try using ext-all.js in you html file. this might help.

    Regards,
    Premkumar.

  3. #3
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    83

    Default

    Quote Originally Posted by a.premkumar View Post
    Try using ext-all.js in you html file. this might help.

    Regards,
    Premkumar.
    Then I have a file with 1.2 MB. 340 kb more.
    The reason why i try to include only the classes which I need is, to minimize the framework.

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    You can use the SDK/Sench Cmd to compile only the required files. In the SDK for example, it will create a JSB3 file.

    Scott.

  5. #5
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Location
    Bangkok, Thailand
    Posts
    506
    Answers
    26

    Default

    Just checked with Sencha Cmd and the resulting file is 699kB (includes core as well). If you use a GZIP filter on your web server, it will be maybe 210kB.

    If you want to stay small then forget about ExtJs components and simply use Ext core to manipulate the DOM. ext.js is a little over 200kB minified and maybe 70kB gzipped.

    Another strategy is to forget about custom builds and pull files from the CDN and hope that the client has the files in the cache. Personally, I think the chances of a cache hit are not very high though.

    This is the Sencha Cmd script I used

    Code:
    compile
    -cl=extjs-4.1.1a/src
    union
    -r
    -c
    Ext.Component
    and
    -debug=false
    concat
    -strip
    -compress
    test.min.js
    and
    metadata
    -f
    -o
    test-dependencies.txt

Posting Permissions

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