Skip to content

Commit abc3de7

Browse files
committed
refactor(render): rename RenderView and RenderProtoView
Part of angular#1675 Closes angular#1705
1 parent 0b1bb17 commit abc3de7

20 files changed

+76
-76
lines changed

modules/angular2/src/render/api.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ export class DirectiveMetadata {
131131
}
132132
}
133133

134-
// An opaque reference to a RenderProtoView
134+
// An opaque reference to a DomProtoView
135135
export class RenderProtoViewRef {}
136136

137-
// An opaque reference to a RenderView
137+
// An opaque reference to a DomView
138138
export class RenderViewRef {}
139139

140140
export class RenderViewContainerRef {
@@ -175,7 +175,7 @@ export class RenderCompiler {
175175
createImperativeComponentProtoView(rendererId):Promise<ProtoViewDto> { return null; }
176176

177177
/**
178-
* Compiles a single RenderProtoView. Non recursive so that
178+
* Compiles a single DomProtoView. Non recursive so that
179179
* we don't need to serialize all possible components over the wire,
180180
* but only the needed ones based on previous calls.
181181
*/
@@ -186,7 +186,7 @@ export class RenderCompiler {
186186
* which will be instantiated when this protoView is instantiated.
187187
* Note: We can't create new ProtoViewRefs here as we need to support cycles / recursive components.
188188
* @param {List<RenderProtoViewRef>} protoViewRefs
189-
* RenderProtoView for every element with a component in this protoView or in a view container's protoView
189+
* DomProtoView for every element with a component in this protoView or in a view container's protoView
190190
*/
191191
mergeChildComponentProtoViews(protoViewRef:RenderProtoViewRef, componentProtoViewRefs:List<RenderProtoViewRef>) { return null; }
192192
}
@@ -259,7 +259,7 @@ export class Renderer {
259259
/**
260260
* This will set the value for a text node.
261261
* Note: This needs to be separate from setElementProperty as we don't have ElementBinders
262-
* for text nodes in the RenderProtoView either.
262+
* for text nodes in the DomProtoView either.
263263
*/
264264
setText(view:RenderViewRef, textNodeIndex:number, text:string):void {}
265265

modules/angular2/src/render/dom/direct_dom_renderer.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
44
import {isBlank, isPresent, BaseException} from 'angular2/src/facade/lang';
55

66
import * as api from '../api';
7-
import {RenderView} from './view/view';
8-
import {RenderProtoView} from './view/proto_view';
7+
import {DomView} from './view/view';
8+
import {DomProtoView} from './view/proto_view';
99
import {ViewFactory} from './view/view_factory';
1010
import {RenderViewHydrator} from './view/view_hydrator';
1111
import {ShadowDomStrategy} from './shadow_dom/shadow_dom_strategy';
@@ -23,7 +23,7 @@ function _resolveProtoView(protoViewRef:DirectDomProtoViewRef) {
2323
return isPresent(protoViewRef) ? protoViewRef.delegate : null;
2424
}
2525

26-
function _wrapView(view:RenderView) {
26+
function _wrapView(view:DomView) {
2727
return new DirectDomViewRef(view);
2828
}
2929

@@ -44,18 +44,18 @@ function _collectComponentChildViewRefs(view, target = null) {
4444

4545
// public so that the compiler can use it.
4646
export class DirectDomProtoViewRef extends api.RenderProtoViewRef {
47-
delegate:RenderProtoView;
47+
delegate:DomProtoView;
4848

49-
constructor(delegate:RenderProtoView) {
49+
constructor(delegate:DomProtoView) {
5050
super();
5151
this.delegate = delegate;
5252
}
5353
}
5454

5555
export class DirectDomViewRef extends api.RenderViewRef {
56-
delegate:RenderView;
56+
delegate:DomView;
5757

58-
constructor(delegate:RenderView) {
58+
constructor(delegate:DomView) {
5959
super();
6060
this.delegate = delegate;
6161
}

modules/angular2/src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export class EmulatedUnscopedShadowDomStrategy extends ShadowDomStrategy {
3333
return false;
3434
}
3535

36-
attachTemplate(el, view:viewModule.RenderView) {
36+
attachTemplate(el, view:viewModule.DomView) {
3737
moveViewNodesIntoParent(el, view);
3838
}
3939

40-
constructLightDom(lightDomView:viewModule.RenderView, shadowDomView:viewModule.RenderView, el): LightDom {
40+
constructLightDom(lightDomView:viewModule.DomView, shadowDomView:viewModule.DomView, el): LightDom {
4141
return new LightDom(lightDomView, shadowDomView, el);
4242
}
4343

modules/angular2/src/render/dom/shadow_dom/light_dom.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class _Root {
2121
// once interfaces are supported
2222
export class LightDom {
2323
// The light DOM of the element is enclosed inside the lightDomView
24-
lightDomView:viewModule.RenderView;
24+
lightDomView:viewModule.DomView;
2525
// The shadow DOM
26-
shadowDomView:viewModule.RenderView;
26+
shadowDomView:viewModule.DomView;
2727
// The nodes of the light DOM
2828
nodes:List;
2929
roots:List<_Root>;
3030

31-
constructor(lightDomView:viewModule.RenderView, shadowDomView:viewModule.RenderView, element) {
31+
constructor(lightDomView:viewModule.DomView, shadowDomView:viewModule.DomView, element) {
3232
this.lightDomView = lightDomView;
3333
this.shadowDomView = shadowDomView;
3434
this.nodes = DOM.childNodesAsList(element);
@@ -45,7 +45,7 @@ export class LightDom {
4545
}
4646

4747
// Collects the Content directives from the view and all its child views
48-
_collectAllContentTags(view: viewModule.RenderView, acc:List<Content>):List<Content> {
48+
_collectAllContentTags(view: viewModule.DomView, acc:List<Content>):List<Content> {
4949
var contentTags = view.contentTags;
5050
var vcs = view.viewContainers;
5151
for (var i=0; i<vcs.length; i++) {

modules/angular2/src/render/dom/shadow_dom/native_shadow_dom_strategy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class NativeShadowDomStrategy extends ShadowDomStrategy {
2222
this.styleUrlResolver = styleUrlResolver;
2323
}
2424

25-
attachTemplate(el, view:viewModule.RenderView){
25+
attachTemplate(el, view:viewModule.DomView){
2626
moveViewNodesIntoParent(DOM.createShadowRoot(el), view);
2727
}
2828

modules/angular2/src/render/dom/shadow_dom/shadow_dom_strategy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export class ShadowDomStrategy {
99
return true;
1010
}
1111

12-
attachTemplate(el, view:viewModule.RenderView) {}
12+
attachTemplate(el, view:viewModule.DomView) {}
1313

14-
constructLightDom(lightDomView:viewModule.RenderView, shadowDomView:viewModule.RenderView, el): LightDom {
14+
constructLightDom(lightDomView:viewModule.DomView, shadowDomView:viewModule.DomView, el): LightDom {
1515
return null;
1616
}
1717

modules/angular2/src/render/dom/view/element_binder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as protoViewModule from './proto_view';
77
export class ElementBinder {
88
contentTagSelector: string;
99
textNodeIndices: List<number>;
10-
nestedProtoView: protoViewModule.RenderProtoView;
10+
nestedProtoView: protoViewModule.DomProtoView;
1111
eventLocals: AST;
1212
localEvents: List<Event>;
1313
globalEvents: List<Event>;

modules/angular2/src/render/dom/view/proto_view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {List, Map, ListWrapper, MapWrapper} from 'angular2/src/facade/collection
66
import {ElementBinder} from './element_binder';
77
import {NG_BINDING_CLASS} from '../util';
88

9-
export class RenderProtoView {
9+
export class DomProtoView {
1010
element;
1111
elementBinders:List<ElementBinder>;
1212
isTemplateElement:boolean;
@@ -30,7 +30,7 @@ export class RenderProtoView {
3030
}
3131
}
3232

33-
mergeChildComponentProtoViews(componentProtoViews:List<RenderProtoView>) {
33+
mergeChildComponentProtoViews(componentProtoViews:List<DomProtoView>) {
3434
var componentProtoViewIndex = 0;
3535
for (var i=0; i<this.elementBinders.length; i++) {
3636
var eb = this.elementBinders[i];

modules/angular2/src/render/dom/view/proto_view_builder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
ASTWithSource, AST, AstTransformer, AccessMember, LiteralArray, ImplicitReceiver
77
} from 'angular2/change_detection';
88

9-
import {RenderProtoView} from './proto_view';
9+
import {DomProtoView} from './proto_view';
1010
import {ElementBinder, Event} from './element_binder';
1111
import {setterFactory} from './property_setter_factory';
1212

@@ -43,7 +43,7 @@ export class ProtoViewBuilder {
4343

4444
bindVariable(name, value) {
4545
// Store the variable map from value to variable, reflecting how it will be used later by
46-
// RenderView. When a local is set to the view, a lookup for the variable name will take place keyed
46+
// DomView. When a local is set to the view, a lookup for the variable name will take place keyed
4747
// by the "value", or exported identifier. For example, ng-repeat sets a view local of "index".
4848
// When this occurs, a lookup keyed by "index" must occur to find if there is a var referencing
4949
// it.
@@ -102,7 +102,7 @@ export class ProtoViewBuilder {
102102
}));
103103
});
104104
return new api.ProtoViewDto({
105-
render: new directDomRenderer.DirectDomProtoViewRef(new RenderProtoView({
105+
render: new directDomRenderer.DirectDomProtoViewRef(new DomProtoView({
106106
element: this.rootElement,
107107
elementBinders: renderElementBinders,
108108
imperativeRendererId: this.imperativeRendererId
@@ -192,7 +192,7 @@ export class ElementBinderBuilder {
192192
this.nestedProtoView.bindVariable(name, value);
193193
} else {
194194
// Store the variable map from value to variable, reflecting how it will be used later by
195-
// RenderView. When a local is set to the view, a lookup for the variable name will take place keyed
195+
// DomView. When a local is set to the view, a lookup for the variable name will take place keyed
196196
// by the "value", or exported identifier. For example, ng-repeat sets a view local of "index".
197197
// When this occurs, a lookup keyed by "index" must occur to find if there is a var referencing
198198
// it.

modules/angular2/src/render/dom/view/view.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {ListWrapper, MapWrapper, Map, StringMapWrapper, List} from 'angular2/src
33
import {int, isPresent, isBlank, BaseException} from 'angular2/src/facade/lang';
44

55
import {ViewContainer} from './view_container';
6-
import {RenderProtoView} from './proto_view';
6+
import {DomProtoView} from './proto_view';
77
import {LightDom} from '../shadow_dom/light_dom';
88
import {Content} from '../shadow_dom/content_tag';
99

@@ -14,29 +14,29 @@ const NG_BINDING_CLASS = 'ng-binding';
1414
/**
1515
* Const of making objects: http://jsperf.com/instantiate-size-of-object
1616
*/
17-
export class RenderView {
17+
export class DomView {
1818
boundElements:List;
1919
boundTextNodes:List;
2020
/// When the view is part of render tree, the DocumentFragment is empty, which is why we need
2121
/// to keep track of the nodes.
2222
rootNodes:List;
2323
// TODO(tbosch): move componentChildViews, viewContainers, contentTags, lightDoms into
2424
// a single array with records inside
25-
componentChildViews: List<RenderView>;
25+
componentChildViews: List<DomView>;
2626
viewContainers: List<ViewContainer>;
2727
contentTags: List<Content>;
2828
lightDoms: List<LightDom>;
2929
hostLightDom: LightDom;
30-
proto: RenderProtoView;
30+
proto: DomProtoView;
3131
hydrated: boolean;
3232
_eventDispatcher: any/*EventDispatcher*/;
3333
eventHandlerRemovers: List<Function>;
3434
/// Host views that were added by an imperative view.
3535
/// This is a dynamically growing / shrinking array.
36-
imperativeHostViews: List<RenderView>;
36+
imperativeHostViews: List<DomView>;
3737

3838
constructor(
39-
proto:RenderProtoView, rootNodes:List,
39+
proto:DomProtoView, rootNodes:List,
4040
boundTextNodes: List, boundElements:List, contentTags:List) {
4141
this.proto = proto;
4242
this.rootNodes = rootNodes;

0 commit comments

Comments
 (0)