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:
@ -1,5 +1,7 @@
|
||||
import {Type} from 'facade/lang';
|
||||
import {ElementServicesFunction} from './facade';
|
||||
import {ABSTRACT} from 'facade/lang';
|
||||
|
||||
|
||||
@ABSTRACT
|
||||
export class Directive {
|
||||
|
@ -2,6 +2,7 @@ import {Future, Type} from 'facade/lang';
|
||||
import {Element} from 'facade/dom';
|
||||
import {ProtoView} from './view';
|
||||
import {TemplateLoader} from './template_loader';
|
||||
import {FIELD} from 'facade/lang';
|
||||
|
||||
export class Compiler {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
import {FIELD} from 'facade/lang';
|
||||
|
||||
/**
|
||||
|
||||
|
@ -1,10 +1,12 @@
|
||||
import {DOM, Node, DocumentFragment, TemplateElement} from 'facade/dom';
|
||||
import {ListWrapper wraps List} from 'facade/collection';
|
||||
import {ListWrapper} from 'facade/collection';
|
||||
import {ProtoWatchGroup, WatchGroup, WatchGroupDispatcher} from 'change_detection/watch_group';
|
||||
import {Record} from 'change_detection/record';
|
||||
import {Module} from 'di/di';
|
||||
import {ProtoElementInjector, ElementInjector} from './element_injector';
|
||||
import {SetterFn} from 'change_detection/facade';
|
||||
import {FIELD, IMPLEMENTS} from 'facade/lang';
|
||||
import {List} from 'facade/collection';
|
||||
|
||||
@IMPLEMENTS(WatchGroupDispatcher)
|
||||
export class View {
|
||||
|
@ -1,9 +1,11 @@
|
||||
import {FIELD} from 'facade/lang';
|
||||
|
||||
export class LifeCycle {
|
||||
|
||||
|
||||
@FIELD('final _changeDetection:ChangeDetection')
|
||||
@FIELD('final _onChangeDispatcher:OnChangeDispatcher')
|
||||
constructor() {}
|
||||
|
||||
|
||||
digest() {
|
||||
_changeDetection.detectChanges();
|
||||
_onChangeDispatcher.done();
|
||||
|
Reference in New Issue
Block a user