Re: [gwt-contrib] JsInterop retrofit

2015-04-02 Thread Julien Dramaix
Hi all, Finally, did you made a decision ? I like very much the *native methods* approach for its simplicity and a test library like PowerMock seems to be able to mock native methods. But Ray seems to have some concerns about using class instead of Interface. So what was the selected

Re: [gwt-contrib] JsInterop retrofit

2015-04-02 Thread 'Goktug Gokdogan' via GWT Contributors
I think last time I checked everybody was convinced this is the way to go and we are planning towards this. I'll update the spec when I have the chance. On Thu, Apr 2, 2015 at 6:08 AM, Julien Dramaix julien.dram...@gmail.com wrote: Hi all, Finally, did you made a decision ? I like very much

Re: [gwt-contrib] JsInterop retrofit

2014-11-05 Thread Cristian Rinaldi
@goktug I like this option, it is expressive and concise. But I have a question, The code generated for the prototype, suppose we are extending some existing JS functionality and want to add some function, the prototype generated will have native code?, how this prototype generates subyasente

Re: [gwt-contrib] JsInterop retrofit

2014-11-05 Thread 'Goktug Gokdogan' via GWT Contributors
It is compiler magic. The compiler understands from PrototypeOfJsType and assumes any methods in the class are native, hence ignores the method body. On Wed, Nov 5, 2014 at 4:08 AM, Cristian Rinaldi csrina...@gmail.com wrote: @goktug I like this option, it is expressive and concise. But I

Re: [gwt-contrib] JsInterop retrofit

2014-11-05 Thread Cristian Rinaldi
@goktug Thanks for the answer!! El miércoles, 5 de noviembre de 2014 17:34:51 UTC-3, Goktug Gokdogan escribió: It is compiler magic. The compiler understands from PrototypeOfJsType and assumes any methods in the class are native, hence ignores the method body. On Wed, Nov 5, 2014 at 4:08

Re: [gwt-contrib] JsInterop retrofit

2014-11-03 Thread 'Ray Cromwell' via GWT Contributors
Moving from interfaces to classes has other downsides. For example, you can't avoid not generating a Java class/object, you can't have your own super-class hierarchy and mark your class as supporting the same interface as an external JS implemented one, the notion of JS objects implementing a Java

Re: [gwt-contrib] JsInterop retrofit

2014-11-03 Thread 'Goktug Gokdogan' via GWT Contributors
On Sat, Nov 1, 2014 at 3:33 AM, Manuel Carrasco Moñino man...@apache.org wrote: After reading, and playing with some stub code based on these ideas, I come to the conclusion than 'native' is almost perfect from the point of view of a gwt developer. We want pure java syntax and simplicity,

Re: [gwt-contrib] JsInterop retrofit

2014-11-03 Thread 'Goktug Gokdogan' via GWT Contributors
On Sat, Nov 1, 2014 at 8:25 AM, Stephen Haberman stephen.haber...@gmail.com wrote: I will try to summarize my thought process and different options that I have played with so that you could get a better understanding where I'm coming from and I hope it will provide good documentation for

Re: [gwt-contrib] JsInterop retrofit

2014-11-03 Thread 'Goktug Gokdogan' via GWT Contributors
I think I didn't understand some of your concerns. Let's meet some time this week to flush out what all of this means and the implications. On Mon, Nov 3, 2014 at 8:45 AM, 'Ray Cromwell' via GWT Contributors google-web-toolkit-contributors@googlegroups.com wrote: Moving from interfaces to

Re: [gwt-contrib] JsInterop retrofit

2014-11-03 Thread 'Goktug Gokdogan' via GWT Contributors
An additional pros / cons about getting rid of JsObject.prototype: Not having JsObject.prototype fixes the symmetry problem between SDK and user code. For example earlier, when you extend Element you need to extend Element.prototype but if the custom element is implemented in java side, then you

Re: [gwt-contrib] JsInterop retrofit

2014-11-01 Thread Manuel Carrasco Moñino
After reading, and playing with some stub code based on these ideas, I come to the conclusion than 'native' is almost perfect from the point of view of a gwt developer. We want pure java syntax and simplicity, and any other conventions like DSLs or magic interface names, etc, could obscure the

Re: [gwt-contrib] JsInterop retrofit

2014-11-01 Thread Stephen Haberman
I will try to summarize my thought process and different options that I have played with so that you could get a better understanding where I'm coming from and I hope it will provide good documentation for future. Thanks for the email; I think the format was really useful. One may argue

Re: [gwt-contrib] JsInterop retrofit

2014-11-01 Thread 'Goktug Gokdogan' via GWT Contributors
There is also a third option. User writes: @JsType(prototype = Object)interface JsObject { class prototype extends Prototype_JsObject {} interface Static { String[] keys(JsObject obj); JsObject defineProperties(JsObject obj, JsObject props); } static Static getStatic() {

Re: [gwt-contrib] JsInterop retrofit

2014-11-01 Thread 'Goktug Gokdogan' via GWT Contributors
(I will read respond to comments after the weekend) On Sat, Nov 1, 2014 at 9:52 AM, Goktug Gokdogan gok...@google.com wrote: There is also a third option. User writes: @JsType(prototype = Object)interface JsObject { class prototype extends Prototype_JsObject {} interface Static {

[gwt-contrib] JsInterop retrofit

2014-10-31 Thread 'Goktug Gokdogan' via GWT Contributors
I finally had some time to think about JsInterop and how to abstract browser APIs. I will try to summarize my thought process and different options that I have played with so that you could get a better understanding where I'm coming from and I hope it will provide good documentation for future.