Subscribe to this blog

Search This Blog

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.

Labels

Popular posts from this blog

We are constantly asking ourselves:
How do we make developers even more productive when writing Dart apps?
We believe that a critical part of the answer to this question is to make strongmode – a sound static type system for Dart – the standard for all Dart developers.

Teams that use Dart to build apps like Soundtrap, AdWords, AdSense, and Greentea say they really enjoy using strong mode features, such as early error detection. In fact, teams that have switched completely to strong mode cite not only early error detection but also better code readability and maintainability as major benefits. We hear this both from small teams and – even more so – from large teams with hundreds of developers writing and maintaining millions of lines of Dart code. As Björn Sperber from Soundtrap says,
Strong mode and the smooth integration with IntelliJ is a joy to use and a huge improvement.
If you’ve tried out Flutter, you’ve already used strong mode checks from the Dart analyzer.

AngularDart v4 is now available. We've been busy since the release angular2
v3.1.0 in May. Not only did we "drop the 2", but we also improved the compiler
and tightened up the framework to give you smaller code, we updated the package
structure to improve usability, and we added several new features. Check out the
updated documentation to get
started.
Just angular
Upgrading to v4 will require more than updating your version constraint. The
package has changed names (back) to angular – dropping the 2.
You'll need to update your pubspec.yaml and the corresponding imports in your
code. In most instances, find-and-replace should do the trick. Going forward,
the package will be called package:angular. We'll just update the version
number.
Smaller code
The updated compiler in 4.0 allows type-based optimizations that not only
improve runtime performance but generate better code because we are able to
strongly type templates. A big result of the update is that many ap…

Dart 1.24 is now available. It includes the Dart Development Compiler and supports a new generic function type syntax. Get it now!

Figure 1: DDC debugging in Chrome.

Some notable changes in this release:pub serve now has support for the Dart Development Compiler. Unlike dart2js, this new compiler is modular, which allows pub to do incremental re-builds for pub serve.In practice what that means is you can edit your Dart files, refresh in Chrome (or other supported browsers), and see your edits almost immediately. This is because pub is only recompiling your package, not all packages that you depend on.There is one caveat with the new compiler, which is that your package and your dependencies must all be strong mode clean.You can also use the new compiler to run your tests in Chrome much more quickly than you can with dart2js.Read more in the changelog.You can now publish packages that depend on the Flutter SDK to pub. Moreover, pub.dartlang.org has started tagging Flutter plugins with …