"socket.io.js" + JSInterop

83 views
Skip to first unread message

Rinaldo Arden

unread,
Jun 19, 2019, 1:51:21 AM6/19/19
to GWT Users
Hi All, 
Just a small query. I am working on an application that requires real-time interaction between server and client. After considering GWT for some time, I am coming to the conclusion that GWT has not, does not, and will not support this kind of interaction. I may be wrong, but I suspect that there is no easy way to achieve this functionality with GWT.  I am aware that some years ago the Atmosphere framework provided something along these lines, but the Atmosphere project is, I am sorry to say, something of a mess at the moment, and appears to be fading. The other project I am considering is of course SocketIO but I can't see how it would be possible to add a SocketIO client to a GWT project. ("socket.io.js" + JSInterop gives me nightmares and wouldn't work anyway, would it?)  But maybe it (real-time + GWT) has been done already, I would like to know. 
Thanks for any insights.
RA

Jens

unread,
Jun 19, 2019, 2:46:40 AM6/19/19
to GWT Users
I don't see a reason why socketio should give you nightmares with GWT + JsInterop. Generally you can use any JS library with GWT.

-- J.

Frank

unread,
Jun 19, 2019, 2:48:56 AM6/19/19
to GWT Users
A quick Goolgle gave me : https://github.com/jumanor/gwt_socket.io

Rinaldo Arden

unread,
Jun 19, 2019, 5:59:51 AM6/19/19
to google-we...@googlegroups.com
As is said, "JSNI will be removed with GWT 3"; and gwt_socket.io [... TJSocketIO.java ] provides a JSNI wrapper for "socket.io.js". Thus gwt_socket.io is not future proof wrt imminent release of GWT 3.
Thanks for the pointer though, appreciate it.

On Wed, Jun 19, 2019 at 4:49 PM Frank <frank....@gmail.com> wrote:
A quick Goolgle gave me : https://github.com/jumanor/gwt_socket.io

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/FnbakOW88O0/unsubscribe.
To unsubscribe from this group and all its topics, 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/80cafd96-6cbd-40c0-8ae8-2c603fdb9c60%40googlegroups.com.

Ahmad Bawaneh

unread,
Jun 19, 2019, 6:15:25 AM6/19/19
to GWT Users
Should you consider this as an option, which is future solution and will work with gwt2 and gwt3

https://github.com/niloc132/webbit-gwt

Ahmad Bawaneh

unread,
Jun 19, 2019, 6:17:16 AM6/19/19
to GWT Users
I am also using https://github.com/sockjs successfully with a vertx backend.

Rinaldo Arden

unread,
Jun 19, 2019, 6:24:52 AM6/19/19
to google-we...@googlegroups.com
Hi Jens,
The problem is not that it cannot be done (everything can be done with a C compiler and a text editor), but that this is the year 2019, and we are still talking about this matter. GWT never provided an underlying up-to-date transport mechanism (there was RPC earlier of course); I recall having to hack up something to get websockets working, some time ago. OK it worked but it was no proper library. Another chap has pointed me kindly to a JSNI wrapper for socketio, which is itself some years old. And some years after JSInterop has been released there still appears to be no up-to-date library for socketio; which confirms my original suspicion that there is no interest in GWT for real-time applications, or really even in underlying network transport. Which cannot be said of Angular, or React, or of other frameworks. What exactly is GWT 3 is going to be all about?

On Wed, Jun 19, 2019 at 4:47 PM Jens <jens.ne...@gmail.com> wrote:
I don't see a reason why socketio should give you nightmares with GWT + JsInterop. Generally you can use any JS library with GWT.

-- J.

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/FnbakOW88O0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Peter Donald

unread,
Jun 19, 2019, 7:11:33 AM6/19/19
to GWT Mailing List
On Wed, Jun 19, 2019 at 8:24 PM Rinaldo Arden <rinald...@gmail.com> wrote:
The problem is not that it cannot be done (everything can be done with a C compiler and a text editor), but that this is the year 2019, and we are still talking about this matter. GWT never provided an underlying up-to-date transport mechanism (there was RPC earlier of course); I recall having to hack up something to get websockets working, some time ago. OK it worked but it was no proper library. Another chap has pointed me kindly to a JSNI wrapper for socketio, which is itself some years old. And some years after JSInterop has been released there still appears to be no up-to-date library for socketio; which confirms my original suspicion that there is no interest in GWT for real-time applications, or really even in underlying network transport. Which cannot be said of Angular, or React, or of other frameworks. What exactly is GWT 3 is going to be all about?

We have been doing "real time applications" in GWT since ~2011 and we have historically used our own libraries that with a combination of long polling, eventsource and websocket tech. However browsers have got good enough these days that we have stripped most of it away and are just sending json packets and json-like packets on websockets. And you can use elemental2 for that - see https://groups.google.com/d/msg/google-web-toolkit/qkgexZ4C0n0/kp9bqw-MAQAJ for latest elemental2.

GWT may not have have bindings for some library but most of those libraries no longer offer the value they once did. I do miss having decent serialization library ... but you can't have everything ;)
--
Cheers,

Peter Donald
Reply all
Reply to author
Forward
0 new messages