diff --git a/modules/benchmarks/src/tree/render3/tree.ts b/modules/benchmarks/src/tree/render3/tree.ts index 7c9e0f77f4..bf146dffcf 100644 --- a/modules/benchmarks/src/tree/render3/tree.ts +++ b/modules/benchmarks/src/tree/render3/tree.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {ɵC as C, ɵD as D, ɵE as E, ɵT as T, ɵV as V, ɵb as b, ɵb1 as b1, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵp as p, ɵs as s, ɵt as t, ɵv as v} from '@angular/core'; +import {ɵC as C, ɵE as E, ɵT as T, ɵV as V, ɵb as b, ɵb1 as b1, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵp as p, ɵs as s, ɵt as t, ɵv as v} from '@angular/core'; import {ComponentDef} from '@angular/core/src/render3/interfaces/definition'; import {TreeNode, buildTree, emptyTree} from '../util'; diff --git a/packages/core/src/core_render3_private_export.ts b/packages/core/src/core_render3_private_export.ts index a8b619c516..e198d69d50 100644 --- a/packages/core/src/core_render3_private_export.ts +++ b/packages/core/src/core_render3_private_export.ts @@ -12,7 +12,6 @@ export { detectChanges as ɵdetectChanges, renderComponent as ɵrenderComponent, C as ɵC, - D as ɵD, E as ɵE, T as ɵT, V as ɵV, diff --git a/packages/core/src/render3/component.ts b/packages/core/src/render3/component.ts index 24557d492f..321dc21036 100644 --- a/packages/core/src/render3/component.ts +++ b/packages/core/src/render3/component.ts @@ -13,7 +13,7 @@ import {ComponentRef as viewEngine_ComponentRef} from '../linker/component_facto import {EmbeddedViewRef as viewEngine_EmbeddedViewRef} from '../linker/view_ref'; import {assertNotNull} from './assert'; -import {NG_HOST_SYMBOL, createError, createLView, directive, directiveCreate, enterView, hostElement, leaveView, locateHostElement, renderComponentOrTemplate} from './instructions'; +import {NG_HOST_SYMBOL, createError, createLView, directiveCreate, enterView, hostElement, leaveView, locateHostElement, renderComponentOrTemplate} from './instructions'; import {ComponentDef, ComponentType, TypedComponentDef} from './interfaces/definition'; import {LElementNode} from './interfaces/node'; import {RElement, Renderer3, RendererFactory3, domRendererFactory3} from './interfaces/renderer'; diff --git a/packages/core/src/render3/index.ts b/packages/core/src/render3/index.ts index 3317d3d2a5..542358231e 100644 --- a/packages/core/src/render3/index.ts +++ b/packages/core/src/render3/index.ts @@ -43,8 +43,6 @@ export { containerRefreshStart as cR, containerRefreshEnd as cr, - directive as D, - elementAttribute as a, elementClass as k, elementEnd as e, @@ -83,4 +81,4 @@ export { defineDirective, }; export {createComponentRef, detectChanges, getHostElement, markDirty, renderComponent}; -export {InjectFlags} from './di'; \ No newline at end of file +export {InjectFlags} from './di'; diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index 976e1c8ee1..d716d211ab 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -898,20 +898,6 @@ export function textBinding(index: number, value: T | NO_CHANGE): void { //// Directive ////////////////////////// -/** - * Retrieve a directive. - * - * NOTE: directives can be created in order other than the index order. They can also - * be retrieved before they are created in which case the value will be null. - * - * @param index Each directive in a `View` will have a unique index. Directives can - * be created or retrieved out of order. - */ -export function directive(index: number): T { - ngDevMode && assertDataInRange(index); - return data[index]; -} - /** * Create a directive. * diff --git a/packages/core/test/render3/component_spec.ts b/packages/core/test/render3/component_spec.ts index b955864bc3..e58aa4a00b 100644 --- a/packages/core/test/render3/component_spec.ts +++ b/packages/core/test/render3/component_spec.ts @@ -7,7 +7,7 @@ */ import {ViewEncapsulation} from '../../src/core'; -import {D, E, T, b, defineComponent, e, markDirty, t} from '../../src/render3/index'; +import {E, T, b, defineComponent, e, markDirty, t} from '../../src/render3/index'; import {createRendererType2} from '../../src/view/index'; import {getRendererFactory2} from './imported_renderer2'; diff --git a/packages/core/test/render3/content_spec.ts b/packages/core/test/render3/content_spec.ts index c41b2f4980..95deea6e82 100644 --- a/packages/core/test/render3/content_spec.ts +++ b/packages/core/test/render3/content_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {C, D, E, P, T, V, cR, cr, detectChanges, e, m, pD, v} from '../../src/render3/index'; +import {C, E, P, T, V, cR, cr, detectChanges, e, m, pD, v} from '../../src/render3/index'; import {createComponent, renderComponent, toHtml} from './render_util'; @@ -266,7 +266,7 @@ describe('content projection', () => { if (cm) { E(0, Child); { - childCmptInstance = D(1); + childCmptInstance = m(1); T(2, 'content'); } e(); @@ -319,7 +319,7 @@ describe('content projection', () => { if (cm) { E(0, Child); { - childCmptInstance = D(1); + childCmptInstance = m(1); T(2, 'content'); } e(); @@ -414,7 +414,7 @@ describe('content projection', () => { if (cm) { E(0, Child); { - childCmptInstance = D(1); + childCmptInstance = m(1); T(2, 'content'); } e(); diff --git a/packages/core/test/render3/di_spec.ts b/packages/core/test/render3/di_spec.ts index cfaf31b054..6b8429f2f9 100644 --- a/packages/core/test/render3/di_spec.ts +++ b/packages/core/test/render3/di_spec.ts @@ -9,7 +9,7 @@ import {ElementRef, TemplateRef, ViewContainerRef} from '@angular/core'; import {bloomAdd, bloomFindPossibleInjector} from '../../src/render3/di'; -import {C, D, E, PublicFeature, T, V, b, b2, cR, cr, defineDirective, e, inject, injectElementRef, injectTemplateRef, injectViewContainerRef, t, v} from '../../src/render3/index'; +import {C, E, PublicFeature, T, V, b, b2, cR, cr, defineDirective, e, inject, injectElementRef, injectTemplateRef, injectViewContainerRef, m, t, v} from '../../src/render3/index'; import {createLNode, createLView, enterView, getOrCreateNodeInjector, leaveView} from '../../src/render3/instructions'; import {LInjector} from '../../src/render3/interfaces/injector'; import {LNodeFlags} from '../../src/render3/interfaces/node'; @@ -30,7 +30,7 @@ describe('di', () => { { T(2); } e(); } - t(2, b(D(1).value)); + t(2, b(m(1).value)); } expect(renderToHtml(Template, {})).toEqual('
Created
'); @@ -68,7 +68,7 @@ describe('di', () => { } e(); } - t(5, b(D(4).value)); + t(5, b(m(4).value)); } expect(renderToHtml(Template, {})).toEqual('
AB
'); @@ -101,7 +101,7 @@ describe('di', () => { { T(3); } e(); } - t(3, b2('', D(1).value, '-', D(2).value, '')); + t(3, b2('', m(1).value, '-', m(2).value, '')); } expect(renderToHtml(Template, {})).toEqual('
ElementRef-true
'); @@ -134,7 +134,7 @@ describe('di', () => { C(0, [Directive, DirectiveSameInstance], function() {}); T(3); } - t(3, b2('', D(1).value, '-', D(2).value, '')); + t(3, b2('', m(1).value, '-', m(2).value, '')); } expect(renderToHtml(Template, {})).toEqual('TemplateRef-true'); @@ -168,7 +168,7 @@ describe('di', () => { { T(3); } e(); } - t(3, b2('', D(1).value, '-', D(2).value, '')); + t(3, b2('', m(1).value, '-', m(2).value, '')); } expect(renderToHtml(Template, {})).toEqual('
ViewContainerRef-true
'); @@ -256,7 +256,7 @@ describe('di', () => { { T(3); } e(); } - t(3, b2('', D(1).value, '-', D(2).value, '')); + t(3, b2('', m(1).value, '-', m(2).value, '')); v(); } cr(); diff --git a/packages/core/test/render3/directive_spec.ts b/packages/core/test/render3/directive_spec.ts index 25782ad334..8032f818c2 100644 --- a/packages/core/test/render3/directive_spec.ts +++ b/packages/core/test/render3/directive_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {D, E, b, defineDirective, e, p} from '../../src/render3/index'; +import {E, b, defineDirective, e, m, p} from '../../src/render3/index'; import {renderToHtml} from './render_util'; @@ -22,7 +22,7 @@ describe('directive', () => { static ngDirectiveDef = defineDirective({ factory: () => directiveInstance = new Directive, refresh: (directiveIndex: number, elementIndex: number) => { - p(elementIndex, 'className', b(D(directiveIndex).klass)); + p(elementIndex, 'className', b(m(directiveIndex).klass)); } }); } diff --git a/packages/core/test/render3/exports_spec.ts b/packages/core/test/render3/exports_spec.ts index 3ce2d4164e..7026f333c5 100644 --- a/packages/core/test/render3/exports_spec.ts +++ b/packages/core/test/render3/exports_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {C, D, E, T, V, a, b, cR, cr, defineComponent, defineDirective, e, k, p, t, v} from '../../src/render3/index'; +import {C, E, T, V, a, b, cR, cr, defineComponent, defineDirective, e, k, m, p, t, v} from '../../src/render3/index'; import {renderToHtml} from './render_util'; @@ -36,7 +36,7 @@ describe('exports', () => { e(); T(2); } - t(2, D(1).name); + t(2, m(1).name); } class MyComponent { @@ -73,7 +73,7 @@ describe('exports', () => { E(2, 'div', null, [MyDir]); e(); } - p(2, 'myDir', b(D(1))); + p(2, 'myDir', b(m(1))); } renderToHtml(Template, {}); @@ -89,7 +89,7 @@ describe('exports', () => { e(); T(2); } - t(2, D(1).name); + t(2, m(1).name); } class SomeDir { @@ -198,7 +198,7 @@ describe('exports', () => { E(2, MyComponent); e(); } - p(0, 'myDir', b(D(3))); + p(0, 'myDir', b(m(3))); } renderToHtml(Template, {}); @@ -218,7 +218,7 @@ describe('exports', () => { e(); } let myInput = E(4); - let myComp = D(3) as MyComponent; + let myComp = m(3) as MyComponent; t(0, b(myInput && (myInput as any).value)); t(1, b(myComp && myComp.name)); } diff --git a/packages/core/test/render3/integration_spec.ts b/packages/core/test/render3/integration_spec.ts index 2a5017f02d..18c3562b5d 100644 --- a/packages/core/test/render3/integration_spec.ts +++ b/packages/core/test/render3/integration_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {C, D, E, NC, T, V, a, b, b1, b2, b3, b4, b5, b6, b7, b8, bV, cR, cr, defineComponent, e, k, p, r, s, t, v} from '../../src/render3/index'; +import {C, E, NC, T, V, a, b, b1, b2, b3, b4, b5, b6, b7, b8, bV, cR, cr, defineComponent, e, k, m, p, r, s, t, v} from '../../src/render3/index'; import {NO_CHANGE} from '../../src/render3/instructions'; import {containerEl, renderToHtml} from './render_util'; @@ -290,7 +290,7 @@ describe('render3 integration test', () => { factory: () => cmptInstance = new TodoComponentHostBinding, hostBindings: function(directiveIndex: number, elementIndex: number): void { // host bindings - p(elementIndex, 'title', b(D(directiveIndex).title)); + p(elementIndex, 'title', b(m(directiveIndex).title)); } }); } diff --git a/packages/core/test/render3/lifecycle_spec.ts b/packages/core/test/render3/lifecycle_spec.ts index 57766836d2..a31f01cf41 100644 --- a/packages/core/test/render3/lifecycle_spec.ts +++ b/packages/core/test/render3/lifecycle_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {C, ComponentDef, ComponentTemplate, D, E, L, LifecycleHook, T, V, b, cR, cr, defineComponent, e, l, p, r, v} from '../../src/render3/index'; +import {C, ComponentDef, ComponentTemplate, E, L, LifecycleHook, T, V, b, cR, cr, defineComponent, e, l, m, p, r, v} from '../../src/render3/index'; import {containerEl, renderToHtml} from './render_util'; @@ -41,7 +41,7 @@ describe('lifecycles', () => { tag: name, factory: () => new Component(), hostBindings: function(directiveIndex: number, elementIndex: number): - void { l(LifecycleHook.ON_INIT) && D(directiveIndex).ngOnInit(); }, + void { l(LifecycleHook.ON_INIT) && m(directiveIndex).ngOnInit(); }, inputs: {val: 'val'}, template }); }; @@ -274,8 +274,8 @@ describe('lifecycles', () => { factory: () => new Component(), hostBindings: function( this: ComponentDef, directiveIndex: number, elementIndex: number): void { - l(LifecycleHook.ON_INIT) && D(directiveIndex).ngOnInit(); - D(directiveIndex).ngDoCheck(); + l(LifecycleHook.ON_INIT) && m(directiveIndex).ngOnInit(); + m(directiveIndex).ngDoCheck(); }, template }); @@ -365,7 +365,7 @@ describe('lifecycles', () => { factory: () => new Component(), refresh: (directiveIndex: number, elementIndex: number) => { r(directiveIndex, elementIndex, template); - const comp = D(directiveIndex) as Component; + const comp = m(directiveIndex) as Component; l(LifecycleHook.AFTER_VIEW_INIT, comp, comp.ngAfterViewInit); l(LifecycleHook.AFTER_VIEW_CHECKED, comp, comp.ngAfterViewChecked); }, diff --git a/packages/core/test/render3/listeners_spec.ts b/packages/core/test/render3/listeners_spec.ts index 096e9d1863..7ed78305c2 100644 --- a/packages/core/test/render3/listeners_spec.ts +++ b/packages/core/test/render3/listeners_spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {C, D, E, L, T, V, cR, cr, defineComponent, e, v} from '../../src/render3/index'; +import {C, E, L, T, V, cR, cr, defineComponent, e, v} from '../../src/render3/index'; import {containerEl, renderComponent, renderToHtml} from './render_util'; diff --git a/packages/core/test/render3/outputs_spec.ts b/packages/core/test/render3/outputs_spec.ts index 103e882970..584c2f3db9 100644 --- a/packages/core/test/render3/outputs_spec.ts +++ b/packages/core/test/render3/outputs_spec.ts @@ -8,7 +8,7 @@ import {EventEmitter} from '@angular/core'; -import {C, D, E, L, LifecycleHook, T, V, b, cR, cr, defineComponent, defineDirective, e, l, p, v} from '../../src/render3/index'; +import {C, E, L, LifecycleHook, T, V, b, cR, cr, defineComponent, defineDirective, e, l, p, v} from '../../src/render3/index'; import {containerEl, renderToHtml} from './render_util'; diff --git a/packages/core/test/render3/properties_spec.ts b/packages/core/test/render3/properties_spec.ts index 2aa72d1676..e704a1383f 100644 --- a/packages/core/test/render3/properties_spec.ts +++ b/packages/core/test/render3/properties_spec.ts @@ -8,7 +8,7 @@ import {EventEmitter} from '@angular/core'; -import {C, D, E, L, T, V, b, b1, cR, cr, defineComponent, defineDirective, e, p, t, v} from '../../src/render3/index'; +import {C, E, L, T, V, b, b1, cR, cr, defineComponent, defineDirective, e, m, p, t, v} from '../../src/render3/index'; import {NO_CHANGE} from '../../src/render3/instructions'; import {renderToHtml} from './render_util'; @@ -474,7 +474,7 @@ describe('elementProperty', () => { e(); T(2); } - t(2, b(D(1).role)); + t(2, b(m(1).role)); }, factory: () => new Comp() }); diff --git a/packages/core/test/render3/query_spec.ts b/packages/core/test/render3/query_spec.ts index f80ba97f49..da5f841f40 100644 --- a/packages/core/test/render3/query_spec.ts +++ b/packages/core/test/render3/query_spec.ts @@ -5,7 +5,7 @@ * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ -import {C, D, E, Q, QueryList, e, m, qR} from '../../src/render3/index'; +import {C, E, Q, QueryList, e, m, qR} from '../../src/render3/index'; import {QueryReadType} from '../../src/render3/interfaces/query'; import {createComponent, createDirective, renderComponent} from './render_util'; @@ -61,9 +61,9 @@ describe('query', () => { m(1, Q(Child, true)); E(2, Child); { - child1 = D(3); + child1 = m(3); E(4, Child); - { child2 = D(5); } + { child2 = m(5); } e(); } e(); @@ -121,7 +121,7 @@ describe('query', () => { if (cm) { m(0, Q(Child, false, OtherChild)); E(1, 'div', null, [Child, OtherChild]); - { otherChildInstance = D(3); } + { otherChildInstance = m(3); } e(); } qR(tmp = m>(0)) && (ctx.query = tmp as QueryList); @@ -380,7 +380,7 @@ describe('query', () => { if (cm) { m(0, Q(['foo'])); E(1, Child, null, null, ['foo', '']); - { childInstance = D(2); } + { childInstance = m(2); } e(); } qR(tmp = m>(0)) && (ctx.query = tmp as QueryList); @@ -408,7 +408,7 @@ describe('query', () => { if (cm) { m(0, Q(['foo'])); E(1, 'div', null, [Child], ['foo', 'child']); - childInstance = D(2); + childInstance = m(2); e(); } qR(tmp = m>(0)) && (ctx.query = tmp as QueryList); @@ -437,8 +437,8 @@ describe('query', () => { m(0, Q(['foo', 'bar'])); E(1, 'div', null, [Child1, Child2], ['foo', 'child1', 'bar', 'child2']); { - child1Instance = D(2); - child2Instance = D(3); + child1Instance = m(2); + child2Instance = m(3); } e(); } @@ -493,7 +493,7 @@ describe('query', () => { if (cm) { m(0, Q(['foo', 'bar'])); div = E(1, 'div', null, [Child], ['foo', '', 'bar', 'child']); - { childInstance = D(2); } + { childInstance = m(2); } e(); } qR(tmp = m>(0)) && (ctx.query = tmp as QueryList); diff --git a/packages/core/test/render3/renderer_factory_spec.ts b/packages/core/test/render3/renderer_factory_spec.ts index 14d75f8025..708d4c9103 100644 --- a/packages/core/test/render3/renderer_factory_spec.ts +++ b/packages/core/test/render3/renderer_factory_spec.ts @@ -10,7 +10,7 @@ import {AnimationEvent} from '@angular/animations'; import {MockAnimationDriver, MockAnimationPlayer} from '@angular/animations/browser/testing'; import {RendererType2, ViewEncapsulation} from '../../src/core'; -import {D, E, L, T, b, defineComponent, detectChanges, e, p} from '../../src/render3/index'; +import {E, L, T, b, defineComponent, detectChanges, e, p} from '../../src/render3/index'; import {createRendererType2} from '../../src/view/index'; import {getAnimationRendererFactory2, getRendererFactory2} from './imported_renderer2';