Wednesday, July 24, 2019

GWT code splitting and generics

Hi,

A little question about gwt coe splitting features. I am in the process of splitting a large application using GIN.
When I look at the soyc report, it's look like gwt doesn't support generics when checking for candidates for code splitting.

For example, I have a class with @Inject Provider<A> provider;
The soyc report shows me a dependency between this class and every GIN Provider<X>, making code splitting difficult/impossible.

Am I wrong, or is there some compiler option/tricks to make it work ?

Regards,
Jérémie

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/2e6f4b6d-ff5c-4634-ad28-dbf6a815abf9%40googlegroups.com.

Re: Building a GWT project in Eclipse 2019-03+ with Java 11.

Ideally, people should stop using the "GWT SDK" uberjars to begin with; because the JAR that's deployed to the Central Repository does not have these packages: https://github.com/gwtproject/gwt/blob/4d36d55d26aabc12e4429faf0603c539a54a13cd/maven/lib-gwt.sh#L109

On Wednesday, July 24, 2019 at 9:10:46 AM UTC+2, Jens wrote:

When I configure Eclipse 2019-06 to use this modified GWT 2.8.2 SDK, i am able to more or less get it to build, eventually, but with a flood of obscure "Validating GWT Components" errors that have to be tediously clicked through:

An internal error occurred during: "Validating GWT components".

class org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.PackageBinding (org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding and org.eclipse.jdt.internal.compiler.lookup.PackageBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @57cd77e1)


So...first question: Did I miss an important step when I stripped those classes out of gwt-dev.jar? Or is there a way to make "Validating GWT components" stop complaining?


I don't think so. IMHO it looks like an Eclipse bug or the GWT plugin needs to be updated.


If we plan to announce that GWT 2.9 will be Java 11 compatible (syntax) then contributors will probably also sit down and make sure it works in IDEs either out of the box or by providing instructions how to configure Eclipse to make it work. In general all those 3rd party classes are included in gwt-dev.jar to just have a single dependency that needs to be added by the GWT plugin. The Maven release of GWT pulls those in as transitive dependencies. 

I think going forward GWT SDK release (non Maven release) should repackage all those dependencies into com.google.gwt.thirdparty as it already does for some dependencies. That way we can also make sure that no dependency version conflicts exist on class path.


-- J.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/98986a0d-ff25-4090-a5a6-25e9f54e38b1%40googlegroups.com.

Re: java.time

The only other library I am aware of is gwt-joda-java-time which uses js-joda which itself is a JavaScript port of ThreeTen (which is also the base implementation used for the gwt-time project you took ownership of).

gwt-joda-java-time project also only emulates a minimal set of classes.



-- J.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/130bd227-0dda-49db-b6ec-5b76937e2bb2%40googlegroups.com.

java.time

Please excuse me if this topic has been discussed before. I did look but I didn't find anything recent.

I was looking to use java.time with GWT. I saw it was not supported "out of the box" in 2.8.2. I looked around for libraries and found https://github.com/m-m-m/gwt-time. It was not complete, but I fixed a few things and it worked well enough for me.

What do you use for java.time? Do you use that library, or something else?

The original maintainer of the m-m-m project was helpful, but not interested in continuing maintenance. I have offered to take offer this project, so now it lives in my GitHub repository.

This is my understanding of the situation:
  • The code originated from another project, but is used with permission.
  • The code is copyright some other people, therefore, I imagine it cannot be merged with GWT core.
  • There is a lot missing:
    • I'm not convinced all classes are implemented? The ones I was looking for are implemented, but there might be others that are not.
    • It was never designed for GWT so it uses concurrent maps in some place (easy enough to replace with normal maps), java.util.Locale in some places.
    • It doesn't have converters to allow seriazliation of the types from client to the server.
    • There are no tests
  • The code is not currently on Maven Central. The procedure is checking out from Git, doing "mvn install", then using it. I would be happy to publish it to Maven Central if there was interest.
  • The current version numbering mirrors GWT, so it's currently "2.8.2-SNAPSHOT". I'm not sure this is really helpful.
So I am going to slowly improve the code for my usage (i.e. where my project needs a class or encounters a bug, I will make the change and publish it). I have added the facility for LocalDate to be sent between the client and the server (that is the only class I need at the moment) so adding client-server communication for other classes should be easy too.

