@angular/compiler-cli 21.2.0-next.3 → 21.2.0-rc.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-FLWAEX6T.js +1 -1
- package/bundles/{chunk-TAXP3SCS.js → chunk-IQF227JC.js} +36 -17
- package/bundles/{chunk-RBFYX33W.js → chunk-NO3TCVXN.js} +3 -3
- package/bundles/{chunk-PT6VYMWK.js → chunk-OXTYPMKB.js} +1 -1
- package/bundles/{chunk-REXDVAT6.js → chunk-YMCUV3OT.js} +6 -8
- 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 +3 -3
- 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/src/ops/signal_forms.d.ts +1 -1
- package/src/ngtsc/typecheck/src/ops/switch_block.d.ts +1 -1
|
@@ -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.2.0-
|
|
458
|
+
var PLACEHOLDER_VERSION = "21.2.0-rc.0";
|
|
459
459
|
function wrapReference(wrapped) {
|
|
460
460
|
return { value: wrapped, type: wrapped };
|
|
461
461
|
}
|
|
@@ -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.2.0-
|
|
232
|
+
const isPreRelease = full.includes("-next") || full.includes("-rc") || full === "21.2.0-rc.0";
|
|
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;
|
|
@@ -6006,6 +6006,7 @@ var TraitCompiler = class {
|
|
|
6006
6006
|
semanticDepGraphUpdater;
|
|
6007
6007
|
sourceFileTypeIdentifier;
|
|
6008
6008
|
emitDeclarationOnly;
|
|
6009
|
+
emitIntermediateTs;
|
|
6009
6010
|
/**
|
|
6010
6011
|
* Maps class declarations to their `ClassRecord`, which tracks the Ivy traits being applied to
|
|
6011
6012
|
* those classes.
|
|
@@ -6023,7 +6024,7 @@ var TraitCompiler = class {
|
|
|
6023
6024
|
filesWithoutTraits = /* @__PURE__ */ new Set();
|
|
6024
6025
|
reexportMap = /* @__PURE__ */ new Map();
|
|
6025
6026
|
handlersByName = /* @__PURE__ */ new Map();
|
|
6026
|
-
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly) {
|
|
6027
|
+
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly, emitIntermediateTs) {
|
|
6027
6028
|
this.handlers = handlers;
|
|
6028
6029
|
this.reflector = reflector;
|
|
6029
6030
|
this.perf = perf;
|
|
@@ -6034,6 +6035,7 @@ var TraitCompiler = class {
|
|
|
6034
6035
|
this.semanticDepGraphUpdater = semanticDepGraphUpdater;
|
|
6035
6036
|
this.sourceFileTypeIdentifier = sourceFileTypeIdentifier;
|
|
6036
6037
|
this.emitDeclarationOnly = emitDeclarationOnly;
|
|
6038
|
+
this.emitIntermediateTs = emitIntermediateTs;
|
|
6037
6039
|
for (const handler of handlers) {
|
|
6038
6040
|
this.handlersByName.set(handler.name, handler);
|
|
6039
6041
|
}
|
|
@@ -6708,11 +6710,11 @@ var Visitor = class {
|
|
|
6708
6710
|
// packages/compiler-cli/src/ngtsc/transform/src/transform.js
|
|
6709
6711
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
6710
6712
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
6711
|
-
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly) {
|
|
6713
|
+
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification) {
|
|
6712
6714
|
const recordWrappedNode = createRecorderFn(defaultImportTracker);
|
|
6713
6715
|
return (context) => {
|
|
6714
6716
|
return (file) => {
|
|
6715
|
-
return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode));
|
|
6717
|
+
return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode));
|
|
6716
6718
|
};
|
|
6717
6719
|
};
|
|
6718
6720
|
}
|
|
@@ -6748,7 +6750,9 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6748
6750
|
isClosureCompilerEnabled;
|
|
6749
6751
|
isCore;
|
|
6750
6752
|
deferrableImports;
|
|
6751
|
-
|
|
6753
|
+
refEmitter;
|
|
6754
|
+
enableTypeReification;
|
|
6755
|
+
constructor(compilation, classCompilationMap, reflector, importManager, recordWrappedNodeExpr, isClosureCompilerEnabled, isCore, deferrableImports, refEmitter, enableTypeReification) {
|
|
6752
6756
|
super();
|
|
6753
6757
|
this.compilation = compilation;
|
|
6754
6758
|
this.classCompilationMap = classCompilationMap;
|
|
@@ -6758,6 +6762,8 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6758
6762
|
this.isClosureCompilerEnabled = isClosureCompilerEnabled;
|
|
6759
6763
|
this.isCore = isCore;
|
|
6760
6764
|
this.deferrableImports = deferrableImports;
|
|
6765
|
+
this.refEmitter = refEmitter;
|
|
6766
|
+
this.enableTypeReification = enableTypeReification;
|
|
6761
6767
|
}
|
|
6762
6768
|
visitClassDeclaration(node) {
|
|
6763
6769
|
const original = ts31.getOriginalNode(node, ts31.isClassDeclaration);
|
|
@@ -6777,7 +6783,11 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6777
6783
|
continue;
|
|
6778
6784
|
}
|
|
6779
6785
|
const exprNode = translateExpression(sourceFile, field.initializer, this.importManager, translateOptions);
|
|
6780
|
-
|
|
6786
|
+
let typeNode = void 0;
|
|
6787
|
+
if (this.enableTypeReification && this.refEmitter !== null) {
|
|
6788
|
+
typeNode = translateType(field.type, sourceFile, this.reflector, this.refEmitter, this.importManager);
|
|
6789
|
+
}
|
|
6790
|
+
const property = ts31.factory.createPropertyDeclaration([ts31.factory.createToken(ts31.SyntaxKind.StaticKeyword)], field.name, void 0, typeNode, exprNode);
|
|
6781
6791
|
if (this.isClosureCompilerEnabled) {
|
|
6782
6792
|
ts31.addSyntheticLeadingComment(
|
|
6783
6793
|
property,
|
|
@@ -6876,7 +6886,7 @@ var IvyTransformationVisitor = class extends Visitor {
|
|
|
6876
6886
|
return node;
|
|
6877
6887
|
}
|
|
6878
6888
|
};
|
|
6879
|
-
function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode) {
|
|
6889
|
+
function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode) {
|
|
6880
6890
|
const constantPool = new ConstantPool(isClosureCompilerEnabled);
|
|
6881
6891
|
const importManager = new ImportManager({
|
|
6882
6892
|
...presetImportManagerForceNamespaceImports,
|
|
@@ -6887,7 +6897,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
|
|
|
6887
6897
|
if (emitDeclarationOnly) {
|
|
6888
6898
|
return file;
|
|
6889
6899
|
}
|
|
6890
|
-
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports);
|
|
6900
|
+
const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports, refEmitter, enableTypeReification);
|
|
6891
6901
|
let sf = visit(file, transformationVisitor, context);
|
|
6892
6902
|
const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts31.ScriptTarget.ES2015;
|
|
6893
6903
|
const constants = constantPool.statements.map((stmt) => translateStatement(file, stmt, importManager, {
|
|
@@ -10784,7 +10794,7 @@ var SelectorlessComponentScopeReader = class {
|
|
|
10784
10794
|
result.set(stmt.name.text, stmt.name);
|
|
10785
10795
|
continue;
|
|
10786
10796
|
}
|
|
10787
|
-
if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !stmt.importClause.
|
|
10797
|
+
if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !(stmt.importClause.phaseModifier === ts46.SyntaxKind.TypeKeyword)) {
|
|
10788
10798
|
const clause = stmt.importClause;
|
|
10789
10799
|
if (clause.namedBindings !== void 0 && ts46.isNamedImports(clause.namedBindings)) {
|
|
10790
10800
|
for (const element of clause.namedBindings.elements) {
|
|
@@ -15105,6 +15115,14 @@ var TcbSwitchOp = class extends TcbOp {
|
|
|
15105
15115
|
return switchCase.expression === null ? ts70.factory.createDefaultClause(statementsForCase) : ts70.factory.createCaseClause(tcbExpression(switchCase.expression, this.tcb, this.scope), statementsForCase);
|
|
15106
15116
|
});
|
|
15107
15117
|
});
|
|
15118
|
+
if (this.block.exhaustiveCheck) {
|
|
15119
|
+
const switchValue = tcbExpression(this.block.expression, this.tcb, this.scope);
|
|
15120
|
+
clauses.push(ts70.factory.createDefaultClause([
|
|
15121
|
+
ts70.factory.createVariableStatement(void 0, ts70.factory.createVariableDeclarationList([
|
|
15122
|
+
ts70.factory.createVariableDeclaration(ts70.factory.createUniqueName("tcbExhaustive"), void 0, ts70.factory.createKeywordTypeNode(ts70.SyntaxKind.NeverKeyword), switchValue)
|
|
15123
|
+
], ts70.NodeFlags.Const))
|
|
15124
|
+
]));
|
|
15125
|
+
}
|
|
15108
15126
|
this.scope.addStatement(ts70.factory.createSwitchStatement(switchExpression, ts70.factory.createCaseBlock(clauses)));
|
|
15109
15127
|
return null;
|
|
15110
15128
|
}
|
|
@@ -15330,7 +15348,8 @@ var TcbNativeFieldOp = class extends TcbOp {
|
|
|
15330
15348
|
case "datetime-local":
|
|
15331
15349
|
return ts73.factory.createUnionTypeNode([
|
|
15332
15350
|
ts73.factory.createKeywordTypeNode(ts73.SyntaxKind.StringKeyword),
|
|
15333
|
-
ts73.factory.createKeywordTypeNode(ts73.SyntaxKind.NumberKeyword)
|
|
15351
|
+
ts73.factory.createKeywordTypeNode(ts73.SyntaxKind.NumberKeyword),
|
|
15352
|
+
ts73.factory.createLiteralTypeNode(ts73.factory.createNull())
|
|
15334
15353
|
]);
|
|
15335
15354
|
case "date":
|
|
15336
15355
|
case "month":
|
|
@@ -20742,7 +20761,7 @@ function getTopLevelDeclarationNames(sourceFile) {
|
|
|
20742
20761
|
}
|
|
20743
20762
|
if (ts91.isImportDeclaration(node) && node.importClause) {
|
|
20744
20763
|
const importClause = node.importClause;
|
|
20745
|
-
if (importClause.
|
|
20764
|
+
if (importClause.phaseModifier === ts91.SyntaxKind.TypeKeyword) {
|
|
20746
20765
|
continue;
|
|
20747
20766
|
}
|
|
20748
20767
|
if (importClause.name) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TrackedIncrementalBuildStrategy,
|
|
9
9
|
freshCompilationTicket,
|
|
10
10
|
incrementalFromCompilerTicket
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YMCUV3OT.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-IQF227JC.js";
|
|
22
22
|
import {
|
|
23
23
|
absoluteFrom,
|
|
24
24
|
createFileSystemTsReadDirectoryFn,
|
|
@@ -149,7 +149,7 @@ function compareVersions(v1, v2) {
|
|
|
149
149
|
|
|
150
150
|
// packages/compiler-cli/src/typescript_support.js
|
|
151
151
|
var MIN_TS_VERSION = "5.9.0";
|
|
152
|
-
var MAX_TS_VERSION = "6.
|
|
152
|
+
var MAX_TS_VERSION = "6.1.0";
|
|
153
153
|
var tsVersion = ts2.version;
|
|
154
154
|
function checkVersion(version, minVersion, maxVersion) {
|
|
155
155
|
if (compareVersions(version, minVersion) < 0 || compareVersions(version, maxVersion) >= 0) {
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
toUnredirectedSourceFile,
|
|
89
89
|
tryParseInitializerApi,
|
|
90
90
|
untagAllTsFiles
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-IQF227JC.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)) {
|
|
@@ -4484,7 +4482,7 @@ var NgCompiler = class _NgCompiler {
|
|
|
4484
4482
|
}
|
|
4485
4483
|
const defaultImportTracker = new DefaultImportTracker();
|
|
4486
4484
|
const before = [
|
|
4487
|
-
ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly),
|
|
4485
|
+
ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly, compilation.refEmitter, !!this.options["_experimentalEmitIntermediateTs"]),
|
|
4488
4486
|
aliasTransformFactory(compilation.traitCompiler.exportStatements),
|
|
4489
4487
|
defaultImportTracker.importPreservingTransformer()
|
|
4490
4488
|
];
|
|
@@ -4922,7 +4920,7 @@ var NgCompiler = class _NgCompiler {
|
|
|
4922
4920
|
new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
4923
4921
|
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)
|
|
4924
4922
|
];
|
|
4925
|
-
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly);
|
|
4923
|
+
const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly, !!this.options["_experimentalEmitIntermediateTs"]);
|
|
4926
4924
|
const notifyingDriver = new NotifyingProgramDriverWrapper(this.programDriver, (program) => {
|
|
4927
4925
|
this.incrementalStrategy.setIncrementalState(this.incrementalCompilation.state, program);
|
|
4928
4926
|
this.currentProgram = program;
|
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-NO3TCVXN.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-YMCUV3OT.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-IQF227JC.js";
|
|
50
50
|
import "./chunk-CSUVPNMK.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.2.0-
|
|
80
|
+
var VERSION = new Version("21.2.0-rc.0");
|
|
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-YMCUV3OT.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-IQF227JC.js";
|
|
36
36
|
import "../chunk-CSUVPNMK.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-OXTYPMKB.js";
|
|
10
10
|
import {
|
|
11
11
|
EmitFlags
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-NO3TCVXN.js";
|
|
13
|
+
import "../../chunk-YMCUV3OT.js";
|
|
14
|
+
import "../../chunk-IQF227JC.js";
|
|
15
15
|
import "../../chunk-CSUVPNMK.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-OXTYPMKB.js";
|
|
9
|
+
import "../../chunk-NO3TCVXN.js";
|
|
10
|
+
import "../../chunk-YMCUV3OT.js";
|
|
11
|
+
import "../../chunk-IQF227JC.js";
|
|
12
12
|
import "../../chunk-CSUVPNMK.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.2.0-
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "21.2.0-rc.0";
|
|
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.2.0-
|
|
3
|
+
"version": "21.2.0-rc.0",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"typescript": "5.9.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@angular/compiler": "21.2.0-
|
|
47
|
-
"typescript": ">=5.9 <6.
|
|
46
|
+
"@angular/compiler": "21.2.0-rc.0",
|
|
47
|
+
"typescript": ">=5.9 <6.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"typescript": {
|
|
@@ -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>;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { TmplAstSwitchBlock } from '@angular/compiler';
|
|
9
9
|
import { TcbOp } from './base';
|
|
10
|
-
import type { Scope } from './scope';
|
|
11
10
|
import type { Context } from './context';
|
|
11
|
+
import type { Scope } from './scope';
|
|
12
12
|
/**
|
|
13
13
|
* A `TcbOp` which renders a `switch` block as a TypeScript `switch` statement.
|
|
14
14
|
*
|