Is it possible to use Dart with the App Engine Channel API?

284 views
Skip to first unread message

Bjorn Tipling

unread,
May 18, 2012, 2:27:02 PM5/18/12
to mi...@dartlang.org
https://developers.google.com/appengine/docs/go/channel/javascript

This requires some JavaScript, but Dart does have websockets so maybe there is some way to get this to work. Has anyone tried?

Thanks.

Justin Fagnani

unread,
May 18, 2012, 2:55:13 PM5/18/12
to Bjorn Tipling, mi...@dartlang.org
You could write a shim that uses the JS channel API and calls window.postMessage when receiving messages from the channel, and handle your custom messages in Dart.

-Justin

Bjorn Tipling

unread,
May 18, 2012, 3:26:40 PM5/18/12
to mi...@dartlang.org, Bjorn Tipling
Ok I will try this. Thank you.

Moises Belchin

unread,
May 22, 2012, 3:44:17 AM5/22/12
to Bjorn Tipling, mi...@dartlang.org
Very useful if someone can post some code sample

Many people have asked how to work with Dart and JavaScript and I think this is very interesting for all of us.

Thanks all.

Regards 
Moisés Belchín.



2012/5/18 Bjorn Tipling <bjorn....@gmail.com>

Seth Ladd

unread,
May 22, 2012, 11:44:27 AM5/22/12
to Moises Belchin, Bjorn Tipling, mi...@dartlang.org
Hi Moises,

I too would love to see sync JavaScript interop. In the meantime, you might find this post on JSONP interesting (it shows how to use postMessage), as well as Chris Buckett's cleaned up JSONP class

In the meantime, you might want to star this bug: http://code.google.com/p/dart/issues/detail?id=625

Thanks,
Seth

Justin Fagnani

unread,
Sep 23, 2012, 8:27:27 PM9/23/12
to Seth Ladd, Moises Belchin, Bjorn Tipling, General Dart Discussion
FYI, I just pushed a Dart port of the Channel API that delegates to the JavaScript version via custom events.


Hope it's useful!

-Justin
Reply all
Reply to author
Forward
0 new messages