@angular/compiler-cli 17.3.0-rc.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-Q4UHSSKO.js → chunk-4A7ZWBEL.js} +2 -2
- package/bundles/{chunk-MNT5B5MH.js → chunk-64VF23SF.js} +2 -2
- package/bundles/{chunk-WYZJV3LZ.js → chunk-A46CQFUG.js} +82 -76
- 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-FH3I22MY.js → chunk-SQY7XLGB.js} +196 -142
- package/bundles/chunk-SQY7XLGB.js.map +6 -0
- package/bundles/{chunk-Q5Y7HH3O.js → chunk-YUMIYLNL.js} +1 -1
- package/bundles/{chunk-Q5Y7HH3O.js.map → chunk-YUMIYLNL.js.map} +1 -1
- package/bundles/index.js +5 -5
- package/bundles/linker/babel/index.js +1 -1
- package/bundles/linker/index.js +1 -1
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- 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 +4 -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/initializer_functions.d.ts +1 -1
- package/src/ngtsc/annotations/directive/src/shared.d.ts +1 -1
- package/src/ngtsc/core/api/src/public_options.d.ts +0 -4
- package/src/ngtsc/core/src/compiler.d.ts +1 -7
- package/src/ngtsc/transform/src/api.d.ts +2 -0
- package/src/ngtsc/transform/src/compilation.d.ts +1 -2
- package/src/ngtsc/typecheck/api/checker.d.ts +6 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +1 -3
- package/src/ngtsc/typecheck/src/symbol_util.d.ts +10 -0
- package/src/ngtsc/typecheck/template_semantics/api/api.d.ts +18 -0
- package/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.d.ts +15 -0
- package/bundles/chunk-E5DF5SRS.js.map +0 -6
- package/bundles/chunk-FH3I22MY.js.map +0 -6
- package/bundles/chunk-WYZJV3LZ.js.map +0 -6
- package/src/ngtsc/typecheck/src/template_semantics.d.ts +0 -21
- /package/bundles/{chunk-Q4UHSSKO.js.map → chunk-4A7ZWBEL.js.map} +0 -0
- /package/bundles/{chunk-MNT5B5MH.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
|
|
@@ -2532,7 +2532,7 @@ var TraitCompiler = class {
|
|
|
2532
2532
|
}
|
|
2533
2533
|
}
|
|
2534
2534
|
}
|
|
2535
|
-
|
|
2535
|
+
runAdditionalChecks(sf, check) {
|
|
2536
2536
|
if (this.compilationMode === CompilationMode.LOCAL) {
|
|
2537
2537
|
return [];
|
|
2538
2538
|
}
|
|
@@ -2547,10 +2547,10 @@ var TraitCompiler = class {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
const record = this.classes.get(clazz);
|
|
2549
2549
|
for (const trait of record.traits) {
|
|
2550
|
-
|
|
2551
|
-
|
|
2550
|
+
const result = check(clazz, trait.handler);
|
|
2551
|
+
if (result !== null) {
|
|
2552
|
+
diagnostics.push(...result);
|
|
2552
2553
|
}
|
|
2553
|
-
diagnostics.push(...trait.handler.extendedTemplateCheck(clazz, extendedTemplateChecker));
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
2556
|
return diagnostics;
|
|
@@ -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,
|
|
@@ -7344,7 +7340,11 @@ var ComponentDecoratorHandler = class {
|
|
|
7344
7340
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
7345
7341
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
7346
7342
|
}
|
|
7343
|
+
templateSemanticsCheck(component, templateSemanticsChecker) {
|
|
7344
|
+
return templateSemanticsChecker.getDiagnosticsForComponent(component);
|
|
7345
|
+
}
|
|
7347
7346
|
resolve(node, analysis, symbol) {
|
|
7347
|
+
var _a;
|
|
7348
7348
|
const metadata = analysis.meta;
|
|
7349
7349
|
const diagnostics = [];
|
|
7350
7350
|
const context = getSourceFile(node);
|
|
@@ -7361,10 +7361,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7361
7361
|
data = {
|
|
7362
7362
|
declarations: EMPTY_ARRAY2,
|
|
7363
7363
|
declarationListEmitMode: !analysis.meta.isStandalone || analysis.rawImports !== null ? 3 : 0,
|
|
7364
|
-
|
|
7364
|
+
deferPerBlockDependencies: this.locateDeferBlocksWithoutScope(analysis.template),
|
|
7365
7365
|
deferBlockDepsEmitMode: 1,
|
|
7366
7366
|
deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
|
|
7367
|
-
|
|
7367
|
+
deferPerComponentDependencies: (_a = analysis.explicitlyDeferredTypes) != null ? _a : []
|
|
7368
7368
|
};
|
|
7369
7369
|
if (this.localCompilationExtraImportsTracker === null) {
|
|
7370
7370
|
return { data };
|
|
@@ -7373,10 +7373,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7373
7373
|
data = {
|
|
7374
7374
|
declarations: EMPTY_ARRAY2,
|
|
7375
7375
|
declarationListEmitMode: 0,
|
|
7376
|
-
|
|
7376
|
+
deferPerBlockDependencies: /* @__PURE__ */ new Map(),
|
|
7377
7377
|
deferBlockDepsEmitMode: 0,
|
|
7378
7378
|
deferrableDeclToImportDecl: /* @__PURE__ */ new Map(),
|
|
7379
|
-
|
|
7379
|
+
deferPerComponentDependencies: []
|
|
7380
7380
|
};
|
|
7381
7381
|
}
|
|
7382
7382
|
if (this.semanticDepGraphUpdater !== null && analysis.baseClass instanceof Reference) {
|
|
@@ -7487,7 +7487,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7487
7487
|
}
|
|
7488
7488
|
const eagerDeclarations = Array.from(declarations.values()).filter((decl) => decl.kind === R3TemplateDependencyKind.NgModule || eagerlyUsed.has(decl.ref.node));
|
|
7489
7489
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
7490
|
-
this.resolveDeferBlocks(node, deferBlocks, declarations, data, analysis, eagerlyUsed
|
|
7490
|
+
this.resolveDeferBlocks(node, deferBlocks, declarations, data, analysis, eagerlyUsed);
|
|
7491
7491
|
}
|
|
7492
7492
|
const cyclesFromDirectives = /* @__PURE__ */ new Map();
|
|
7493
7493
|
const cyclesFromPipes = /* @__PURE__ */ new Map();
|
|
@@ -7547,7 +7547,7 @@ var ComponentDecoratorHandler = class {
|
|
|
7547
7547
|
}
|
|
7548
7548
|
}
|
|
7549
7549
|
} else {
|
|
7550
|
-
data.
|
|
7550
|
+
data.deferPerBlockDependencies = this.locateDeferBlocksWithoutScope(metadata.template);
|
|
7551
7551
|
}
|
|
7552
7552
|
if (this.compilationMode !== CompilationMode.LOCAL) {
|
|
7553
7553
|
if (analysis.resolvedImports !== null && analysis.rawImports !== null) {
|
|
@@ -7558,11 +7558,11 @@ var ComponentDecoratorHandler = class {
|
|
|
7558
7558
|
const importDiagnostics = validateStandaloneImports(analysis.resolvedDeferredImports, analysis.rawDeferredImports, this.metaReader, this.scopeReader, true);
|
|
7559
7559
|
diagnostics.push(...importDiagnostics);
|
|
7560
7560
|
}
|
|
7561
|
-
if (analysis.providersRequiringFactory !== null && analysis.meta.providers instanceof
|
|
7561
|
+
if (analysis.providersRequiringFactory !== null && analysis.meta.providers instanceof o2.WrappedNodeExpr) {
|
|
7562
7562
|
const providerDiagnostics = getProviderDiagnostics(analysis.providersRequiringFactory, analysis.meta.providers.node, this.injectableRegistry);
|
|
7563
7563
|
diagnostics.push(...providerDiagnostics);
|
|
7564
7564
|
}
|
|
7565
|
-
if (analysis.viewProvidersRequiringFactory !== null && analysis.meta.viewProviders instanceof
|
|
7565
|
+
if (analysis.viewProvidersRequiringFactory !== null && analysis.meta.viewProviders instanceof o2.WrappedNodeExpr) {
|
|
7566
7566
|
const viewProviderDiagnostics = getProviderDiagnostics(analysis.viewProvidersRequiringFactory, analysis.meta.viewProviders.node, this.injectableRegistry);
|
|
7567
7567
|
diagnostics.push(...viewProviderDiagnostics);
|
|
7568
7568
|
}
|
|
@@ -7616,12 +7616,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7616
7616
|
return [];
|
|
7617
7617
|
}
|
|
7618
7618
|
const deferrableTypes = this.collectDeferredSymbols(resolution);
|
|
7619
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7620
7619
|
const meta = {
|
|
7621
7620
|
...analysis.meta,
|
|
7622
7621
|
...resolution,
|
|
7623
|
-
|
|
7624
|
-
useTemplatePipeline
|
|
7622
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7625
7623
|
};
|
|
7626
7624
|
const fac = compileNgFactoryDefField(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7627
7625
|
removeDeferrableTypesFromComponentDecorator(analysis, deferrableTypes);
|
|
@@ -7640,13 +7638,12 @@ var ComponentDecoratorHandler = class {
|
|
|
7640
7638
|
content: analysis.template.content,
|
|
7641
7639
|
sourceUrl: analysis.template.declaration.resolvedTemplateUrl,
|
|
7642
7640
|
isInline: analysis.template.declaration.isInline,
|
|
7643
|
-
inlineTemplateLiteralExpression: analysis.template.sourceMapping.type === "direct" ? new
|
|
7641
|
+
inlineTemplateLiteralExpression: analysis.template.sourceMapping.type === "direct" ? new o2.WrappedNodeExpr(analysis.template.sourceMapping.node) : null
|
|
7644
7642
|
};
|
|
7645
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7646
7643
|
const meta = {
|
|
7647
7644
|
...analysis.meta,
|
|
7648
7645
|
...resolution,
|
|
7649
|
-
|
|
7646
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7650
7647
|
};
|
|
7651
7648
|
const fac = compileDeclareFactory(toFactoryMetadata(meta, FactoryTarget3.Component));
|
|
7652
7649
|
const inputTransformFields = compileInputTransformFields(analysis.inputs);
|
|
@@ -7659,12 +7656,10 @@ var ComponentDecoratorHandler = class {
|
|
|
7659
7656
|
return [];
|
|
7660
7657
|
}
|
|
7661
7658
|
const deferrableTypes = analysis.explicitlyDeferredTypes;
|
|
7662
|
-
const useTemplatePipeline = this.useTemplatePipeline;
|
|
7663
7659
|
const meta = {
|
|
7664
7660
|
...analysis.meta,
|
|
7665
7661
|
...resolution,
|
|
7666
|
-
|
|
7667
|
-
useTemplatePipeline
|
|
7662
|
+
defer: this.compileDeferBlocks(resolution)
|
|
7668
7663
|
};
|
|
7669
7664
|
if (analysis.explicitlyDeferredTypes !== null) {
|
|
7670
7665
|
removeDeferrableTypesFromComponentDecorator(analysis, analysis.explicitlyDeferredTypes);
|
|
@@ -7682,30 +7677,22 @@ var ComponentDecoratorHandler = class {
|
|
|
7682
7677
|
const directivelessBinder = new R3TargetBinder(new SelectorMatcher2());
|
|
7683
7678
|
const bound = directivelessBinder.bind({ template: template.nodes });
|
|
7684
7679
|
const deferredBlocks = bound.getDeferBlocks();
|
|
7685
|
-
const triggerElements = /* @__PURE__ */ new Map();
|
|
7686
7680
|
for (const block of deferredBlocks) {
|
|
7687
|
-
|
|
7688
|
-
this.resolveDeferTriggers(block, block.prefetchTriggers, bound, triggerElements);
|
|
7689
|
-
deferBlocks.set(block, { deps: [], triggerElements });
|
|
7681
|
+
deferBlocks.set(block, []);
|
|
7690
7682
|
}
|
|
7691
7683
|
return deferBlocks;
|
|
7692
7684
|
}
|
|
7693
7685
|
collectDeferredSymbols(resolution) {
|
|
7694
7686
|
var _a;
|
|
7695
|
-
const deferrableTypes =
|
|
7696
|
-
for (const [_,
|
|
7697
|
-
for (const deferBlockDep of
|
|
7698
|
-
const
|
|
7699
|
-
const classDecl = dep.classDeclaration;
|
|
7700
|
-
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;
|
|
7701
7691
|
if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
|
|
7702
7692
|
deferBlockDep.isDeferrable = true;
|
|
7703
7693
|
deferBlockDep.importPath = importDecl.moduleSpecifier.text;
|
|
7704
7694
|
deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
|
|
7705
|
-
deferrableTypes.
|
|
7706
|
-
importPath: deferBlockDep.importPath,
|
|
7707
|
-
isDefaultImport: deferBlockDep.isDefaultImport
|
|
7708
|
-
});
|
|
7695
|
+
deferrableTypes.push(deferBlockDep);
|
|
7709
7696
|
}
|
|
7710
7697
|
}
|
|
7711
7698
|
}
|
|
@@ -7742,13 +7729,18 @@ var ComponentDecoratorHandler = class {
|
|
|
7742
7729
|
}
|
|
7743
7730
|
this.cycleAnalyzer.recordSyntheticImport(origin, imported);
|
|
7744
7731
|
}
|
|
7745
|
-
resolveDeferBlocks(componentClassDecl, deferBlocks, deferrableDecls, resolutionData, analysisData, eagerlyUsedDecls
|
|
7732
|
+
resolveDeferBlocks(componentClassDecl, deferBlocks, deferrableDecls, resolutionData, analysisData, eagerlyUsedDecls) {
|
|
7746
7733
|
const allDeferredDecls = /* @__PURE__ */ new Set();
|
|
7747
7734
|
for (const [deferBlock, bound] of deferBlocks) {
|
|
7748
7735
|
const usedDirectives = new Set(bound.getEagerlyUsedDirectives().map((d) => d.ref.node));
|
|
7749
7736
|
const usedPipes = new Set(bound.getEagerlyUsedPipes());
|
|
7750
|
-
|
|
7751
|
-
|
|
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
|
+
}
|
|
7752
7744
|
for (const decl of Array.from(deferrableDecls.values())) {
|
|
7753
7745
|
if (decl.kind === R3TemplateDependencyKind.NgModule) {
|
|
7754
7746
|
continue;
|
|
@@ -7760,18 +7752,15 @@ var ComponentDecoratorHandler = class {
|
|
|
7760
7752
|
continue;
|
|
7761
7753
|
}
|
|
7762
7754
|
deps.push({
|
|
7763
|
-
|
|
7764
|
-
symbolName: decl.ref.node.name.
|
|
7755
|
+
typeReference: decl.type,
|
|
7756
|
+
symbolName: decl.ref.node.name.text,
|
|
7765
7757
|
isDeferrable: false,
|
|
7766
7758
|
importPath: null,
|
|
7767
7759
|
isDefaultImport: false,
|
|
7768
|
-
|
|
7760
|
+
declaration: decl.ref
|
|
7769
7761
|
});
|
|
7770
7762
|
allDeferredDecls.add(decl.ref.node);
|
|
7771
7763
|
}
|
|
7772
|
-
this.resolveDeferTriggers(deferBlock, deferBlock.triggers, componentBoundTarget, triggerElements);
|
|
7773
|
-
this.resolveDeferTriggers(deferBlock, deferBlock.prefetchTriggers, componentBoundTarget, triggerElements);
|
|
7774
|
-
resolutionData.deferBlocks.set(deferBlock, { deps, triggerElements });
|
|
7775
7764
|
}
|
|
7776
7765
|
if (analysisData.meta.isStandalone) {
|
|
7777
7766
|
if (analysisData.rawImports !== null) {
|
|
@@ -7823,11 +7812,28 @@ var ComponentDecoratorHandler = class {
|
|
|
7823
7812
|
this.deferredSymbolTracker.markAsDeferrableCandidate(node, imp.node, componentClassDecl, isDeferredImport);
|
|
7824
7813
|
}
|
|
7825
7814
|
}
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
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.`);
|
|
7831
7837
|
}
|
|
7832
7838
|
};
|
|
7833
7839
|
function createTargetBinder(dependencies) {
|
|
@@ -7853,9 +7859,9 @@ function extractPipes(dependencies) {
|
|
|
7853
7859
|
}
|
|
7854
7860
|
function removeDeferrableTypesFromComponentDecorator(analysis, deferrableTypes) {
|
|
7855
7861
|
if (analysis.classMetadata) {
|
|
7856
|
-
const deferrableSymbols = new Set(deferrableTypes.
|
|
7862
|
+
const deferrableSymbols = new Set(deferrableTypes.map((t) => t.symbolName));
|
|
7857
7863
|
const rewrittenDecoratorsNode = removeIdentifierReferences(analysis.classMetadata.decorators.node, deferrableSymbols);
|
|
7858
|
-
analysis.classMetadata.decorators = new
|
|
7864
|
+
analysis.classMetadata.decorators = new o2.WrappedNodeExpr(rewrittenDecoratorsNode);
|
|
7859
7865
|
}
|
|
7860
7866
|
}
|
|
7861
7867
|
function validateNoImportOverlap(eagerDeps, deferredDeps, rawDeferredImports) {
|
|
@@ -7904,7 +7910,7 @@ function isDefaultImport(node) {
|
|
|
7904
7910
|
}
|
|
7905
7911
|
|
|
7906
7912
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
7907
|
-
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";
|
|
7908
7914
|
import ts28 from "typescript";
|
|
7909
7915
|
var InjectableDecoratorHandler = class {
|
|
7910
7916
|
constructor(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, perf, includeClassMetadata, compilationMode, errorOnDuplicateProv = true) {
|
|
@@ -8047,7 +8053,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8047
8053
|
result.useClass = getProviderExpression(meta.get("useClass"), reflector);
|
|
8048
8054
|
result.deps = deps;
|
|
8049
8055
|
} else if (meta.has("useFactory")) {
|
|
8050
|
-
result.useFactory = new
|
|
8056
|
+
result.useFactory = new WrappedNodeExpr8(meta.get("useFactory"));
|
|
8051
8057
|
result.deps = deps;
|
|
8052
8058
|
}
|
|
8053
8059
|
return result;
|
|
@@ -8057,7 +8063,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
8057
8063
|
}
|
|
8058
8064
|
function getProviderExpression(expression, reflector) {
|
|
8059
8065
|
const forwardRefValue = tryUnwrapForwardRef(expression, reflector);
|
|
8060
|
-
return createMayBeForwardRefExpression3(new
|
|
8066
|
+
return createMayBeForwardRefExpression3(new WrappedNodeExpr8(forwardRefValue != null ? forwardRefValue : expression), forwardRefValue !== null ? 2 : 0);
|
|
8061
8067
|
}
|
|
8062
8068
|
function extractInjectableCtorDeps(clazz, meta, decorator, reflector, isCore, strictCtorDeps) {
|
|
8063
8069
|
if (decorator.args === null) {
|
|
@@ -8086,7 +8092,7 @@ function requiresValidCtor(meta) {
|
|
|
8086
8092
|
}
|
|
8087
8093
|
function getDep(dep, reflector) {
|
|
8088
8094
|
const meta = {
|
|
8089
|
-
token: new
|
|
8095
|
+
token: new WrappedNodeExpr8(dep),
|
|
8090
8096
|
attributeNameType: null,
|
|
8091
8097
|
host: false,
|
|
8092
8098
|
optional: false,
|
|
@@ -8101,7 +8107,7 @@ function getDep(dep, reflector) {
|
|
|
8101
8107
|
switch (source.name) {
|
|
8102
8108
|
case "Inject":
|
|
8103
8109
|
if (token !== void 0) {
|
|
8104
|
-
meta.token = new
|
|
8110
|
+
meta.token = new WrappedNodeExpr8(token);
|
|
8105
8111
|
}
|
|
8106
8112
|
break;
|
|
8107
8113
|
case "Optional":
|
|
@@ -8128,7 +8134,7 @@ function getDep(dep, reflector) {
|
|
|
8128
8134
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
8129
8135
|
}
|
|
8130
8136
|
if (!isDecorator) {
|
|
8131
|
-
meta.token = new
|
|
8137
|
+
meta.token = new WrappedNodeExpr8(el);
|
|
8132
8138
|
}
|
|
8133
8139
|
});
|
|
8134
8140
|
}
|
|
@@ -8348,4 +8354,4 @@ export {
|
|
|
8348
8354
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8349
8355
|
* found in the LICENSE file at https://angular.io/license
|
|
8350
8356
|
*/
|
|
8351
|
-
//# sourceMappingURL=chunk-
|
|
8357
|
+
//# sourceMappingURL=chunk-A46CQFUG.js.map
|