refactor(render): remove recursion from renderer
The goal is to make implementing a renderer straight forward. BREAKING_CHANGE: - Renderer interface was redone / simplified. - `DirectDomRenderer` was replaced by `DomRenderer`. - `DirectDomRenderer.setImperativeComponentRootNodes` is replaced by the following 2 steps: 1. `ViewManager.getComponentView(elementRef) -> ViewRef` 2. `DomRenderer.setComponentViewRootNodes(viewRef, rootNodes)` - all `@View` annotations need to have a template, but the template may be empty. Previously views that had a `renderer` property did not have to have a `template`. - `dynamicComponentLoader.loadIntoNewLocation` does no more allow to pass an element, but requires a css selector. Special syntax: `:document` can be used as prefix to search globally on the document instead of in the provided parent view. Part of #1675
This commit is contained in:
@ -2,7 +2,6 @@ import {Injectable} from 'angular2/src/di/annotations_impl';
|
||||
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
import {BaseException, isPresent} from 'angular2/src/facade/lang';
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
|
||||
import {ViewDefinition, ProtoViewDto, DirectiveMetadata, RenderCompiler, RenderProtoViewRef} from '../../api';
|
||||
@ -11,13 +10,6 @@ import {TemplateLoader} from 'angular2/src/render/dom/compiler/template_loader';
|
||||
import {CompileStepFactory, DefaultStepFactory} from './compile_step_factory';
|
||||
import {Parser} from 'angular2/change_detection';
|
||||
import {ShadowDomStrategy} from '../shadow_dom/shadow_dom_strategy';
|
||||
import {ProtoViewBuilder} from '../view/proto_view_builder';
|
||||
|
||||
import {DirectDomProtoViewRef} from '../direct_dom_renderer';
|
||||
|
||||
function _resolveProtoView(protoViewRef:DirectDomProtoViewRef) {
|
||||
return isPresent(protoViewRef) ? protoViewRef.delegate : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The compiler loads and translates the html templates of components into
|
||||
@ -53,18 +45,6 @@ export class DomCompiler extends RenderCompiler {
|
||||
return this._compileTemplate(hostViewDef, element);
|
||||
}
|
||||
|
||||
createImperativeComponentProtoView(rendererId):Promise<ProtoViewDto> {
|
||||
var protoViewBuilder = new ProtoViewBuilder(null);
|
||||
protoViewBuilder.setImperativeRendererId(rendererId);
|
||||
return PromiseWrapper.resolve(protoViewBuilder.build());
|
||||
}
|
||||
|
||||
mergeChildComponentProtoViews(protoViewRef:RenderProtoViewRef, protoViewRefs:List<RenderProtoViewRef>) {
|
||||
_resolveProtoView(protoViewRef).mergeChildComponentProtoViews(
|
||||
ListWrapper.map(protoViewRefs, _resolveProtoView)
|
||||
);
|
||||
}
|
||||
|
||||
_compileTemplate(viewDef: ViewDefinition, tplElement):Promise<ProtoViewDto> {
|
||||
var subTaskPromises = [];
|
||||
var pipeline = new CompilePipeline(this._stepFactory.createSteps(viewDef, subTaskPromises));
|
||||
|
Reference in New Issue
Block a user