Results 1 to 9 of 9

Thread: Build a separated production microloader file

  1. #1
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    905

    Default Build a separated production microloader file

    I need the temp microloader.js file generated in app build dir while building. I can see that the index.html is created with a compressed microloader script inside. Is there any option to not generate this script inside the html file and generate a separated js file?

    Thanks
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    There is no option, having it within index.html allows it to be loaded and evaluated by the browser as fast as possible.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    905

    Default

    Quote Originally Posted by mitchellsimoens View Post
    There is no option, having it within index.html allows it to be loaded and evaluated by the browser as fast as possible.
    Yes, I agree @mitchellsimoens! But my app have a index.php in another dir (public/) and contains some especifics php codes for my app, Then I need to copy the script generated in index.html to my .php file everytime my app is built,What do you recommend?

    I suggest an option in app.json or in sencha.cfg to specify to write microloader.min.js separated instead within index.hml,

    Thanks for your attention!
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  4. #4
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    905

    Default

    Any help is appreciated. Thanks!
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  5. #5
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    905

    Default Solved

    Quote Originally Posted by mitchellsimoens View Post
    There is no option, having it within index.html allows it to be loaded and evaluated by the browser as fast as possible.
    I have discouvered after studing the .sencha dir files, and found in .sencha/app/default.properties a config called
    build.enable.embedded.microloader=true

    I've just overrided it to false and microloader content wasn't embedded in the output markup anymore , So this solved partialy my need because microloader is not compressed.

    To solve completally my need, I have commented line 27 in .sencha/app/page-impl.xml
    where delete file after embedded.
    <delete file="${build.microloader.path}"/>

    Please add an option, where developer can set to delete or not this microloader.js file

    Now I can work better with my php blade view file

    PHP Code:
    <!DOCTYPE HTML>
    <
    html lang="en-US"><head>    
    <
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>       
    @if (
    App::environment() === 'production')    
    <
    base href="/build/production/myApp/"/>        
    @elseif(
    App::environment() === 'testing')        
    <
    base href="/build/testing/myApp/"/>
        @elseif (
    App::environment() === 'local')       
     <
    base href="/myApp/"/>        
    @endif       
     <
    title>My custom title</title>           
    @if (
    App::environment() === 'production')        
    <
    script id="microloader" type="text/javascript" src="microloader.js"></script>        
    @elseif (App::environment() === 'local')        
    <script id="microloader" type="text/javascript" src="bootstrap.js"></script>
        @elseif (App::environment() === 'testing')       
     <script id="microloader" type="text/javascript" src="microloader.js"></script>        
    @endif    
    </head>

    <body cz-shortcut-listen="true" scrolling="no">
    </body></html> 
    Thanks!
    Last edited by wemerson.januario; 30 Jun 2014 at 5:33 PM. Reason: HTML Code indentation
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  6. #6
    Sencha User
    Join Date
    Apr 2013
    Posts
    36

    Default

    @wemerson.januario , Thanks for posting your solution.
    It saved my bacon after spending a few hours trying to change the script tag in the built app. Looking at your solution pointed me in the right direction.

    In any case for future reference, there is more on the Sencha Cmd Build process here
    http://docs-origin.sencha.com/cmd/5....cmd_build.html if anyone happens to across similar problems

  7. #7

    Default

    From app.json. This generates the microloader separately (embed=false)

    Used to be always uncompressed, now it is always compressed, look for that switch to change or be surfaced in app.json or otherwise screw you on an update one day.


    Code:
        "production": {
            "indexHtmlPath": "",
    
            "output": {
                "base": "${workspace.build.dir}/${build.environment}/${app.name}",
    
                "page": {
                    "path": "../../../../../index.html",
                    "enable": false
                },
                "microloader": {
                    "path": "microloader.js",
                    "embed": false,
                    "enable": true
                }
            }
        },
    sencha The "index.html" crap is confused. Are we specifying a PATH or a FILENAME ? The answer is a bit of both. You guys can do better.

  8. #8
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    905

    Default

    Actualy who is looking for this, I suggest to upgrade Sencha CMD to lastest versions and aprecciate the new app.json config option called"output" ;
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  9. #9

    Default

    SUGGESTIONS FOR SENCHA


    1. Add a compress option to the microloader config in the output config. Let us decide.

    2. Address confusion over "index.html" determining both path and file name. The symbol has become overloaded, the docs say path but it is clearly not a path, the file name can be ignored if the stars align etc.

    3. Where is a hook in the microloader to show some progress? I can keep people at their desktop for a few moments longer if they think something is happening. Meantime each new release is bigger and fatter.

    4. "For a fuller understanding of the ideas behind Profiles and how best to use them in your app, we suggest you read the device profiles guide." Please fix the freaking link. I keep searching for this profile guide. The bad link is at http://docs.sencha.com/extjs/5.1/5.1...xt.app.Profile It has been reported.

    I think the good link is http://docs.sencha.com/cmd/5.x/micro...Build_Profiles

    But I cannot know. Theres a helluva lot of sencha spread all over.

Posting Permissions

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