ExtJS 4.x support

Feature requests
hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Tue Jun 28, 2011 1:47 pm

Thanks for the updates so far - it's great to have ExtJS 4 support!

There's one suggestion that I have for improvement, though - it would be nice to have Spket work with singleton types.

For example, there are some types like this:

Code: Select all

Ext.define('MyNamespace.SomeSingleton', {
	singleton: true,
	someFunc: function() {
		// ...
	}
});
This is accessed in the code elsewhere, like this:

Code: Select all

MyNamespace.SomeSingleton.someFunc();
But code complete after "MyNamespace.SomeSingleton." does not list "someFunc()" in the completion options. Could this be included in a future update? Thanks for all the hard work!

jeldad
Posts: 2
Joined: Tue Jun 28, 2011 10:13 am

Re: ExtJS 4.x support

Post by jeldad » Tue Jun 28, 2011 1:50 pm

@eric_suen

Thanks for the reply. Was just about to reply when i saw urs.
Was my bad!!! After making the changes, I didn't restart Aptana Studio. After a restart everything was working perfectly well!

Big thanks :D

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: ExtJS 4.x support

Post by eric_suen » Wed Jun 29, 2011 10:57 am

hopper wrote:it would be nice to have Spket work with singleton types.
I have uploaded a quick fix, please download http://www.agpad.com/downloads/com.spket.js_1.6.18.jar and replace the old one.

Arise
Posts: 2
Joined: Wed Jun 29, 2011 11:04 am

Re: ExtJS 4.x support

Post by Arise » Wed Jun 29, 2011 11:13 am

Support for Sencha Touch?

Inside the Sencha Touch folder there is a sencha-touch.jsb3 file.
Can this file be converted to a compatible jsb2 that works with spket?

Regards,
Arise

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Wed Jun 29, 2011 1:13 pm

@eric_suen

Your update works great - thank you! :D

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Wed Jun 29, 2011 3:51 pm

I also came across another suggestion for improvement: code-complete for the "this" keyword doesn't seem to handle inheritance from parent classes. Here's an example of what I mean:

Code: Select all

Ext.define('MyNamespace.ParentClass', {
	parentFunction: function() {
		// ...
	}
});

Ext.define('MyNamespace.ChildClass', {
	extend: 'MyNamespace.ParentClass',
	childFunction: function() {
		// ...
	},
	thirdFunction: function() {
		this.parentFunction(); // not shown in code completion
		this.childFunction(); // shown
	}
});

var instance = Ext.create('MyNamespace.ChildClass');
instance.parentFunction(); // shown
instance.childFunction(); // shown
Both the parentFunction and childFunction appear in the code completion for explicitly created instances, but the parentFunction does not appear in code completion within the class definition. Thanks!

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Thu Jul 07, 2011 9:30 pm

As I've been using Spket for ExtJS development (and loving it!), I've come up with yet another feature on my Spket wish-list. It would be really great if Spket could do an "Open Declaration" for ExtJS 4 dynamic instantiation. An example:

Code: Select all

// The old way of doing instantiation, in ExtJS 3.x
var obj = new MyNamespace.SomeClass();

// The new method for instantiation, in ExtJS 4.x
var obj = Ext.create('MyNamespace.SomeClass', {});
In the first case, highlighting "SomeClass" and pressing F3 (Open Declaration) takes me to the class definition. But that doesn't work in the second case, since the string is being passed to Ext.create(). It would be nice if I could highlight the "SomeClass" in that Ext.create() call and again press F3 to jump to the class definition. I don't know if that is possible, since it's a string literal and not an object reference, but it would be very convenient so that I wouldn't have to hunt down the definition location manually every time.

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: ExtJS 4.x support

Post by eric_suen » Tue Jul 12, 2011 3:38 pm

I have uploaded a quick fix, please download http://www.agpad.com/downloads/com.spket.js_1.6.18.jar and replace the old one.

What's new:
1. xtype support
2. jsb3 support(Sencha Touch)
3. Ext4 extend was improved
4. open declaration was improved

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Wed Jul 13, 2011 2:37 pm

