I'm really more in favor of the second options because (in addition to
Jens' arguments):
- it's more readable to have several meaningful annotations than one with
several parameters. And I think it's more Javaish. simple example :
@JsIgnore vs @Js(ignore=true)
- IMO, the option 1 won't be simpler to learn for developper and I think
instead it will be more confusing for the gwt developers. Most  of
parameters on the annotations cannot be used simultaneously and can be used
only on specific case (for instance: exports parameter has only a meaning
when the annotation is on type)




On Wed, Apr 22, 2015 at 6:06 AM 'Goktug Gokdogan' via GWT Contributors <
[email protected]> wrote:

> Yes and no depending what you mean.
>
> Before answering that I think there might have been some confusion the way
> I listed the options in the doc so let me try to summarize it again.
>
> There are 3 options.
>
> Option 1 uses @Js annotation everywhere. There is no other annotation. The
> @Js annotation can be applied to a class and in general it will behave
> similar to applying the annotation to all public members (if that is what
> you meant as syntactic sugar).
> This is the one that is described first in the doc and it is the direction
> we are heading right now.
>
> Option 2 uses @JsType/@JsFunction/@JsLiteral for types and @JsMember for
> members. @JsExport, @JsProperty, @JsMethod etc. are still gone (if that's
> what you meant with syntactic sugar). @JsNamespace is still used for
> setting namespaces where needed. So this is more or less the same design as
> Option 1 but separates the annotation used at class level from the one used
> at members.
> This is listed as "Alternative 1" in the doc. Originally this was the
> direction we were heading and it was described at the beginning while
> Option 1 was listed as "Alternative 1". I changed the order because John
> and Roberto both argued having single annotation (i.e. @Js) is simpler.
>
> Option 3 uses @JsImport/JsExport and it is completely separate design from
> the first two options.
> This is listed as "Alternative 2".
>
> Personally I am more towards Option 2 (see the pros and cons for the
> Option 2 in the doc) but I am getting mixed signals from outside so I need
> more feedback from developers.
>
>
> On Tue, Apr 21, 2015 at 6:21 PM, 'Ray Cromwell' via GWT Contributors <
> [email protected]> wrote:
>
>> Goktug, I though we were keeping @JsType and others as syntactic sugar?
>>
>>
>> On Tue, Apr 21, 2015 at 5:40 PM, Jens <[email protected]> wrote:
>>
>>> Damn it, Safari crashed. So now a shorter version of my answer:
>>>
>>> First I agree that the current design has become quite confusing.
>>> Personally I really dislike the single @Js annotation approach because:
>>> - can be applied everywhere so you throw away some compile time checks
>>> provided by Java's @Target annotation
>>> - exports vs. export is a bit misleading. One must be used with
>>> interfaces/classes the other with methods. That issue only exists because
>>> @Js alone has no real meaning.
>>> - You have to type more because it is always annotation name + property
>>> + value if you can't stick with the default "@Js".
>>> - Can't see a good use case for splitting exports in ALL,
>>> INSTANCE_MEMBERS and STATIC_MEMBERS. When I want to export a class I want
>>> to export its public API.
>>>
>>>
>>> Personally what describes JsInterop best is the alternative using the
>>> import/export concepts. So I would stick with:
>>>
>>> Import/Export types:
>>>
>>> @JsImport: can only be applied on interfaces.
>>> @JsExport: always exports all public API in a given scope (package,
>>> class, method). So no ALL, INSTANCE_MEMBER, STATIC_MEMBER distinction.
>>> @JsIgnore can be used to opt-out selectively.
>>>
>>> Configure import/export:
>>>
>>> @JsNamespace: import/export from/to namespace
>>> @JsName: workaround reserved keywords
>>> @JsProperty: mark method as JS property
>>> @JsIgnore: opt-out of export. Might even be useful for import, e.g. do
>>> not generate trampoline for annotated default method.
>>>
>>> Special constructs:
>>>
>>> @JsLiteral
>>> @JsFunction (currently it seems not to be a real function which breaks
>>> interop
>>> <https://groups.google.com/d/msg/google-web-toolkit/PHtfLTSAJDM/oJjAo3qWa7sJ>
>>> )
>>>
>>>
>>> I guess that is the cleanest you can get. Not sure what @JsOpaque is
>>> good for?!
>>>
>>> -- J.
>>>
>>> --
>>> 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 [email protected]
>>> .
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/778b8f0b-8cc1-4a90-84d5-39c1b9c02afb%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/778b8f0b-8cc1-4a90-84d5-39c1b9c02afb%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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAPVRV7ec1A4w4sb4ZN9wpruLg7K%2BrdnQq3nC0LXtSCK2N5%3DBeQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAPVRV7ec1A4w4sb4ZN9wpruLg7K%2BrdnQq3nC0LXtSCK2N5%3DBeQ%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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA3JFP%2BruK-ysKOCD6AMEDvvV4neVsHk%3DcMGP6AbNNLFXA%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA3JFP%2BruK-ysKOCD6AMEDvvV4neVsHk%3DcMGP6AbNNLFXA%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CABb_3%3D7jHrOBsHzJ_f6keFkUm-MUdK1fiXsLAmwTFonyvV8vOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to