1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    White Rock, BC Canada
    Posts
    161
    Vote Rating
    0
    WagsMax is on a distinguished road

      0  

    Default Avoiding missing classes in compiled output

    Avoiding missing classes in compiled output


    I am using the new Sencha Cmd compiler, and it works awesome to produce the smallest single js. One problem I had was that if I didn't put a requires into views such as this:
    Code:
        requires: [
        	'Ext.layout.AbsoluteLayout'
        ],
    
    
        title: 'Advanced Task Manager',
        autoScroll: true,
        layout: 'absolute'
    the compiled js would barf saying it did not have layout absolute loaded. There is a way to set up in development so that the system, if you didn't put the requires in, when it dynamically loads a class using ext-debug.js, a console message is displayed that recommends that you put a requires in. I can't seem to find where that is documented. This would save a lot of time compiling, finding the error, and then adding the requires. Can anyone help?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,197
    Vote Rating
    482
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Moved to Sencha Cmd forums.

    Scott.

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,512
    Vote Rating
    176
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  

    Default


    Can you provide some more of the context around that code snippet? The compiler does recognize some of these dependencies, but not all so I would be curious to know where those lines exist in your code a bit more precisely.

    You are correct that the guide could be more helpful in explaining how to detect these issues.
    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!"

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Location
    White Rock, BC Canada
    Posts
    161
    Vote Rating
    0
    WagsMax is on a distinguished road

      0  

    Default


    I can give you all the code you need, but I am not sure what would help, so if you give me a little direction I can reply with the code you want.

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,512
    Vote Rating
    176
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  

    Default


    Let's start with that file. If it is too large, try eliminating pieces but just be sure that the problem persists.
    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!"

  6. #6
    Sencha User
    Join Date
    Dec 2011
    Location
    White Rock, BC Canada
    Posts
    161
    Vote Rating
    0
    WagsMax is on a distinguished road

      0  

    Default


    Code:
    Ext.define('ATMgo.view.Viewport', {
    	extend: 'Ext.container.Viewport',
    
    
        requires: [
        	'Ext.layout.BorderLayout',
        	'ATMgo.view.LoginForm'
        ],
    
    
    	layout: 'border',
    	items:[
    		{
    			region: 'west',
    			id: 'viewportWestRegion',
    			title: 'Menu',
    			collapsible: true,
    			width: 200,
    			hidden: true,
    			layout: 'fit'
    		},
    		{
    			region: 'center',
    			id: 'viewportCenterRegion',
    //			xtype: 'tabpanel',
    //			activeTab: 0,
    			layout: 'ux.center',
    			items: [ { xtype: 'loginform' }	]
    		},
    		{
    			region: 'south',
    			id: 'viewportSouthRegion',
    			title: 'South Panel',
    			collapsible: true,
    			html: 'Information goes here',
    			split: true,
    			height: 100,
    			minHeight: 100,
    			hidden: true
    		}
    	]
    });

  7. #7
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,512
    Vote Rating
    176
    dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of dongryphon has much to be proud of

      0  

    Default


    Currently, the compiler recognizes auto-dependencies of the form:

    Code:
        Ext.define('App.foo.Bar', {
            extend: 'Ext.panel.Panel',
    
            layout: 'fit'
        });
    That is, this only works in Ext.define calls. We need to expand this to include instantiations such as the contents of your items array. That bug is being tracked as SDKTOOLS-198 which will appear in the release notes when we fix it.

    In the meantime, you will need to include the "requires" statements as you have done.

    Thanks for taking the time to report this!
    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!"

Thread Participants: 2