refactor(core): rename precompile
into entryComponents
.
Part of #10043 BREAKING CHANGE: - `@Component.precompile` was renamed to `@Component.entryComponents` (old property still works but is deprecated) - `ANALYZE_FOR_PRECOMPILE` was renamed to `ANALYZE_FOR_ENTRY_COMPONENTS` (no deprecations)
This commit is contained in:
@ -92,14 +92,13 @@ export class CompileElement extends CompileNode {
|
||||
this._instances.add(identifierToken(Identifiers.AppElement), this.appElement);
|
||||
}
|
||||
|
||||
public createComponentFactoryResolver(precompileComponent: CompileIdentifierMetadata[]) {
|
||||
if (!precompileComponent || precompileComponent.length === 0) {
|
||||
public createComponentFactoryResolver(entryComponents: CompileIdentifierMetadata[]) {
|
||||
if (!entryComponents || entryComponents.length === 0) {
|
||||
return;
|
||||
}
|
||||
var createComponentFactoryResolverExpr =
|
||||
o.importExpr(Identifiers.CodegenComponentFactoryResolver).instantiate([
|
||||
o.literalArr(precompileComponent.map(
|
||||
(precompiledComponent) => o.importExpr(precompiledComponent))),
|
||||
o.literalArr(entryComponents.map((entryComponent) => o.importExpr(entryComponent))),
|
||||
injectFromViewParentInjector(identifierToken(Identifiers.ComponentFactoryResolver), false)
|
||||
]);
|
||||
var provider = new CompileProviderMetadata({
|
||||
|
@ -211,13 +211,13 @@ class ViewBuilderVisitor implements TemplateAstVisitor {
|
||||
new CompileIdentifierMetadata({name: getViewFactoryName(component, 0)});
|
||||
this.targetDependencies.push(
|
||||
new ViewFactoryDependency(component.type, nestedComponentIdentifier));
|
||||
let precompileComponentIdentifiers =
|
||||
component.precompile.map((precompileComp: CompileIdentifierMetadata) => {
|
||||
var id = new CompileIdentifierMetadata({name: precompileComp.name});
|
||||
this.targetDependencies.push(new ComponentFactoryDependency(precompileComp, id));
|
||||
let entryComponentIdentifiers =
|
||||
component.entryComponents.map((entryComponent: CompileIdentifierMetadata) => {
|
||||
var id = new CompileIdentifierMetadata({name: entryComponent.name});
|
||||
this.targetDependencies.push(new ComponentFactoryDependency(entryComponent, id));
|
||||
return id;
|
||||
});
|
||||
compileElement.createComponentFactoryResolver(precompileComponentIdentifiers);
|
||||
compileElement.createComponentFactoryResolver(entryComponentIdentifiers);
|
||||
|
||||
compViewExpr = o.variable(`compView_${nodeIndex}`); // fix highlighting: `
|
||||
compileElement.setComponentView(compViewExpr);
|
||||
|
Reference in New Issue
Block a user