What is Wrong With GWT Widgets

362 views
Skip to first unread message

Mutaz Alghafary

unread,
Jan 22, 2018, 5:09:27 PM1/22/18
to GWT Users
What is exactly the problem with GWT Widgets, I am new to GWT and I have been watching some sessions about the future of GWT , it seems everyone agrees that you should not be using GWT Widgets, and use things like Elemental or other UI libraries ?

Rogelio Flores

unread,
Jan 23, 2018, 11:58:00 AM1/23/18
to GWT Users
There's really nothing wrong with widgets per se, they work fine.

The reason our community is saying to stay away from them (i.e. don't use them for new development) is because the parts of GWT that make them possible will be deprecated in the future. Nobody really knows when that will be--if I had to guess, it's at least a couple of years into the future. Also, some could be a bit heavier (use/produce more html/css/js) compared to using simply html/elemental.

Sašo Petrovič

unread,
Jan 23, 2018, 12:01:53 PM1/23/18
to GWT Users
GWT Widgets are heavy and will probably be dropped in the GWT 3 (there was some talk about WC).
AFAIK Widgets wore the solution for the browser memory leaks, which are no longer a problem in modern browsers - http://www.gwtproject.org/articles/dom_events_memory_leaks_and_you.html


Dne ponedeljek, 22. januar 2018 23.09.27 UTC+1 je oseba Mutaz Alghafary napisala:

Thomas Broyer

unread,
Jan 23, 2018, 12:23:22 PM1/23/18
to GWT Users

On Monday, January 22, 2018 at 11:09:27 PM UTC+1, Mutaz Alghafary wrote:
What is exactly the problem with GWT Widgets, I am new to GWT and I have been watching some sessions about the future of GWT , it seems everyone agrees that you should not be using GWT Widgets, and use things like Elemental or other UI libraries ?

Nothing "wrong" with them, besides : they're a lot of code to maintain, sometimes quite complex, Google won't maintain them anymore, so it's big work left to the community. That doesn't mean they'll necessarily be deprecated, etc. but maintaining them has a cost.
Other reasons are: they rely on com.google.gwt.dom which makes extensive use of JSNI (and deferred binding), things that will go away in GWT3. They also rely on com.google.event.dom which was built in a time where browsers needed a lot of workarounds to avoid memory leaks, make them behave similarly, etc. Both com.google.gwt.dom and com.google.event.dom could mostly be trashed in GWT3, assuming you target "modern browsers" (evergreen browsers, possibly IE11, maybe IE10, nothing older), and/or be rebuilt with a totally different architecture. In other words: they're a legacy, most probably not how we'd build things nowadays.
Finally, it's harder than necessary to integrate third-party non-GWT UI components in GWT applications; but Web Components (custom elements, etc.)
With that in mind, it doesn't make much sense (YMMV) to invest into porting widgets to GWT3. I'm not saying it won't be done, just that it's a lot of work, and nobody knows if and when it would be done. On the other hand, Web Components provide similar levels of "encapsulation" as GWT WIdgets and are portable across a lot of JS toolkits/frameworks, which means you're a) much more likely to find a component that suits your needs and b) those components, with wider reaches beyond toolkit/framework boundaries, are more likely to receive patches and overall be maintained in the long term. So, starting a new project with web components today, while not as easy as it could be in a GWT2 world –should be much better in GWT3–, interacting with them through low-level APIs (in other terms: develop a JS application, except you write Java code; like other people write TypeScript), might be your best bet for future-proofness.

It's too early to draw conclusions though, and each project will have to make their own choices.

Mutaz Alghafary

unread,
Jan 25, 2018, 3:02:44 PM1/25/18
to GWT Users
Thank you Thomas for the detailed reply, I hope we see GWT 3.0 soon. 

Alexander Koch

unread,
Jan 28, 2018, 4:30:46 AM1/28/18
to GWT Users
Has anyone information on what this could mean for the GWT material project?

Rodolfo M. Raya

unread,
Jan 28, 2018, 8:40:34 AM1/28/18
to google-we...@googlegroups.com

On Sun, Jan 28, 2018 at 6:31 AM Alexander Koch <josef...@gmail.com> wrote:
Has anyone information on what this could mean for the GWT material project?

--
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 post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages