Ok I can confirm that the issue was my fault. After moving everything to a 
JsTyp annotated classes, everything works fine. 

I have a last question regarding code size and the use if isNative=true.
I guess isNative=true is preferred and will make sure that code size stays 
low by not exposing the Java contract to JS. 

For example I have a JS library that takes configuration settings as an 
configuration object: 

options = { option1:'some string',option2: 24, option3:[],..}

and I want to use JsInterop to write a type safe wrapper for this that is 
only used by GWT/Java code, I would create a class like this (using 
isNative=true instead of just an empty @JsType): 

@JsType(isNative=true,namespace=JsPackage.GLOBAL,name="Object")
public class Options {
   public String option1;
   public int option2;
   ...
}

Thanks in advance


P.S:: Great work btw, the new JsInterop is a pleasure to work with. 


On Monday, November 16, 2015 at 12:26:32 PM UTC+1, Goktug Gokdogan wrote:


>
> On Mon, Nov 16, 2015 at 2:59 AM, Ümit Seren <uemit...@gmail.com 
> <javascript:>> wrote:
>
> Thanks for the info. 
>
> AFAIK JSNI syntax will go away at some point. I guess I would then rely on 
> a utility class to do that. 
>
>
> There is going to be a replacement for JSNI by supplying supplementary js 
> files. So if you have a class with JSNI you can still keep it future 
> compatible but it is a good idea to minimize such classes.
>  
>
> One more question: 
> Are there any restrictions regarding @JsProperty fields and Arrays ? 
>
> somehow following thing dosn't work (it's not set on the object , stays 
> undefined) 
>
> @JsProperty void setLabels(String[] labels);
>
>
> There is no limitation on this. Most of the time when there is such 
> limitation, compiler gives an error or warning.
> However there is a bug with respect to non public instance methods; 
> perhaps you are hitting that. Can you provide a full snippet so that I can 
> take a look?
>  
>
>
> On Friday, November 13, 2015 at 7:30:11 PM UTC+1, Goktug Gokdogan wrote:
>
>
>
> On Fri, Nov 13, 2015 at 6:28 AM, Ümit Seren <uemit...@gmail.com> wrote:
>
> Is there a way to add dynamic properties to a JsType without relying on 
> JSNI ? 
>
> With the experimental JSInterop version I had following solution:
>
> @JsTypinterface Options {
>
>    @JsProperty void getSomeProp();
>
>    @JsProperty String getSomeProp2();
>    @JsProperty void setSomeProp2(String prop);
>
>     void setSeries(String series, SeriesOptions options);
> }
>
> OptionsImpl implements Options {
>
>      ....
>
>      @Override
>      public final native void setSeries(String series, SeriesOptions options) 
> /*-{
>            this['series'] = options;
>      }*-/;
> }
>
> Or generally what’s the best practice regarding generic JS properties ?
>
>
> If you are not implementing an interface with JsProperty, the best way is 
> simply putting a JsProperty field in your class.
>
> If you are implementing an interface, you can do what you did here but I 
> would recommend having a separate generic utility class so that you can 
> reuse what you have here in many places. We will probably provide a similar 
> utility class as part of jsinterop at some stage.
>  
>
> On Wednesday, November 11, 2015 at 6:26:09 AM UTC+1, Goktug Gokdogan wrote:
>
> In native types, the support for static methods are same as the support 
> for static fields; only overlays are supported because we don't modify the 
> native types. Can you give an example that works with static methods and 
> doesn't work with static field but should work as well? What do you mean by 
> "static shared fields"?
>
>
> wrt. overloading: we are not planning to support automatic dispatches per 
> argument count in this version. And btw, method overloading never worked 
> earlier and we recently added support and just for native types.
>
> On Tue, Nov 10, 2015 at 4:19 PM, Manuel Carrasco Moñino <man...@apache.org
> > wrote:
>
>
> Another issue in the new implementation is that it's not supported any 
> more static shared fields in JsType native interfaces, I think if we 
> support static methods we should support static fields as well, or is there 
> i any reason to prevent it ?.
>
> On Tue, Nov 10, 2015 at 6:11 PM, Manuel Carrasco Moñino <man...@apache.org
> > wrote:
>
> var args sounds pretty good, but some kind of overloading based on the 
> number of parameters like we had in gwt-exporter should cover many use 
> cases, compiler could give an error (like it does now) when it sees two 
> methods with the same-number-of-parameters signature.
>
>
>
> On Tue, Nov 10, 2015 at 5:59 PM, 'Roberto Lublinerman' via GWT 
> Contributors <google-web-toolkit-contributors@googlegroups.com> wrote:
>
> No plan to support through Java implementors, although there are plans to 
> support varargs which would let you accomplish something similar.
> On Nov 10, 2015 08:53, "Manuel Carrasco Moñino" <man...@apache.org> wrote:
>
> I see, it works, thanks.
>
> Any plan to work as well with gwt exported classes ?
>
> On Tue, Nov 10, 2015 at 5:33 PM, Julien Dramaix <julien....@gmail.com> 
> wrote:
>
> Method overloading works in native JsType JsType(isNative=true)
>
> On Tue, Nov 10, 2015 at 5:15 PM Manuel Carrasco Moñino <man...@apache.org> 
> wrote:
>
> Seems that method overloading is not working anymore with JS_RC mode, it 
> was working in JS mode though:
>
> Example:
>
>    boolean validate()
>    boolean validate(String foo)
>
> Is it a feature not implemented yet, or it is not in the specification?
>
> Thanks
> - Manolo
>
>
> On Mon, Nov 9, 2015 at 3:40 PM, Cristian Rinaldi <csri...@gmail.com> 
> wrote:
>
> Thanks Julien!!!
>
> This work fine!!
>
> El viernes, 23 de octubre de 2015, 4:13:55 (UTC-3), Goktug Gokdogan 
> escribió:
>
> As we are getting close to 2.8 release I wrote a new document that is 
> concentrating on jsinterop features to be released in 2.8:
>
> https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit#
>
> Please share your feedback.
>
> Thanks,
>
> Goktug
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/51f767f9-0afd-48fd-bef8-a9106b0d716a%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/51f767f9-0afd-48fd-bef8-a9106b0d716a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAtrYCKBHtp6ccqnxTq%3Dq2EK8jB-A57qqFX05U2sw6-12w%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAtrYCKBHtp6ccqnxTq%3Dq2EK8jB-A57qqFX05U2sw6-12w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D62mQ0iqjRBc8E8vbPTWqtE61gUcb-1qbKATt8wtrsUTw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D62mQ0iqjRBc8E8vbPTWqtE61gUcb-1qbKATt8wtrsUTw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAtTjvgcdJLojY4C4ouNzDUOBOXTF_TKjxRA8V2Azjoecw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAtTjvgcdJLojY4C4ouNzDUOBOXTF_TKjxRA8V2Azjoecw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gk0jt7HDSPDX22f9LX5SLdxK8Hm9D1rzo92ac2qzoMXHw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAC7T7gk0jt7HDSPDX22f9LX5SLdxK8Hm9D1rzo92ac2qzoMXHw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAsdPGjuGR7eNg-YMjBGwiLcc3P2dHXhk%3D20e5rRfdSqKg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAM28XAsdPGjuGR7eNg-YMjBGwiLcc3P2dHXhk%3D20e5rRfdSqKg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> ...

​

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/1092818f-d58c-43b2-8dbb-5041e6626c90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to