Using what Thomas said works good. I've had the same question about using 
Object literals.  So I wrote down some examples and stored them here. You 
may need 2.8 +(nightly) to use some of the example options.
http://docs.sencha.com/gxt/4.x/gwt/jsinterop/jsinterop_object_literals.html

On Thursday, April 7, 2016 at 6:14:28 AM UTC-7, Paul Stockley wrote:
>
> Bloat and performance is one reason. However, the real reason is that 
> frameworks like react and redux choke if you pass anything but a plain 
> JavaScript object to some of their API's. I don't really care what the 
> annotation is e.g. JsStruct or JsLiteral would work just as well.
>
>
>  

> On Thursday, April 7, 2016 at 6:51:06 AM UTC-4, Thomas Broyer wrote:
>>
>>
>>
>> On Wednesday, April 6, 2016 at 5:46:49 PM UTC+2, Paul Stockley wrote:
>>>
>>> This is the only way you can create a true object literal equivalent in 
>>> JsInterop (i.e. no prototype other than Object) 
>>>
>>
>> The real question is whether (and why) you need "no prototype other than 
>> Object", other than for the bloat in the generated JS (and then 
>> @JsType(isNative=true, namespace=JsPackage.GLOBAL, name="Object") is what 
>> you're after, no need for syntactic sugar –moreover if it has approximate 
>> naming semantics)
>> Plus: your proposed literal=true as a synonym for 
>> isNative=true,namespace=JsPackage.GLOBAL,name="Object", in addition to 
>> being misleading, is likely to collide with future proper object literal 
>> support, at least as currently proposed in 
>> https://docs.google.com/document/d/1DFrC-GtcK7cu6DGxaWCswvb2fai9cnrWPvGcdgsKlBw/edit?usp=sharing
>>  
>> (I, for one, quite like the JsStruct; and I'd go as far as making it a 
>> special type, without the @JsType(literal=true) at all)
>>
>

-- 
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/7ae5f5ac-08fc-47ff-bd89-fed4c24f3e60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to