4 ms·
Interesting post! I'm wondering: 1. How do you test your Dart code? 2. How do you integrate Dart with your existing Javascript? 3. Do you use Dart Web UI?
by stephanos2k 14y ago
Interesting post! I'm wondering:
1. How do you test your Dart code?
2. How do you integrate Dart with your existing Javascript?
3. Do you use Dart Web UI?
- sethladd 14y ago[disclaimer: I work on the Dart team] 1) We have unit tests and mocks built-in. Check out https://www.dartlang.org/articles/dart-unit-tests/ https://www.dartlang.org/articles/dart-unit-tests/ 2) We have JS-interop. Check out http://www.dartlang.org/articles/js-dart-interop/ http://www.dartlang.org/articles/js-dart-interop/ 3) We have tutorials for Web UI. Check out http://www.dartlang.org/docs/tutorials/ http://www.dartlang.org/docs/tutorials/ Hope that helps!
- tosh 14y agoGreat questions. Seth already hinted on some answers but I'll try to go more into detail. 1.) We have an acceptance test suite for the existing app (pre-Dart) using web driver and written in Python). This is currently quite useful since we can continue to use the same test suite when we've migrated a certain widget to Dart. Additionally to that we use the testing infrastructure that comes with dart: https://www.dartlang.org/articles/dart-unit-tests/ https://www.dartlang.org/articles/dart-unit-tests/ 2.) We use js interop http://www.dartlang.org/articles/js-dart-interop/ http://www.dartlang.org/articles/js-dart-interop/ to communicate between Dart and JavaScript. For the migration we are rewriting widget by widget (Backbone view by view). That's fairly straight forward since our existing Backbone.js codebase already was structured in a way where widgets are encapsulating behaviour, dom and style. 3.) Yes we do use Web UI. It's awesome. A bit like Angular.js but on top of a solid language foundation. We'll also look into open sourcing some of our web components going forward :)