Wow, Eric - this update is fantastic, makes working in Spket really great! I hope you don't mind, but I came across a small gap in the improvements to 'extend' - in the ExtJS world, singletons are allowed to inherit from non-singleton parents (for example, Ext.Ajax is a singleton instance of the parent class Ext.data.Connection), but this doesn't seem to be handled. A simple example:

Code: Select all

Ext.define('MyNamespace.ParentClass', {
	someFunction: function() {
		// ...
	}
});

Ext.define('MyNamespace.SingleChild', {
	extend: 'MyNamespace.ParentClass',
	singleton: true
});

// This is a valid method call (inherited from the parent), but is not shown in code completion
MyNamespace.SingleChild.someFunction();
However, the improvements to Ext4 extend do work wonderfully for singletons extending singletons, and non-singletons extending other non-singletons. Thanks for all your great updates!

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: ExtJS 4.x support

Post by eric_suen » Fri Jul 15, 2011 12:53 pm

Thanks for the information, here is the update - http://www.agpad.com/downloads/com.spket.js_1.6.18.jar

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Fri Jul 15, 2011 6:13 pm

Works like a charm - thank you! :D

papertiger
Posts: 7
Joined: Mon Jul 18, 2011 12:34 am

Re: ExtJS 4.x support

Post by papertiger » Mon Jul 18, 2011 12:37 am

eric_suen wrote:I have uploaded a quick fix, please download http://www.agpad.com/downloads/com.spket.js_1.6.18.jar and replace the old one.

What's new:
1. xtype support
2. jsb3 support(Sencha Touch)
3. Ext4 extend was improved
4. open declaration was improved

hi, eric, i'm a fresh man in the spket. And i succeed in configuring the spket in my eclipse to ext 2.0. But i don't know how to configure this to support ext 4.0. What should i do while i have downloaded the files u provide ?

dani_bs
Posts: 1
Joined: Wed Jul 20, 2011 9:03 am

Re: ExtJS 4.x support

Post by dani_bs » Wed Jul 20, 2011 9:06 am

"java -jar com.spket.js_1.6.18.jar" produce:
"Failed to load Main-Class manifest attribute from com.spket.js_1.6.18.jar"

:(

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: ExtJS 4.x support

Post by eric_suen » Wed Jul 20, 2011 10:44 am

dani_bs wrote:"java -jar com.spket.js_1.6.18.jar" produce:
"Failed to load Main-Class manifest attribute from com.spket.js_1.6.18.jar"

:(
This is a quick fix, not a standalone version, just replace the old one in plugins folder

hopper
Posts: 9
Joined: Tue Jun 28, 2011 1:34 pm

Re: ExtJS 4.x support

Post by hopper » Thu Jul 21, 2011 2:49 pm

I have another idea for Spket / ExtJS 4 improvement! I don't know if this is doable or not, but here's what I'm thinking: it would be nice to have documentation be inherited from parent classes for overridden functions that don't supply their own. That may be a little unclear so here's an example:

Code: Select all

Ext.define('MyNamespace.Thing1', {
	someFunc: function() {}
});

Ext.define('MyNamespace.Thing2', {
	otherFunc: function() {}
});

Ext.define('MyNamespace.ParentClass', {
	/**
	 * A test function to be overridden by child classes.
	 * 
	 * @param {MyNamespace.Thing1} param
	 * 
	 * @return {MyNamespace.Thing2}
	 */
	inheritableFunc: function(param) {
		param.someFunc(); // shows in autocomplete
		
		return Ext.create('MyNamespace.Thing2');
	},
	
	testFunc: function() {
		this.inheritableFunc(null).otherFunc(); // shows in autocomplete
	}
});

Ext.define('MyNamespace.ChildClass', {
	extend: 'MyNamespace.ParentClass',
	
	inheritableFunc: function(param) {
		param.someFunc(); // not shown in autocomplete
		
		return this.callParent();
	},
	
	testFunc: function() {
		this.inheritableFunc(null).otherFunc(); // not shown in autocomplete
	}
});
As you can see, the documentation and return and parameter types work great in the parent class, but none of that is inherited in the child class, since the function definition is extended. Obviously, the function comment could be copy-pasted into the child class and everything would work fine, but that's a lot of work for a large class hierarchy with lots of child classes and any alterations to the parent would have to be re-copied to all the children.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest