GWT 2.9.0 release

2,708 views
Skip to first unread message

Colin Alworth

unread,
May 13, 2020, 11:40:25 PM5/13/20
to GWT Users
Today we are pleased to announce the next release of GWT, version 2.9.0. Some highlights of this release:
 * GWT supports Java 9, 10, 11 language features.
 * The elemental2 1.0.0 release is supported, along with jsinterop-annotations 2.0.0 (except @JsAsync, which requires dropping support for older browsers, and @JsEnum, which assumes closure-compiler semantics, so isn't appropriate for GWT2), bringing GWT2 in line with J2CL. Since this is now an official stable release of elemental2, the JSNI-based elemental that is included with GWT is deprecated, and will be removed in a future release.
 * The release was tested on a variety of operating systems, on Java 8, 11, and 14. Java 7 is no longer officially supported, and future builds will be compiled for Java 8 as the minimum required version.


Starting shortly after this release, we're going to be changing the release process slightly - there will be more frequent dated releases (something like 2.9-20200701) that occur every few months, and minor/bug fix releases that happen intermittently to signify that a more lengthy manual testing and acceptance process has taken place. The idea is that with more frequent releases, changes will make their way faster to the developers that want them, while for others, more heavily tested releases for maintenance-mode projects will still be available.

We'll also be talking soon on the contributors list about the upcoming releases of individual projects that represent the various modules found in gwt-user.jar, updated and tested for use in either GWT2 or J2CL.

We're experiencing some issues in updating the gwtproject.org website, but to get this release out while that is managed, find the zip download and the release notes below. Maven/Gradle/Ivy users, just update the GWT SDK versions to 2.9.0 - the various plugins will be updated as needed in the coming days.


----

Release Notes for 2.9.0:

Highlights
  • Able to compile projects with jsinterop-base 1.0.0, elemental2 1.0.0, and jsinterop-annotations 2.0.0. With the exception of @JsAsync and @JsEnum, this brings GWT2 to be compatible across these tools with J2CL.
  • Added support for Java language levels 9, 10, and 11.
  • Officially, support is dropped for running the GWT compiler or server-side tooling on Java 7. The GWT distribution is still compiled to run on Java 7 for this release, but no guarantees are made about whether or not this will work. Future versions will compile bytecode for Java 8+. The release was tested and found to work cross platform when run with Java 8, 11, and 14.

Deprecations
  • Elemental has been officially deprecated - it is still included in this release, but may not appear in future releases. Instead, we encourage the use of the Elemental2 libraries, which are compatible with both GWT2 and J2CL.
  • Removed NoSuchMethodException emulation.

Bug fixes
  • Fixes Arrays.binarySearch semantics for float[] and double[]
  • Adds Support multi-line messages in errors/exceptions
  • Adds shutdown hook in DiskCache to clean up temp files
  • Cache Gecko version to lower CPU usage on FireFox
  • Do not assume that "this" is always non null.
  • Updates globals for Firefox version 60.0.2, Chrome 66.0.3359.45
  • Fixes String.regionMatches.
  • Native JsMethods allowed to coexist with implementations with the same name.
  • Make sure lambdas box, unbox and insert erasure casts when necessary.
  • Negative zero treated properly in Double/Float.compare()

Miscellaneous
  • Updates CLDR to version 34.
  • Arrays now implement Cloneable
  • Link backing errors together with a cause attribute, start tracking suppressed errors in addition to the cause in underlying error object.
  • Add AtomicReference to gwt/emul.
  • Propagate script nonces via ScriptInjector
  • Add partial emulation for ExecutorService and ScheduledExecutorService
  • Emulate java.util.concurrent.Flow
  • Emulate javax.annotation{,.processing}.Generated
  • Make sure "goog.global" is $wnd if not defined.
  • Add when-linker-added element definition
  • Add Reader and StringReader emulation.
  • Remove GWT version check.
  • Do not show "unusable-by-js" warning for synthetic methods.
  • Update unmodifiableList to throw on Java8 methods.
  • Disable DataflowOptimizer by default and emit a warning when used
For more detail, see the commit log.


----

Finally, if you haven't already done so, please join the very active GWT discussions happening at https://gitter.im/gwtproject/gwt!

Emac

unread,
May 14, 2020, 1:11:24 AM5/14/20
to GWT Users
Nice!

Andy Stevko

unread,
May 14, 2020, 1:24:46 AM5/14/20
to google-web-toolkit
Congratulations!

--
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-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/b4e6124f-1981-48c1-b390-2115a371df08%40googlegroups.com.


--
-- A. Stevko
===========
"If everything seems under control, you're just not going fast enough." M. Andretti




Max F

unread,
May 14, 2020, 2:50:59 AM5/14/20
to GWT Users
Congratulations, and a big "thank you" to Colin and everyone involved!

Filipe Sousa

unread,
May 14, 2020, 4:59:41 AM5/14/20
to GWT Users
Wonderful news.

Thank you for the work and the commitment with this release.

Vassilis Virvilis

unread,
May 14, 2020, 6:07:04 AM5/14/20
to google-we...@googlegroups.com
Congrats to everybody involved.

--
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-tool...@googlegroups.com.


--
Vassilis Virvilis

Dr. Lofi Dewanto

unread,
May 14, 2020, 7:19:44 AM5/14/20
to GWT Users
Congrats to the team!!! Great news!

Hamid Razoki

unread,
May 14, 2020, 8:39:12 AM5/14/20
to google-we...@googlegroups.com
Congratulations everyone 

Le jeu. 14 mai 2020 à 11:20, Dr. Lofi Dewanto <lofid...@gmail.com> a écrit :
Congrats to the team!!! Great news!

--
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-tool...@googlegroups.com.

Adrian Smith

unread,
May 14, 2020, 10:12:04 AM5/14/20
to GWT Users
Thanks for the incredible amount of work you put into GWT, and for this release. Just tried it out, enjoyed replacing Lombok "var" with proper Java "var" :-)

Robin Roos

unread,
May 14, 2020, 12:55:33 PM5/14/20
to GWT Users
Congratulations on the release of 2.9.0.

Can anyone point me to a sample Maven pom.xml from which to begin a new GWT project?  I specifically want to be using J2CL, and I'm happy to use snapshot releases if required.  Thanks, Robin.


Michael Angueira

unread,
May 14, 2020, 5:10:27 PM5/14/20
to GWT Users
Thanks so much.

Ahmad Bawaneh

unread,
May 14, 2020, 6:33:17 PM5/14/20
to GWT Users
You can use domino-cli to create a j2cl simple maven project, download and the proper package for your operating system from the releases page, then from the command line use the following command

dominokit gen app -t basic --j2cl -n sample -g com.foo


where sample is the name/artifactId of the generated project and com.foo is the group id

the generated project is similar to a generated GWT project from tbroyer archetype.

after the project is generated inside the root folder do 
mvn clean install

once the project is built you can run it in development mode 

in one terminal run 
mvn tomcat7:run -pl *-server -am -Denv=dev

to start the server

and in another terminal run

mvn j2cl:watch

access the running application from the browser through 
Happy J2CLing

Ahmad Bawaneh

unread,
May 14, 2020, 6:38:52 PM5/14/20
to GWT Users
I forget to mention the generated project also include dominno-ui dependency, if you dont want it you can remove it, but it gives you the chance to test many of the GWT3/J2CL migrated modules.
and for quick support you can reach us at dominokit gitter channel or gwt gitter channel

David Nouls

unread,
May 15, 2020, 10:56:41 AM5/15/20
to GWT Users
Congratulations on a big milestone and great news to hear for the plan to release more frequently. Is that just an intent or is it automated ?

Dr. Lofi Dewanto

unread,
May 15, 2020, 1:09:57 PM5/15/20
to GWT Users
I published a short news article at heise.dehttps://bit.ly/GWTNews29

Enjoy, Lofi

Craig Mitchell

unread,
May 15, 2020, 11:56:14 PM5/15/20
to GWT Users
Congratulations all.  Just upgraded from 2.8.2, and everything just worked.  Well done, and thank you!

H Maner

unread,
May 17, 2020, 9:55:11 PM5/17/20
to GWT Users
Congrats and thank you!


On Wednesday, May 13, 2020 at 11:40:25 PM UTC-4, Colin Alworth wrote:

mpallesen

unread,
May 18, 2020, 2:02:26 AM5/18/20
to GWT Users
Awesome news! 

Michael


On Thursday, May 14, 2020 at 5:40:25 AM UTC+2, Colin Alworth wrote:

Alex Chevelev

unread,
May 20, 2020, 6:26:40 PM5/20/20
to GWT Users
Thank you! That is really great news!

Alicia Jones

unread,
May 20, 2020, 11:41:13 PM5/20/20
to google-we...@googlegroups.com
Congratulations, and thanks so much for all the great work on GWT!
Dan & Alicia Jones

--
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-tool...@googlegroups.com.

Jofrantoba

unread,
May 21, 2020, 1:08:31 AM5/21/20
to google-we...@googlegroups.com
Congratulation!!!

 

     

Jonathan Franchesco Torres Baca

CIO - Kiongo Inc.

Av. Manuel Seoane 761 2do Piso- La Victoria

Teléfono   074 - 613534

Cel.    958429349

La información contenida en este e-mail es confidencial, privilegiada y está dirigida exclusivamente a su destinatario. Su revisión, difusión, distribución o copiado está prohibido. Si ha recibido este e-mail por error por favor bórrelo y envíe un mensaje al remitente.

The information contained in this e-mail is privileged and confidential and is intended only for its addressee. Any review, dissemination, distribution or copying of this is prohibited. If you have received this mail in error please delete the original message and e-mail us.


GWT dev

unread,
May 22, 2020, 5:35:29 PM5/22/20
to GWT Users
Can you provide some clarification for us?
  • Is it definite that JSNI will not be supported in the first GWT 3.x release?
  • Will JSNI continue to be supported in future GWT 2.9.x releases if they are made?
  • As for GWT 2.9.0, we don't see any deprecation warnings during compilation for JSNI, but you're saying JSNI is actually deprecated as of the 2.9.0 release, or is that a forward-looking statement targeting potential future 2.9.x releases?

Thomas Broyer

unread,
May 22, 2020, 6:18:22 PM5/22/20
to GWT Users


On Friday, May 22, 2020 at 11:35:29 PM UTC+2, GWT dev wrote:
Can you provide some clarification for us?
  • Is it definite that JSNI will not be supported in the first GWT 3.x release?
Yes.
There is an alternate way to do the same with J2Cl when it's absolutely required, but it's not JSNI, and most of the time you shouldn't need it.
  • Will JSNI continue to be supported in future GWT 2.9.x releases if they are made?
Yes, because there's no reason to remove it.
  • As for GWT 2.9.0, we don't see any deprecation warnings during compilation for JSNI, but you're saying JSNI is actually deprecated as of the 2.9.0 release, or is that a forward-looking statement targeting potential future 2.9.x releases?
It's "deprecated" in the sense that it's still supported but you're encouraged to not write new JSNI methods anymore; use JsInterop instead, with the help of jsinterop-base and Elemental 2.

GWT dev

unread,
May 22, 2020, 8:46:58 PM5/22/20
to GWT Users
Thanks.  I see various overviews for jsinterop, including the official one from GWT.  However, what about a migration guide?  I.e., given a JSNI method what would the path-of-least-resistance translation look like?

I'm guessing you'd have to move the JSNI code itself into a JS file, declare it with types from the Java side, and then use jsinterop again (by adding declarations as needed) to support that now pure JS code calling back into GWT Java (as JSNI can do).  Something like that?

