refactor: simplify and make tests work in JS and Dart

* remove `wraps` syntax enhancements for imports
  and support new `import * as module from ...` syntax

  - default imports are the wrong construct for importing
    everything from a module

* moved tests from transpiler to jasmine and karma

  - transpiler tests are included when running karma in main project folder
  - transpiler is reloaded after every test run in karma,
    so no need to restart karma when the transpiler has been changed.
  - removed own gulp build for transpiler and `postinstall.sh`
    as they are no more needed.
  - transpiler tests are now executed in Dart AND JavaScript (used to be executed
    only in Dart), which allowed to catch some bugs (see the bug with the
    import specification above).

* made tests work in dart as well by using the following hack:

  - dependencies are loaded from the `build` folder, which makes
    running `gulp build` necessary before running karma for dart
  - for this to work,
    the dependencies are included in main `pubspec.yaml` of project
  - reason for the hack: `karma-dart` loads all `packages` urls
    directly from disc (should rather use the karma file list)

* added explicit annotations `FIELD`, `ABSTRACT`, ... to `facade/lang.*`

  - needed for now that we can run tests and don't get errors for undefined
    annotations.

* added `README.md` with details about the build and tests
This commit is contained in:
Tobias Bosch
2014-09-28 13:55:01 -07:00
parent 817c005845
commit c79f0c3472
47 changed files with 338 additions and 508 deletions

View File

@ -14,12 +14,17 @@ class DOM {
static getInnerHTML(el) {
return el.innerHtml;
}
static setInnerHTML(el:, value) {
static setInnerHTML(el, value) {
el.innerHtml = value;
}
static setText(Text text, String value) {
text.text = value;
}
static createTemplate(html) {
var t = document.createElement('template');
t.setInnerHtml(html);
return t;
}
static clone(Node node) {
return node.clone(true);
}

View File

@ -1,4 +1,12 @@
library angular.core.facade.async;
export 'dart:async' show Future;
export 'dart:core' show Type;
export 'dart:core' show Type;
class FIELD {
const constructor(this.definition);
}
class CONST {}
class ABSTRACT {}
class IMPLEMENTS {}

View File

@ -1,2 +1,12 @@
export var Future = Promise;
export var Type = Function;
export var Type = Function;
export class FIELD {
constructor(definition) {
this.definition = definition;
}
}
export class CONST {}
export class ABSTRACT {}
export class IMPLEMENTS {}