RendererV2 -> Renderer2 rename (#14998)
* refactor: rename `RendererV2` into `Renderer2` BREAKING CHANGE (since 4.0 rc.1): - rename `RendererV2` to `Renderer2` - rename `RendererTypeV2` to `RendererType2` - rename `RendererFactoryV2` to `RendererFactory2`
This commit is contained in:

committed by
Chuck Jazdzewski

parent
5df998d086
commit
ad3b44aef7
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {ChangeDetectionStrategy, ComponentFactory, RendererTypeV2, SchemaMetadata, Type, ViewEncapsulation, ɵLifecycleHooks, ɵreflector, ɵstringify as stringify} from '@angular/core';
|
||||
import {ChangeDetectionStrategy, ComponentFactory, RendererType2, SchemaMetadata, Type, ViewEncapsulation, ɵLifecycleHooks, ɵreflector, ɵstringify as stringify} from '@angular/core';
|
||||
import {StaticSymbol} from './aot/static_symbol';
|
||||
import {CssSelector} from './selector';
|
||||
import {splitAtColon} from './util';
|
||||
@ -310,7 +310,7 @@ export interface CompileDirectiveSummary extends CompileTypeSummary {
|
||||
changeDetection: ChangeDetectionStrategy;
|
||||
template: CompileTemplateSummary;
|
||||
componentViewType: StaticSymbol|ProxyClass;
|
||||
rendererType: StaticSymbol|RendererTypeV2;
|
||||
rendererType: StaticSymbol|RendererType2;
|
||||
componentFactory: StaticSymbol|ComponentFactory<any>;
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ export class CompileDirectiveMetadata {
|
||||
entryComponents?: CompileEntryComponentMetadata[],
|
||||
template?: CompileTemplateMetadata,
|
||||
componentViewType?: StaticSymbol|ProxyClass,
|
||||
rendererType?: StaticSymbol|RendererTypeV2,
|
||||
rendererType?: StaticSymbol|RendererType2,
|
||||
componentFactory?: StaticSymbol|ComponentFactory<any>,
|
||||
} = {}): CompileDirectiveMetadata {
|
||||
const hostListeners: {[key: string]: string} = {};
|
||||
@ -416,7 +416,7 @@ export class CompileDirectiveMetadata {
|
||||
template: CompileTemplateMetadata;
|
||||
|
||||
componentViewType: StaticSymbol|ProxyClass;
|
||||
rendererType: StaticSymbol|RendererTypeV2;
|
||||
rendererType: StaticSymbol|RendererType2;
|
||||
componentFactory: StaticSymbol|ComponentFactory<any>;
|
||||
|
||||
constructor({isHost, type, isComponent, selector, exportAs,
|
||||
@ -441,7 +441,7 @@ export class CompileDirectiveMetadata {
|
||||
entryComponents?: CompileEntryComponentMetadata[],
|
||||
template?: CompileTemplateMetadata,
|
||||
componentViewType?: StaticSymbol|ProxyClass,
|
||||
rendererType?: StaticSymbol|RendererTypeV2,
|
||||
rendererType?: StaticSymbol|RendererType2,
|
||||
componentFactory?: StaticSymbol|ComponentFactory<any>,
|
||||
} = {}) {
|
||||
this.isHost = !!isHost;
|
||||
|
@ -96,9 +96,9 @@ export class Identifiers {
|
||||
static nodeValue: IdentifierSpec = {name: 'ɵnov', moduleUrl: CORE, runtime: ɵnov};
|
||||
static ngContentDef: IdentifierSpec = {name: 'ɵncd', moduleUrl: CORE, runtime: ɵncd};
|
||||
static unwrapValue: IdentifierSpec = {name: 'ɵunv', moduleUrl: CORE, runtime: ɵunv};
|
||||
static createRendererTypeV2: IdentifierSpec = {name: 'ɵcrt', moduleUrl: CORE, runtime: ɵcrt};
|
||||
static RendererTypeV2: IdentifierSpec = {
|
||||
name: 'RendererTypeV2',
|
||||
static createRendererType2: IdentifierSpec = {name: 'ɵcrt', moduleUrl: CORE, runtime: ɵcrt};
|
||||
static RendererType2: IdentifierSpec = {
|
||||
name: 'RendererType2',
|
||||
moduleUrl: CORE,
|
||||
// type only
|
||||
runtime: null
|
||||
|
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Attribute, ChangeDetectionStrategy, Component, ComponentFactory, Directive, Host, Inject, Injectable, InjectionToken, ModuleWithProviders, Optional, Provider, Query, RendererTypeV2, SchemaMetadata, Self, SkipSelf, Type, resolveForwardRef, ɵERROR_COMPONENT_TYPE, ɵLIFECYCLE_HOOKS_VALUES, ɵReflectorReader, ɵccf as createComponentFactory, ɵreflector, ɵstringify as stringify} from '@angular/core';
|
||||
import {Attribute, ChangeDetectionStrategy, Component, ComponentFactory, Directive, Host, Inject, Injectable, InjectionToken, ModuleWithProviders, Optional, Provider, Query, RendererType2, SchemaMetadata, Self, SkipSelf, Type, resolveForwardRef, ɵERROR_COMPONENT_TYPE, ɵLIFECYCLE_HOOKS_VALUES, ɵReflectorReader, ɵccf as createComponentFactory, ɵreflector, ɵstringify as stringify} from '@angular/core';
|
||||
import {StaticSymbol, StaticSymbolCache} from './aot/static_symbol';
|
||||
import {ngfactoryFilePath} from './aot/util';
|
||||
import {assertArrayOfStrings, assertInterpolationSymbols} from './assertions';
|
||||
@ -124,7 +124,7 @@ export class CompileMetadataResolver {
|
||||
}
|
||||
}
|
||||
|
||||
private getRendererType(dirType: any): StaticSymbol|RendererTypeV2 {
|
||||
private getRendererType(dirType: any): StaticSymbol|RendererType2 {
|
||||
if (dirType instanceof StaticSymbol) {
|
||||
return this._staticSymbolCache.get(
|
||||
ngfactoryFilePath(dirType.filePath), cpl.rendererTypeName(dirType));
|
||||
|
@ -52,7 +52,7 @@ export class ViewCompiler {
|
||||
const renderComponentVar = o.variable(rendererTypeName(component.type.reference));
|
||||
statements.push(
|
||||
renderComponentVar
|
||||
.set(o.importExpr(createIdentifier(Identifiers.createRendererTypeV2)).callFn([
|
||||
.set(o.importExpr(createIdentifier(Identifiers.createRendererType2)).callFn([
|
||||
new o.LiteralMapExpr([
|
||||
new o.LiteralMapEntry('encapsulation', o.literal(component.template.encapsulation)),
|
||||
new o.LiteralMapEntry('styles', styles),
|
||||
@ -60,8 +60,7 @@ export class ViewCompiler {
|
||||
])
|
||||
]))
|
||||
.toDeclStmt(
|
||||
o.importType(createIdentifier(Identifiers.RendererTypeV2)),
|
||||
[o.StmtModifier.Final]));
|
||||
o.importType(createIdentifier(Identifiers.RendererType2)), [o.StmtModifier.Final]));
|
||||
|
||||
const viewBuilderFactory = (parent: ViewBuilder): ViewBuilder => {
|
||||
const embeddedViewIndex = embeddedViewCount++;
|
||||
@ -331,7 +330,7 @@ class ViewBuilder implements TemplateAstVisitor, LocalResolver, BuiltinConverter
|
||||
// BindingType.DirectiveHostProperty, string, SecurityContext])[],
|
||||
// outputs?: ([OutputType.ElementOutput | OutputType.DirectiveHostOutput, string, string])[],
|
||||
// handleEvent?: ElementHandleEventFn,
|
||||
// componentView?: () => ViewDefinition, componentRendererType?: RendererTypeV2): NodeDef;
|
||||
// componentView?: () => ViewDefinition, componentRendererType?: RendererType2): NodeDef;
|
||||
const nodeDef = () => o.importExpr(createIdentifier(Identifiers.elementDef)).callFn([
|
||||
o.literal(flags), queryMatchesExpr, o.literal(ast.ngContentIndex), o.literal(childCount),
|
||||
o.literal(elName), elName ? fixedAttrsDef(ast) : o.NULL_EXPR,
|
||||
|
Reference in New Issue
Block a user