@angular/compiler-cli 21.0.0-rc.0 → 21.0.0-rc.1
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-ZOZ6XVF3.js → chunk-5UJIUEKT.js} +220 -121
- package/bundles/{chunk-ZOLVJRLX.js → chunk-DBAV4W4V.js} +2 -2
- package/bundles/chunk-DT6FD4OE.js +1 -1
- package/bundles/{chunk-3CWKYDQ7.js → chunk-VBBJY6IR.js} +235 -20
- package/bundles/{chunk-HSIRUBJU.js → chunk-YVYYMXOI.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/diagnostics/src/error_code.d.ts +2 -0
- package/src/ngtsc/docs/src/entities.d.ts +7 -1
- package/src/ngtsc/docs/src/extractor.d.ts +6 -0
- package/src/ngtsc/docs/src/namespace_extractor.d.ts +15 -0
- package/src/ngtsc/docs/src/variable_extractor.d.ts +16 -0
- package/src/ngtsc/translator/src/translator.d.ts +1 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +5 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TrackedIncrementalBuildStrategy,
|
|
9
9
|
freshCompilationTicket,
|
|
10
10
|
incrementalFromCompilerTicket
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5UJIUEKT.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-VBBJY6IR.js";
|
|
22
22
|
import {
|
|
23
23
|
absoluteFrom,
|
|
24
24
|
createFileSystemTsReadDirectoryFn,
|
|
@@ -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.0.0-rc.
|
|
458
|
+
var PLACEHOLDER_VERSION = "21.0.0-rc.1";
|
|
459
459
|
function wrapReference(wrapped) {
|
|
460
460
|
return { value: wrapped, type: wrapped };
|
|
461
461
|
}
|
|
@@ -104,6 +104,7 @@ var ErrorCode;
|
|
|
104
104
|
ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER"] = 8019] = "DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER";
|
|
105
105
|
ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER"] = 8020] = "DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER";
|
|
106
106
|
ErrorCode2[ErrorCode2["DEFER_TRIGGER_MISCONFIGURATION"] = 8021] = "DEFER_TRIGGER_MISCONFIGURATION";
|
|
107
|
+
ErrorCode2[ErrorCode2["FORM_FIELD_UNSUPPORTED_BINDING"] = 8022] = "FORM_FIELD_UNSUPPORTED_BINDING";
|
|
107
108
|
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
108
109
|
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
109
110
|
ErrorCode2[ErrorCode2["MISSING_CONTROL_FLOW_DIRECTIVE"] = 8103] = "MISSING_CONTROL_FLOW_DIRECTIVE";
|
|
@@ -13686,7 +13687,7 @@ var Environment = class extends ReferenceEmitEnvironment {
|
|
|
13686
13687
|
};
|
|
13687
13688
|
|
|
13688
13689
|
// packages/compiler-cli/src/ngtsc/typecheck/src/oob.js
|
|
13689
|
-
import { AbsoluteSourceSpan as AbsoluteSourceSpan3, TmplAstBoundEvent as TmplAstBoundEvent2, TmplAstComponent, TmplAstDirective, TmplAstElement } from "@angular/compiler";
|
|
13690
|
+
import { AbsoluteSourceSpan as AbsoluteSourceSpan3, TmplAstBoundAttribute as TmplAstBoundAttribute2, TmplAstBoundEvent as TmplAstBoundEvent2, TmplAstComponent, TmplAstDirective, TmplAstElement, ParseSourceSpan as ParseSourceSpan2, BindingType as BindingType2 } from "@angular/compiler";
|
|
13690
13691
|
import ts58 from "typescript";
|
|
13691
13692
|
var OutOfBandDiagnosticRecorderImpl = class {
|
|
13692
13693
|
resolver;
|
|
@@ -13854,7 +13855,23 @@ Consider enabling the 'strictTemplates' option in your tsconfig.json for better
|
|
|
13854
13855
|
}
|
|
13855
13856
|
missingRequiredInputs(id, element, directiveName, isComponent, inputAliases) {
|
|
13856
13857
|
const message = `Required input${inputAliases.length === 1 ? "" : "s"} ${inputAliases.map((n2) => `'${n2}'`).join(", ")} from ${isComponent ? "component" : "directive"} ${directiveName} must be specified.`;
|
|
13857
|
-
|
|
13858
|
+
let span;
|
|
13859
|
+
let name;
|
|
13860
|
+
if (element instanceof TmplAstElement || element instanceof TmplAstDirective) {
|
|
13861
|
+
name = element.name;
|
|
13862
|
+
} else if (element instanceof TmplAstComponent) {
|
|
13863
|
+
name = element.componentName;
|
|
13864
|
+
} else {
|
|
13865
|
+
name = null;
|
|
13866
|
+
}
|
|
13867
|
+
if (name === null) {
|
|
13868
|
+
span = element.startSourceSpan;
|
|
13869
|
+
} else {
|
|
13870
|
+
const start = element.startSourceSpan.start.moveBy(1);
|
|
13871
|
+
const end = element.startSourceSpan.end.moveBy(start.offset + name.length - element.startSourceSpan.end.offset);
|
|
13872
|
+
span = new ParseSourceSpan2(start, end);
|
|
13873
|
+
}
|
|
13874
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), span, ts58.DiagnosticCategory.Error, ngErrorCode(ErrorCode.MISSING_REQUIRED_INPUTS), message));
|
|
13858
13875
|
}
|
|
13859
13876
|
illegalForLoopTrackAccess(id, block, access) {
|
|
13860
13877
|
const sourceSpan = this.resolver.toTemplateParseSourceSpan(id, access.sourceSpan);
|
|
@@ -13934,6 +13951,23 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
|
|
|
13934
13951
|
deferImplicitTriggerInvalidPlaceholder(id, trigger) {
|
|
13935
13952
|
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts58.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER), "Trigger with no target can only be placed on an @defer that has a @placeholder block with exactly one root element node"));
|
|
13936
13953
|
}
|
|
13954
|
+
formFieldUnsupportedBinding(id, node) {
|
|
13955
|
+
let message;
|
|
13956
|
+
if (node instanceof TmplAstBoundAttribute2) {
|
|
13957
|
+
let name;
|
|
13958
|
+
if (node.type === BindingType2.Property) {
|
|
13959
|
+
name = `[${node.name}]`;
|
|
13960
|
+
} else if (node.type === BindingType2.Attribute) {
|
|
13961
|
+
name = `[attr.${node.name}]`;
|
|
13962
|
+
} else {
|
|
13963
|
+
name = node.name;
|
|
13964
|
+
}
|
|
13965
|
+
message = `Binding to '${name}' is not allowed on nodes using the '[field]' directive`;
|
|
13966
|
+
} else {
|
|
13967
|
+
message = `Setting the '${node.name}' attribute is not allowed on nodes using the '[field]' directive`;
|
|
13968
|
+
}
|
|
13969
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), node.sourceSpan, ts58.DiagnosticCategory.Error, ngErrorCode(ErrorCode.FORM_FIELD_UNSUPPORTED_BINDING), message));
|
|
13970
|
+
}
|
|
13937
13971
|
};
|
|
13938
13972
|
function makeInlineDiagnostic(id, code, node, messageText, relatedInformation) {
|
|
13939
13973
|
return {
|
|
@@ -13960,7 +13994,7 @@ var TypeCheckShimGenerator = class {
|
|
|
13960
13994
|
};
|
|
13961
13995
|
|
|
13962
13996
|
// packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.js
|
|
13963
|
-
import { BindingPipe, BindingType as
|
|
13997
|
+
import { BindingPipe, BindingType as BindingType3, Call as Call3, createCssSelectorFromNode, CssSelector as CssSelector3, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, ParsedEventType as ParsedEventType2, PropertyRead as PropertyRead4, R3Identifiers as R3Identifiers4, SafeCall as SafeCall2, SafePropertyRead as SafePropertyRead3, SelectorMatcher as SelectorMatcher2, ThisReceiver as ThisReceiver2, TmplAstBoundAttribute as TmplAstBoundAttribute3, TmplAstBoundText, TmplAstContent, TmplAstDeferredBlock, TmplAstElement as TmplAstElement2, TmplAstForLoopBlock, TmplAstIcu, TmplAstIfBlock, TmplAstIfBlockBranch, TmplAstLetDeclaration as TmplAstLetDeclaration2, TmplAstReference as TmplAstReference2, TmplAstSwitchBlock, TmplAstTemplate, TmplAstText, TmplAstTextAttribute as TmplAstTextAttribute2, TmplAstVariable, TmplAstHostElement as TmplAstHostElement2, TransplantedType, TmplAstComponent as TmplAstComponent2, TmplAstDirective as TmplAstDirective2, Binary } from "@angular/compiler";
|
|
13964
13998
|
import ts62 from "typescript";
|
|
13965
13999
|
|
|
13966
14000
|
// packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.js
|
|
@@ -14649,7 +14683,7 @@ var TcbTemplateBodyOp = class extends TcbOp {
|
|
|
14649
14683
|
const dirId = this.tcb.env.reference(dir.ref);
|
|
14650
14684
|
dir.ngTemplateGuards.forEach((guard) => {
|
|
14651
14685
|
const boundInput = hostNode.inputs.find((i) => i.name === guard.inputName) || (isTemplate ? hostNode.templateAttrs.find((input) => {
|
|
14652
|
-
return input instanceof
|
|
14686
|
+
return input instanceof TmplAstBoundAttribute3 && input.name === guard.inputName;
|
|
14653
14687
|
}) : void 0);
|
|
14654
14688
|
if (boundInput !== void 0) {
|
|
14655
14689
|
const expr = tcbExpression(boundInput.value, this.tcb, this.scope);
|
|
@@ -14762,6 +14796,168 @@ var TcbGenericDirectiveTypeWithAnyParamsOp = class extends TcbDirectiveTypeOpBas
|
|
|
14762
14796
|
return super.execute();
|
|
14763
14797
|
}
|
|
14764
14798
|
};
|
|
14799
|
+
var TcbFieldDirectiveTypeBaseOp = class extends TcbOp {
|
|
14800
|
+
tcb;
|
|
14801
|
+
scope;
|
|
14802
|
+
node;
|
|
14803
|
+
dir;
|
|
14804
|
+
/** Bindings that aren't supported on signal form fields. */
|
|
14805
|
+
unsupportedBindingFields;
|
|
14806
|
+
constructor(tcb, scope, node, dir) {
|
|
14807
|
+
super();
|
|
14808
|
+
this.tcb = tcb;
|
|
14809
|
+
this.scope = scope;
|
|
14810
|
+
this.node = node;
|
|
14811
|
+
this.dir = dir;
|
|
14812
|
+
const commonUnsupportedNames = [
|
|
14813
|
+
"value",
|
|
14814
|
+
"checked",
|
|
14815
|
+
"errors",
|
|
14816
|
+
"invalid",
|
|
14817
|
+
"disabled",
|
|
14818
|
+
"disabledReasons",
|
|
14819
|
+
"name",
|
|
14820
|
+
"readonly",
|
|
14821
|
+
"touched",
|
|
14822
|
+
"max",
|
|
14823
|
+
"maxlength",
|
|
14824
|
+
"maxLength",
|
|
14825
|
+
"min",
|
|
14826
|
+
"minLength",
|
|
14827
|
+
"minlength",
|
|
14828
|
+
"pattern",
|
|
14829
|
+
"required",
|
|
14830
|
+
"type"
|
|
14831
|
+
];
|
|
14832
|
+
this.unsupportedBindingFields = new Set(commonUnsupportedNames);
|
|
14833
|
+
}
|
|
14834
|
+
get optional() {
|
|
14835
|
+
return true;
|
|
14836
|
+
}
|
|
14837
|
+
execute() {
|
|
14838
|
+
const inputs = this.node instanceof TmplAstHostElement2 ? this.node.bindings : this.node.inputs;
|
|
14839
|
+
for (const input of inputs) {
|
|
14840
|
+
if (input.type === BindingType3.Property && this.unsupportedBindingFields.has(input.name)) {
|
|
14841
|
+
this.tcb.oobRecorder.formFieldUnsupportedBinding(this.tcb.id, input);
|
|
14842
|
+
} else if (input.type === BindingType3.Attribute && this.unsupportedBindingFields.has(input.name.toLowerCase())) {
|
|
14843
|
+
this.tcb.oobRecorder.formFieldUnsupportedBinding(this.tcb.id, input);
|
|
14844
|
+
}
|
|
14845
|
+
}
|
|
14846
|
+
if (!(this.node instanceof TmplAstHostElement2)) {
|
|
14847
|
+
for (const attr of this.node.attributes) {
|
|
14848
|
+
const name = attr.name.toLowerCase();
|
|
14849
|
+
if (name !== "type" && this.unsupportedBindingFields.has(name)) {
|
|
14850
|
+
this.tcb.oobRecorder.formFieldUnsupportedBinding(this.tcb.id, attr);
|
|
14851
|
+
}
|
|
14852
|
+
}
|
|
14853
|
+
}
|
|
14854
|
+
const refType = this.tcb.env.referenceType(this.dir.ref);
|
|
14855
|
+
if (!ts62.isTypeReferenceNode(refType)) {
|
|
14856
|
+
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.dir.ref.debugName}`);
|
|
14857
|
+
}
|
|
14858
|
+
const span = this.node instanceof TmplAstHostElement2 ? this.node.sourceSpan : this.node.startSourceSpan || this.node.sourceSpan;
|
|
14859
|
+
const type = ts62.factory.createTypeReferenceNode(refType.typeName, [this.getExpectedType()]);
|
|
14860
|
+
const id = this.tcb.allocateId();
|
|
14861
|
+
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
14862
|
+
addParseSpanInfo(id, span);
|
|
14863
|
+
this.scope.addStatement(tsDeclareVariable(id, type));
|
|
14864
|
+
return id;
|
|
14865
|
+
}
|
|
14866
|
+
};
|
|
14867
|
+
var TcbNativeFieldDirectiveTypeOp = class extends TcbFieldDirectiveTypeBaseOp {
|
|
14868
|
+
getExpectedType() {
|
|
14869
|
+
if (this.node instanceof TmplAstElement2) {
|
|
14870
|
+
return this.getExpectedTypeFromDomNode(this.node);
|
|
14871
|
+
}
|
|
14872
|
+
return this.getUnsupportedType();
|
|
14873
|
+
}
|
|
14874
|
+
getExpectedTypeFromDomNode(node) {
|
|
14875
|
+
if (node.name === "textarea" || node.name === "select") {
|
|
14876
|
+
return ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.StringKeyword);
|
|
14877
|
+
}
|
|
14878
|
+
if (node.name !== "input") {
|
|
14879
|
+
return this.getUnsupportedType();
|
|
14880
|
+
}
|
|
14881
|
+
const inputType = node.attributes.find((attr) => attr.name === "type")?.value;
|
|
14882
|
+
switch (inputType) {
|
|
14883
|
+
case "checkbox":
|
|
14884
|
+
return ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.BooleanKeyword);
|
|
14885
|
+
case "number":
|
|
14886
|
+
case "range":
|
|
14887
|
+
case "datetime-local":
|
|
14888
|
+
return ts62.factory.createUnionTypeNode([
|
|
14889
|
+
ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.StringKeyword),
|
|
14890
|
+
ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.NumberKeyword)
|
|
14891
|
+
]);
|
|
14892
|
+
case "date":
|
|
14893
|
+
case "month":
|
|
14894
|
+
case "time":
|
|
14895
|
+
case "week":
|
|
14896
|
+
return ts62.factory.createUnionTypeNode([
|
|
14897
|
+
ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.StringKeyword),
|
|
14898
|
+
ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.NumberKeyword),
|
|
14899
|
+
ts62.factory.createTypeReferenceNode("Date"),
|
|
14900
|
+
ts62.factory.createLiteralTypeNode(ts62.factory.createNull())
|
|
14901
|
+
]);
|
|
14902
|
+
}
|
|
14903
|
+
return ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.StringKeyword);
|
|
14904
|
+
}
|
|
14905
|
+
getUnsupportedType() {
|
|
14906
|
+
return ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.UnknownKeyword);
|
|
14907
|
+
}
|
|
14908
|
+
};
|
|
14909
|
+
var TcbCustomFieldDirectiveTypeOp = class extends TcbFieldDirectiveTypeBaseOp {
|
|
14910
|
+
customFieldDir;
|
|
14911
|
+
constructor(tcb, scope, node, dir, customFieldDir) {
|
|
14912
|
+
super(tcb, scope, node, dir);
|
|
14913
|
+
this.customFieldDir = customFieldDir;
|
|
14914
|
+
}
|
|
14915
|
+
execute() {
|
|
14916
|
+
const refId = super.execute();
|
|
14917
|
+
this.appendFormFieldConformanceStatements();
|
|
14918
|
+
return refId;
|
|
14919
|
+
}
|
|
14920
|
+
getExpectedType() {
|
|
14921
|
+
const id = R3Identifiers4.ExtractFormControlValue;
|
|
14922
|
+
const extractRef = this.tcb.env.referenceExternalType(id.moduleName, id.name);
|
|
14923
|
+
if (!ts62.isTypeReferenceNode(extractRef)) {
|
|
14924
|
+
throw new Error(`Expected TypeReferenceNode when referencing the type for ${id.name}`);
|
|
14925
|
+
}
|
|
14926
|
+
return ts62.factory.createTypeReferenceNode(extractRef.typeName, [
|
|
14927
|
+
this.getCustomFieldTypeReference()
|
|
14928
|
+
]);
|
|
14929
|
+
}
|
|
14930
|
+
getCustomFieldTypeReference() {
|
|
14931
|
+
const customFieldRef = this.tcb.env.referenceType(this.customFieldDir.meta.ref);
|
|
14932
|
+
if (!ts62.isTypeReferenceNode(customFieldRef)) {
|
|
14933
|
+
throw new Error(`Expected TypeReferenceNode when referencing the type for ${this.customFieldDir.meta.ref.debugName}`);
|
|
14934
|
+
}
|
|
14935
|
+
return customFieldRef;
|
|
14936
|
+
}
|
|
14937
|
+
appendFormFieldConformanceStatements() {
|
|
14938
|
+
let span;
|
|
14939
|
+
if (this.node instanceof TmplAstHostElement2) {
|
|
14940
|
+
span = this.node.sourceSpan;
|
|
14941
|
+
} else {
|
|
14942
|
+
span = this.node.inputs.find((input) => {
|
|
14943
|
+
return input.type === BindingType3.Property && input.name === "field";
|
|
14944
|
+
})?.sourceSpan ?? this.node.startSourceSpan;
|
|
14945
|
+
}
|
|
14946
|
+
const isCheckbox = this.customFieldDir.type === "checkbox";
|
|
14947
|
+
const symbolName = isCheckbox ? "FormCheckboxControl" : "FormValueControl";
|
|
14948
|
+
const targetTypeRef = this.tcb.env.referenceExternalType("@angular/forms/signals", symbolName);
|
|
14949
|
+
if (!ts62.isTypeReferenceNode(targetTypeRef)) {
|
|
14950
|
+
throw new Error(`Expected TypeReferenceNode when referencing the type for ${symbolName}`);
|
|
14951
|
+
}
|
|
14952
|
+
const id = this.tcb.allocateId();
|
|
14953
|
+
const targetType = ts62.factory.createTypeReferenceNode(targetTypeRef.typeName, isCheckbox ? void 0 : [ts62.factory.createKeywordTypeNode(ts62.SyntaxKind.UnknownKeyword)]);
|
|
14954
|
+
this.scope.addStatement(tsDeclareVariable(id, targetType));
|
|
14955
|
+
const controlType = ts62.factory.createAsExpression(ts62.factory.createNonNullExpression(ts62.factory.createNull()), this.getCustomFieldTypeReference());
|
|
14956
|
+
const assignment = ts62.factory.createBinaryExpression(id, ts62.SyntaxKind.EqualsToken, controlType);
|
|
14957
|
+
addParseSpanInfo(assignment, span);
|
|
14958
|
+
this.scope.addStatement(ts62.factory.createIfStatement(id, ts62.factory.createExpressionStatement(assignment)));
|
|
14959
|
+
}
|
|
14960
|
+
};
|
|
14765
14961
|
var TcbReferenceOp = class extends TcbOp {
|
|
14766
14962
|
tcb;
|
|
14767
14963
|
scope;
|
|
@@ -15019,7 +15215,7 @@ var TcbDomSchemaCheckerOp = class extends TcbOp {
|
|
|
15019
15215
|
this.tcb.domSchemaChecker.checkElement(this.tcb.id, this.getTagName(element), element.startSourceSpan, this.tcb.schemas, this.tcb.hostIsStandalone);
|
|
15020
15216
|
}
|
|
15021
15217
|
for (const binding of bindings) {
|
|
15022
|
-
const isPropertyBinding = binding.type ===
|
|
15218
|
+
const isPropertyBinding = binding.type === BindingType3.Property || binding.type === BindingType3.TwoWay;
|
|
15023
15219
|
if (isPropertyBinding && this.claimedInputs?.has(binding.name)) {
|
|
15024
15220
|
continue;
|
|
15025
15221
|
}
|
|
@@ -15174,7 +15370,7 @@ var TcbUnclaimedInputsOp = class extends TcbOp {
|
|
|
15174
15370
|
execute() {
|
|
15175
15371
|
let elId = null;
|
|
15176
15372
|
for (const binding of this.inputs) {
|
|
15177
|
-
const isPropertyBinding = binding.type ===
|
|
15373
|
+
const isPropertyBinding = binding.type === BindingType3.Property || binding.type === BindingType3.TwoWay;
|
|
15178
15374
|
if (isPropertyBinding && this.claimedInputs?.has(binding.name)) {
|
|
15179
15375
|
continue;
|
|
15180
15376
|
}
|
|
@@ -15992,7 +16188,7 @@ var Scope = class _Scope {
|
|
|
15992
16188
|
}
|
|
15993
16189
|
const dirMap = /* @__PURE__ */ new Map();
|
|
15994
16190
|
for (const dir of directives) {
|
|
15995
|
-
this.appendDirectiveInputs(dir, node, dirMap);
|
|
16191
|
+
this.appendDirectiveInputs(dir, node, dirMap, directives);
|
|
15996
16192
|
}
|
|
15997
16193
|
this.directiveOpMap.set(node, dirMap);
|
|
15998
16194
|
if (node instanceof TmplAstElement2) {
|
|
@@ -16033,7 +16229,7 @@ var Scope = class _Scope {
|
|
|
16033
16229
|
if (directives !== null && directives.length > 0) {
|
|
16034
16230
|
const dirMap = /* @__PURE__ */ new Map();
|
|
16035
16231
|
for (const dir of directives) {
|
|
16036
|
-
this.appendDirectiveInputs(dir, node, dirMap);
|
|
16232
|
+
this.appendDirectiveInputs(dir, node, dirMap, directives);
|
|
16037
16233
|
for (const propertyName of dir.inputs.propertyNames) {
|
|
16038
16234
|
claimedInputs.add(propertyName);
|
|
16039
16235
|
}
|
|
@@ -16077,15 +16273,25 @@ var Scope = class _Scope {
|
|
|
16077
16273
|
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, node.outputs, node.inputs, claimedOutputs));
|
|
16078
16274
|
}
|
|
16079
16275
|
}
|
|
16080
|
-
appendDirectiveInputs(dir, node, dirMap) {
|
|
16081
|
-
const directiveOp = this.getDirectiveOp(dir, node);
|
|
16276
|
+
appendDirectiveInputs(dir, node, dirMap, allDirectiveMatches) {
|
|
16277
|
+
const directiveOp = this.getDirectiveOp(dir, node, allDirectiveMatches);
|
|
16082
16278
|
const dirIndex = this.opQueue.push(directiveOp) - 1;
|
|
16083
16279
|
dirMap.set(dir, dirIndex);
|
|
16084
16280
|
this.opQueue.push(new TcbDirectiveInputsOp(this.tcb, this, node, dir));
|
|
16085
16281
|
}
|
|
16086
|
-
getDirectiveOp(dir, node) {
|
|
16282
|
+
getDirectiveOp(dir, node, allDirectiveMatches) {
|
|
16087
16283
|
const dirRef = dir.ref;
|
|
16088
|
-
if (
|
|
16284
|
+
if (dir.name === "Field" && dirRef.bestGuessOwningModule?.specifier === "@angular/forms/signals") {
|
|
16285
|
+
let customControl = null;
|
|
16286
|
+
for (const meta of allDirectiveMatches) {
|
|
16287
|
+
const type = getCustomFieldDirectiveType(meta);
|
|
16288
|
+
if (type !== null) {
|
|
16289
|
+
customControl = { type, meta };
|
|
16290
|
+
break;
|
|
16291
|
+
}
|
|
16292
|
+
}
|
|
16293
|
+
return customControl === null ? new TcbNativeFieldDirectiveTypeOp(this.tcb, this, node, dir) : new TcbCustomFieldDirectiveTypeOp(this.tcb, this, node, dir, customControl);
|
|
16294
|
+
} else if (!dir.isGeneric) {
|
|
16089
16295
|
return new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, dir);
|
|
16090
16296
|
} else if (!requiresInlineTypeCtor(dirRef.node, this.tcb.env.reflector, this.tcb.env) || this.tcb.env.config.useInlineTypeConstructors) {
|
|
16091
16297
|
return new TcbDirectiveCtorOp(this.tcb, this, node, dir);
|
|
@@ -16219,7 +16425,7 @@ var Scope = class _Scope {
|
|
|
16219
16425
|
if (directives !== null && directives.length > 0) {
|
|
16220
16426
|
const directiveOpMap = /* @__PURE__ */ new Map();
|
|
16221
16427
|
for (const directive of directives) {
|
|
16222
|
-
const directiveOp = this.getDirectiveOp(directive, node);
|
|
16428
|
+
const directiveOp = this.getDirectiveOp(directive, node, directives);
|
|
16223
16429
|
directiveOpMap.set(directive, this.opQueue.push(directiveOp) - 1);
|
|
16224
16430
|
}
|
|
16225
16431
|
this.directiveOpMap.set(node, directiveOpMap);
|
|
@@ -16418,7 +16624,7 @@ function tcbCallTypeCtor(dir, tcb, inputs) {
|
|
|
16418
16624
|
function getBoundAttributes(directive, node) {
|
|
16419
16625
|
const boundInputs = [];
|
|
16420
16626
|
const processAttribute = (attr) => {
|
|
16421
|
-
if (attr instanceof
|
|
16627
|
+
if (attr instanceof TmplAstBoundAttribute3 && attr.type !== BindingType3.Property && attr.type !== BindingType3.TwoWay) {
|
|
16422
16628
|
return;
|
|
16423
16629
|
}
|
|
16424
16630
|
const inputs = directive.inputs.getByBindingPropertyName(attr.name);
|
|
@@ -16431,7 +16637,7 @@ function getBoundAttributes(directive, node) {
|
|
|
16431
16637
|
required: input.required,
|
|
16432
16638
|
transformType: input.transform?.type || null,
|
|
16433
16639
|
isSignal: input.isSignal,
|
|
16434
|
-
isTwoWayBinding: attr instanceof
|
|
16640
|
+
isTwoWayBinding: attr instanceof TmplAstBoundAttribute3 && attr.type === BindingType3.TwoWay
|
|
16435
16641
|
};
|
|
16436
16642
|
})
|
|
16437
16643
|
});
|
|
@@ -16450,7 +16656,7 @@ function getBoundAttributes(directive, node) {
|
|
|
16450
16656
|
return boundInputs;
|
|
16451
16657
|
}
|
|
16452
16658
|
function translateInput(attr, tcb, scope) {
|
|
16453
|
-
if (attr instanceof
|
|
16659
|
+
if (attr instanceof TmplAstBoundAttribute3) {
|
|
16454
16660
|
return tcbExpression(attr.value, tcb, scope);
|
|
16455
16661
|
} else {
|
|
16456
16662
|
return ts62.factory.createStringLiteral(attr.value);
|
|
@@ -16590,6 +16796,15 @@ var TcbForLoopTrackTranslator = class extends TcbExpressionTranslator {
|
|
|
16590
16796
|
function getComponentTagName(node) {
|
|
16591
16797
|
return node.tagName || "ng-component";
|
|
16592
16798
|
}
|
|
16799
|
+
function getCustomFieldDirectiveType({ inputs, outputs }) {
|
|
16800
|
+
if (inputs.getByBindingPropertyName("value")?.some((v) => v.isSignal) && outputs.hasBindingPropertyName("valueChange")) {
|
|
16801
|
+
return "value";
|
|
16802
|
+
}
|
|
16803
|
+
if (inputs.getByBindingPropertyName("checked")?.some((v) => v.isSignal) && outputs.hasBindingPropertyName("checkedChange")) {
|
|
16804
|
+
return "checkbox";
|
|
16805
|
+
}
|
|
16806
|
+
return null;
|
|
16807
|
+
}
|
|
16593
16808
|
|
|
16594
16809
|
// packages/compiler-cli/src/ngtsc/typecheck/src/type_check_file.js
|
|
16595
16810
|
import ts63 from "typescript";
|
|
@@ -16971,7 +17186,7 @@ var TypeCtorOp = class {
|
|
|
16971
17186
|
};
|
|
16972
17187
|
|
|
16973
17188
|
// packages/compiler-cli/src/ngtsc/typecheck/src/source.js
|
|
16974
|
-
import { ParseLocation as ParseLocation2, ParseSourceSpan as
|
|
17189
|
+
import { ParseLocation as ParseLocation2, ParseSourceSpan as ParseSourceSpan3 } from "@angular/compiler";
|
|
16975
17190
|
|
|
16976
17191
|
// packages/compiler-cli/src/ngtsc/typecheck/src/line_mappings.js
|
|
16977
17192
|
var LF_CHAR = 10;
|
|
@@ -17026,7 +17241,7 @@ var Source = class {
|
|
|
17026
17241
|
toParseSourceSpan(start, end) {
|
|
17027
17242
|
const startLoc = this.toParseLocation(start);
|
|
17028
17243
|
const endLoc = this.toParseLocation(end);
|
|
17029
|
-
return new
|
|
17244
|
+
return new ParseSourceSpan3(startLoc, endLoc);
|
|
17030
17245
|
}
|
|
17031
17246
|
toParseLocation(position) {
|
|
17032
17247
|
const lineStarts = this.acquireLineStarts();
|
|
@@ -17087,7 +17302,7 @@ var DirectiveSourceManager = class {
|
|
|
17087
17302
|
};
|
|
17088
17303
|
|
|
17089
17304
|
// packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.js
|
|
17090
|
-
import { AST, ASTWithName as ASTWithName2, ASTWithSource as ASTWithSource2, Binary as Binary2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, R3Identifiers as R3Identifiers5, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as
|
|
17305
|
+
import { AST, ASTWithName as ASTWithName2, ASTWithSource as ASTWithSource2, Binary as Binary2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, R3Identifiers as R3Identifiers5, SafePropertyRead as SafePropertyRead4, TmplAstBoundAttribute as TmplAstBoundAttribute4, TmplAstBoundEvent as TmplAstBoundEvent3, TmplAstComponent as TmplAstComponent3, TmplAstDirective as TmplAstDirective3, TmplAstElement as TmplAstElement3, TmplAstLetDeclaration as TmplAstLetDeclaration3, TmplAstReference as TmplAstReference3, TmplAstTemplate as TmplAstTemplate2, TmplAstTextAttribute as TmplAstTextAttribute3, TmplAstVariable as TmplAstVariable2 } from "@angular/compiler";
|
|
17091
17306
|
import ts65 from "typescript";
|
|
17092
17307
|
var SymbolBuilder = class {
|
|
17093
17308
|
tcbPath;
|
|
@@ -17110,7 +17325,7 @@ var SymbolBuilder = class {
|
|
|
17110
17325
|
return this.symbolCache.get(node);
|
|
17111
17326
|
}
|
|
17112
17327
|
let symbol = null;
|
|
17113
|
-
if (node instanceof
|
|
17328
|
+
if (node instanceof TmplAstBoundAttribute4 || node instanceof TmplAstTextAttribute3) {
|
|
17114
17329
|
symbol = this.getSymbolOfInputBinding(node);
|
|
17115
17330
|
} else if (node instanceof TmplAstBoundEvent3) {
|
|
17116
17331
|
symbol = this.getSymbolOfBoundEvent(node);
|
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-DBAV4W4V.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-5UJIUEKT.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-VBBJY6IR.js";
|
|
50
50
|
import "./chunk-LS5RJ5CS.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.0.0-rc.
|
|
80
|
+
var VERSION = new Version("21.0.0-rc.1");
|
|
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-5UJIUEKT.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-VBBJY6IR.js";
|
|
36
36
|
import "../chunk-LS5RJ5CS.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-YVYYMXOI.js";
|
|
10
10
|
import {
|
|
11
11
|
EmitFlags
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-DBAV4W4V.js";
|
|
13
|
+
import "../../chunk-5UJIUEKT.js";
|
|
14
|
+
import "../../chunk-VBBJY6IR.js";
|
|
15
15
|
import "../../chunk-LS5RJ5CS.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-YVYYMXOI.js";
|
|
9
|
+
import "../../chunk-DBAV4W4V.js";
|
|
10
|
+
import "../../chunk-5UJIUEKT.js";
|
|
11
|
+
import "../../chunk-VBBJY6IR.js";
|
|
12
12
|
import "../../chunk-LS5RJ5CS.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.0.0-rc.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "21.0.0-rc.1";
|
|
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.0.0-rc.
|
|
3
|
+
"version": "21.0.0-rc.1",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"yargs": "^18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@angular/compiler": "21.0.0-rc.
|
|
43
|
+
"@angular/compiler": "21.0.0-rc.1",
|
|
44
44
|
"typescript": ">=5.9 <6.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
@@ -365,6 +365,8 @@ export declare enum ErrorCode {
|
|
|
365
365
|
* prefetch timer delay that is not earlier than the main timer, or an identical prefetch
|
|
366
366
|
*/
|
|
367
367
|
DEFER_TRIGGER_MISCONFIGURATION = 8021,
|
|
368
|
+
/** Raised when the user has an unsupported binding on a `Field` directive. */
|
|
369
|
+
FORM_FIELD_UNSUPPORTED_BINDING = 8022,
|
|
368
370
|
/**
|
|
369
371
|
* A two way binding in a template has an incorrect syntax,
|
|
370
372
|
* parentheses outside brackets. For example:
|
|
@@ -29,7 +29,8 @@ export declare enum EntryType {
|
|
|
29
29
|
Pipe = "pipe",
|
|
30
30
|
TypeAlias = "type_alias",
|
|
31
31
|
UndecoratedClass = "undecorated_class",
|
|
32
|
-
InitializerApiFunction = "initializer_api_function"
|
|
32
|
+
InitializerApiFunction = "initializer_api_function",
|
|
33
|
+
Namespace = "namespace"
|
|
33
34
|
}
|
|
34
35
|
/** Types of class members */
|
|
35
36
|
export declare enum MemberType {
|
|
@@ -89,6 +90,7 @@ export interface ConstantEntry extends DocEntry {
|
|
|
89
90
|
/** Documentation entity for a type alias. */
|
|
90
91
|
export interface TypeAliasEntry extends ConstantEntry {
|
|
91
92
|
generics: GenericEntry[];
|
|
93
|
+
members?: DocEntry[];
|
|
92
94
|
}
|
|
93
95
|
/** Documentation entity for a TypeScript class. */
|
|
94
96
|
export interface ClassEntry extends DocEntry {
|
|
@@ -176,6 +178,10 @@ export interface FunctionDefinitionEntry {
|
|
|
176
178
|
signatures: FunctionSignatureMetadata[];
|
|
177
179
|
implementation: FunctionSignatureMetadata | null;
|
|
178
180
|
}
|
|
181
|
+
/** Documentation entity for a TypeScript namespace. */
|
|
182
|
+
export interface NamespaceEntry extends DocEntry {
|
|
183
|
+
members: DocEntry[];
|
|
184
|
+
}
|
|
179
185
|
/**
|
|
180
186
|
* Docs entry describing an initializer API function.
|
|
181
187
|
*
|
|
@@ -26,6 +26,12 @@ export declare class DocsExtractor {
|
|
|
26
26
|
entries: DocEntry[];
|
|
27
27
|
symbols: Map<string, string>;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Extracts a documentation entry for a given set of declarations that are all exported under
|
|
31
|
+
* the same name. This is used to combine entries, e.g. for a type and a namespace that are
|
|
32
|
+
* exported under the same name.
|
|
33
|
+
*/
|
|
34
|
+
private extractDeclarations;
|
|
29
35
|
/** Extract the doc entry for a single declaration. */
|
|
30
36
|
private extractDeclaration;
|
|
31
37
|
/** Gets the list of exported declarations for doc extraction. */
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { NamespaceEntry } from './entities';
|
|
10
|
+
/**
|
|
11
|
+
* Extracts documentation entry for a TypeScript namespace.
|
|
12
|
+
* @param node The TypeScript AST node for the namespace.
|
|
13
|
+
* @param typeChecker The TypeScript type checker.
|
|
14
|
+
*/
|
|
15
|
+
export declare function extractNamespace(node: ts.ModuleDeclaration, typeChecker: ts.TypeChecker): NamespaceEntry;
|