PDA

View Full Version : [OPEN] Plugin does not seem to pick up on libs that are declared in the config



TheCatWhisperer
28 May 2015, 6:24 AM
The plugin does not seem to pick up on libs that are declared in the config.. it complains on the requires that it is unused, and on the xtype that it is unknown, however it compile and runs as expected.

Or are we missing some configuration?

eg:

Ext.Loader.setConfig({
name: 'MyApp',
paths: {
'MyApp': 'app',
'UX': 'ux/components/js' // UX.common.ux.Button declared in here
},
enabled: true,
disableCaching: false
});

and:

Ext.define('MyApp.component.MyEditor', {
requires: [
'Ext.container.Container',
'Ext.form.Label',
'Ext.form.field.Text',
'Ext.layout.container.HBox',
'UX.common.ux.Button' // Unused
],
extend: 'Ext.form.FieldContainer',
xtype: 'my-editor',

initComponent: function () {
var me = this;

me.items = [{
xtype: 'container',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'container',
layout: {
type: 'hbox',
align: 'bottom'
},
items: [{
xtype: 'textfield',
width: 200,
fieldLabel: "My Field"
}, {
xtype: 'ux-button', // Unknown
scale: 'medium',
action: 'add',
disabled: true,
itemId: 'addButton',
ui: 'darkblue',
flex: 1,
margin: '0 0 0 10',
text: "Add"
}]
}]
}];

me.callParent(arguments);
}
});

Chris.OBrien
28 May 2015, 8:57 AM
The plugin does not seem to pick up on libs that are declared in the config.. it complains on the requires that it is unused, and on the xtype that it is unknown, however it compile and runs as expected.

I've moved this into its own thread so it doesn't get lost with the other.

TheCatWhisperer
29 May 2015, 5:43 AM
Note also that the 'MyApp.component.MyEditor' in:

Ext.define('MyApp.component.MyEditor', {
Also throws an error: "Fully qualified name does not match the path". Again, this is defined in the config.

The path is app/component.MyEditor.js

Chris.OBrien
29 May 2015, 6:49 AM
As of now, the plugin does nothing with the Ext.Loader and its config, so it's just ignoring what you have there.

I have opened an improvement request in our bug tracker for potential future inclusion.

TheCatWhisperer
1 Jun 2015, 4:26 AM
OK, in the meantime is there another thing we can use, even just for the IDE? We use Grunt for our JS and SASS compilation, linting, etc.. this is a company standards requirement.

Eg: can we add something to package.json or create a dummy app.json?

PS: can you add a link to the ticket?

TheCatWhisperer
1 Jun 2015, 4:34 AM
Note: I can resolve the Ext.define issues by crating an app.json like the following:

{
"name": "MyApp"
}
However, IMO, this is NOT a solution! The plugin should be able to digest and understand the Loader, since it is part of Sencha.