I welcome your thoughts. You are welcome to use it, and of course pull requests are welcome too. If there is another implementation that is better, I am happy to abandon this repository and use (and submit pull requests to) the better one.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/29a58e13-914b-4cfb-b4aa-26ad63dcaa09%40googlegroups.com.

Re: super dev mode Jetty version?

  • Is it possible to configure my project to use Jetty 9.3.x in super dev mode?
In case you are still looking to an answer to this, I found out that you can use the following command-line options to Maven when running super dev mode to influence what version of Jetty is used:

mvn -Djetty.version=9.4.19.v20190610 war:exploded gwt:devmode 


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/0a4f510a-d494-4cfb-9281-fbd06a3d1cda%40googlegroups.com.

Re: Building a GWT project in Eclipse 2019-03+ with Java 11.


When I configure Eclipse 2019-06 to use this modified GWT 2.8.2 SDK, i am able to more or less get it to build, eventually, but with a flood of obscure "Validating GWT Components" errors that have to be tediously clicked through:

An internal error occurred during: "Validating GWT components".

class org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.PackageBinding (org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding and org.eclipse.jdt.internal.compiler.lookup.PackageBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @57cd77e1)


So...first question: Did I miss an important step when I stripped those classes out of gwt-dev.jar? Or is there a way to make "Validating GWT components" stop complaining?


I don't think so. IMHO it looks like an Eclipse bug or the GWT plugin needs to be updated.


If we plan to announce that GWT 2.9 will be Java 11 compatible (syntax) then contributors will probably also sit down and make sure it works in IDEs either out of the box or by providing instructions how to configure Eclipse to make it work. In general all those 3rd party classes are included in gwt-dev.jar to just have a single dependency that needs to be added by the GWT plugin. The Maven release of GWT pulls those in as transitive dependencies. 

I think going forward GWT SDK release (non Maven release) should repackage all those dependencies into com.google.gwt.thirdparty as it already does for some dependencies. That way we can also make sure that no dependency version conflicts exist on class path.


-- J.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/ce65c364-c14e-423b-8710-1f34d61a56cc%40googlegroups.com.

Tuesday, July 23, 2019

Building a GWT project in Eclipse 2019-03+ with Java 11.

As of Eclipse 2019-03, Eclipse started to strictly enforce JLS §7.4.3 (7.4.3. Package Observability and Visibility), as discussed here:

https://stackoverflow.com/questions/51094274/eclipse-cant-find-xml-related-classes-after-switching-build-path-to-jdk-10

https://bugs.eclipse.org/bugs/show_bug.cgi?id=544758

This means that when building with Java 11, any Eclipse package with a classpath that contains any classes that are also defined in the JDK will now report a flood of build errors in the format:

"The package org.w3c.dom is accessible from more than one module: <unnamed>, jdk.xml.dom" 

My GWT project uses classes that are defined in these Java 11 modules:



It turns out that gwt-dev.jar contains several hundred classes that conflict with Java 11 internal modules. In an attempt to hack around this, I made a copy of the gwt-2.8.2 folder and stripped out the offending classes:

scrappy:gwt-2.8.2-mod jimdouglas$ zip -d gwt-dev.jar "org/w3c/*" "org/xml/*" "javax/xml/*" "netscape/javascript/*"


When I configure Eclipse 2019-06 to use this modified GWT 2.8.2 SDK, i am able to more or less get it to build, eventually, but with a flood of obscure "Validating GWT Components" errors that have to be tediously clicked through:

An internal error occurred during: "Validating GWT components".

class org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.PackageBinding (org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding and org.eclipse.jdt.internal.compiler.lookup.PackageBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @57cd77e1)


So...first question: Did I miss an important step when I stripped those classes out of gwt-dev.jar? Or is there a way to make "Validating GWT components" stop complaining?

And moving forward, are there plans for a GWT 2.9.0, and would it be possible for it to incorporate some version of this hack, or whatever other changes are necessary to enable GWT development in Eclipse with Java 11? (N.B. I don't particularly care about Java 11 syntax support, just minimal build ability.)

ValidatingGWTComponents.png


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/9482a0db-8156-417c-bfef-1a40f3b17f33%40googlegroups.com.