Monday, March 7, 2016

Re: Compiling only what is needed to run?


It would be great if we had an option to tell GWT to not fail on compilation errors but automatically mark non compiling code as @GwtIncompatible.
Is it a possible enhancement I can submit?

But then you would hide real compilation issues.

Perhaps not if in this mode there is a final standard compilation after all the GWT incompatible code has been removed. If the application really doesn't use this incompatible code, it should finally compile. If not, an error will be reported. That's basically the behaviour that the other transpiler had and I was very happy with it.
 

 
So for now, the only way to use thrid-party libraries that don't compile as is with GWT (even if the problem is in a part that I don't use) is to copy the sources and then patch them with @GwtIncompatible annotations?

Yes either use @GwtIncompatible or provide a super-source implementation. In the best case you would fork the third-party library in question, make it GWT compatible by adding @GwtIncompatible annotation and contribute it back.

But keep in mind when using @GwtIncompatible its acts like you have deleted that annotated method in source code. The source code must still be valid even with the now "deleted" method and as the JavaDoc states it can have surprising effects with method overloading or inheritance if you do not take care.

-- J.

Sure, it's all about removing code that is really not used by the final GWT application.

Forking the library and adding the annotations is an additional work, but ok, I will do it if there is no other possibility.
But what is annoying is that this process will need to be repeated each time there is a new release of the library.

Perhaps I'm not the only one facing this problem when using third-party java libraries with GWT.
Would that make sense to add this new compilation option (eventually with scope = only the library source artifact)?

Or, if this enhancement is not possible, would it be possible to declare the incompatible code in a separate declarative file instead of using annotations (this would reduce the amount of work when moving to another library release)? What do you think?

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment