What you say is: It is not possible to have a page with:
*** gwtapp + gwtlib + js_export + optimization ***
What is possible to have is either or
1) gwtapp + gwtlib + optimization
or (xor actually)
2) gwtapp + gwtlib + js_export
a) We assume gwtlib has @JsType(isNative=false) types
b) Optimization is used in the broad sense for method and properties
renaming, removal and other optimization steps
Jens, Thomas thanks a lot for the education.
On Thu, Sep 15, 2016 at 11:44 AM, Thomas Broyer <t.bro...@gmail.com> wrote:
> Let me try: without -generateJsInteropExports, GWT acts as if
> @JsType(isNative=false) wasn't there at all.
> Why'd you want this?
> - when @JsType(isNative=false) is applied to types you didn't write
> yourself (third-party). For example, java.util.Collection, java.util.List,
> java.util.Map, java.util.Set, and java.lang.Enum are annotated with
> @JsType. If you don't use -generateJsInteropExports, their non-@JsIgnore⋅d
> public members won't be renamed, and the @JsProperty and
> @JsMethod-specified names won't be honored, so you'll have very short
> (obfuscated) names in your app. If you use -generateJsInteropExports, the
> given js-names will be honored and your code will be slightly bigger, but
> then you can pass a java.util.List to JS and you can call getAtIndex and
> removeAtIndex (for example) on it from JS code.
> - when you want to possibly export your project as a standalone JS
> lib, but have it consumable by GWT apps with all the GWT optimization
> goodness: your types will be annotated with @JsType, apps that use your GWT
> library without using -generateJsInteropExports will have highly-optimized
> code; but you can use -generateJsInteropExports to export your annotated
> types to create a standalone JS lib. GWT apps consuming your GWT library
> and using -generateJsInteropExports will pay the price for your @JsType
> though (see example above about java.util.List), so you'll probably want to
> separate out some of your code into a project specific to exporting your JS
> lib (similarly to how GWTUpload/JSUpload did it)
> That was Jens' example.
> On Thursday, September 15, 2016 at 10:18:55 AM UTC+2, Vassilis Virvilis
>> Jens sorry - one more round if you please
>> > The library exists as GWT library (*.jar file with *.gwt.xml)...
>> This GWT library is source right? That means it is compiled by the
>> compilation session of MyApplication right?
>> Unless.... (light bulb goes on)
>> In some cases you want the library to act as JS library for one Page but
>> for another page you only plan to link it with the GWT MyApplication (and
>> not export is as a JS library) where normal optimization techniques apply.
>> Is that it? If so tricky...
>> On Thu, Sep 15, 2016 at 1:54 AM, Jens wrote:
>>> Is this GWT library exported as JS only? ...
>>> So I don't get it. What am I missing?
>>> The library exists as GWT library (*.jar file with *.gwt.xml) so you can
>>> use it right away in your GWT app, but the library is also exported by the
>>> right away by including a *.js file.
>>> In that case your app does not want to use -generateJsInteropExports
>>> because it directly uses the GWT library which has @JsType(isNative =
>>> false) all over the place in its Java files. If you would use
>>> -generateJsInteropExport in your app, it would have a negative impact on
>>> your code size because these @JsType classes would not be optimized/pruned
>>> then. Now imagine you have several of such libraries in your app.
>>> -- J.
>> Vassilis Virvilis
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to firstname.lastname@example.org.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "GWT
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.