66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { ChangeDetectionStrategy , ComponentFactory , SchemaMetadata , Type , ViewEncapsulation } from '@angular/core' ;
9+ import { ChangeDetectionStrategy , ComponentFactory , ComponentRenderTypeV2 , SchemaMetadata , Type , ViewEncapsulation } from '@angular/core' ;
1010
1111import { StaticSymbol } from './aot/static_symbol' ;
1212import { ListWrapper } from './facade/collection' ;
@@ -15,6 +15,7 @@ import {LifecycleHooks, reflector} from './private_import_core';
1515import { CssSelector } from './selector' ;
1616import { splitAtColon } from './util' ;
1717
18+
1819// group 0: "[prop] or (event) or @trigger"
1920// group 1: "prop" from "[prop]"
2021// group 2: "event" from "(event)"
@@ -116,6 +117,10 @@ export function viewClassName(compType: any, embeddedTemplateIndex: number): str
116117 return `View_${ identifierName ( { reference : compType } ) } _${ embeddedTemplateIndex } ` ;
117118}
118119
120+ export function componentRenderTypeName ( compType : any ) : string {
121+ return `RenderType_${ identifierName ( { reference : compType } ) } ` ;
122+ }
123+
119124export function hostViewClassName ( compType : any ) : string {
120125 return `HostView_${ identifierName ( { reference : compType } ) } ` ;
121126}
@@ -310,6 +315,7 @@ export interface CompileDirectiveSummary extends CompileTypeSummary {
310315 template : CompileTemplateSummary ;
311316 wrapperType : StaticSymbol | ProxyClass ;
312317 componentViewType : StaticSymbol | ProxyClass ;
318+ componentRenderType : StaticSymbol | ComponentRenderTypeV2 ;
313319 componentFactory : StaticSymbol | ComponentFactory < any > ;
314320}
315321
@@ -320,7 +326,7 @@ export class CompileDirectiveMetadata {
320326 static create (
321327 { isHost, type, isComponent, selector, exportAs, changeDetection, inputs, outputs, host,
322328 providers, viewProviders, queries, viewQueries, entryComponents, template, wrapperType,
323- componentViewType, componentFactory} : {
329+ componentViewType, componentRenderType , componentFactory} : {
324330 isHost ?: boolean ,
325331 type ?: CompileTypeMetadata ,
326332 isComponent ?: boolean ,
@@ -338,6 +344,7 @@ export class CompileDirectiveMetadata {
338344 template ?: CompileTemplateMetadata ,
339345 wrapperType ?: StaticSymbol | ProxyClass ,
340346 componentViewType ?: StaticSymbol | ProxyClass ,
347+ componentRenderType ?: StaticSymbol | ComponentRenderTypeV2 ,
341348 componentFactory ?: StaticSymbol | ComponentFactory < any > ,
342349 } = { } ) : CompileDirectiveMetadata {
343350 const hostListeners : { [ key : string ] : string } = { } ;
@@ -392,6 +399,7 @@ export class CompileDirectiveMetadata {
392399 template,
393400 wrapperType,
394401 componentViewType,
402+ componentRenderType,
395403 componentFactory,
396404 } ) ;
397405 }
@@ -416,12 +424,14 @@ export class CompileDirectiveMetadata {
416424
417425 wrapperType : StaticSymbol | ProxyClass ;
418426 componentViewType : StaticSymbol | ProxyClass ;
427+ componentRenderType : StaticSymbol | ComponentRenderTypeV2 ;
419428 componentFactory : StaticSymbol | ComponentFactory < any > ;
420429
421430 constructor ( { isHost, type, isComponent, selector, exportAs,
422431 changeDetection, inputs, outputs, hostListeners, hostProperties,
423432 hostAttributes, providers, viewProviders, queries, viewQueries,
424- entryComponents, template, wrapperType, componentViewType, componentFactory} : {
433+ entryComponents, template, wrapperType, componentViewType, componentRenderType,
434+ componentFactory} : {
425435 isHost ?: boolean ,
426436 type ?: CompileTypeMetadata ,
427437 isComponent ?: boolean ,
@@ -441,6 +451,7 @@ export class CompileDirectiveMetadata {
441451 template ?: CompileTemplateMetadata ,
442452 wrapperType ?: StaticSymbol | ProxyClass ,
443453 componentViewType ?: StaticSymbol | ProxyClass ,
454+ componentRenderType ?: StaticSymbol | ComponentRenderTypeV2 ,
444455 componentFactory ?: StaticSymbol | ComponentFactory < any > ,
445456 } = { } ) {
446457 this . isHost = ! ! isHost ;
@@ -463,6 +474,7 @@ export class CompileDirectiveMetadata {
463474
464475 this . wrapperType = wrapperType ;
465476 this . componentViewType = componentViewType ;
477+ this . componentRenderType = componentRenderType ;
466478 this . componentFactory = componentFactory ;
467479 }
468480
@@ -487,6 +499,7 @@ export class CompileDirectiveMetadata {
487499 template : this . template && this . template . toSummary ( ) ,
488500 wrapperType : this . wrapperType ,
489501 componentViewType : this . componentViewType ,
502+ componentRenderType : this . componentRenderType ,
490503 componentFactory : this . componentFactory
491504 } ;
492505 }
@@ -521,7 +534,9 @@ export function createHostComponentMeta(
521534 viewProviders : [ ] ,
522535 queries : [ ] ,
523536 viewQueries : [ ] ,
524- componentViewType : hostViewType
537+ componentViewType : hostViewType ,
538+ componentRenderType :
539+ { id : '__Host__' , encapsulation : ViewEncapsulation . None , styles : [ ] , data : { } }
525540 } ) ;
526541}
527542
0 commit comments