@angular/compiler-cli 21.1.4 → 21.1.6
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-RUZT54XX.js → chunk-622FKITK.js} +47 -18
- package/bundles/{chunk-2XURAWTH.js → chunk-73D7RRZJ.js} +1 -1
- package/bundles/{chunk-VVZRG35Z.js → chunk-7XABP3IF.js} +2 -2
- package/bundles/{chunk-TU2XV7EG.js → chunk-E2YMRKVR.js} +42 -30
- package/bundles/chunk-WEF4HIPN.js +1 -1
- package/bundles/index.js +4 -4
- package/bundles/private/migrations.js +2 -2
- package/bundles/private/testing.js +1 -1
- package/bundles/private/tooling.js +1 -1
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/preprocessor.d.ts +33 -0
- package/src/ngtsc/transform/src/compilation.d.ts +2 -1
- package/src/ngtsc/transform/src/transform.d.ts +2 -2
- package/src/ngtsc/typecheck/extended/api/format-extended-error.d.ts +17 -0
- package/src/ngtsc/typecheck/extended/api/index.d.ts +1 -0
- package/src/ngtsc/typecheck/src/ops/expression.d.ts +15 -0
|
@@ -229,7 +229,7 @@ var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
|
|
|
229
229
|
import { VERSION } from "@angular/compiler";
|
|
230
230
|
var DOC_PAGE_BASE_URL = (() => {
|
|
231
231
|
const full = VERSION.full;
|
|
232
|
-
const isPreRelease = full.includes("-next") || full.includes("-rc") || full === "21.1.
|
|
232
|
+
const isPreRelease = full.includes("-next") || full.includes("-rc") || full === "21.1.6";
|
|
233
233
|
const prefix = isPreRelease ? "next" : `v${VERSION.major}`;
|
|
234
234
|
return `https://${prefix}.angular.dev`;
|
|
235
235
|
})();
|
|
@@ -694,7 +694,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
|
|
|
694
694
|
const firstDecl = local.declarations && local.declarations[0];
|
|
695
695
|
if (firstDecl !== void 0) {
|
|
696
696
|
if (ts5.isImportClause(firstDecl) && firstDecl.name !== void 0) {
|
|
697
|
-
if (firstDecl.
|
|
697
|
+
if (firstDecl.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
|
|
698
698
|
return typeOnlyImport(typeNode, firstDecl);
|
|
699
699
|
}
|
|
700
700
|
if (!ts5.isImportDeclaration(firstDecl.parent)) {
|
|
@@ -709,7 +709,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
|
|
|
709
709
|
if (firstDecl.isTypeOnly) {
|
|
710
710
|
return typeOnlyImport(typeNode, firstDecl);
|
|
711
711
|
}
|
|
712
|
-
if (firstDecl.parent.parent.
|
|
712
|
+
if (firstDecl.parent.parent.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
|
|
713
713
|
return typeOnlyImport(typeNode, firstDecl.parent.parent);
|
|
714
714
|
}
|
|
715
715
|
const importedName = (firstDecl.propertyName || firstDecl.name).text;
|
|
@@ -727,7 +727,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
|
|
|
727
727
|
nestedPath
|
|
728
728
|
};
|
|
729
729
|
} else if (ts5.isNamespaceImport(firstDecl)) {
|
|
730
|
-
if (firstDecl.parent.
|
|
730
|
+
if (firstDecl.parent.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
|
|
731
731
|
return typeOnlyImport(typeNode, firstDecl.parent);
|
|
732
732
|
}
|
|
733
733
|
if (symbols.symbolNames.length === 1) {
|
|
@@ -1930,7 +1930,7 @@ var DeferredSymbolTracker = class {
|
|
|
1930
1930
|
if (importDecl.importClause === void 0) {
|
|
1931
1931
|
throw new Error(`Provided import declaration doesn't have any symbols.`);
|
|
1932
1932
|
}
|
|
1933
|
-
if (importDecl.importClause.
|
|
1933
|
+
if (importDecl.importClause.phaseModifier === ts10.SyntaxKind.TypeKeyword) {
|
|
1934
1934
|
return symbolMap;
|
|
1935
1935
|
}
|
|
1936
1936
|
if (importDecl.importClause.namedBindings !== void 0) {
|
|
@@ -4737,7 +4737,7 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
|
|
|
4737
4737
|
if (clause.namedBindings === void 0 || !ts19.isNamedImports(clause.namedBindings) || !updatedImports.has(clause.namedBindings)) {
|
|
4738
4738
|
return node;
|
|
4739
4739
|
}
|
|
4740
|
-
const newClause = ctx.factory.updateImportClause(clause, clause.
|
|
4740
|
+
const newClause = ctx.factory.updateImportClause(clause, clause.phaseModifier, clause.name, updatedImports.get(clause.namedBindings));
|
|
4741
4741
|
const newImport = ctx.factory.updateImportDeclaration(node, node.modifiers, newClause, node.moduleSpecifier, node.attributes);
|
|
4742
4742
|
ts19.setOriginalNode(newImport, {
|
|
4743
4743
|
importClause: newClause,
|
|
@@ -4809,7 +4809,7 @@ function attemptToReuseExistingSourceFileImports(tracker, sourceFile, request) {
|
|
|
4809
4809
|
if (!ts21.isImportDeclaration(statement) || !ts21.isStringLiteral(statement.moduleSpecifier)) {
|
|
4810
4810
|
continue;
|
|
4811
4811
|
}
|
|
4812
|
-
if (!statement.importClause || statement.importClause.
|
|
4812
|
+
if (!statement.importClause || statement.importClause.phaseModifier === ts21.SyntaxKind.TypeKeyword) {
|
|
4813
4813
|
continue;
|
|
4814
4814
|
}
|
|
4815
4815
|
const moduleSpecifier = statement.moduleSpecifier.text;
|
|
@@ -6005,6 +6005,7 @@ var TraitCompiler = class {
|
|
|
6005
6005
|
semanticDepGraphUpdater;
|
|
6006
6006
|
sourceFileTypeIdentifier;
|
|
6007
6007
|
emitDeclarationOnly;
|
|
6008
|
+
emitIntermediateTs;
|
|
6008
6009
|
/**
|
|
6009
6010
|
* Maps class declarations to their `ClassRecord`, which tracks the Ivy traits being applied to
|
|
6010
6011
|
* those classes.
|
|
@@ -6022,7 +6023,7 @@ var TraitCompiler = class {
|
|
|
6022
6023
|
filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
6023
6024
|
reexportMap = /* @__PURE__ */ new Map();
|
|
6024
6025
|
handlersByName = /* @__PURE__ */ new Map();
|
|
6025
|
-
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly) {
|
|
6026
|
+
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly, emitIntermediateTs) {
|
|
6026
6027
|
this.handlers = handlers;
|
|
6027
6028
|
this.reflector = reflector;
|
|
6028
6029
|
this.perf = perf;
|
|
@@ -6033,6 +6034,7 @@ var TraitCompiler = class {
|
|
|
6033
6034
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
6034
6035
|
this.sourceFileTypeIdentifier = sourceFileTypeIdentifier;
|
|
6035
6036
|
this.emitDeclarationOnly = emitDeclarationOnly;
|
|
6037
|
+
this.emitIntermediateTs = emitIntermediateTs;
|
|
6036
6038
|
for (const handler of handlers) {
|
|
6037
6039
|
this.handlersByName.set(handler.name, handler);
|
|
6038
6040
|
}
|
|
@@ -6707,11 +6709,11 @@ var Visitor = class {
|
|
|
6707
6709
|
// packages/compiler-cli/src/ngtsc/transform/src/transform.js
|
|
6708
6710
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
6709
6711
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
6710
|
-
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly) {
|
|
6712
|
+
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification) {
|
|
6711
6713
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
6712
6714
|
return (context) => {
|
|
6713
6715
|
return (file) => {
|
|
6714
|
-
return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode));
|
|
6716
|
+
return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode));
|
|
6715
6717
|
};
|
|
6716
6718
|
};
|
|
6717
6719
|
}
|
|
@@ -6747,7 +6749,9 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6747
6749
|
isClosureCompilerEnabled;
|
|
6748
6750
|
isCore;
|
|
6749
6751
|
deferrableImports;
|
|
6750
|
-
|
|
6752
|
+
refEmitter;
|
|
6753
|
+
enableTypeReification;
|
|
6754
|
+
constructor(compilation, classCompilationMap, reflector, importManager, recordWrappedNodeExpr, isClosureCompilerEnabled, isCore, deferrableImports, refEmitter, enableTypeReification) {
|
|
6751
6755
|
super();
|
|
6752
6756
|
this.compilation = compilation;
|
|
6753
6757
|
this.classCompilationMap = classCompilationMap;
|
|
@@ -6757,6 +6761,8 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6757
6761
|
this.isClosureCompilerEnabled = isClosureCompilerEnabled;
|
|
6758
6762
|
this.isCore = isCore;
|
|
6759
6763
|
this.deferrableImports = deferrableImports;
|
|
6764
|
+
this.refEmitter = refEmitter;
|
|
6765
|
+
this.enableTypeReification = enableTypeReification;
|
|
6760
6766
|
}
|
|
6761
6767
|
visitClassDeclaration(node) {
|
|
6762
6768
|
if (!this.classCompilationMap.has(node)) {
|
|
@@ -6774,7 +6780,11 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6774
6780
|
continue;
|
|
6775
6781
|
}
|
|
6776
6782
|
const exprNode = translateExpression(sourceFile, field.initializer, this.importManager, translateOptions);
|
|
6777
|
-
|
|
6783
|
+
let typeNode = void 0;
|
|
6784
|
+
if (this.enableTypeReification && this.refEmitter !== null) {
|
|
6785
|
+
typeNode = translateType(field.type, sourceFile, this.reflector, this.refEmitter, this.importManager);
|
|
6786
|
+
}
|
|
6787
|
+
const property = ts31.factory.createPropertyDeclaration([ts31.factory.createToken(ts31.SyntaxKind.StaticKeyword)], field.name, void 0, typeNode, exprNode);
|
|
6778
6788
|
if (this.isClosureCompilerEnabled) {
|
|
6779
6789
|
ts31.addSyntheticLeadingComment(
|
|
6780
6790
|
property,
|
|
@@ -6873,7 +6883,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6873
6883
|
return node;
|
|
6874
6884
|
}
|
|
6875
6885
|
};
|
|
6876
|
-
function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode) {
|
|
6886
|
+
function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode) {
|
|
6877
6887
|
const constantPool = new ConstantPool(isClosureCompilerEnabled);
|
|
6878
6888
|
const importManager = new ImportManager({
|
|
6879
6889
|
...presetImportManagerForceNamespaceImports,
|
|
@@ -6884,7 +6894,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
6884
6894
|
if (emitDeclarationOnly) {
|
|
6885
6895
|
return file;
|
|
6886
6896
|
}
|
|
6887
|
-
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports);
|
|
6897
|
+
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports, refEmitter, enableTypeReification);
|
|
6888
6898
|
let sf = visit(file, transformationVisitor, context);
|
|
6889
6899
|
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts31.ScriptTarget.ES2015;
|
|
6890
6900
|
const constants = constantPool.statements.map((stmt) => translateStatement(file, stmt, importManager, {
|
|
@@ -10764,7 +10774,7 @@ var SelectorlessComponentScopeReader = class {
|
|
|
10764
10774
|
result.set(stmt.name.text, stmt.name);
|
|
10765
10775
|
continue;
|
|
10766
10776
|
}
|
|
10767
|
-
if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !stmt.importClause.
|
|
10777
|
+
if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !(stmt.importClause.phaseModifier === ts46.SyntaxKind.TypeKeyword)) {
|
|
10768
10778
|
const clause = stmt.importClause;
|
|
10769
10779
|
if (clause.namedBindings !== void 0 && ts46.isNamedImports(clause.namedBindings)) {
|
|
10770
10780
|
for (const element of clause.namedBindings.elements) {
|
|
@@ -14575,6 +14585,25 @@ var TcbExpressionOp = class extends TcbOp {
|
|
|
14575
14585
|
return null;
|
|
14576
14586
|
}
|
|
14577
14587
|
};
|
|
14588
|
+
var TcbConditionOp = class extends TcbOp {
|
|
14589
|
+
tcb;
|
|
14590
|
+
scope;
|
|
14591
|
+
expression;
|
|
14592
|
+
constructor(tcb, scope, expression) {
|
|
14593
|
+
super();
|
|
14594
|
+
this.tcb = tcb;
|
|
14595
|
+
this.scope = scope;
|
|
14596
|
+
this.expression = expression;
|
|
14597
|
+
}
|
|
14598
|
+
get optional() {
|
|
14599
|
+
return false;
|
|
14600
|
+
}
|
|
14601
|
+
execute() {
|
|
14602
|
+
const expr = tcbExpression(this.expression, this.tcb, this.scope);
|
|
14603
|
+
this.scope.addStatement(ts64.factory.createIfStatement(expr, ts64.factory.createBlock([])));
|
|
14604
|
+
return null;
|
|
14605
|
+
}
|
|
14606
|
+
};
|
|
14578
14607
|
var TcbExpressionTranslator = class {
|
|
14579
14608
|
tcb;
|
|
14580
14609
|
scope;
|
|
@@ -16902,7 +16931,7 @@ var Scope = class _Scope {
|
|
|
16902
16931
|
this.appendDeferredTriggers(block, block.triggers);
|
|
16903
16932
|
this.appendDeferredTriggers(block, block.prefetchTriggers);
|
|
16904
16933
|
if (block.hydrateTriggers.when) {
|
|
16905
|
-
this.opQueue.push(new
|
|
16934
|
+
this.opQueue.push(new TcbConditionOp(this.tcb, this, block.hydrateTriggers.when.value));
|
|
16906
16935
|
}
|
|
16907
16936
|
this.appendChildren(block);
|
|
16908
16937
|
if (block.placeholder !== null) {
|
|
@@ -16917,7 +16946,7 @@ var Scope = class _Scope {
|
|
|
16917
16946
|
}
|
|
16918
16947
|
appendDeferredTriggers(block, triggers) {
|
|
16919
16948
|
if (triggers.when !== void 0) {
|
|
16920
|
-
this.opQueue.push(new
|
|
16949
|
+
this.opQueue.push(new TcbConditionOp(this.tcb, this, triggers.when.value));
|
|
16921
16950
|
}
|
|
16922
16951
|
if (triggers.viewport !== void 0 && triggers.viewport.options !== null) {
|
|
16923
16952
|
this.opQueue.push(new TcbIntersectionObserverOp(this.tcb, this, triggers.viewport.options));
|
|
@@ -20696,7 +20725,7 @@ function getTopLevelDeclarationNames(sourceFile) {
|
|
|
20696
20725
|
}
|
|
20697
20726
|
if (ts91.isImportDeclaration(node) && node.importClause) {
|
|
20698
20727
|
const importClause = node.importClause;
|
|
20699
|
-
if (importClause.
|
|
20728
|
+
if (importClause.phaseModifier === ts91.SyntaxKind.TypeKeyword) {
|
|
20700
20729
|
continue;
|
|
20701
20730
|
}
|
|
20702
20731
|
if (importClause.name) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TrackedIncrementalBuildStrategy,
|
|
9
9
|
freshCompilationTicket,
|
|
10
10
|
incrementalFromCompilerTicket
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-E2YMRKVR.js";
|
|
12
12
|
import {
|
|
13
13
|
ActivePerfRecorder,
|
|
14
14
|
OptimizeFor,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
TsCreateProgramDriver,
|
|
19
19
|
replaceTsWithNgInErrors,
|
|
20
20
|
retagAllTsFiles
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-622FKITK.js";
|
|
22
22
|
import {
|
|
23
23
|
absoluteFrom,
|
|
24
24
|
createFileSystemTsReadDirectoryFn,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
toUnredirectedSourceFile,
|
|
89
89
|
tryParseInitializerApi,
|
|
90
90
|
untagAllTsFiles
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-622FKITK.js";
|
|
92
92
|
import {
|
|
93
93
|
LogicalFileSystem,
|
|
94
94
|
absoluteFromSourceFile,
|
|
@@ -709,11 +709,9 @@ var PipeExtractor = class extends ClassExtractor {
|
|
|
709
709
|
};
|
|
710
710
|
var NgModuleExtractor = class extends ClassExtractor {
|
|
711
711
|
reference;
|
|
712
|
-
|
|
713
|
-
constructor(declaration, reference, metadata, typeChecker) {
|
|
712
|
+
constructor(declaration, reference, typeChecker) {
|
|
714
713
|
super(declaration, typeChecker);
|
|
715
714
|
this.reference = reference;
|
|
716
|
-
this.metadata = metadata;
|
|
717
715
|
}
|
|
718
716
|
extract() {
|
|
719
717
|
return {
|
|
@@ -733,7 +731,7 @@ function extractClass(classDeclaration, metadataReader, typeChecker) {
|
|
|
733
731
|
} else if (pipeMetadata) {
|
|
734
732
|
extractor = new PipeExtractor(classDeclaration, ref, pipeMetadata, typeChecker);
|
|
735
733
|
} else if (ngModuleMetadata) {
|
|
736
|
-
extractor = new NgModuleExtractor(classDeclaration, ref,
|
|
734
|
+
extractor = new NgModuleExtractor(classDeclaration, ref, typeChecker);
|
|
737
735
|
} else {
|
|
738
736
|
extractor = new ClassExtractor(classDeclaration, typeChecker);
|
|
739
737
|
}
|
|
@@ -1591,7 +1589,7 @@ function isLocalFile(sf) {
|
|
|
1591
1589
|
return !sf.isDeclarationFile;
|
|
1592
1590
|
}
|
|
1593
1591
|
function isTypeOnlyImportClause(node) {
|
|
1594
|
-
if (node.
|
|
1592
|
+
if (node.phaseModifier === ts15.SyntaxKind.TypeKeyword) {
|
|
1595
1593
|
return true;
|
|
1596
1594
|
}
|
|
1597
1595
|
if (node.namedBindings !== void 0 && ts15.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
|
|
@@ -2958,6 +2956,20 @@ var TemplateVisitor2 = class extends CombinedRecursiveAstVisitor2 {
|
|
|
2958
2956
|
}
|
|
2959
2957
|
};
|
|
2960
2958
|
|
|
2959
|
+
// packages/compiler-cli/src/ngtsc/typecheck/extended/api/format-extended-error.js
|
|
2960
|
+
import { VERSION } from "@angular/compiler";
|
|
2961
|
+
var EXTENDED_ERROR_DETAILS_PAGE_BASE_URL = (() => {
|
|
2962
|
+
const versionSubDomain = VERSION.major !== "0" ? `v${VERSION.major}.` : "";
|
|
2963
|
+
return `https://${versionSubDomain}angular.dev/extended-diagnostics`;
|
|
2964
|
+
})();
|
|
2965
|
+
function formatExtendedError(code, message) {
|
|
2966
|
+
const fullCode = `NG${Math.abs(code)}`;
|
|
2967
|
+
const errorMessage = `${fullCode}${message ? ": " + message : ""}`;
|
|
2968
|
+
const addPeriodSeparator = !errorMessage.match(/[.,;!?\n]$/);
|
|
2969
|
+
const separator = addPeriodSeparator ? "." : "";
|
|
2970
|
+
return `${errorMessage}${separator} Find more at ${EXTENDED_ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2961
2973
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.js
|
|
2962
2974
|
var SIGNAL_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["set", "update", "asReadonly"]);
|
|
2963
2975
|
var FUNCTION_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["name", "length", "prototype"]);
|
|
@@ -3035,7 +3047,7 @@ function buildDiagnosticForSignal(ctx, node, component) {
|
|
|
3035
3047
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
3036
3048
|
if (symbol !== null && symbol.kind === SymbolKind.Expression && isSignalReference(symbol)) {
|
|
3037
3049
|
const templateMapping = ctx.templateTypeChecker.getSourceMappingAtTcbLocation(symbol.tcbLocation);
|
|
3038
|
-
const errorString = `${node.name} is a function and should be invoked: ${node.name}()
|
|
3050
|
+
const errorString = formatExtendedError(ErrorCode.INTERPOLATED_SIGNAL_NOT_INVOKED, `${node.name} is a function and should be invoked: ${node.name}()}`);
|
|
3039
3051
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
3040
3052
|
return [diagnostic];
|
|
3041
3053
|
}
|
|
@@ -3045,7 +3057,7 @@ function buildDiagnosticForSignal(ctx, node, component) {
|
|
|
3045
3057
|
const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
3046
3058
|
if (symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
|
|
3047
3059
|
const templateMapping = ctx.templateTypeChecker.getSourceMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
|
|
3048
|
-
const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()
|
|
3060
|
+
const errorString = formatExtendedError(ErrorCode.INTERPOLATED_SIGNAL_NOT_INVOKED, `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`);
|
|
3049
3061
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
3050
3062
|
return [diagnostic];
|
|
3051
3063
|
}
|
|
@@ -3069,8 +3081,7 @@ var InvalidBananaInBoxCheck = class extends TemplateCheckWithVisitor {
|
|
|
3069
3081
|
return [];
|
|
3070
3082
|
const boundSyntax = node.sourceSpan.toString();
|
|
3071
3083
|
const expectedBoundSyntax = boundSyntax.replace(`(${name})`, `[(${name.slice(1, -1)})]`);
|
|
3072
|
-
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, `In the two-way binding syntax the parentheses should be inside the brackets, ex. '${expectedBoundSyntax}'
|
|
3073
|
-
Find more at ${DOC_PAGE_BASE_URL}/guide/templates/two-way-binding`);
|
|
3084
|
+
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, formatExtendedError(ErrorCode.INVALID_BANANA_IN_BOX, `In the two-way binding syntax the parentheses should be inside the brackets, ex. '${expectedBoundSyntax}'`));
|
|
3074
3085
|
return [diagnostic];
|
|
3075
3086
|
}
|
|
3076
3087
|
};
|
|
@@ -3109,7 +3120,7 @@ var MissingControlFlowDirectiveCheck = class extends TemplateCheckWithVisitor {
|
|
|
3109
3120
|
}
|
|
3110
3121
|
const sourceSpan = controlFlowAttr.keySpan || controlFlowAttr.sourceSpan;
|
|
3111
3122
|
const directiveAndBuiltIn = KNOWN_CONTROL_FLOW_DIRECTIVES.get(controlFlowAttr.name);
|
|
3112
|
-
const errorMessage = `The \`*${controlFlowAttr.name}\` directive was used in the template, but neither the \`${directiveAndBuiltIn?.directive}\` directive nor the \`CommonModule\` was imported. Use Angular's built-in control flow ${directiveAndBuiltIn?.builtIn} or make sure that either the \`${directiveAndBuiltIn?.directive}\` directive or the \`CommonModule\` is included in the \`@Component.imports\` array of this component
|
|
3123
|
+
const errorMessage = formatExtendedError(ErrorCode.MISSING_CONTROL_FLOW_DIRECTIVE, `The \`*${controlFlowAttr.name}\` directive was used in the template, but neither the \`${directiveAndBuiltIn?.directive}\` directive nor the \`CommonModule\` was imported. Use Angular's built-in control flow ${directiveAndBuiltIn?.builtIn} or make sure that either the \`${directiveAndBuiltIn?.directive}\` directive or the \`CommonModule\` is included in the \`@Component.imports\` array of this component.`);
|
|
3113
3124
|
const diagnostic = ctx.makeTemplateDiagnostic(sourceSpan, errorMessage);
|
|
3114
3125
|
return [diagnostic];
|
|
3115
3126
|
}
|
|
@@ -3141,7 +3152,7 @@ var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
|
|
|
3141
3152
|
if (node.variables.length > 0) {
|
|
3142
3153
|
return [];
|
|
3143
3154
|
}
|
|
3144
|
-
const errorString =
|
|
3155
|
+
const errorString = formatExtendedError(ErrorCode.MISSING_NGFOROF_LET, `Your ngFor is missing a value. Did you forget to add the \`let\` keyword?`);
|
|
3145
3156
|
const diagnostic = ctx.makeTemplateDiagnostic(attr.sourceSpan, errorString);
|
|
3146
3157
|
return [diagnostic];
|
|
3147
3158
|
}
|
|
@@ -3184,7 +3195,7 @@ var MissingStructuralDirectiveCheck = class extends TemplateCheckWithVisitor {
|
|
|
3184
3195
|
if (hasStructuralDirective)
|
|
3185
3196
|
return [];
|
|
3186
3197
|
const sourceSpan = customStructuralDirective.keySpan || customStructuralDirective.sourceSpan;
|
|
3187
|
-
const errorMessage = `A structural directive \`${customStructuralDirective.name}\` was used in the template without a corresponding import in the component. Make sure that the directive is included in the \`@Component.imports\` array of this component
|
|
3198
|
+
const errorMessage = formatExtendedError(ErrorCode.MISSING_STRUCTURAL_DIRECTIVE, `A structural directive \`${customStructuralDirective.name}\` was used in the template without a corresponding import in the component. Make sure that the directive is included in the \`@Component.imports\` array of this component.`);
|
|
3188
3199
|
return [ctx.makeTemplateDiagnostic(sourceSpan, errorMessage)];
|
|
3189
3200
|
}
|
|
3190
3201
|
};
|
|
@@ -3220,7 +3231,7 @@ var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
3220
3231
|
if (templateMapping === null) {
|
|
3221
3232
|
return [];
|
|
3222
3233
|
}
|
|
3223
|
-
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, `The left side of this nullish coalescing operation does not include 'null' or 'undefined' in its type, therefore the '??' operator can be safely removed.`);
|
|
3234
|
+
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, formatExtendedError(ErrorCode.NULLISH_COALESCING_NOT_NULLABLE, `The left side of this nullish coalescing operation does not include 'null' or 'undefined' in its type, therefore the '??' operator can be safely removed.`));
|
|
3224
3235
|
return [diagnostic];
|
|
3225
3236
|
}
|
|
3226
3237
|
};
|
|
@@ -3272,7 +3283,7 @@ var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
|
3272
3283
|
return [];
|
|
3273
3284
|
}
|
|
3274
3285
|
const advice = node instanceof SafePropertyRead ? `the '?.' operator can be replaced with the '.' operator` : `the '?.' operator can be safely removed`;
|
|
3275
|
-
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, `The left side of this optional chain operation does not include 'null' or 'undefined' in its type, therefore ${advice}
|
|
3286
|
+
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, formatExtendedError(ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE, `The left side of this optional chain operation does not include 'null' or 'undefined' in its type, therefore ${advice}`));
|
|
3276
3287
|
return [diagnostic];
|
|
3277
3288
|
}
|
|
3278
3289
|
};
|
|
@@ -3296,7 +3307,7 @@ var NgSkipHydrationSpec = class extends TemplateCheckWithVisitor {
|
|
|
3296
3307
|
code = ErrorCode.SKIP_HYDRATION_NOT_STATIC;
|
|
3297
3308
|
visitNode(ctx, component, node) {
|
|
3298
3309
|
if (node instanceof TmplAstBoundAttribute2 && node.name === NG_SKIP_HYDRATION_ATTR_NAME) {
|
|
3299
|
-
const errorString = `ngSkipHydration should not be used as a binding
|
|
3310
|
+
const errorString = formatExtendedError(ErrorCode.SKIP_HYDRATION_NOT_STATIC, `ngSkipHydration should not be used as a binding`);
|
|
3300
3311
|
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, errorString);
|
|
3301
3312
|
return [diagnostic];
|
|
3302
3313
|
}
|
|
@@ -3306,7 +3317,7 @@ var NgSkipHydrationSpec = class extends TemplateCheckWithVisitor {
|
|
|
3306
3317
|
/* empty string */
|
|
3307
3318
|
];
|
|
3308
3319
|
if (node instanceof TmplAstTextAttribute && node.name === NG_SKIP_HYDRATION_ATTR_NAME && !acceptedValues.includes(node.value) && node.value !== void 0) {
|
|
3309
|
-
const errorString = `ngSkipHydration only accepts "true" or "" as value or no value at all. For example 'ngSkipHydration="true"' or 'ngSkipHydration'
|
|
3320
|
+
const errorString = formatExtendedError(ErrorCode.SKIP_HYDRATION_NOT_STATIC, `ngSkipHydration only accepts "true" or "" as value or no value at all. For example 'ngSkipHydration="true"' or 'ngSkipHydration'`);
|
|
3310
3321
|
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, errorString);
|
|
3311
3322
|
return [diagnostic];
|
|
3312
3323
|
}
|
|
@@ -3330,7 +3341,7 @@ var SuffixNotSupportedCheck = class extends TemplateCheckWithVisitor {
|
|
|
3330
3341
|
if (!node.keySpan.toString().startsWith("attr.") || !STYLE_SUFFIXES.some((suffix) => node.name.endsWith(`.${suffix}`))) {
|
|
3331
3342
|
return [];
|
|
3332
3343
|
}
|
|
3333
|
-
const diagnostic = ctx.makeTemplateDiagnostic(node.keySpan, `The ${STYLE_SUFFIXES.map((suffix) => `'.${suffix}'`).join(", ")} suffixes are only supported on style bindings
|
|
3344
|
+
const diagnostic = ctx.makeTemplateDiagnostic(node.keySpan, formatExtendedError(ErrorCode.SUFFIX_NOT_SUPPORTED, `The ${STYLE_SUFFIXES.map((suffix) => `'.${suffix}'`).join(", ")} suffixes are only supported on style bindings`));
|
|
3334
3345
|
return [diagnostic];
|
|
3335
3346
|
}
|
|
3336
3347
|
};
|
|
@@ -3369,6 +3380,7 @@ var TextAttributeNotBindingSpec = class extends TemplateCheckWithVisitor {
|
|
|
3369
3380
|
if (node.value) {
|
|
3370
3381
|
errorString += ` For example, '${expectedKey}="${expectedValue}"'.`;
|
|
3371
3382
|
}
|
|
3383
|
+
errorString = formatExtendedError(ErrorCode.TEXT_ATTRIBUTE_NOT_BINDING, errorString);
|
|
3372
3384
|
}
|
|
3373
3385
|
const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, errorString);
|
|
3374
3386
|
return [diagnostic];
|
|
@@ -3413,7 +3425,7 @@ function assertExpressionInvoked(expression, component, node, expressionText, ct
|
|
|
3413
3425
|
if (symbol !== null && symbol.kind === SymbolKind.Expression) {
|
|
3414
3426
|
if (symbol.tsType.getCallSignatures()?.length > 0) {
|
|
3415
3427
|
const fullExpressionText = generateStringFromExpression(expression, expressionText);
|
|
3416
|
-
const errorString = `Function in event binding should be invoked: ${fullExpressionText}()
|
|
3428
|
+
const errorString = formatExtendedError(ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING, `Function in event binding should be invoked: ${fullExpressionText}()`);
|
|
3417
3429
|
return [ctx.makeTemplateDiagnostic(node.sourceSpan, errorString)];
|
|
3418
3430
|
}
|
|
3419
3431
|
}
|
|
@@ -3444,7 +3456,7 @@ var UnparenthesizedNullishCoalescing = class extends TemplateCheckWithVisitor {
|
|
|
3444
3456
|
if (sourceMapping === null) {
|
|
3445
3457
|
return [];
|
|
3446
3458
|
}
|
|
3447
|
-
const diagnostic = ctx.makeTemplateDiagnostic(sourceMapping.span, `Parentheses are required to disambiguate precedence when mixing '??' with '&&' and '||'
|
|
3459
|
+
const diagnostic = ctx.makeTemplateDiagnostic(sourceMapping.span, formatExtendedError(ErrorCode.UNPARENTHESIZED_NULLISH_COALESCING, `Parentheses are required to disambiguate precedence when mixing '??' with '&&' and '||'`));
|
|
3448
3460
|
return [diagnostic];
|
|
3449
3461
|
}
|
|
3450
3462
|
}
|
|
@@ -3469,7 +3481,7 @@ var UnusedLetDeclarationCheck = class extends TemplateCheckWithVisitor {
|
|
|
3469
3481
|
const { allLetDeclarations, usedLetDeclarations } = this.getAnalysis(component);
|
|
3470
3482
|
for (const decl of allLetDeclarations) {
|
|
3471
3483
|
if (!usedLetDeclarations.has(decl)) {
|
|
3472
|
-
diagnostics.push(ctx.makeTemplateDiagnostic(decl.sourceSpan, `@let ${decl.name} is declared but its value is never read.`));
|
|
3484
|
+
diagnostics.push(ctx.makeTemplateDiagnostic(decl.sourceSpan, formatExtendedError(ErrorCode.UNUSED_LET_DECLARATION, `@let ${decl.name} is declared but its value is never read.`)));
|
|
3473
3485
|
}
|
|
3474
3486
|
}
|
|
3475
3487
|
this.analysis.clear();
|
|
@@ -3517,7 +3529,7 @@ var UninvokedTrackFunctionCheck = class extends TemplateCheckWithVisitor {
|
|
|
3517
3529
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node.trackBy.ast, component);
|
|
3518
3530
|
if (symbol !== null && symbol.kind === SymbolKind.Expression && symbol.tsType.getCallSignatures()?.length > 0) {
|
|
3519
3531
|
const fullExpressionText = generateStringFromExpression2(node.trackBy.ast, node.trackBy.source || "");
|
|
3520
|
-
const errorString = `The track function in the @for block should be invoked: ${fullExpressionText}(/* arguments */)
|
|
3532
|
+
const errorString = formatExtendedError(ErrorCode.UNINVOKED_TRACK_FUNCTION, `The track function in the @for block should be invoked: ${fullExpressionText}(/* arguments */)`);
|
|
3521
3533
|
return [ctx.makeTemplateDiagnostic(node.sourceSpan, errorString)];
|
|
3522
3534
|
}
|
|
3523
3535
|
return [];
|
|
@@ -3550,7 +3562,7 @@ function assertExpressionInvoked2(expression, component, ctx) {
|
|
|
3550
3562
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(expression, component);
|
|
3551
3563
|
if (symbol !== null && symbol.kind === SymbolKind.Expression) {
|
|
3552
3564
|
if (symbol.tsType.getCallSignatures()?.length > 0) {
|
|
3553
|
-
const errorString = `Function in text interpolation should be invoked: ${expression.name}()
|
|
3565
|
+
const errorString = formatExtendedError(ErrorCode.UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION, `Function in text interpolation should be invoked: ${expression.name}()`);
|
|
3554
3566
|
const templateMapping = ctx.templateTypeChecker.getSourceMappingAtTcbLocation(symbol.tcbLocation);
|
|
3555
3567
|
return [ctx.makeTemplateDiagnostic(templateMapping.span, errorString)];
|
|
3556
3568
|
}
|
|
@@ -3579,11 +3591,11 @@ var DeferTriggerMisconfiguration = class extends TemplateCheckWithVisitor {
|
|
|
3579
3591
|
if (hasImmediateMain) {
|
|
3580
3592
|
if (mains.length > 1) {
|
|
3581
3593
|
const msg = `The 'immediate' trigger makes additional triggers redundant.`;
|
|
3582
|
-
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, msg));
|
|
3594
|
+
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, formatExtendedError(ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, msg)));
|
|
3583
3595
|
}
|
|
3584
3596
|
if (prefetches.length > 0) {
|
|
3585
3597
|
const msg = `Prefetch triggers have no effect because 'immediate' executes earlier.`;
|
|
3586
|
-
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, msg));
|
|
3598
|
+
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, formatExtendedError(ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, msg)));
|
|
3587
3599
|
}
|
|
3588
3600
|
}
|
|
3589
3601
|
if (mains.length === 1 && prefetches.length > 0) {
|
|
@@ -3595,7 +3607,7 @@ var DeferTriggerMisconfiguration = class extends TemplateCheckWithVisitor {
|
|
|
3595
3607
|
const preDelay = pre.delay;
|
|
3596
3608
|
if (preDelay >= mainDelay) {
|
|
3597
3609
|
const msg = `The Prefetch 'timer(${preDelay}ms)' is not scheduled before the main 'timer(${mainDelay}ms)', so it won\u2019t run prior to rendering. Lower the prefetch delay or remove it.`;
|
|
3598
|
-
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3610
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, formatExtendedError(ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, msg)));
|
|
3599
3611
|
}
|
|
3600
3612
|
}
|
|
3601
3613
|
const isHoverTrigger = main instanceof TmplAstHoverDeferredTrigger && pre instanceof TmplAstHoverDeferredTrigger;
|
|
@@ -3607,14 +3619,14 @@ var DeferTriggerMisconfiguration = class extends TemplateCheckWithVisitor {
|
|
|
3607
3619
|
if (mainRef && preRef && mainRef === preRef) {
|
|
3608
3620
|
const kindName = main.constructor.name.replace("DeferredTrigger", "").toLowerCase();
|
|
3609
3621
|
const msg = `Prefetch '${kindName}' matches the main trigger and provides no benefit. Remove the prefetch modifier.`;
|
|
3610
|
-
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3622
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, formatExtendedError(ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, msg)));
|
|
3611
3623
|
}
|
|
3612
3624
|
continue;
|
|
3613
3625
|
}
|
|
3614
3626
|
if (main.constructor === pre.constructor && !(main instanceof TmplAstTimerDeferredTrigger)) {
|
|
3615
3627
|
const kind = main instanceof TmplAstImmediateDeferredTrigger ? "immediate" : main.constructor.name.replace("DeferredTrigger", "").toLowerCase();
|
|
3616
3628
|
const msg = `Prefetch '${kind}' matches the main trigger and provides no benefit. Remove the prefetch modifier.`;
|
|
3617
|
-
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3629
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, formatExtendedError(ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, msg)));
|
|
3618
3630
|
}
|
|
3619
3631
|
}
|
|
3620
3632
|
}
|
|
@@ -4480,7 +4492,7 @@ var NgCompiler = class _NgCompiler {
|
|
|
4480
4492
|
}
|
|
4481
4493
|
const defaultImportTracker = new DefaultImportTracker();
|
|
4482
4494
|
const before = [
|
|
4483
|
-
ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly),
|
|
4495
|
+
ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly, compilation.refEmitter, !!this.options["_experimentalEmitIntermediateTs"]),
|
|
4484
4496
|
aliasTransformFactory(compilation.traitCompiler.exportStatements),
|
|
4485
4497
|
defaultImportTracker.importPreservingTransformer()
|
|
4486
4498
|
];
|
|
@@ -4918,7 +4930,7 @@ var NgCompiler = class _NgCompiler {
|
|
|
4918
4930
|
new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
4919
4931
|
new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, exportedProviderStatusResolver, semanticDepGraphUpdater, isCore, refEmitter, this.closureCompilerEnabled, this.options.onlyPublishPublicTypingsForNgModules ?? false, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, supportJitMode, compilationMode, localCompilationExtraImportsTracker, jitDeclarationRegistry, this.emitDeclarationOnly)
|
|
4920
4932
|
];
|
|
4921
|
-
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly);
|
|
4933
|
+
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly, !!this.options["_experimentalEmitIntermediateTs"]);
|
|
4922
4934
|
const notifyingDriver = new NotifyingProgramDriverWrapper(this.programDriver, (program) => {
|
|
4923
4935
|
this.incrementalStrategy.setIncrementalState(this.incrementalCompilation.state, program);
|
|
4924
4936
|
this.currentProgram = program;
|
|
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
|
|
|
455
455
|
// packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
|
|
456
456
|
import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
|
|
457
457
|
import semver from "semver";
|
|
458
|
-
var PLACEHOLDER_VERSION = "21.1.
|
|
458
|
+
var PLACEHOLDER_VERSION = "21.1.6";
|
|
459
459
|
function wrapReference(wrapped) {
|
|
460
460
|
return { value: wrapped, type: wrapped };
|
|
461
461
|
}
|
package/bundles/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isTsDiagnostic,
|
|
18
18
|
performCompilation,
|
|
19
19
|
readConfiguration
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-7XABP3IF.js";
|
|
21
21
|
import {
|
|
22
22
|
ConsoleLogger,
|
|
23
23
|
LogLevel
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
freshCompilationTicket,
|
|
35
35
|
incrementalFromStateTicket,
|
|
36
36
|
isDocEntryWithSourceInfo
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-E2YMRKVR.js";
|
|
38
38
|
import {
|
|
39
39
|
ActivePerfRecorder,
|
|
40
40
|
ErrorCode,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
getInitializerApiJitTransform,
|
|
47
47
|
isLocalCompilationDiagnostics,
|
|
48
48
|
ngErrorCode
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-622FKITK.js";
|
|
50
50
|
import "./chunk-FROPOOFC.js";
|
|
51
51
|
import {
|
|
52
52
|
InvalidFileSystem,
|
|
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
|
|
|
77
77
|
|
|
78
78
|
// packages/compiler-cli/src/version.js
|
|
79
79
|
import { Version } from "@angular/compiler";
|
|
80
|
-
var VERSION = new Version("21.1.
|
|
80
|
+
var VERSION = new Version("21.1.6");
|
|
81
81
|
|
|
82
82
|
// packages/compiler-cli/private/tooling.js
|
|
83
83
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
DiagnosticCategoryLabel,
|
|
7
7
|
NgCompiler
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-E2YMRKVR.js";
|
|
9
9
|
import {
|
|
10
10
|
CompilationMode,
|
|
11
11
|
DtsMetadataReader,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
queryDecoratorNames,
|
|
33
33
|
reflectObjectLiteral,
|
|
34
34
|
unwrapExpression
|
|
35
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-622FKITK.js";
|
|
36
36
|
import "../chunk-FROPOOFC.js";
|
|
37
37
|
import {
|
|
38
38
|
getFileSystem,
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
import {
|
|
7
7
|
main,
|
|
8
8
|
readCommandLineAndConfiguration
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-73D7RRZJ.js";
|
|
10
10
|
import {
|
|
11
11
|
EmitFlags
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-7XABP3IF.js";
|
|
13
|
+
import "../../chunk-E2YMRKVR.js";
|
|
14
|
+
import "../../chunk-622FKITK.js";
|
|
15
15
|
import "../../chunk-FROPOOFC.js";
|
|
16
16
|
import {
|
|
17
17
|
setFileSystem
|
package/bundles/src/bin/ngc.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
main
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-73D7RRZJ.js";
|
|
9
|
+
import "../../chunk-7XABP3IF.js";
|
|
10
|
+
import "../../chunk-E2YMRKVR.js";
|
|
11
|
+
import "../../chunk-622FKITK.js";
|
|
12
12
|
import "../../chunk-FROPOOFC.js";
|
|
13
13
|
import {
|
|
14
14
|
setFileSystem
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
|
|
9
9
|
import { AstObject, AstValue } from '../../ast/ast_value';
|
|
10
|
-
export declare const PLACEHOLDER_VERSION = "21.1.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "21.1.6";
|
|
11
11
|
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
|
|
12
12
|
/**
|
|
13
13
|
* Parses the value of an enum from the AST value's symbol name.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/compiler-cli",
|
|
3
|
-
"version": "21.1.
|
|
3
|
+
"version": "21.1.6",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"typescript": "5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@angular/compiler": "21.1.
|
|
46
|
+
"@angular/compiler": "21.1.6",
|
|
47
47
|
"typescript": ">=5.9 <6.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import ts from 'typescript';
|
|
9
|
+
import { NgCompiler } from './core';
|
|
10
|
+
import { NgCompilerOptions } from './core/api';
|
|
11
|
+
/**
|
|
12
|
+
* A driver for the Angular Compiler that performs "Source-to-Source" transformation.
|
|
13
|
+
*
|
|
14
|
+
* Unlike `NgtscProgram`, this driver does NOT use `program.emit()`. Instead, it:
|
|
15
|
+
* 1. Analyzes the program using `NgCompiler`.
|
|
16
|
+
* 2. Manually runs `ts.transform` with Angular's Ivy transformers.
|
|
17
|
+
* 3. Prints the transformed AST back to a TypeScript string.
|
|
18
|
+
*
|
|
19
|
+
* This mode is designed for a mode where the Angular Compiler
|
|
20
|
+
* acts as a pre-processor for a downstream TypeScript compiler.
|
|
21
|
+
*/
|
|
22
|
+
export declare class NgtscIsolatedPreprocessor {
|
|
23
|
+
private options;
|
|
24
|
+
readonly compiler: NgCompiler;
|
|
25
|
+
private tsProgram;
|
|
26
|
+
private host;
|
|
27
|
+
private incrementalStrategy;
|
|
28
|
+
constructor(rootNames: ReadonlyArray<string>, options: NgCompilerOptions, delegateHost: ts.CompilerHost, oldProgram?: NgtscIsolatedPreprocessor);
|
|
29
|
+
transformAndPrint(): {
|
|
30
|
+
fileName: string;
|
|
31
|
+
content: string;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
@@ -66,6 +66,7 @@ export declare class TraitCompiler implements ProgramTypeCheckAdapter {
|
|
|
66
66
|
private semanticDepGraphUpdater;
|
|
67
67
|
private sourceFileTypeIdentifier;
|
|
68
68
|
private emitDeclarationOnly;
|
|
69
|
+
private emitIntermediateTs;
|
|
69
70
|
/**
|
|
70
71
|
* Maps class declarations to their `ClassRecord`, which tracks the Ivy traits being applied to
|
|
71
72
|
* those classes.
|
|
@@ -83,7 +84,7 @@ export declare class TraitCompiler implements ProgramTypeCheckAdapter {
|
|
|
83
84
|
private filesWithoutTraits;
|
|
84
85
|
private reexportMap;
|
|
85
86
|
private handlersByName;
|
|
86
|
-
constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], reflector: ReflectionHost, perf: PerfRecorder, incrementalBuild: IncrementalBuild<ClassRecord, unknown>, compileNonExportedClasses: boolean, compilationMode: CompilationMode, dtsTransforms: DtsTransformRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, sourceFileTypeIdentifier: SourceFileTypeIdentifier, emitDeclarationOnly: boolean);
|
|
87
|
+
constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], reflector: ReflectionHost, perf: PerfRecorder, incrementalBuild: IncrementalBuild<ClassRecord, unknown>, compileNonExportedClasses: boolean, compilationMode: CompilationMode, dtsTransforms: DtsTransformRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, sourceFileTypeIdentifier: SourceFileTypeIdentifier, emitDeclarationOnly: boolean, emitIntermediateTs: boolean);
|
|
87
88
|
analyzeSync(sf: ts.SourceFile): void;
|
|
88
89
|
analyzeAsync(sf: ts.SourceFile): Promise<void> | undefined;
|
|
89
90
|
private analyze;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
|
-
import { DefaultImportTracker, ImportRewriter, LocalCompilationExtraImportsTracker } from '../../imports';
|
|
9
|
+
import { DefaultImportTracker, ImportRewriter, LocalCompilationExtraImportsTracker, ReferenceEmitter } from '../../imports';
|
|
10
10
|
import { PerfRecorder } from '../../perf';
|
|
11
11
|
import { ReflectionHost } from '../../reflection';
|
|
12
12
|
import { TraitCompiler } from './compilation';
|
|
13
|
-
export declare function ivyTransformFactory(compilation: TraitCompiler, reflector: ReflectionHost, importRewriter: ImportRewriter, defaultImportTracker: DefaultImportTracker, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, perf: PerfRecorder, isCore: boolean, isClosureCompilerEnabled: boolean, emitDeclarationOnly: boolean): ts.TransformerFactory<ts.SourceFile>;
|
|
13
|
+
export declare function ivyTransformFactory(compilation: TraitCompiler, reflector: ReflectionHost, importRewriter: ImportRewriter, defaultImportTracker: DefaultImportTracker, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, perf: PerfRecorder, isCore: boolean, isClosureCompilerEnabled: boolean, emitDeclarationOnly: boolean, refEmitter: ReferenceEmitter | null, enableTypeReification: boolean): ts.TransformerFactory<ts.SourceFile>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { ErrorCode } from '../../../diagnostics';
|
|
9
|
+
/**
|
|
10
|
+
* Base URL for the extended error details page.
|
|
11
|
+
*
|
|
12
|
+
* Keep the files below in full sync:
|
|
13
|
+
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
|
|
14
|
+
* - packages/core/src/error_details_base_url.ts
|
|
15
|
+
*/
|
|
16
|
+
export declare const EXTENDED_ERROR_DETAILS_PAGE_BASE_URL: string;
|
|
17
|
+
export declare function formatExtendedError(code: ErrorCode, message: null | false | string): string;
|
|
@@ -32,6 +32,21 @@ export declare class TcbExpressionOp extends TcbOp {
|
|
|
32
32
|
get optional(): boolean;
|
|
33
33
|
execute(): null;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* A `TcbOp` which renders an Angular expression inside a conditional context.
|
|
37
|
+
* This is used for `@defer` triggers (`when`, `prefetch when`, `hydrate when`)
|
|
38
|
+
* to enable TypeScript's TS2774 diagnostic for uninvoked functions/signals.
|
|
39
|
+
*
|
|
40
|
+
* Executing this operation returns nothing.
|
|
41
|
+
*/
|
|
42
|
+
export declare class TcbConditionOp extends TcbOp {
|
|
43
|
+
private tcb;
|
|
44
|
+
private scope;
|
|
45
|
+
private expression;
|
|
46
|
+
constructor(tcb: Context, scope: Scope, expression: AST);
|
|
47
|
+
get optional(): boolean;
|
|
48
|
+
execute(): null;
|
|
49
|
+
}
|
|
35
50
|
export declare class TcbExpressionTranslator {
|
|
36
51
|
protected tcb: Context;
|
|
37
52
|
protected scope: Scope;
|