@angular/compiler-cli 17.3.0 → 18.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-OXIOYWLB.js → chunk-4A7ZWBEL.js} +2 -2
- package/bundles/{chunk-GQ63H5AL.js → chunk-64VF23SF.js} +2 -2
- package/bundles/{chunk-3ESFLGKJ.js → chunk-A46CQFUG.js} +75 -72
- package/bundles/chunk-A46CQFUG.js.map +6 -0
- package/bundles/{chunk-E5DF5SRS.js → chunk-NB6ZWAGP.js} +10 -26
- package/bundles/chunk-NB6ZWAGP.js.map +6 -0
- package/bundles/{chunk-X6GFRI46.js → chunk-SQY7XLGB.js} +15 -16
- package/bundles/chunk-SQY7XLGB.js.map +6 -0
- package/bundles/index.js +4 -4
- package/bundles/linker/babel/index.js +1 -1
- package/bundles/linker/index.js +1 -1
- package/bundles/private/migrations.js +1 -1
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +3 -3
- package/bundles/src/bin/ngc.js +3 -3
- package/bundles_metadata.json +1 -1
- package/index.d.ts +1 -1
- package/linker/src/file_linker/partial_linkers/partial_component_linker_1.d.ts +1 -2
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -2
- package/package.json +2 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -4
- package/src/ngtsc/annotations/component/src/metadata.d.ts +36 -7
- package/src/ngtsc/annotations/directive/src/handler.d.ts +1 -2
- package/src/ngtsc/annotations/directive/src/shared.d.ts +1 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +0 -4
- package/bundles/chunk-3ESFLGKJ.js.map +0 -6
- package/bundles/chunk-E5DF5SRS.js.map +0 -6
- package/bundles/chunk-X6GFRI46.js.map +0 -6
- /package/bundles/{chunk-OXIOYWLB.js.map → chunk-4A7ZWBEL.js.map} +0 -0
- /package/bundles/{chunk-GQ63H5AL.js.map → chunk-64VF23SF.js.map} +0 -0
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
tryParseSignalInputMapping,
|
|
12
12
|
tryParseSignalModelMapping,
|
|
13
13
|
tryParseSignalQueryFromInitializer
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A46CQFUG.js";
|
|
15
15
|
import {
|
|
16
16
|
ImportManager,
|
|
17
17
|
ImportedSymbolsTracker,
|
|
@@ -549,4 +549,4 @@ export {
|
|
|
549
549
|
* Use of this source code is governed by an MIT-style license that can be
|
|
550
550
|
* found in the LICENSE file at https://angular.io/license
|
|
551
551
|
*/
|
|
552
|
-
//# sourceMappingURL=chunk-
|
|
552
|
+
//# sourceMappingURL=chunk-4A7ZWBEL.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
formatDiagnostics,
|
|
13
13
|
performCompilation,
|
|
14
14
|
readConfiguration
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SQY7XLGB.js";
|
|
16
16
|
|
|
17
17
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/main.mjs
|
|
18
18
|
import ts2 from "typescript";
|
|
@@ -342,4 +342,4 @@ export {
|
|
|
342
342
|
* Use of this source code is governed by an MIT-style license that can be
|
|
343
343
|
* found in the LICENSE file at https://angular.io/license
|
|
344
344
|
*/
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
345
|
+
//# sourceMappingURL=chunk-64VF23SF.js.map
|
|
@@ -3638,7 +3638,7 @@ function compileInputTransformFields(inputs) {
|
|
|
3638
3638
|
}
|
|
3639
3639
|
|
|
3640
3640
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
3641
|
-
import { compileClassDebugInfo, compileComponentClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation as ViewEncapsulation2
|
|
3641
|
+
import { compileClassDebugInfo, compileComponentClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, compileDeferResolverFunction, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, ExternalExpr as ExternalExpr6, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, outputAst as o2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation as ViewEncapsulation2 } from "@angular/compiler";
|
|
3642
3642
|
import ts27 from "typescript";
|
|
3643
3643
|
|
|
3644
3644
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
@@ -4666,7 +4666,7 @@ function parseDescendantsOption(value) {
|
|
|
4666
4666
|
var EMPTY_OBJECT = {};
|
|
4667
4667
|
var queryDecoratorNames = ["ViewChild", "ViewChildren", "ContentChild", "ContentChildren"];
|
|
4668
4668
|
var QUERY_TYPES = new Set(queryDecoratorNames);
|
|
4669
|
-
function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, evaluator, refEmitter, referencesRegistry, isCore, annotateForClosureCompiler, compilationMode, defaultSelector
|
|
4669
|
+
function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, evaluator, refEmitter, referencesRegistry, isCore, annotateForClosureCompiler, compilationMode, defaultSelector) {
|
|
4670
4670
|
let directive;
|
|
4671
4671
|
if (decorator.args === null || decorator.args.length === 0) {
|
|
4672
4672
|
directive = /* @__PURE__ */ new Map();
|
|
@@ -4768,8 +4768,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
4768
4768
|
name: clazz.name.text,
|
|
4769
4769
|
deps: ctorDeps,
|
|
4770
4770
|
host: {
|
|
4771
|
-
...host
|
|
4772
|
-
useTemplatePipeline
|
|
4771
|
+
...host
|
|
4773
4772
|
},
|
|
4774
4773
|
lifecycle: {
|
|
4775
4774
|
usesOnChanges
|
|
@@ -5560,7 +5559,7 @@ var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
|
5560
5559
|
"ngAfterContentChecked"
|
|
5561
5560
|
]);
|
|
5562
5561
|
var DirectiveDecoratorHandler = class {
|
|
5563
|
-
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode,
|
|
5562
|
+
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode, generateExtraImportsInLocalMode) {
|
|
5564
5563
|
this.reflector = reflector;
|
|
5565
5564
|
this.evaluator = evaluator;
|
|
5566
5565
|
this.metaRegistry = metaRegistry;
|
|
@@ -5577,7 +5576,6 @@ var DirectiveDecoratorHandler = class {
|
|
|
5577
5576
|
this.importTracker = importTracker;
|
|
5578
5577
|
this.includeClassMetadata = includeClassMetadata;
|
|
5579
5578
|
this.compilationMode = compilationMode;
|
|
5580
|
-
this.useTemplatePipeline = useTemplatePipeline;
|
|
5581
5579
|
this.generateExtraImportsInLocalMode = generateExtraImportsInLocalMode;
|
|
5582
5580
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
5583
5581
|
this.name = "DirectiveDecoratorHandler";
|
|
@@ -5611,8 +5609,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
5611
5609
|
this.isCore,
|
|
5612
5610
|
this.annotateForClosureCompiler,
|
|
5613
5611
|
this.compilationMode,
|
|
5614
|
-
null
|
|
5615
|
-
this.useTemplatePipeline
|
|
5612
|
+
null
|
|
5616
5613
|
);
|
|
5617
5614
|
if (directiveResult === void 0) {
|
|
5618
5615
|
return {};
|
|
@@ -6911,7 +6908,7 @@ var EMPTY_ARRAY2 = [];
|
|
|
6911
6908
|
var isUsedDirective = (decl) => decl.kind === R3TemplateDependencyKind.Directive;
|
|
6912
6909
|
var isUsedPipe = (decl) => decl.kind === R3TemplateDependencyKind.Pipe;
|
|
6913
6910
|
var ComponentDecoratorHandler = class {
|
|
6914
|
-
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax,
|
|
6911
|
+
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, localCompilationExtraImportsTracker) {
|
|
6915
6912
|
this.reflector = reflector;
|
|
6916
6913
|
this.evaluator = evaluator;
|
|
6917
6914
|
this.metaRegistry = metaRegistry;
|
|
@@ -6947,7 +6944,6 @@ var ComponentDecoratorHandler = class {
|
|
|
6947
6944
|
this.deferredSymbolTracker = deferredSymbolTracker;
|
|
6948
6945
|
this.forbidOrphanRendering = forbidOrphanRendering;
|
|
6949
6946
|
this.enableBlockSyntax = enableBlockSyntax;
|
|
6950
|
-
this.useTemplatePipeline = useTemplatePipeline;
|
|
6951
6947
|
this.localCompilationExtraImportsTracker = localCompilationExtraImportsTracker;
|
|
6952
6948
|
this.literalCache = /* @__PURE__ */ new Map();
|
|
6953
6949
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
@@ -7025,7 +7021,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7025
7021
|
this.literalCache.delete(decorator);
|
|
7026
7022
|
let diagnostics;
|
|
7027
7023
|
let isPoisoned = false;
|
|
7028
|
-
const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode, this.elementSchemaRegistry.getDefaultComponentElementName()
|
|
7024
|
+
const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode, this.elementSchemaRegistry.getDefaultComponentElementName());
|
|
7029
7025
|
if (directiveResult === void 0) {
|
|
7030
7026
|
return {};
|
|
7031
7027
|
}
|
|
@@ -7035,13 +7031,13 @@ var ComponentDecoratorHandler = class {
|
|
|
7035
7031
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
7036
7032
|
changeDetection = resolveEnumValue(this.evaluator, component, "changeDetection", "ChangeDetectionStrategy");
|
|
7037
7033
|
} else if (component.has("changeDetection")) {
|
|
7038
|
-
changeDetection = new
|
|
7034
|
+
changeDetection = new o2.WrappedNodeExpr(component.get("changeDetection"));
|
|
7039
7035
|
}
|
|
7040
7036
|
let animations = null;
|
|
7041
7037
|
let animationTriggerNames = null;
|
|
7042
7038
|
if (component.has("animations")) {
|
|
7043
7039
|
const animationExpression = component.get("animations");
|
|
7044
|
-
animations = new
|
|
7040
|
+
animations = new o2.WrappedNodeExpr(animationExpression);
|
|
7045
7041
|
const animationsValue = this.evaluator.evaluate(animationExpression, animationTriggerResolver);
|
|
7046
7042
|
animationTriggerNames = { includesDynamicAnimations: false, staticTriggerNames: [] };
|
|
7047
7043
|
collectAnimationNames(animationsValue, animationTriggerNames);
|
|
@@ -7060,7 +7056,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7060
7056
|
if (component.has("viewProviders")) {
|
|
7061
7057
|
const viewProviders = component.get("viewProviders");
|
|
7062
7058
|
viewProvidersRequiringFactory = resolveProvidersRequiringFactory(viewProviders, this.reflector, this.evaluator);
|
|
7063
|
-
wrappedViewProviders = new
|
|
7059
|
+
wrappedViewProviders = new o2.WrappedNodeExpr(this.annotateForClosureCompiler ? wrapFunctionExpressionsInParens(viewProviders) : viewProviders);
|
|
7064
7060
|
}
|
|
7065
7061
|
if (component.has("providers")) {
|
|
7066
7062
|
providersRequiringFactory = resolveProvidersRequiringFactory(component.get("providers"), this.reflector, this.evaluator);
|
|
@@ -7195,8 +7191,9 @@ var ComponentDecoratorHandler = class {
|
|
|
7195
7191
|
if (metadata.isStandalone && rawDeferredImports !== null) {
|
|
7196
7192
|
const deferredTypes = this.collectExplicitlyDeferredSymbols(rawDeferredImports);
|
|
7197
7193
|
for (const [deferredType, importDetails] of deferredTypes) {
|
|
7198
|
-
explicitlyDeferredTypes != null ? explicitlyDeferredTypes : explicitlyDeferredTypes =
|
|
7199
|
-
explicitlyDeferredTypes.
|
|
7194
|
+
explicitlyDeferredTypes != null ? explicitlyDeferredTypes : explicitlyDeferredTypes = [];
|
|
7195
|
+
explicitlyDeferredTypes.push({
|
|
7196
|
+
symbolName: importDetails.name,
|
|
7200
7197
|
importPath: importDetails.from,
|
|
7201
7198
|
isDefaultImport: isDefaultImport(importDetails.node)
|
|
7202
7199
|
});
|
|
@@ -7221,8 +7218,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7221
7218
|
viewProviders: wrappedViewProviders,
|
|
7222
7219
|
i18nUseExternalIds: this.i18nUseExternalIds,
|
|
7223
7220
|
relativeContextFilePath,
|
|
7224
|
-
rawImports: rawImports !== null ? new
|
|
7225
|
-
useTemplatePipeline: this.useTemplatePipeline
|
|
7221
|
+
rawImports: rawImports !== null ? new o2.WrappedNodeExpr(rawImports) : void 0
|
|
7226
7222
|
},
|
|
7227
7223
|
typeCheckMeta: extractDirectiveTypeCheckMeta(node, inputs, this.reflector),
|
|
7228
7224
|
classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, (dec) => transformDecoratorResources(dec, component, styles, template)) : null,
|
|
@@ -7348,6 +7344,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7348
7344
|
return templateSemanticsChecker.getDiagnosticsForComponent(component);
|
|
7349
7345
|
}
|
|
7350
7346
|
resolve(node, analysis, symbol) {
|
|
7347
|
+
var _a;
|
|
7351
7348
|
const metadata = analysis.meta;
|
|
7352
7349
|
const diagnostics = [];
|
|
7353
7350
|
const context = getSourceFile(node);
|
|
@@ -7364,10 +7361,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7364
7361
|
data = {
|
|
7365
7362
|
declarations: EMPTY_ARRAY2,
|
|
7366
7363
|
declarationListEmitMode: !analysis.meta.isStandalone || analysis.rawImports !== null ? 3 : 0,
|
|
7367
|
-
|
|
7364
|
+
deferPerBlockDependencies: this.locateDeferBlocksWithoutScope(analysis.template),
|
|
7368
7365
|
deferBlockDepsEmitMode: 1,
|
|
7369
7366
|
deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
|
|
7370
|
-
|
|
7367
|
+
deferPerComponentDependencies: (_a = analysis.explicitlyDeferredTypes) != null ? _a : []
|
|
7371
7368
|
};
|
|
7372
7369
|
if (this.localCompilationExtraImportsTracker === null) {
|
|
7373
7370
|
return { data };
|
|
@@ -7376,10 +7373,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7376
7373
|
data = {
|
|
7377
7374
|
declarations: EMPTY_ARRAY2,
|
|
7378
7375
|
declarationListEmitMode: 0,
|
|
7379
|
-
|
|
7376
|
+
deferPerBlockDependencies: /* @__PURE__ */ new Map(),
|
|
7380
7377
|
deferBlockDepsEmitMode: 0,
|
|
7381
7378
|
deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
|
|
7382
|
-
|
|
7379
|
+
deferPerComponentDependencies: []
|
|
7383
7380
|
};
|
|
7384
7381
|
}
|
|
7385
7382
|
if (this.semanticDepGraphUpdater !== null && analysis.baseClass instanceof Reference) {
|
|
@@ -7490,7 +7487,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7490
7487
|
}
|
|
7491
7488
|
const eagerDeclarations = Array.from(declarations.values()).filter((decl) => decl.kind === R3TemplateDependencyKind.NgModule || eagerlyUsed.has(decl.ref.node));
|
|
7492
7489
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
7493
|
-
this.resolveDeferBlocks(node, deferBlocks, declarations, data, analysis, eagerlyUsed
|
|
7490
|
+
this.resolveDeferBlocks(node, deferBlocks, declarations, data, analysis, eagerlyUsed);
|
|
7494
7491
|
}
|
|
7495
7492
|
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
7496
7493
|
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
@@ -7550,7 +7547,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7550
7547
|
}
|
|
7551
7548
|
}
|
|
7552
7549
|
} else {
|
|
7553
|
-
data.
|
|
7550
|
+
data.deferPerBlockDependencies = this.locateDeferBlocksWithoutScope(metadata.template);
|
|
7554
7551
|
}
|
|
7555
7552
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
7556
7553
|
if (analysis.resolvedImports !== null && analysis.rawImports !== null) {
|
|
@@ -7561,11 +7558,11 @@ var ComponentDecoratorHandler = class {
|
|
|
7561
7558
|
const importDiagnostics = validateStandaloneImports(analysis.resolvedDeferredImports, analysis.rawDeferredImports, this.metaReader, this.scopeReader, true);
|
|
7562
7559
|
diagnostics.push(...importDiagnostics);
|
|
7563
7560
|
}
|
|
7564
|
-
if (analysis.providersRequiringFactory !== null && analysis.meta.providers instanceof
|
|
7561
|
+
if (analysis.providersRequiringFactory !== null && analysis.meta.providers instanceof o2.WrappedNodeExpr) {
|
|
7565
7562
|
const providerDiagnostics = getProviderDiagnostics(analysis.providersRequiringFactory, analysis.meta.providers.node, this.injectableRegistry);
|
|
7566
7563
|
diagnostics.push(...providerDiagnostics);
|
|
7567
7564
|
}
|
|
7568
|
-
if (analysis.viewProvidersRequiringFactory !== null && analysis.meta.viewProviders instanceof
|
|
7565
|
+
if (analysis.viewProvidersRequiringFactory !== null && analysis.meta.viewProviders instanceof o2.WrappedNodeExpr) {
|
|
7569
7566
|
const viewProviderDiagnostics = getProviderDiagnostics(analysis.viewProvidersRequiringFactory, analysis.meta.viewProviders.node, this.injectableRegistry);
|
|
7570
7567
|
diagnostics.push(...viewProviderDiagnostics);
|
|
7571
7568
|
}
|
|
@@ -7619,12 +7616,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7619
7616
|
return [];
|
|
7620
7617
|
}
|
|
7621
7618
|
const deferrableTypes = this.collectDeferredSymbols(resolution);
|
|
7622
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7623
7619
|
const meta = {
|
|
7624
7620
|
...analysis.meta,
|
|
7625
7621
|
...resolution,
|
|
7626
|
-
|
|
7627
|
-
useTemplatePipeline
|
|
7622
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7628
7623
|
};
|
|
7629
7624
|
const fac = compileNgFactoryDefField(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7630
7625
|
removeDeferrableTypesFromComponentDecorator(analysis, deferrableTypes);
|
|
@@ -7643,13 +7638,12 @@ var ComponentDecoratorHandler = class {
|
|
|
7643
7638
|
content: analysis.template.content,
|
|
7644
7639
|
sourceUrl: analysis.template.declaration.resolvedTemplateUrl,
|
|
7645
7640
|
isInline: analysis.template.declaration.isInline,
|
|
7646
|
-
inlineTemplateLiteralExpression: analysis.template.sourceMapping.type === "direct" ? new
|
|
7641
|
+
inlineTemplateLiteralExpression: analysis.template.sourceMapping.type === "direct" ? new o2.WrappedNodeExpr(analysis.template.sourceMapping.node) : null
|
|
7647
7642
|
};
|
|
7648
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7649
7643
|
const meta = {
|
|
7650
7644
|
...analysis.meta,
|
|
7651
7645
|
...resolution,
|
|
7652
|
-
|
|
7646
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7653
7647
|
};
|
|
7654
7648
|
const fac = compileDeclareFactory(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7655
7649
|
const inputTransformFields = compileInputTransformFields(analysis.inputs);
|
|
@@ -7662,12 +7656,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7662
7656
|
return [];
|
|
7663
7657
|
}
|
|
7664
7658
|
const deferrableTypes = analysis.explicitlyDeferredTypes;
|
|
7665
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7666
7659
|
const meta = {
|
|
7667
7660
|
...analysis.meta,
|
|
7668
7661
|
...resolution,
|
|
7669
|
-
|
|
7670
|
-
useTemplatePipeline
|
|
7662
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7671
7663
|
};
|
|
7672
7664
|
if (analysis.explicitlyDeferredTypes !== null) {
|
|
7673
7665
|
removeDeferrableTypesFromComponentDecorator(analysis, analysis.explicitlyDeferredTypes);
|
|
@@ -7685,30 +7677,22 @@ var ComponentDecoratorHandler = class {
|
|
|
7685
7677
|
const directivelessBinder = new R3TargetBinder(new SelectorMatcher2());
|
|
7686
7678
|
const bound = directivelessBinder.bind({ template: template.nodes });
|
|
7687
7679
|
const deferredBlocks = bound.getDeferBlocks();
|
|
7688
|
-
const triggerElements = /* @__PURE__ */ new Map();
|
|
7689
7680
|
for (const block of deferredBlocks) {
|
|
7690
|
-
|
|
7691
|
-
this.resolveDeferTriggers(block, block.prefetchTriggers, bound, triggerElements);
|
|
7692
|
-
deferBlocks.set(block, { deps: [], triggerElements });
|
|
7681
|
+
deferBlocks.set(block, []);
|
|
7693
7682
|
}
|
|
7694
7683
|
return deferBlocks;
|
|
7695
7684
|
}
|
|
7696
7685
|
collectDeferredSymbols(resolution) {
|
|
7697
7686
|
var _a;
|
|
7698
|
-
const deferrableTypes =
|
|
7699
|
-
for (const [_,
|
|
7700
|
-
for (const deferBlockDep of
|
|
7701
|
-
const
|
|
7702
|
-
const classDecl = dep.classDeclaration;
|
|
7703
|
-
const importDecl = (_a = resolution.deferrableDeclToImportDecl.get(classDecl)) != null ? _a : null;
|
|
7687
|
+
const deferrableTypes = [];
|
|
7688
|
+
for (const [_, deps] of resolution.deferPerBlockDependencies) {
|
|
7689
|
+
for (const deferBlockDep of deps) {
|
|
7690
|
+
const importDecl = (_a = resolution.deferrableDeclToImportDecl.get(deferBlockDep.declaration.node)) != null ? _a : null;
|
|
7704
7691
|
if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
|
|
7705
7692
|
deferBlockDep.isDeferrable = true;
|
|
7706
7693
|
deferBlockDep.importPath = importDecl.moduleSpecifier.text;
|
|
7707
7694
|
deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
|
|
7708
|
-
deferrableTypes.
|
|
7709
|
-
importPath: deferBlockDep.importPath,
|
|
7710
|
-
isDefaultImport: deferBlockDep.isDefaultImport
|
|
7711
|
-
});
|
|
7695
|
+
deferrableTypes.push(deferBlockDep);
|
|
7712
7696
|
}
|
|
7713
7697
|
}
|
|
7714
7698
|
}
|
|
@@ -7745,13 +7729,18 @@ var ComponentDecoratorHandler = class {
|
|
|
7745
7729
|
}
|
|
7746
7730
|
this.cycleAnalyzer.recordSyntheticImport(origin, imported);
|
|
7747
7731
|
}
|
|
7748
|
-
resolveDeferBlocks(componentClassDecl, deferBlocks, deferrableDecls, resolutionData, analysisData, eagerlyUsedDecls
|
|
7732
|
+
resolveDeferBlocks(componentClassDecl, deferBlocks, deferrableDecls, resolutionData, analysisData, eagerlyUsedDecls) {
|
|
7749
7733
|
const allDeferredDecls = /* @__PURE__ */ new Set();
|
|
7750
7734
|
for (const [deferBlock, bound] of deferBlocks) {
|
|
7751
7735
|
const usedDirectives = new Set(bound.getEagerlyUsedDirectives().map((d) => d.ref.node));
|
|
7752
7736
|
const usedPipes = new Set(bound.getEagerlyUsedPipes());
|
|
7753
|
-
|
|
7754
|
-
|
|
7737
|
+
let deps;
|
|
7738
|
+
if (resolutionData.deferPerBlockDependencies.has(deferBlock)) {
|
|
7739
|
+
deps = resolutionData.deferPerBlockDependencies.get(deferBlock);
|
|
7740
|
+
} else {
|
|
7741
|
+
deps = [];
|
|
7742
|
+
resolutionData.deferPerBlockDependencies.set(deferBlock, deps);
|
|
7743
|
+
}
|
|
7755
7744
|
for (const decl of Array.from(deferrableDecls.values())) {
|
|
7756
7745
|
if (decl.kind === R3TemplateDependencyKind.NgModule) {
|
|
7757
7746
|
continue;
|
|
@@ -7763,18 +7752,15 @@ var ComponentDecoratorHandler = class {
|
|
|
7763
7752
|
continue;
|
|
7764
7753
|
}
|
|
7765
7754
|
deps.push({
|
|
7766
|
-
|
|
7767
|
-
symbolName: decl.ref.node.name.
|
|
7755
|
+
typeReference: decl.type,
|
|
7756
|
+
symbolName: decl.ref.node.name.text,
|
|
7768
7757
|
isDeferrable: false,
|
|
7769
7758
|
importPath: null,
|
|
7770
7759
|
isDefaultImport: false,
|
|
7771
|
-
|
|
7760
|
+
declaration: decl.ref
|
|
7772
7761
|
});
|
|
7773
7762
|
allDeferredDecls.add(decl.ref.node);
|
|
7774
7763
|
}
|
|
7775
|
-
this.resolveDeferTriggers(deferBlock, deferBlock.triggers, componentBoundTarget, triggerElements);
|
|
7776
|
-
this.resolveDeferTriggers(deferBlock, deferBlock.prefetchTriggers, componentBoundTarget, triggerElements);
|
|
7777
|
-
resolutionData.deferBlocks.set(deferBlock, { deps, triggerElements });
|
|
7778
7764
|
}
|
|
7779
7765
|
if (analysisData.meta.isStandalone) {
|
|
7780
7766
|
if (analysisData.rawImports !== null) {
|
|
@@ -7826,11 +7812,28 @@ var ComponentDecoratorHandler = class {
|
|
|
7826
7812
|
this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
|
|
7827
7813
|
}
|
|
7828
7814
|
}
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7815
|
+
compileDeferBlocks(resolution) {
|
|
7816
|
+
const { deferBlockDepsEmitMode: mode, deferPerBlockDependencies: perBlockDeps, deferPerComponentDependencies: perComponentDeps } = resolution;
|
|
7817
|
+
if (mode === 0) {
|
|
7818
|
+
if (!perBlockDeps) {
|
|
7819
|
+
throw new Error("Internal error: deferPerBlockDependencies must be present when compiling in PerBlock mode");
|
|
7820
|
+
}
|
|
7821
|
+
const blocks = /* @__PURE__ */ new Map();
|
|
7822
|
+
for (const [block, dependencies] of perBlockDeps) {
|
|
7823
|
+
blocks.set(block, dependencies.length === 0 ? null : compileDeferResolverFunction({ mode, dependencies }));
|
|
7824
|
+
}
|
|
7825
|
+
return { mode, blocks };
|
|
7826
|
+
}
|
|
7827
|
+
if (mode === 1) {
|
|
7828
|
+
if (!perComponentDeps) {
|
|
7829
|
+
throw new Error("Internal error: deferPerComponentDependencies must be present in PerComponent mode");
|
|
7830
|
+
}
|
|
7831
|
+
return {
|
|
7832
|
+
mode: 1,
|
|
7833
|
+
dependenciesFn: perComponentDeps.length === 0 ? null : compileDeferResolverFunction({ mode, dependencies: perComponentDeps })
|
|
7834
|
+
};
|
|
7835
|
+
}
|
|
7836
|
+
throw new Error(`Invalid deferBlockDepsEmitMode. Cannot compile deferred block metadata.`);
|
|
7834
7837
|
}
|
|
7835
7838
|
};
|
|
7836
7839
|
function createTargetBinder(dependencies) {
|
|
@@ -7856,9 +7859,9 @@ function extractPipes(dependencies) {
|
|
|
7856
7859
|
}
|
|
7857
7860
|
function removeDeferrableTypesFromComponentDecorator(analysis, deferrableTypes) {
|
|
7858
7861
|
if (analysis.classMetadata) {
|
|
7859
|
-
const deferrableSymbols = new Set(deferrableTypes.
|
|
7862
|
+
const deferrableSymbols = new Set(deferrableTypes.map((t) => t.symbolName));
|
|
7860
7863
|
const rewrittenDecoratorsNode = removeIdentifierReferences(analysis.classMetadata.decorators.node, deferrableSymbols);
|
|
7861
|
-
analysis.classMetadata.decorators = new
|
|
7864
|
+
analysis.classMetadata.decorators = new o2.WrappedNodeExpr(rewrittenDecoratorsNode);
|
|
7862
7865
|
}
|
|
7863
7866
|
}
|
|
7864
7867
|
function validateNoImportOverlap(eagerDeps, deferredDeps, rawDeferredImports) {
|
|
@@ -7907,7 +7910,7 @@ function isDefaultImport(node) {
|
|
|
7907
7910
|
}
|
|
7908
7911
|
|
|
7909
7912
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
7910
|
-
import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression3, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as
|
|
7913
|
+
import { compileClassMetadata as compileClassMetadata3, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression3, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
7911
7914
|
import ts28 from "typescript";
|
|
7912
7915
|
var InjectableDecoratorHandler = class {
|
|
7913
7916
|
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, includeClassMetadata, compilationMode, errorOnDuplicateProv = true) {
|
|
@@ -8050,7 +8053,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8050
8053
|
result.useClass = getProviderExpression(meta.get("useClass"), reflector);
|
|
8051
8054
|
result.deps = deps;
|
|
8052
8055
|
} else if (meta.has("useFactory")) {
|
|
8053
|
-
result.useFactory = new
|
|
8056
|
+
result.useFactory = new WrappedNodeExpr8(meta.get("useFactory"));
|
|
8054
8057
|
result.deps = deps;
|
|
8055
8058
|
}
|
|
8056
8059
|
return result;
|
|
@@ -8060,7 +8063,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8060
8063
|
}
|
|
8061
8064
|
function getProviderExpression(expression, reflector) {
|
|
8062
8065
|
const forwardRefValue = tryUnwrapForwardRef(expression, reflector);
|
|
8063
|
-
return createMayBeForwardRefExpression3(new
|
|
8066
|
+
return createMayBeForwardRefExpression3(new WrappedNodeExpr8(forwardRefValue != null ? forwardRefValue : expression), forwardRefValue !== null ? 2 : 0);
|
|
8064
8067
|
}
|
|
8065
8068
|
function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, strictCtorDeps) {
|
|
8066
8069
|
if (decorator.args === null) {
|
|
@@ -8089,7 +8092,7 @@ function requiresValidCtor(meta) {
|
|
|
8089
8092
|
}
|
|
8090
8093
|
function getDep(dep, reflector) {
|
|
8091
8094
|
const meta = {
|
|
8092
|
-
token: new
|
|
8095
|
+
token: new WrappedNodeExpr8(dep),
|
|
8093
8096
|
attributeNameType: null,
|
|
8094
8097
|
host: false,
|
|
8095
8098
|
optional: false,
|
|
@@ -8104,7 +8107,7 @@ function getDep(dep, reflector) {
|
|
|
8104
8107
|
switch (source.name) {
|
|
8105
8108
|
case "Inject":
|
|
8106
8109
|
if (token !== void 0) {
|
|
8107
|
-
meta.token = new
|
|
8110
|
+
meta.token = new WrappedNodeExpr8(token);
|
|
8108
8111
|
}
|
|
8109
8112
|
break;
|
|
8110
8113
|
case "Optional":
|
|
@@ -8131,7 +8134,7 @@ function getDep(dep, reflector) {
|
|
|
8131
8134
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
8132
8135
|
}
|
|
8133
8136
|
if (!isDecorator) {
|
|
8134
|
-
meta.token = new
|
|
8137
|
+
meta.token = new WrappedNodeExpr8(el);
|
|
8135
8138
|
}
|
|
8136
8139
|
});
|
|
8137
8140
|
}
|
|
@@ -8351,4 +8354,4 @@ export {
|
|
|
8351
8354
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8352
8355
|
* found in the LICENSE file at https://angular.io/license
|
|
8353
8356
|
*/
|
|
8354
|
-
//# sourceMappingURL=chunk-
|
|
8357
|
+
//# sourceMappingURL=chunk-A46CQFUG.js.map
|