Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Dart with Google Web Toolkit

In this episode of Dartisans, I'm going to show you a variety of ways to use Dart with Google Web Toolkit. I know that there are a lot of GWT developers out there who would like to give Dart a shot, but they aren't sure how because they already have a large, successful app that's written in GWT. I'm going to show you ways to integrate Dart into your existing GWT application without having to rewrite it from scratch.

To do this, I've built a sample application that uses both GWT and Dart. I'll show you how to setup a development environment so that you can work with both technologies. Then, I'll show you a variety of ways in which you can get GWT and Dart to interoperate, such as:
  • Using GWT and Dart to manage different parts of the same page
  • Using Dart to retrieve JSON from a Java servlet
  • Using window.postMessage and JSNI to pass messages between GWT and Dart
  • Using JavaScript, JSNI, and Dart's js package for synchronous interoperability between GWT and Dart
  • Using CustomEvent objects and Elemental to pass messages between GWT and Dart
Rather than show you a one-size-fits-all solution, I decided to show you a bunch of approaches so that you could pick the right tool for the job. Each of them has stengths and weaknesses, and I'll cover those along the way as well.

Aside from watching the video, you can also download the source code or view the video transcript.



As always, we invite you to join the discussion on the Dart mailing list, and ask us questions on Stack Overflow. Your feedback is important. Thanks for checking out Dart!