From b8e3617a1df9f175d95eca1cf76ce40e6fd0f683 Mon Sep 17 00:00:00 2001 From: Rado Kirov Date: Fri, 14 Nov 2014 12:41:05 -0800 Subject: [PATCH] refactor(annotations): replace Module functions with plain lists. Renames: elementServices -> shadowDomServices. --- modules/core/src/annotations/component.js | 32 +++++++++-------------- modules/core/src/annotations/decorator.js | 6 ++--- modules/core/src/annotations/directive.js | 7 +++-- modules/core/src/annotations/facade.dart | 7 ----- modules/core/src/annotations/facade.es6 | 2 -- modules/core/src/annotations/template.js | 6 ++--- 6 files changed, 22 insertions(+), 38 deletions(-) delete mode 100644 modules/core/src/annotations/facade.dart delete mode 100644 modules/core/src/annotations/facade.es6 diff --git a/modules/core/src/annotations/component.js b/modules/core/src/annotations/component.js index e5f2e8ca3e..3945647968 100644 --- a/modules/core/src/annotations/component.js +++ b/modules/core/src/annotations/component.js @@ -6,19 +6,19 @@ export class Component extends Directive { constructor({ selector, bind, - lightDomServices, - implementsTypes, template, - elementServices, - componentServices + lightDomServices, + shadowDomServices, + componentServices, + implementsTypes }:{ selector:String, bind:Object, template:TemplateConfig, - lightDomServices:DomServicesFunction, - shadowDomServices:DomServicesFunction, - componentServices:Array, - implementsTypes:Array + lightDomServices:List, + shadowDomServices:List, + componentServices:List, + implementsTypes:List }={}) { super({ @@ -27,7 +27,8 @@ export class Component extends Directive { lightDomServices: lightDomServices, implementsTypes: implementsTypes}); this.template = template; - this.elementServices = elementServices; + this.lightDomServices = lightDomServices; + this.shadowDomServices = shadowDomServices; this.componentServices = componentServices; } } @@ -45,18 +46,11 @@ import 'package:angular/core.dart' as core; directives: const [CompA], formatters: const [Stringify] ), - componentServices: Example.componentServices, - elementServices: Example.elementServices, + componentServices: [...], + shadowDomServices: [...] implementsTypes: const [App] ) -class Example implements App { - static componentServices(Module m) { - m.bind(); - } - static elementServices(ElementModule m) { - m.bind(); - } -} +class Example implements App {} class CompA {} diff --git a/modules/core/src/annotations/decorator.js b/modules/core/src/annotations/decorator.js index dc214f3f81..b60b1fe33a 100644 --- a/modules/core/src/annotations/decorator.js +++ b/modules/core/src/annotations/decorator.js @@ -11,8 +11,8 @@ export class Decorator extends Directive { }:{ selector:String, bind:Object, - lightDomServices:ElementServicesFunction, - implementsTypes:Array + lightDomServices:List, + implementsTypes:List }={}) { super({ @@ -22,4 +22,4 @@ export class Decorator extends Directive { implementsTypes: implementsTypes }); } -} \ No newline at end of file +} diff --git a/modules/core/src/annotations/directive.js b/modules/core/src/annotations/directive.js index 8a08c185b9..402199c14b 100644 --- a/modules/core/src/annotations/directive.js +++ b/modules/core/src/annotations/directive.js @@ -1,6 +1,5 @@ -// import {Type} from 'facade/lang'; -// import {ElementServicesFunction} from './facade'; import {ABSTRACT, CONST} from 'facade/lang'; +import {List} from 'facade/collection'; @ABSTRACT() @@ -14,8 +13,8 @@ export class Directive { }:{ selector:String, bind:Object, - lightDomServices:ElementServicesFunction, - implementsTypes:Array + lightDomServices:List, + implementsTypes:List }) { this.selector = selector; diff --git a/modules/core/src/annotations/facade.dart b/modules/core/src/annotations/facade.dart deleted file mode 100644 index 833a7d4476..0000000000 --- a/modules/core/src/annotations/facade.dart +++ /dev/null @@ -1,7 +0,0 @@ -library core.annotations.facade; - -import 'package:di/di.dart' show Module; -import '../compiler/element_module.dart' show ElementModule; - -typedef DomServicesFunction(ElementModule m); -typedef ComponentServicesFunction(Module m); diff --git a/modules/core/src/annotations/facade.es6 b/modules/core/src/annotations/facade.es6 deleted file mode 100644 index ee9dc146b6..0000000000 --- a/modules/core/src/annotations/facade.es6 +++ /dev/null @@ -1,2 +0,0 @@ -export var DomServicesFunction = Function; -export var ComponentServicesFunction = Function; \ No newline at end of file diff --git a/modules/core/src/annotations/template.js b/modules/core/src/annotations/template.js index cbcd60e971..12220e22f3 100644 --- a/modules/core/src/annotations/template.js +++ b/modules/core/src/annotations/template.js @@ -11,8 +11,8 @@ export class Template extends Directive { }:{ selector:String, bind:Object, - lightDomServices:ElementServicesFunction, - implementsTypes:Array + lightDomServices:List, + implementsTypes:List }={}) { super({ @@ -22,4 +22,4 @@ export class Template extends Directive { implementsTypes: implementsTypes }); } -} \ No newline at end of file +}