Colin Alworth

unread,
May 22, 2020, 10:11:15 PM5/22/20
to GWT Users
There are sort of two categories of these - the ones on your JSOs, i.e. already native types, so you just want to describe the real JS API, except in terms that let you use it in Java, and cases where you need a util method to do something in JS that seemed difficult to do in Java. For the first, you mostly just add a @JsType(...) annotation, remove the JSNI body and make sure the method signature matches what will make sense in JS.

Here's an example of a class in com.google.gwt that has been ported, maintaining as much of its api as possible, while also now being compatible with J2CL:


For the second case, with lambdas in Java 8 and jsinterop annotations, this is much simpler than it used to be. My standard approach is to remove the "native" keyword and "/*-", "-*/;" tokens, and then look for syntax errors. Most of my projects still assume Java 8 as a baseline, so "var" is a problem, but if you are using recent Java you can leave that in and just go after the other oddities.

For the most part, you can use Elemental2 types to get a pretty close-to-JS experience. Sometimes you'll need to "cheat" a bit with a Js.cast() or Js.uncheckedCast() to get to the matching type.

Here's an example where JSNI was probably not needed to begin with (and with the bug left intact for complete backward compatibility):

Here's a more complex example - note that to achieve this, the odd annoying cast is required, as well as a new SAM interface, DOMImplStandard.Fn, which just has a onEvent(Event) method, and is marked as @JsFunction (https://github.com/treblereel/gwt-widgets/blob/master/gwt-widgets/src/main/java/org/gwtproject/user/client/impl/DOMImplStandard.java#L435-L440 for the source)

This could probably be made slightly more pretty, but the goal while porting this was to just get it done quickly (and as a result of these efforts, nearly all of gwt-user.jar in some way or another works in J2CL today).

Generally, your JSNI methods should be shorter than this, so it becomes a matter of knowing which tools are out there, and which parts of Java+JsInterop map nicely to which parts of JS. When you find something missing, 99% of the time it can be found in jsinterop-base - the Js class there provides a bit of extra glue for things that can't be expressed easily in both GWT2 and J2CL.


The really ugly way that Thomas was alluding to is moving JS to an external JS file, but this is not the path of least resistance, it may be brittle (unless you take great care to use JsInterop annotations to avoid renames, changes in the compiler could break how you reference Java), and it will not be GWT2 compatible any longer. Using JsInterop as the examples above show should be simpler, more correct, and let you finish most of your migration before you even glance at J2CL.

freebsddude

unread,
Jun 11, 2020, 10:51:18 PM6/11/20
to GWT Users
Good job done!


On Wednesday, May 13, 2020 at 10:40:25 PM UTC-5, Colin Alworth wrote:

Ming-Yee Iu

unread,
Jul 12, 2020, 1:01:44 AM7/12/20
to GWT Users


On Friday, 22 May 2020 22:11:15 UTC-4, Colin Alworth wrote:
The really ugly way that Thomas was alluding to is moving JS to an external JS file, but this is not the path of least resistance, it may be brittle (unless you take great care to use JsInterop annotations to avoid renames, changes in the compiler could break how you reference Java), and it will not be GWT2 compatible any longer. Using JsInterop as the examples above show should be simpler, more correct, and let you finish most of your migration before you even glance at J2CL.


It might be nice if a future GWT 2.9.x release provides some rudimentary support for that procedure in preparation for J2CL. I'm not sure how that would look though. Maybe a way to specify extra .js files to be linked-in in the .gwt.xml file? Maybe a way to specify where the contents of those JavaScript files should be placed in the JavaScript namespace? Maybe a new GWT linker that outputs a single script file that runs in the same scope as the web page so that it doesn't require that $wnd stuff? Right now, I'm not sure how well blending external .js files with GWT2 actually works.
Reply all
Reply to author
Forward
0 new messages