feat(dart/transform): Use the render Compiler and the DirectiveParser
Update the `TemplateCompile` step to use the full render `Compiler`. Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to run the `DirectiveParser` step of the render compile pipeline.
This commit is contained in:
@ -9,6 +9,9 @@ import 'parser.dart';
|
||||
DirectiveMetadata readDirectiveMetadata(RegisteredType t) {
|
||||
var visitor = new _DirectiveMetadataVisitor();
|
||||
t.annotations.accept(visitor);
|
||||
if (visitor.meta != null) {
|
||||
visitor.meta.id = '${t.typeName}';
|
||||
}
|
||||
return visitor.meta;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,8 @@ class NgDeps {
|
||||
final List<ImportDirective> imports = [];
|
||||
final List<ExportDirective> exports = [];
|
||||
final List<RegisteredType> registeredTypes = [];
|
||||
FunctionDeclaration setupMethod;
|
||||
LibraryDirective lib = null;
|
||||
FunctionDeclaration setupMethod = null;
|
||||
|
||||
NgDeps(this.code);
|
||||
}
|
||||
@ -76,6 +77,12 @@ class NgDeps {
|
||||
class _ParseNgDepsVisitor extends Object with RecursiveAstVisitor<Object> {
|
||||
NgDeps ngDeps = null;
|
||||
|
||||
@override
|
||||
Object visitLibraryDirective(LibraryDirective node) {
|
||||
ngDeps.lib = node;
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Object visitImportDirective(ImportDirective node) {
|
||||
ngDeps.imports.add(node);
|
||||
|
Reference in New Issue
Block a user