@angular/compiler-cli 21.0.0-next.7 → 21.0.0-next.8
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-DT6FD4OE.js +1 -1
- package/bundles/{chunk-O7L4BBZY.js → chunk-ELPMV5DB.js} +196 -38
- package/bundles/{chunk-CXWG7H5K.js → chunk-MVFPDRXS.js} +1 -1
- package/bundles/{chunk-3I7LEC2O.js → chunk-NBFYHUMW.js} +118 -48
- package/bundles/{chunk-WX6HCNBV.js → chunk-WXJFCHPN.js} +1 -1
- package/bundles/index.js +4 -4
- package/bundles/private/migrations.js +1 -1
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +4 -4
- package/bundles/src/bin/ngc.js +4 -4
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/common/src/metadata.d.ts +5 -3
- package/src/ngtsc/annotations/component/src/handler.d.ts +1 -0
- package/src/ngtsc/annotations/directive/src/handler.d.ts +1 -0
- package/src/ngtsc/annotations/directive/src/shared.d.ts +6 -1
- package/src/ngtsc/diagnostics/src/error_code.d.ts +6 -0
- package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
- package/src/ngtsc/typecheck/api/checker.d.ts +4 -0
- package/src/ngtsc/typecheck/extended/api/api.d.ts +0 -10
- package/src/ngtsc/typecheck/extended/checks/defer_trigger_misconfiguration/index.d.ts +10 -0
- package/src/ngtsc/typecheck/src/checker.d.ts +1 -0
|
@@ -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-next.
|
|
458
|
+
var PLACEHOLDER_VERSION = "21.0.0-next.8";
|
|
459
459
|
function wrapReference(wrapped) {
|
|
460
460
|
return { value: wrapped, type: wrapped };
|
|
461
461
|
}
|
|
@@ -102,6 +102,7 @@ var ErrorCode;
|
|
|
102
102
|
ErrorCode2[ErrorCode2["UNCLAIMED_DIRECTIVE_BINDING"] = 8018] = "UNCLAIMED_DIRECTIVE_BINDING";
|
|
103
103
|
ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER"] = 8019] = "DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER";
|
|
104
104
|
ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER"] = 8020] = "DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER";
|
|
105
|
+
ErrorCode2[ErrorCode2["DEFER_TRIGGER_MISCONFIGURATION"] = 8021] = "DEFER_TRIGGER_MISCONFIGURATION";
|
|
105
106
|
ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
|
|
106
107
|
ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
|
|
107
108
|
ErrorCode2[ErrorCode2["MISSING_CONTROL_FLOW_DIRECTIVE"] = 8103] = "MISSING_CONTROL_FLOW_DIRECTIVE";
|
|
@@ -249,6 +250,7 @@ var ExtendedTemplateDiagnosticName;
|
|
|
249
250
|
ExtendedTemplateDiagnosticName2["UNUSED_STANDALONE_IMPORTS"] = "unusedStandaloneImports";
|
|
250
251
|
ExtendedTemplateDiagnosticName2["UNPARENTHESIZED_NULLISH_COALESCING"] = "unparenthesizedNullishCoalescing";
|
|
251
252
|
ExtendedTemplateDiagnosticName2["UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION"] = "uninvokedFunctionInTextInterpolation";
|
|
253
|
+
ExtendedTemplateDiagnosticName2["DEFER_TRIGGER_MISCONFIGURATION"] = "deferTriggerMisconfiguration";
|
|
252
254
|
})(ExtendedTemplateDiagnosticName || (ExtendedTemplateDiagnosticName = {}));
|
|
253
255
|
|
|
254
256
|
// packages/compiler-cli/src/ngtsc/reflection/src/typescript.js
|
|
@@ -3145,8 +3147,8 @@ var StaticInterpreter = class {
|
|
|
3145
3147
|
if (ts13.isIdentifier(node) || ts13.isStringLiteral(node) || ts13.isNumericLiteral(node)) {
|
|
3146
3148
|
return node.text;
|
|
3147
3149
|
} else if (ts13.isComputedPropertyName(node)) {
|
|
3148
|
-
const
|
|
3149
|
-
return typeof
|
|
3150
|
+
const literal4 = this.visitExpression(node.expression, context);
|
|
3151
|
+
return typeof literal4 === "string" ? literal4 : void 0;
|
|
3150
3152
|
} else {
|
|
3151
3153
|
return void 0;
|
|
3152
3154
|
}
|
|
@@ -7365,7 +7367,7 @@ var InjectableClassRegistry = class {
|
|
|
7365
7367
|
// packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.js
|
|
7366
7368
|
import { ArrowFunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
7367
7369
|
import ts35 from "typescript";
|
|
7368
|
-
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
7370
|
+
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec, undecoratedMetadataExtractor = () => null) {
|
|
7369
7371
|
if (!reflection.isClass(clazz)) {
|
|
7370
7372
|
return null;
|
|
7371
7373
|
}
|
|
@@ -7386,15 +7388,41 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
7386
7388
|
metaCtorParameters = new ArrowFunctionExpr([], new LiteralArrayExpr(ctorParameters));
|
|
7387
7389
|
}
|
|
7388
7390
|
let metaPropDecorators = null;
|
|
7389
|
-
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic &&
|
|
7391
|
+
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic && // Private fields are not supported in the metadata emit
|
|
7390
7392
|
member.accessLevel !== ClassMemberAccessLevel.EcmaScriptPrivate);
|
|
7391
|
-
const
|
|
7392
|
-
|
|
7393
|
+
const decoratedMembers = [];
|
|
7394
|
+
const seenMemberNames = /* @__PURE__ */ new Set();
|
|
7395
|
+
let duplicateDecoratedMembers = null;
|
|
7396
|
+
for (const member of classMembers) {
|
|
7397
|
+
const shouldQuoteName = member.nameNode !== null && ts35.isStringLiteralLike(member.nameNode);
|
|
7398
|
+
if (member.decorators !== null && member.decorators.length > 0) {
|
|
7399
|
+
decoratedMembers.push({
|
|
7400
|
+
key: member.name,
|
|
7401
|
+
quoted: shouldQuoteName,
|
|
7402
|
+
value: decoratedClassMemberToMetadata(member.decorators, isCore)
|
|
7403
|
+
});
|
|
7404
|
+
if (seenMemberNames.has(member.name)) {
|
|
7405
|
+
duplicateDecoratedMembers ??= [];
|
|
7406
|
+
duplicateDecoratedMembers.push(member);
|
|
7407
|
+
} else {
|
|
7408
|
+
seenMemberNames.add(member.name);
|
|
7409
|
+
}
|
|
7410
|
+
} else {
|
|
7411
|
+
const undecoratedMetadata = undecoratedMetadataExtractor(member);
|
|
7412
|
+
if (undecoratedMetadata !== null) {
|
|
7413
|
+
decoratedMembers.push({
|
|
7414
|
+
key: member.name,
|
|
7415
|
+
quoted: shouldQuoteName,
|
|
7416
|
+
value: undecoratedMetadata
|
|
7417
|
+
});
|
|
7418
|
+
}
|
|
7419
|
+
}
|
|
7420
|
+
}
|
|
7421
|
+
if (duplicateDecoratedMembers !== null) {
|
|
7393
7422
|
throw new FatalDiagnosticError(ErrorCode.DUPLICATE_DECORATED_PROPERTIES, duplicateDecoratedMembers[0].nameNode ?? clazz, `Duplicate decorated properties found on class '${clazz.name.text}': ` + duplicateDecoratedMembers.map((member) => member.name).join(", "));
|
|
7394
7423
|
}
|
|
7395
|
-
const decoratedMembers = classMembers.map((member) => classMemberToMetadata(member.nameNode ?? member.name, member.decorators, isCore));
|
|
7396
7424
|
if (decoratedMembers.length > 0) {
|
|
7397
|
-
metaPropDecorators =
|
|
7425
|
+
metaPropDecorators = literalMap(decoratedMembers);
|
|
7398
7426
|
}
|
|
7399
7427
|
return {
|
|
7400
7428
|
type: new WrappedNodeExpr4(id),
|
|
@@ -7415,10 +7443,9 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
7415
7443
|
}
|
|
7416
7444
|
return literalMap(mapEntries);
|
|
7417
7445
|
}
|
|
7418
|
-
function
|
|
7419
|
-
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
7420
|
-
|
|
7421
|
-
return ts35.factory.createPropertyAssignment(name, decoratorMeta);
|
|
7446
|
+
function decoratedClassMemberToMetadata(decorators, isCore) {
|
|
7447
|
+
const ngDecorators = decorators.filter((dec) => isAngularDecorator2(dec, isCore)).map((decorator) => new WrappedNodeExpr4(decoratorToMetadata(decorator)));
|
|
7448
|
+
return new LiteralArrayExpr(ngDecorators);
|
|
7422
7449
|
}
|
|
7423
7450
|
function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
7424
7451
|
if (decorator.identifier === null) {
|
|
@@ -8647,7 +8674,7 @@ import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirect
|
|
|
8647
8674
|
import ts65 from "typescript";
|
|
8648
8675
|
|
|
8649
8676
|
// packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.js
|
|
8650
|
-
import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr6, ExternalReference as ExternalReference2, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
8677
|
+
import { createMayBeForwardRefExpression as createMayBeForwardRefExpression2, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr6, ExternalReference as ExternalReference2, getSafePropertyAccessString, LiteralArrayExpr as LiteralArrayExpr2, literalMap as literalMap2, parseHostBindings, verifyHostBindings, R3Identifiers, ArrowFunctionExpr as ArrowFunctionExpr2, WrappedNodeExpr as WrappedNodeExpr6, literal as literal3 } from "@angular/compiler";
|
|
8651
8678
|
import ts43 from "typescript";
|
|
8652
8679
|
|
|
8653
8680
|
// packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_function_access.js
|
|
@@ -9322,6 +9349,108 @@ function parseFieldStringArrayValue(directive, field, evaluator) {
|
|
|
9322
9349
|
}
|
|
9323
9350
|
return value;
|
|
9324
9351
|
}
|
|
9352
|
+
function getDirectiveUndecoratedMetadataExtractor(reflector, importTracker) {
|
|
9353
|
+
return (member) => {
|
|
9354
|
+
const input = tryParseSignalInputMapping(member, reflector, importTracker);
|
|
9355
|
+
if (input !== null) {
|
|
9356
|
+
return getDecoratorMetaArray([
|
|
9357
|
+
[new ExternalExpr6(R3Identifiers.inputDecorator), memberMetadataFromSignalInput(input)]
|
|
9358
|
+
]);
|
|
9359
|
+
}
|
|
9360
|
+
const output = tryParseInitializerBasedOutput(member, reflector, importTracker);
|
|
9361
|
+
if (output !== null) {
|
|
9362
|
+
return getDecoratorMetaArray([
|
|
9363
|
+
[
|
|
9364
|
+
new ExternalExpr6(R3Identifiers.outputDecorator),
|
|
9365
|
+
memberMetadataFromInitializerOutput(output.metadata)
|
|
9366
|
+
]
|
|
9367
|
+
]);
|
|
9368
|
+
}
|
|
9369
|
+
const model = tryParseSignalModelMapping(member, reflector, importTracker);
|
|
9370
|
+
if (model !== null) {
|
|
9371
|
+
return getDecoratorMetaArray([
|
|
9372
|
+
[
|
|
9373
|
+
new ExternalExpr6(R3Identifiers.inputDecorator),
|
|
9374
|
+
memberMetadataFromSignalInput(model.input)
|
|
9375
|
+
],
|
|
9376
|
+
[
|
|
9377
|
+
new ExternalExpr6(R3Identifiers.outputDecorator),
|
|
9378
|
+
memberMetadataFromInitializerOutput(model.output)
|
|
9379
|
+
]
|
|
9380
|
+
]);
|
|
9381
|
+
}
|
|
9382
|
+
const query = tryParseSignalQueryFromInitializer(member, reflector, importTracker);
|
|
9383
|
+
if (query !== null) {
|
|
9384
|
+
let identifier;
|
|
9385
|
+
if (query.name === "viewChild") {
|
|
9386
|
+
identifier = R3Identifiers.viewChildDecorator;
|
|
9387
|
+
} else if (query.name === "viewChildren") {
|
|
9388
|
+
identifier = R3Identifiers.viewChildrenDecorator;
|
|
9389
|
+
} else if (query.name === "contentChild") {
|
|
9390
|
+
identifier = R3Identifiers.contentChildDecorator;
|
|
9391
|
+
} else if (query.name === "contentChildren") {
|
|
9392
|
+
identifier = R3Identifiers.contentChildrenDecorator;
|
|
9393
|
+
} else {
|
|
9394
|
+
return null;
|
|
9395
|
+
}
|
|
9396
|
+
return getDecoratorMetaArray([
|
|
9397
|
+
[new ExternalExpr6(identifier), memberMetadataFromSignalQuery(query.call)]
|
|
9398
|
+
]);
|
|
9399
|
+
}
|
|
9400
|
+
return null;
|
|
9401
|
+
};
|
|
9402
|
+
}
|
|
9403
|
+
function getDecoratorMetaArray(decorators) {
|
|
9404
|
+
return new LiteralArrayExpr2(decorators.map(([type, args]) => literalMap2([
|
|
9405
|
+
{ key: "type", value: type, quoted: false },
|
|
9406
|
+
{ key: "args", value: args, quoted: false }
|
|
9407
|
+
])));
|
|
9408
|
+
}
|
|
9409
|
+
function memberMetadataFromSignalInput(input) {
|
|
9410
|
+
return new LiteralArrayExpr2([
|
|
9411
|
+
literalMap2([
|
|
9412
|
+
{
|
|
9413
|
+
key: "isSignal",
|
|
9414
|
+
value: literal3(true),
|
|
9415
|
+
quoted: false
|
|
9416
|
+
},
|
|
9417
|
+
{
|
|
9418
|
+
key: "alias",
|
|
9419
|
+
value: literal3(input.bindingPropertyName),
|
|
9420
|
+
quoted: false
|
|
9421
|
+
},
|
|
9422
|
+
{
|
|
9423
|
+
key: "required",
|
|
9424
|
+
value: literal3(input.required),
|
|
9425
|
+
quoted: false
|
|
9426
|
+
}
|
|
9427
|
+
])
|
|
9428
|
+
]);
|
|
9429
|
+
}
|
|
9430
|
+
function memberMetadataFromInitializerOutput(output) {
|
|
9431
|
+
return new LiteralArrayExpr2([literal3(output.bindingPropertyName)]);
|
|
9432
|
+
}
|
|
9433
|
+
function memberMetadataFromSignalQuery(call) {
|
|
9434
|
+
const firstArg = call.arguments[0];
|
|
9435
|
+
const firstArgMeta = ts43.isStringLiteralLike(firstArg) || ts43.isCallExpression(firstArg) ? new WrappedNodeExpr6(firstArg) : (
|
|
9436
|
+
// If the first argument is a class reference, we need to wrap it in a `forwardRef`
|
|
9437
|
+
// because the reference might occur after the current class. This wouldn't be flagged
|
|
9438
|
+
// on the query initializer, because it executes after the class is initialized, whereas
|
|
9439
|
+
// `setClassMetadata` runs immediately.
|
|
9440
|
+
new ExternalExpr6(R3Identifiers.forwardRef).callFn([
|
|
9441
|
+
new ArrowFunctionExpr2([], new WrappedNodeExpr6(firstArg))
|
|
9442
|
+
])
|
|
9443
|
+
);
|
|
9444
|
+
const entries = [
|
|
9445
|
+
// We use wrapped nodes here, because the output AST doesn't support spread assignments.
|
|
9446
|
+
firstArgMeta,
|
|
9447
|
+
new WrappedNodeExpr6(ts43.factory.createObjectLiteralExpression([
|
|
9448
|
+
...call.arguments.length > 1 ? [ts43.factory.createSpreadAssignment(call.arguments[1])] : [],
|
|
9449
|
+
ts43.factory.createPropertyAssignment("isSignal", ts43.factory.createTrue())
|
|
9450
|
+
]))
|
|
9451
|
+
];
|
|
9452
|
+
return new LiteralArrayExpr2(entries);
|
|
9453
|
+
}
|
|
9325
9454
|
function isStringArrayOrDie(value, name, node) {
|
|
9326
9455
|
if (!Array.isArray(value)) {
|
|
9327
9456
|
return false;
|
|
@@ -12178,11 +12307,11 @@ var ReferenceEmitEnvironment = class {
|
|
|
12178
12307
|
};
|
|
12179
12308
|
|
|
12180
12309
|
// packages/compiler-cli/src/ngtsc/typecheck/src/type_constructor.js
|
|
12181
|
-
import { ExpressionType as ExpressionType2, R3Identifiers as
|
|
12310
|
+
import { ExpressionType as ExpressionType2, R3Identifiers as R3Identifiers3, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
12182
12311
|
import ts54 from "typescript";
|
|
12183
12312
|
|
|
12184
12313
|
// packages/compiler-cli/src/ngtsc/typecheck/src/tcb_util.js
|
|
12185
|
-
import { R3Identifiers } from "@angular/compiler";
|
|
12314
|
+
import { R3Identifiers as R3Identifiers2 } from "@angular/compiler";
|
|
12186
12315
|
import ts53 from "typescript";
|
|
12187
12316
|
|
|
12188
12317
|
// packages/compiler-cli/src/ngtsc/typecheck/src/type_parameter_emitter.js
|
|
@@ -12277,12 +12406,12 @@ var TypeParameterEmitter = class {
|
|
|
12277
12406
|
import { BindingType, CssSelector as CssSelector2, makeBindingParser, TmplAstBoundAttribute, TmplAstBoundEvent, TmplAstHostElement, AbsoluteSourceSpan as AbsoluteSourceSpan2, ParseSpan, PropertyRead as PropertyRead2, ParsedEventType, Call, ThisReceiver, KeyedRead, LiteralPrimitive, RecursiveAstVisitor, ASTWithName, SafeCall, ImplicitReceiver as ImplicitReceiver2 } from "@angular/compiler";
|
|
12278
12407
|
import ts52 from "typescript";
|
|
12279
12408
|
var GUARD_COMMENT_TEXT = "hostBindingsBlockGuard";
|
|
12280
|
-
function createHostElement(type, selector, sourceNode,
|
|
12409
|
+
function createHostElement(type, selector, sourceNode, literal4, bindingDecorators, listenerDecorators) {
|
|
12281
12410
|
const bindings = [];
|
|
12282
12411
|
const listeners = [];
|
|
12283
12412
|
let parser = null;
|
|
12284
|
-
if (
|
|
12285
|
-
for (const prop of
|
|
12413
|
+
if (literal4 !== null) {
|
|
12414
|
+
for (const prop of literal4.properties) {
|
|
12286
12415
|
if (ts52.isPropertyAssignment(prop) && ts52.isStringLiteralLike(prop.initializer) && isStaticName(prop.name)) {
|
|
12287
12416
|
parser ??= makeBindingParser();
|
|
12288
12417
|
createNodeFromHostLiteralProperty(prop, parser, bindings, listeners);
|
|
@@ -12508,7 +12637,7 @@ var TCB_FILE_IMPORT_GRAPH_PREPARE_IDENTIFIERS = [
|
|
|
12508
12637
|
// Imports may be added for signal input checking. We wouldn't want to change the
|
|
12509
12638
|
// import graph for incremental compilations when suddenly a signal input is used,
|
|
12510
12639
|
// or removed.
|
|
12511
|
-
|
|
12640
|
+
R3Identifiers2.InputSignalBrandWriteType
|
|
12512
12641
|
];
|
|
12513
12642
|
var TcbInliningRequirement;
|
|
12514
12643
|
(function(TcbInliningRequirement2) {
|
|
@@ -12742,7 +12871,7 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
12742
12871
|
}
|
|
12743
12872
|
if (signalInputKeys.length > 0) {
|
|
12744
12873
|
const keyTypeUnion = ts54.factory.createUnionTypeNode(signalInputKeys);
|
|
12745
|
-
const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(
|
|
12874
|
+
const unwrapDirectiveSignalInputsExpr = env.referenceExternalType(R3Identifiers3.UnwrapDirectiveSignalInputs.moduleName, R3Identifiers3.UnwrapDirectiveSignalInputs.name, [
|
|
12746
12875
|
// TODO:
|
|
12747
12876
|
new ExpressionType2(new WrappedNodeExpr7(rawType)),
|
|
12748
12877
|
new ExpressionType2(new WrappedNodeExpr7(keyTypeUnion))
|
|
@@ -13118,10 +13247,10 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
|
|
|
13118
13247
|
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), node.keySpan || node.sourceSpan, ts56.DiagnosticCategory.Error, ngErrorCode(ErrorCode.UNCLAIMED_DIRECTIVE_BINDING), errorMsg));
|
|
13119
13248
|
}
|
|
13120
13249
|
deferImplicitTriggerMissingPlaceholder(id, trigger) {
|
|
13121
|
-
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts56.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER), "Trigger with no
|
|
13250
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts56.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER), "Trigger with no target can only be placed on an @defer that has a @placeholder block"));
|
|
13122
13251
|
}
|
|
13123
13252
|
deferImplicitTriggerInvalidPlaceholder(id, trigger) {
|
|
13124
|
-
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts56.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER), "Trigger with no
|
|
13253
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts56.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"));
|
|
13125
13254
|
}
|
|
13126
13255
|
};
|
|
13127
13256
|
function makeInlineDiagnostic(id, code, node, messageText, relatedInformation) {
|
|
@@ -13149,7 +13278,7 @@ var TypeCheckShimGenerator = class {
|
|
|
13149
13278
|
};
|
|
13150
13279
|
|
|
13151
13280
|
// packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.js
|
|
13152
|
-
import { BindingPipe, BindingType as BindingType2, Call as Call3, createCssSelectorFromNode, CssSelector as CssSelector3, DYNAMIC_TYPE, ImplicitReceiver as ImplicitReceiver3, ParsedEventType as ParsedEventType2, PropertyRead as PropertyRead4, R3Identifiers as
|
|
13281
|
+
import { BindingPipe, BindingType as BindingType2, 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 TmplAstBoundAttribute2, 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";
|
|
13153
13282
|
import ts60 from "typescript";
|
|
13154
13283
|
|
|
13155
13284
|
// packages/compiler-cli/src/ngtsc/typecheck/src/diagnostics.js
|
|
@@ -13339,8 +13468,8 @@ var AstTranslator = class {
|
|
|
13339
13468
|
}
|
|
13340
13469
|
visitLiteralArray(ast) {
|
|
13341
13470
|
const elements = ast.expressions.map((expr) => this.translate(expr));
|
|
13342
|
-
const
|
|
13343
|
-
const node = this.config.strictLiteralTypes ?
|
|
13471
|
+
const literal4 = ts59.factory.createArrayLiteralExpression(elements);
|
|
13472
|
+
const node = this.config.strictLiteralTypes ? literal4 : tsCastToAny(literal4);
|
|
13344
13473
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
13345
13474
|
return node;
|
|
13346
13475
|
}
|
|
@@ -13349,8 +13478,8 @@ var AstTranslator = class {
|
|
|
13349
13478
|
const value = this.translate(ast.values[idx]);
|
|
13350
13479
|
return ts59.factory.createPropertyAssignment(ts59.factory.createStringLiteral(key), value);
|
|
13351
13480
|
});
|
|
13352
|
-
const
|
|
13353
|
-
const node = this.config.strictLiteralTypes ?
|
|
13481
|
+
const literal4 = ts59.factory.createObjectLiteralExpression(properties, true);
|
|
13482
|
+
const node = this.config.strictLiteralTypes ? literal4 : tsCastToAny(literal4);
|
|
13354
13483
|
addParseSpanInfo(node, ast.sourceSpan);
|
|
13355
13484
|
return node;
|
|
13356
13485
|
}
|
|
@@ -14124,9 +14253,9 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
14124
14253
|
target = this.dir.stringLiteralInputFields.has(fieldName) ? ts60.factory.createElementAccessExpression(dirId, ts60.factory.createStringLiteral(fieldName)) : ts60.factory.createPropertyAccessExpression(dirId, ts60.factory.createIdentifier(fieldName));
|
|
14125
14254
|
}
|
|
14126
14255
|
if (isSignal) {
|
|
14127
|
-
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(
|
|
14256
|
+
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(R3Identifiers4.InputSignalBrandWriteType.moduleName, R3Identifiers4.InputSignalBrandWriteType.name);
|
|
14128
14257
|
if (!ts60.isIdentifier(inputSignalBrandWriteSymbol) && !ts60.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
14129
|
-
throw new Error(`Expected identifier or property access for reference to ${
|
|
14258
|
+
throw new Error(`Expected identifier or property access for reference to ${R3Identifiers4.InputSignalBrandWriteType.name}`);
|
|
14130
14259
|
}
|
|
14131
14260
|
target = ts60.factory.createElementAccessExpression(target, inputSignalBrandWriteSymbol);
|
|
14132
14261
|
}
|
|
@@ -14745,6 +14874,25 @@ var TcbForOfOp = class extends TcbOp {
|
|
|
14745
14874
|
return null;
|
|
14746
14875
|
}
|
|
14747
14876
|
};
|
|
14877
|
+
var TcbIntersectionObserverOp = class extends TcbOp {
|
|
14878
|
+
tcb;
|
|
14879
|
+
scope;
|
|
14880
|
+
options;
|
|
14881
|
+
constructor(tcb, scope, options) {
|
|
14882
|
+
super();
|
|
14883
|
+
this.tcb = tcb;
|
|
14884
|
+
this.scope = scope;
|
|
14885
|
+
this.options = options;
|
|
14886
|
+
}
|
|
14887
|
+
optional = false;
|
|
14888
|
+
execute() {
|
|
14889
|
+
const options = tcbExpression(this.options, this.tcb, this.scope);
|
|
14890
|
+
const callback = ts60.factory.createNonNullExpression(ts60.factory.createNull());
|
|
14891
|
+
const expression = ts60.factory.createNewExpression(ts60.factory.createIdentifier("IntersectionObserver"), void 0, [callback, options]);
|
|
14892
|
+
this.scope.addStatement(ts60.factory.createExpressionStatement(expression));
|
|
14893
|
+
return null;
|
|
14894
|
+
}
|
|
14895
|
+
};
|
|
14748
14896
|
var Context2 = class {
|
|
14749
14897
|
env;
|
|
14750
14898
|
domSchemaChecker;
|
|
@@ -15370,6 +15518,9 @@ var Scope = class _Scope {
|
|
|
15370
15518
|
if (triggers.when !== void 0) {
|
|
15371
15519
|
this.opQueue.push(new TcbExpressionOp(this.tcb, this, triggers.when.value));
|
|
15372
15520
|
}
|
|
15521
|
+
if (triggers.viewport !== void 0 && triggers.viewport.options !== null) {
|
|
15522
|
+
this.opQueue.push(new TcbIntersectionObserverOp(this.tcb, this, triggers.viewport.options));
|
|
15523
|
+
}
|
|
15373
15524
|
if (triggers.hover !== void 0) {
|
|
15374
15525
|
this.validateReferenceBasedDeferredTrigger(block, triggers.hover);
|
|
15375
15526
|
}
|
|
@@ -15637,7 +15788,7 @@ function widenBinding(expr, tcb) {
|
|
|
15637
15788
|
}
|
|
15638
15789
|
}
|
|
15639
15790
|
function unwrapWritableSignal(expression, tcb) {
|
|
15640
|
-
const unwrapRef = tcb.env.referenceExternalSymbol(
|
|
15791
|
+
const unwrapRef = tcb.env.referenceExternalSymbol(R3Identifiers4.unwrapWritableSignal.moduleName, R3Identifiers4.unwrapWritableSignal.name);
|
|
15641
15792
|
return ts60.factory.createCallExpression(unwrapRef, void 0, [expression]);
|
|
15642
15793
|
}
|
|
15643
15794
|
var EVENT_PARAMETER = "$event";
|
|
@@ -16254,7 +16405,7 @@ var DirectiveSourceManager = class {
|
|
|
16254
16405
|
};
|
|
16255
16406
|
|
|
16256
16407
|
// packages/compiler-cli/src/ngtsc/typecheck/src/template_symbol_builder.js
|
|
16257
|
-
import { AST, ASTWithName as ASTWithName2, ASTWithSource as ASTWithSource2, Binary as Binary2, BindingPipe as BindingPipe2, PropertyRead as PropertyRead5, R3Identifiers as
|
|
16408
|
+
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 TmplAstBoundAttribute3, 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";
|
|
16258
16409
|
import ts63 from "typescript";
|
|
16259
16410
|
var SymbolBuilder = class {
|
|
16260
16411
|
tcbPath;
|
|
@@ -16884,7 +17035,7 @@ function unwrapSignalInputWriteTAccessor(expr) {
|
|
|
16884
17035
|
if (!ts63.isElementAccessExpression(expr) || !ts63.isPropertyAccessExpression(expr.argumentExpression)) {
|
|
16885
17036
|
return null;
|
|
16886
17037
|
}
|
|
16887
|
-
if (!ts63.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !==
|
|
17038
|
+
if (!ts63.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== R3Identifiers5.InputSignalBrandWriteType.name) {
|
|
16888
17039
|
return null;
|
|
16889
17040
|
}
|
|
16890
17041
|
if (!ts63.isPropertyAccessExpression(expr.expression) && !ts63.isElementAccessExpression(expr.expression) && !ts63.isIdentifier(expr.expression)) {
|
|
@@ -16990,6 +17141,9 @@ var TemplateTypeCheckerImpl = class {
|
|
|
16990
17141
|
const { data } = this.getLatestComponentState(directive, optimizeFor);
|
|
16991
17142
|
return data?.hostElement ?? null;
|
|
16992
17143
|
}
|
|
17144
|
+
getDirectivesOfNode(component, node) {
|
|
17145
|
+
return this.getLatestComponentState(component).data?.boundTarget.getDirectivesOfNode(node) ?? null;
|
|
17146
|
+
}
|
|
16993
17147
|
getUsedDirectives(component) {
|
|
16994
17148
|
return this.getLatestComponentState(component).data?.boundTarget.getUsedDirectives() ?? null;
|
|
16995
17149
|
}
|
|
@@ -18148,9 +18302,11 @@ var DirectiveDecoratorHandler = class {
|
|
|
18148
18302
|
this.usePoisonedData = usePoisonedData;
|
|
18149
18303
|
this.typeCheckHostBindings = typeCheckHostBindings;
|
|
18150
18304
|
this.emitDeclarationOnly = emitDeclarationOnly;
|
|
18305
|
+
this.undecoratedMetadataExtractor = getDirectiveUndecoratedMetadataExtractor(reflector, importTracker);
|
|
18151
18306
|
}
|
|
18152
18307
|
precedence = HandlerPrecedence.PRIMARY;
|
|
18153
18308
|
name = "DirectiveDecoratorHandler";
|
|
18309
|
+
undecoratedMetadataExtractor;
|
|
18154
18310
|
detect(node, decorators) {
|
|
18155
18311
|
if (!decorators) {
|
|
18156
18312
|
const angularField = this.findClassFieldWithAngularFeatures(node);
|
|
@@ -18202,7 +18358,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
18202
18358
|
meta: analysis,
|
|
18203
18359
|
hostDirectives: directiveResult.hostDirectives,
|
|
18204
18360
|
rawHostDirectives: directiveResult.rawHostDirectives,
|
|
18205
|
-
classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler) : null,
|
|
18361
|
+
classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, void 0, this.undecoratedMetadataExtractor) : null,
|
|
18206
18362
|
baseClass: readBaseClass(node, this.reflector, this.evaluator),
|
|
18207
18363
|
typeCheckMeta: extractDirectiveTypeCheckMeta(node, directiveResult.inputs, this.reflector),
|
|
18208
18364
|
providersRequiringFactory,
|
|
@@ -18376,7 +18532,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
18376
18532
|
};
|
|
18377
18533
|
|
|
18378
18534
|
// packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.js
|
|
18379
|
-
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr9, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as
|
|
18535
|
+
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr9, FactoryTarget as FactoryTarget2, FunctionExpr, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr3, R3Identifiers as R3Identifiers6, R3NgModuleMetadataKind, R3SelectorScopeMode, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr10 } from "@angular/compiler";
|
|
18380
18536
|
import ts67 from "typescript";
|
|
18381
18537
|
|
|
18382
18538
|
// packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.js
|
|
@@ -19012,14 +19168,14 @@ var NgModuleDecoratorHandler = class {
|
|
|
19012
19168
|
assertSuccessfulReferenceEmit(type, node, "pipe");
|
|
19013
19169
|
return type.expression;
|
|
19014
19170
|
});
|
|
19015
|
-
const directiveArray = new
|
|
19016
|
-
const pipesArray = new
|
|
19171
|
+
const directiveArray = new LiteralArrayExpr3(directives);
|
|
19172
|
+
const pipesArray = new LiteralArrayExpr3(pipes);
|
|
19017
19173
|
const directiveExpr = remoteScopesMayRequireCycleProtection && directives.length > 0 ? new FunctionExpr([], [new ReturnStatement(directiveArray)]) : directiveArray;
|
|
19018
19174
|
const pipesExpr = remoteScopesMayRequireCycleProtection && pipes.length > 0 ? new FunctionExpr([], [new ReturnStatement(pipesArray)]) : pipesArray;
|
|
19019
19175
|
const componentType = this.refEmitter.emit(decl, context);
|
|
19020
19176
|
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
19021
19177
|
const declExpr = componentType.expression;
|
|
19022
|
-
const setComponentScope = new ExternalExpr9(
|
|
19178
|
+
const setComponentScope = new ExternalExpr9(R3Identifiers6.setComponentScope);
|
|
19023
19179
|
const callExpr = new InvokeFunctionExpr(setComponentScope, [
|
|
19024
19180
|
declExpr,
|
|
19025
19181
|
directiveExpr,
|
|
@@ -20086,10 +20242,12 @@ var ComponentDecoratorHandler = class {
|
|
|
20086
20242
|
enableSelectorless: this.enableSelectorless,
|
|
20087
20243
|
preserveSignificantWhitespace: this.i18nPreserveSignificantWhitespace
|
|
20088
20244
|
};
|
|
20245
|
+
this.undecoratedMetadataExtractor = getDirectiveUndecoratedMetadataExtractor(reflector, importTracker);
|
|
20089
20246
|
this.canDeferDeps = !enableHmr;
|
|
20090
20247
|
}
|
|
20091
20248
|
literalCache = /* @__PURE__ */ new Map();
|
|
20092
20249
|
elementSchemaRegistry = new DomElementSchemaRegistry3();
|
|
20250
|
+
undecoratedMetadataExtractor;
|
|
20093
20251
|
/**
|
|
20094
20252
|
* During the asynchronous preanalyze phase, it's necessary to parse the template to extract
|
|
20095
20253
|
* any potential <link> tags which might need to be loaded. This cache ensures that work is not
|
|
@@ -20475,7 +20633,7 @@ var ComponentDecoratorHandler = class {
|
|
|
20475
20633
|
relativeTemplatePath
|
|
20476
20634
|
},
|
|
20477
20635
|
typeCheckMeta: extractDirectiveTypeCheckMeta(node, inputs, this.reflector),
|
|
20478
|
-
classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, (dec) => transformDecoratorResources(dec, component, styles, template)) : null,
|
|
20636
|
+
classMetadata: this.includeClassMetadata ? extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler, (dec) => transformDecoratorResources(dec, component, styles, template), this.undecoratedMetadataExtractor) : null,
|
|
20479
20637
|
classDebugInfo: extractClassDebugInfo(
|
|
20480
20638
|
node,
|
|
20481
20639
|
this.reflector,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
angularJitApplicationTransform
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WXJFCHPN.js";
|
|
8
8
|
import {
|
|
9
9
|
AbsoluteModuleStrategy,
|
|
10
10
|
ActivePerfRecorder,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
toUnredirectedSourceFile,
|
|
93
93
|
tryParseInitializerApi,
|
|
94
94
|
untagAllTsFiles
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-ELPMV5DB.js";
|
|
96
96
|
import {
|
|
97
97
|
LogicalFileSystem,
|
|
98
98
|
absoluteFrom,
|
|
@@ -2804,7 +2804,7 @@ var StandaloneComponentScopeReader = class {
|
|
|
2804
2804
|
};
|
|
2805
2805
|
|
|
2806
2806
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.js
|
|
2807
|
-
import { ASTWithSource as ASTWithSource2, BindingType, Interpolation, PrefixNot, PropertyRead as PropertyRead2, TmplAstBoundAttribute, TmplAstIfBlock, TmplAstSwitchBlock } from "@angular/compiler";
|
|
2807
|
+
import { ASTWithSource as ASTWithSource2, BindingType, Interpolation, PrefixNot, PropertyRead as PropertyRead2, TmplAstBoundAttribute, TmplAstElement as TmplAstElement2, TmplAstIfBlock, TmplAstSwitchBlock, TmplAstTemplate as TmplAstTemplate2 } from "@angular/compiler";
|
|
2808
2808
|
|
|
2809
2809
|
// packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.js
|
|
2810
2810
|
import ts18 from "typescript";
|
|
@@ -2831,16 +2831,6 @@ function isSignalSymbol(symbol) {
|
|
|
2831
2831
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.js
|
|
2832
2832
|
import { CombinedRecursiveAstVisitor as CombinedRecursiveAstVisitor2 } from "@angular/compiler";
|
|
2833
2833
|
var TemplateCheckWithVisitor = class {
|
|
2834
|
-
/**
|
|
2835
|
-
* When extended diagnostics were first introduced, the visitor wasn't implemented correctly
|
|
2836
|
-
* which meant that it wasn't visiting the `templateAttrs` of structural directives (e.g.
|
|
2837
|
-
* the expression of `*ngIf`). Fixing the issue causes a lot of internal breakages and will likely
|
|
2838
|
-
* need to be done in a major version to avoid external breakages. This flag is used to opt out
|
|
2839
|
-
* pre-existing diagnostics from the correct behavior until the breakages have been fixed while
|
|
2840
|
-
* ensuring that newly-written diagnostics are correct from the beginning.
|
|
2841
|
-
* TODO(crisbeto): remove this flag and fix the internal brekages.
|
|
2842
|
-
*/
|
|
2843
|
-
canVisitStructuralAttributes = true;
|
|
2844
2834
|
/**
|
|
2845
2835
|
* Base implementation for run function, visits all nodes in template and calls
|
|
2846
2836
|
* `visitNode()` for each one.
|
|
@@ -2873,9 +2863,7 @@ var TemplateVisitor2 = class extends CombinedRecursiveAstVisitor2 {
|
|
|
2873
2863
|
this.visitAllTemplateNodes(template.outputs);
|
|
2874
2864
|
}
|
|
2875
2865
|
this.visitAllTemplateNodes(template.directives);
|
|
2876
|
-
|
|
2877
|
-
this.visitAllTemplateNodes(template.templateAttrs);
|
|
2878
|
-
}
|
|
2866
|
+
this.visitAllTemplateNodes(template.templateAttrs);
|
|
2879
2867
|
this.visitAllTemplateNodes(template.variables);
|
|
2880
2868
|
this.visitAllTemplateNodes(template.references);
|
|
2881
2869
|
this.visitAllTemplateNodes(template.children);
|
|
@@ -2895,23 +2883,21 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
|
2895
2883
|
visitNode(ctx, component, node) {
|
|
2896
2884
|
if (node instanceof Interpolation) {
|
|
2897
2885
|
return node.expressions.map((item) => item instanceof PrefixNot ? item.expression : item).filter((item) => item instanceof PropertyRead2).flatMap((item) => buildDiagnosticForSignal(ctx, item, component));
|
|
2898
|
-
} else if (node instanceof
|
|
2899
|
-
const
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
const
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
)
|
|
2913
|
-
return buildDiagnosticForSignal(ctx, nodeAst, component);
|
|
2914
|
-
}
|
|
2886
|
+
} else if (node instanceof TmplAstElement2 && node.inputs.length > 0) {
|
|
2887
|
+
const directivesOfElement = ctx.templateTypeChecker.getDirectivesOfNode(component, node);
|
|
2888
|
+
return node.inputs.flatMap((input) => checkBoundAttribute(ctx, component, directivesOfElement, input));
|
|
2889
|
+
} else if (node instanceof TmplAstTemplate2 && node.tagName === "ng-template") {
|
|
2890
|
+
const directivesOfElement = ctx.templateTypeChecker.getDirectivesOfNode(component, node);
|
|
2891
|
+
const inputDiagnostics = node.inputs.flatMap((input) => {
|
|
2892
|
+
return checkBoundAttribute(ctx, component, directivesOfElement, input);
|
|
2893
|
+
});
|
|
2894
|
+
const templateAttrDiagnostics = node.templateAttrs.flatMap((attr) => {
|
|
2895
|
+
if (!(attr instanceof TmplAstBoundAttribute)) {
|
|
2896
|
+
return [];
|
|
2897
|
+
}
|
|
2898
|
+
return checkBoundAttribute(ctx, component, directivesOfElement, attr);
|
|
2899
|
+
});
|
|
2900
|
+
return inputDiagnostics.concat(templateAttrDiagnostics);
|
|
2915
2901
|
} else if (node instanceof TmplAstIfBlock) {
|
|
2916
2902
|
return node.branches.map((branch) => branch.expression).filter((expr) => expr instanceof ASTWithSource2).map((expr) => {
|
|
2917
2903
|
const ast = expr.ast;
|
|
@@ -2926,6 +2912,24 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
|
2926
2912
|
return [];
|
|
2927
2913
|
}
|
|
2928
2914
|
};
|
|
2915
|
+
function checkBoundAttribute(ctx, component, directivesOfElement, node) {
|
|
2916
|
+
if (directivesOfElement !== null && directivesOfElement.some((dir) => dir.inputs.getByBindingPropertyName(node.name) !== null)) {
|
|
2917
|
+
return [];
|
|
2918
|
+
}
|
|
2919
|
+
const nodeAst = isPropertyReadNodeAst(node);
|
|
2920
|
+
if (
|
|
2921
|
+
// a bound property like `[prop]="mySignal"`
|
|
2922
|
+
(node.type === BindingType.Property || // or a class binding like `[class.myClass]="mySignal"`
|
|
2923
|
+
node.type === BindingType.Class || // or a style binding like `[style.width]="mySignal"`
|
|
2924
|
+
node.type === BindingType.Style || // or an attribute binding like `[attr.role]="mySignal"`
|
|
2925
|
+
node.type === BindingType.Attribute || // or an animation binding like `[animate.enter]="mySignal"`
|
|
2926
|
+
node.type === BindingType.Animation || // or an animation binding like `[@myAnimation]="mySignal"`
|
|
2927
|
+
node.type === BindingType.LegacyAnimation) && nodeAst
|
|
2928
|
+
) {
|
|
2929
|
+
return buildDiagnosticForSignal(ctx, nodeAst, component);
|
|
2930
|
+
}
|
|
2931
|
+
return [];
|
|
2932
|
+
}
|
|
2929
2933
|
function isPropertyReadNodeAst(node) {
|
|
2930
2934
|
if (node.value instanceof ASTWithSource2 === false) {
|
|
2931
2935
|
return void 0;
|
|
@@ -2952,8 +2956,11 @@ function buildDiagnosticForSignal(ctx, node, component) {
|
|
|
2952
2956
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
2953
2957
|
return [diagnostic];
|
|
2954
2958
|
}
|
|
2959
|
+
if (!isFunctionInstanceProperty(node.name) && !isSignalInstanceProperty(node.name)) {
|
|
2960
|
+
return [];
|
|
2961
|
+
}
|
|
2955
2962
|
const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
2956
|
-
if (
|
|
2963
|
+
if (symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
|
|
2957
2964
|
const templateMapping = ctx.templateTypeChecker.getSourceMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
|
|
2958
2965
|
const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
|
|
2959
2966
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
@@ -2991,7 +2998,7 @@ var factory2 = {
|
|
|
2991
2998
|
};
|
|
2992
2999
|
|
|
2993
3000
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_control_flow_directive/index.js
|
|
2994
|
-
import { TmplAstTemplate as
|
|
3001
|
+
import { TmplAstTemplate as TmplAstTemplate3 } from "@angular/compiler";
|
|
2995
3002
|
var KNOWN_CONTROL_FLOW_DIRECTIVES = /* @__PURE__ */ new Map([
|
|
2996
3003
|
["ngIf", { directive: "NgIf", builtIn: "@if" }],
|
|
2997
3004
|
["ngFor", { directive: "NgFor", builtIn: "@for" }],
|
|
@@ -3008,7 +3015,7 @@ var MissingControlFlowDirectiveCheck = class extends TemplateCheckWithVisitor {
|
|
|
3008
3015
|
return super.run(ctx, component, template);
|
|
3009
3016
|
}
|
|
3010
3017
|
visitNode(ctx, component, node) {
|
|
3011
|
-
if (!(node instanceof
|
|
3018
|
+
if (!(node instanceof TmplAstTemplate3))
|
|
3012
3019
|
return [];
|
|
3013
3020
|
const controlFlowAttr = node.templateAttrs.find((attr) => KNOWN_CONTROL_FLOW_DIRECTIVES.has(attr.name));
|
|
3014
3021
|
if (!controlFlowAttr)
|
|
@@ -3033,12 +3040,12 @@ var factory3 = {
|
|
|
3033
3040
|
};
|
|
3034
3041
|
|
|
3035
3042
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_ngforof_let/index.js
|
|
3036
|
-
import { TmplAstTemplate as
|
|
3043
|
+
import { TmplAstTemplate as TmplAstTemplate4 } from "@angular/compiler";
|
|
3037
3044
|
var MissingNgForOfLetCheck = class extends TemplateCheckWithVisitor {
|
|
3038
3045
|
code = ErrorCode.MISSING_NGFOROF_LET;
|
|
3039
3046
|
visitNode(ctx, component, node) {
|
|
3040
|
-
const isTemplate = node instanceof
|
|
3041
|
-
if (!(node instanceof
|
|
3047
|
+
const isTemplate = node instanceof TmplAstTemplate4;
|
|
3048
|
+
if (!(node instanceof TmplAstTemplate4)) {
|
|
3042
3049
|
return [];
|
|
3043
3050
|
}
|
|
3044
3051
|
if (node.templateAttrs.length === 0) {
|
|
@@ -3063,7 +3070,7 @@ var factory4 = {
|
|
|
3063
3070
|
};
|
|
3064
3071
|
|
|
3065
3072
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/missing_structural_directive/index.js
|
|
3066
|
-
import { TmplAstTemplate as
|
|
3073
|
+
import { TmplAstTemplate as TmplAstTemplate5 } from "@angular/compiler";
|
|
3067
3074
|
var KNOWN_CONTROL_FLOW_DIRECTIVES2 = /* @__PURE__ */ new Set([
|
|
3068
3075
|
"ngIf",
|
|
3069
3076
|
"ngFor",
|
|
@@ -3082,7 +3089,7 @@ var MissingStructuralDirectiveCheck = class extends TemplateCheckWithVisitor {
|
|
|
3082
3089
|
return super.run(ctx, component, template);
|
|
3083
3090
|
}
|
|
3084
3091
|
visitNode(ctx, component, node) {
|
|
3085
|
-
if (!(node instanceof
|
|
3092
|
+
if (!(node instanceof TmplAstTemplate5))
|
|
3086
3093
|
return [];
|
|
3087
3094
|
const customStructuralDirective = node.templateAttrs.find((attr) => !KNOWN_CONTROL_FLOW_DIRECTIVES2.has(attr.name));
|
|
3088
3095
|
if (!customStructuralDirective)
|
|
@@ -3106,7 +3113,6 @@ var factory5 = {
|
|
|
3106
3113
|
import { Binary } from "@angular/compiler";
|
|
3107
3114
|
import ts19 from "typescript";
|
|
3108
3115
|
var NullishCoalescingNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
3109
|
-
canVisitStructuralAttributes = false;
|
|
3110
3116
|
code = ErrorCode.NULLISH_COALESCING_NOT_NULLABLE;
|
|
3111
3117
|
visitNode(ctx, component, node) {
|
|
3112
3118
|
if (!(node instanceof Binary) || node.operation !== "??")
|
|
@@ -3150,7 +3156,6 @@ import { KeyedRead, SafeCall, SafeKeyedRead, SafePropertyRead } from "@angular/c
|
|
|
3150
3156
|
import ts20 from "typescript";
|
|
3151
3157
|
var OptionalChainNotNullableCheck = class extends TemplateCheckWithVisitor {
|
|
3152
3158
|
noUncheckedIndexedAccess;
|
|
3153
|
-
canVisitStructuralAttributes = false;
|
|
3154
3159
|
code = ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE;
|
|
3155
3160
|
constructor(noUncheckedIndexedAccess) {
|
|
3156
3161
|
super();
|
|
@@ -3473,6 +3478,70 @@ var factory15 = {
|
|
|
3473
3478
|
create: () => new UninvokedFunctionInTextInterpolation()
|
|
3474
3479
|
};
|
|
3475
3480
|
|
|
3481
|
+
// packages/compiler-cli/src/ngtsc/typecheck/extended/checks/defer_trigger_misconfiguration/index.js
|
|
3482
|
+
import { TmplAstDeferredBlock, TmplAstHoverDeferredTrigger, TmplAstImmediateDeferredTrigger, TmplAstInteractionDeferredTrigger, TmplAstTimerDeferredTrigger, TmplAstViewportDeferredTrigger } from "@angular/compiler";
|
|
3483
|
+
var DeferTriggerMisconfiguration = class extends TemplateCheckWithVisitor {
|
|
3484
|
+
code = ErrorCode.DEFER_TRIGGER_MISCONFIGURATION;
|
|
3485
|
+
visitNode(ctx, component, node) {
|
|
3486
|
+
if (!(node instanceof TmplAstDeferredBlock))
|
|
3487
|
+
return [];
|
|
3488
|
+
const mainKeys = Object.keys(node.triggers);
|
|
3489
|
+
const prefetchKeys = Object.keys(node.prefetchTriggers);
|
|
3490
|
+
const mains = mainKeys.map((k) => node.triggers[k]).filter((t) => t !== void 0 && t !== null);
|
|
3491
|
+
const prefetches = prefetchKeys.map((k) => node.prefetchTriggers[k]).filter((t) => t !== void 0 && t !== null);
|
|
3492
|
+
const diags = [];
|
|
3493
|
+
const hasImmediateMain = mains.some((t) => t instanceof TmplAstImmediateDeferredTrigger);
|
|
3494
|
+
if (hasImmediateMain) {
|
|
3495
|
+
if (mains.length > 1) {
|
|
3496
|
+
const msg = `The 'immediate' trigger makes additional triggers redundant.`;
|
|
3497
|
+
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, msg));
|
|
3498
|
+
}
|
|
3499
|
+
if (prefetches.length > 0) {
|
|
3500
|
+
const msg = `Prefetch triggers have no effect because 'immediate' executes earlier.`;
|
|
3501
|
+
diags.push(ctx.makeTemplateDiagnostic(node.sourceSpan, msg));
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
if (mains.length === 1 && prefetches.length > 0) {
|
|
3505
|
+
const main = mains[0];
|
|
3506
|
+
for (const pre of prefetches) {
|
|
3507
|
+
const isTimerTriggger = main instanceof TmplAstTimerDeferredTrigger && pre instanceof TmplAstTimerDeferredTrigger;
|
|
3508
|
+
if (isTimerTriggger) {
|
|
3509
|
+
const mainDelay = main.delay;
|
|
3510
|
+
const preDelay = pre.delay;
|
|
3511
|
+
if (preDelay >= mainDelay) {
|
|
3512
|
+
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.`;
|
|
3513
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
const isHoverTrigger = main instanceof TmplAstHoverDeferredTrigger && pre instanceof TmplAstHoverDeferredTrigger;
|
|
3517
|
+
const isInteractionTrigger = main instanceof TmplAstInteractionDeferredTrigger && pre instanceof TmplAstInteractionDeferredTrigger;
|
|
3518
|
+
const isViewportTrigger = main instanceof TmplAstViewportDeferredTrigger && pre instanceof TmplAstViewportDeferredTrigger;
|
|
3519
|
+
if (isHoverTrigger || isInteractionTrigger || isViewportTrigger) {
|
|
3520
|
+
const mainRef = main.reference;
|
|
3521
|
+
const preRef = pre.reference;
|
|
3522
|
+
if (mainRef && preRef && mainRef === preRef) {
|
|
3523
|
+
const kindName = main.constructor.name.replace("DeferredTrigger", "").toLowerCase();
|
|
3524
|
+
const msg = `Prefetch '${kindName}' matches the main trigger and provides no benefit. Remove the prefetch modifier.`;
|
|
3525
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3526
|
+
}
|
|
3527
|
+
continue;
|
|
3528
|
+
}
|
|
3529
|
+
if (main.constructor === pre.constructor && !(main instanceof TmplAstTimerDeferredTrigger)) {
|
|
3530
|
+
const kind = main instanceof TmplAstImmediateDeferredTrigger ? "immediate" : main.constructor.name.replace("DeferredTrigger", "").toLowerCase();
|
|
3531
|
+
const msg = `Prefetch '${kind}' matches the main trigger and provides no benefit. Remove the prefetch modifier.`;
|
|
3532
|
+
diags.push(ctx.makeTemplateDiagnostic(pre.sourceSpan ?? node.sourceSpan, msg));
|
|
3533
|
+
}
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
return diags;
|
|
3537
|
+
}
|
|
3538
|
+
};
|
|
3539
|
+
var factory16 = {
|
|
3540
|
+
code: ErrorCode.DEFER_TRIGGER_MISCONFIGURATION,
|
|
3541
|
+
name: ExtendedTemplateDiagnosticName.DEFER_TRIGGER_MISCONFIGURATION,
|
|
3542
|
+
create: () => new DeferTriggerMisconfiguration()
|
|
3543
|
+
};
|
|
3544
|
+
|
|
3476
3545
|
// packages/compiler-cli/src/ngtsc/typecheck/extended/src/extended_template_checker.js
|
|
3477
3546
|
import ts21 from "typescript";
|
|
3478
3547
|
|
|
@@ -3491,12 +3560,12 @@ var ExtendedTemplateCheckerImpl = class {
|
|
|
3491
3560
|
constructor(templateTypeChecker, typeChecker, templateCheckFactories, options) {
|
|
3492
3561
|
this.partialCtx = { templateTypeChecker, typeChecker };
|
|
3493
3562
|
this.templateChecks = /* @__PURE__ */ new Map();
|
|
3494
|
-
for (const
|
|
3495
|
-
const category = diagnosticLabelToCategory(options?.extendedDiagnostics?.checks?.[
|
|
3563
|
+
for (const factory17 of templateCheckFactories) {
|
|
3564
|
+
const category = diagnosticLabelToCategory(options?.extendedDiagnostics?.checks?.[factory17.name] ?? options?.extendedDiagnostics?.defaultCategory ?? DiagnosticCategoryLabel.Warning);
|
|
3496
3565
|
if (category === null) {
|
|
3497
3566
|
continue;
|
|
3498
3567
|
}
|
|
3499
|
-
const check =
|
|
3568
|
+
const check = factory17.create(options);
|
|
3500
3569
|
if (check === null) {
|
|
3501
3570
|
continue;
|
|
3502
3571
|
}
|
|
@@ -3556,12 +3625,13 @@ var ALL_DIAGNOSTIC_FACTORIES = [
|
|
|
3556
3625
|
factory8,
|
|
3557
3626
|
factory12,
|
|
3558
3627
|
factory14,
|
|
3559
|
-
factory15
|
|
3628
|
+
factory15,
|
|
3629
|
+
factory16
|
|
3560
3630
|
];
|
|
3561
3631
|
var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
3562
3632
|
ExtendedTemplateDiagnosticName.CONTROL_FLOW_PREVENTING_CONTENT_PROJECTION,
|
|
3563
3633
|
ExtendedTemplateDiagnosticName.UNUSED_STANDALONE_IMPORTS,
|
|
3564
|
-
...ALL_DIAGNOSTIC_FACTORIES.map((
|
|
3634
|
+
...ALL_DIAGNOSTIC_FACTORIES.map((factory17) => factory17.name)
|
|
3565
3635
|
]);
|
|
3566
3636
|
|
|
3567
3637
|
// packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.js
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
tryParseSignalInputMapping,
|
|
17
17
|
tryParseSignalModelMapping,
|
|
18
18
|
tryParseSignalQueryFromInitializer
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ELPMV5DB.js";
|
|
20
20
|
|
|
21
21
|
// packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
|
|
22
22
|
import ts from "typescript";
|
package/bundles/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isTsDiagnostic,
|
|
29
29
|
performCompilation,
|
|
30
30
|
readConfiguration
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NBFYHUMW.js";
|
|
32
32
|
import {
|
|
33
33
|
ConsoleLogger,
|
|
34
34
|
LogLevel
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
angularJitApplicationTransform,
|
|
38
38
|
getDownlevelDecoratorsTransform,
|
|
39
39
|
getInitializerApiJitTransform
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-WXJFCHPN.js";
|
|
41
41
|
import {
|
|
42
42
|
ActivePerfRecorder,
|
|
43
43
|
ErrorCode,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
TsCreateProgramDriver,
|
|
47
47
|
isLocalCompilationDiagnostics,
|
|
48
48
|
ngErrorCode
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ELPMV5DB.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-next.
|
|
80
|
+
var VERSION = new Version("21.0.0-next.8");
|
|
81
81
|
|
|
82
82
|
// packages/compiler-cli/private/tooling.js
|
|
83
83
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TypeScriptReflectionHost,
|
|
14
14
|
createForwardRefResolver,
|
|
15
15
|
reflectObjectLiteral
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-ELPMV5DB.js";
|
|
17
17
|
import "../chunk-LS5RJ5CS.js";
|
|
18
18
|
import "../chunk-GWZQLAGK.js";
|
|
19
19
|
import "../chunk-XYYEESKY.js";
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
angularJitApplicationTransform
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-WXJFCHPN.js";
|
|
8
|
+
import "../chunk-ELPMV5DB.js";
|
|
9
9
|
import "../chunk-LS5RJ5CS.js";
|
|
10
10
|
import "../chunk-GWZQLAGK.js";
|
|
11
11
|
import "../chunk-XYYEESKY.js";
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
import {
|
|
7
7
|
main,
|
|
8
8
|
readCommandLineAndConfiguration
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-MVFPDRXS.js";
|
|
10
10
|
import {
|
|
11
11
|
EmitFlags
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-NBFYHUMW.js";
|
|
13
|
+
import "../../chunk-WXJFCHPN.js";
|
|
14
|
+
import "../../chunk-ELPMV5DB.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-MVFPDRXS.js";
|
|
9
|
+
import "../../chunk-NBFYHUMW.js";
|
|
10
|
+
import "../../chunk-WXJFCHPN.js";
|
|
11
|
+
import "../../chunk-ELPMV5DB.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-next.
|
|
10
|
+
export declare const PLACEHOLDER_VERSION = "21.0.0-next.8";
|
|
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-next.
|
|
3
|
+
"version": "21.0.0-next.8",
|
|
4
4
|
"description": "Angular - the compiler CLI for Node.js",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"bin": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"yargs": "^18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@angular/compiler": "21.0.0-next.
|
|
51
|
+
"@angular/compiler": "21.0.0-next.8",
|
|
52
52
|
"typescript": ">=5.9 <6.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import { R3ClassMetadata } from '@angular/compiler';
|
|
8
|
+
import { LiteralArrayExpr, R3ClassMetadata } from '@angular/compiler';
|
|
9
9
|
import ts from 'typescript';
|
|
10
|
-
import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
|
|
10
|
+
import { ClassMember, DeclarationNode, Decorator, ReflectionHost } from '../../../reflection';
|
|
11
|
+
/** Function that extracts metadata from an undercorated class member. */
|
|
12
|
+
export type UndecoratedMetadataExtractor = (member: ClassMember) => LiteralArrayExpr | null;
|
|
11
13
|
/**
|
|
12
14
|
* Given a class declaration, generate a call to `setClassMetadata` with the Angular metadata
|
|
13
15
|
* present on the class or its member fields. An ngDevMode guard is used to allow the call to be
|
|
@@ -16,7 +18,7 @@ import { DeclarationNode, Decorator, ReflectionHost } from '../../../reflection'
|
|
|
16
18
|
* If no such metadata is present, this function returns `null`. Otherwise, the call is returned
|
|
17
19
|
* as a `Statement` for inclusion along with the class.
|
|
18
20
|
*/
|
|
19
|
-
export declare function extractClassMetadata(clazz: DeclarationNode, reflection: ReflectionHost, isCore: boolean, annotateForClosureCompiler?: boolean, angularDecoratorTransform?: (dec: Decorator) => Decorator): R3ClassMetadata | null;
|
|
21
|
+
export declare function extractClassMetadata(clazz: DeclarationNode, reflection: ReflectionHost, isCore: boolean, annotateForClosureCompiler?: boolean, angularDecoratorTransform?: (dec: Decorator) => Decorator, undecoratedMetadataExtractor?: UndecoratedMetadataExtractor): R3ClassMetadata | null;
|
|
20
22
|
/**
|
|
21
23
|
* Recursively recreates all of the `Identifier` descendant nodes with a particular name inside
|
|
22
24
|
* of an AST node, thus removing any references to them. Useful if a particular node has to be
|
|
@@ -79,6 +79,7 @@ export declare class ComponentDecoratorHandler implements DecoratorHandler<Decor
|
|
|
79
79
|
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, metaReader: MetadataReader, scopeReader: ComponentScopeReader, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, scopeRegistry: LocalModuleScopeRegistry, typeCheckScopeRegistry: TypeCheckScopeRegistry, resourceRegistry: ResourceRegistry, isCore: boolean, strictCtorDeps: boolean, resourceLoader: ResourceLoader, rootDirs: ReadonlyArray<string>, defaultPreserveWhitespaces: boolean, i18nUseExternalIds: boolean, enableI18nLegacyMessageIdFormat: boolean, usePoisonedData: boolean, i18nNormalizeLineEndingsInICUs: boolean, moduleResolver: ModuleResolver, cycleAnalyzer: CycleAnalyzer, cycleHandlingStrategy: CycleHandlingStrategy, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, depTracker: DependencyTracker | null, injectableRegistry: InjectableClassRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, hostDirectivesResolver: HostDirectivesResolver, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, compilationMode: CompilationMode, deferredSymbolTracker: DeferredSymbolTracker, forbidOrphanRendering: boolean, enableBlockSyntax: boolean, enableLetSyntax: boolean, externalRuntimeStyles: boolean, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, jitDeclarationRegistry: JitDeclarationRegistry, i18nPreserveSignificantWhitespace: boolean, strictStandalone: boolean, enableHmr: boolean, implicitStandaloneValue: boolean, typeCheckHostBindings: boolean, enableSelectorless: boolean, emitDeclarationOnly: boolean);
|
|
80
80
|
private literalCache;
|
|
81
81
|
private elementSchemaRegistry;
|
|
82
|
+
private readonly undecoratedMetadataExtractor;
|
|
82
83
|
/**
|
|
83
84
|
* During the asynchronous preanalyze phase, it's necessary to parse the template to extract
|
|
84
85
|
* any potential <link> tags which might need to be loaded. This cache ensures that work is not
|
|
@@ -65,6 +65,7 @@ export declare class DirectiveDecoratorHandler implements DecoratorHandler<Decor
|
|
|
65
65
|
constructor(reflector: ReflectionHost, evaluator: PartialEvaluator, metaRegistry: MetadataRegistry, scopeRegistry: LocalModuleScopeRegistry, metaReader: MetadataReader, injectableRegistry: InjectableClassRegistry, refEmitter: ReferenceEmitter, referencesRegistry: ReferencesRegistry, isCore: boolean, strictCtorDeps: boolean, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, annotateForClosureCompiler: boolean, perf: PerfRecorder, importTracker: ImportedSymbolsTracker, includeClassMetadata: boolean, typeCheckScopeRegistry: TypeCheckScopeRegistry, compilationMode: CompilationMode, jitDeclarationRegistry: JitDeclarationRegistry, resourceRegistry: ResourceRegistry, strictStandalone: boolean, implicitStandaloneValue: boolean, usePoisonedData: boolean, typeCheckHostBindings: boolean, emitDeclarationOnly: boolean);
|
|
66
66
|
readonly precedence = HandlerPrecedence.PRIMARY;
|
|
67
67
|
readonly name = "DirectiveDecoratorHandler";
|
|
68
|
+
private readonly undecoratedMetadataExtractor;
|
|
68
69
|
detect(node: ClassDeclaration, decorators: Decorator[] | null): DetectResult<Decorator | null> | undefined;
|
|
69
70
|
analyze(node: ClassDeclaration, decorator: Readonly<Decorator | null>): AnalysisOutput<DirectiveHandlerData>;
|
|
70
71
|
symbol(node: ClassDeclaration, analysis: Readonly<DirectiveHandlerData>): DirectiveSymbol;
|
|
@@ -12,7 +12,7 @@ import { ClassPropertyMapping, DecoratorInputTransform, HostDirectiveMeta, Input
|
|
|
12
12
|
import { DynamicValue, PartialEvaluator } from '../../../partial_evaluator';
|
|
13
13
|
import { ClassDeclaration, Decorator, ReflectionHost } from '../../../reflection';
|
|
14
14
|
import { CompilationMode } from '../../../transform';
|
|
15
|
-
import { ReferencesRegistry } from '../../common';
|
|
15
|
+
import { ReferencesRegistry, UndecoratedMetadataExtractor } from '../../common';
|
|
16
16
|
type QueryDecoratorName = 'ViewChild' | 'ViewChildren' | 'ContentChild' | 'ContentChildren';
|
|
17
17
|
export declare const queryDecoratorNames: QueryDecoratorName[];
|
|
18
18
|
export interface HostBindingNodes {
|
|
@@ -43,6 +43,11 @@ export declare function extractDirectiveMetadata(clazz: ClassDeclaration, decora
|
|
|
43
43
|
export declare function extractDecoratorQueryMetadata(exprNode: ts.Node, name: string, args: ReadonlyArray<ts.Expression>, propertyName: string, reflector: ReflectionHost, evaluator: PartialEvaluator): R3QueryMetadata;
|
|
44
44
|
export declare function parseDirectiveStyles(directive: Map<string, ts.Expression>, evaluator: PartialEvaluator, compilationMode: CompilationMode): null | string[];
|
|
45
45
|
export declare function parseFieldStringArrayValue(directive: Map<string, ts.Expression>, field: string, evaluator: PartialEvaluator): null | string[];
|
|
46
|
+
/**
|
|
47
|
+
* Returns a function that can be used to extract data for the `setClassMetadata`
|
|
48
|
+
* calls from undecorated directive class members.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getDirectiveUndecoratedMetadataExtractor(reflector: ReflectionHost, importTracker: ImportedSymbolsTracker): UndecoratedMetadataExtractor;
|
|
46
51
|
/**
|
|
47
52
|
* Parses the `transform` function and its type for a decorator `@Input`.
|
|
48
53
|
*
|
|
@@ -354,6 +354,12 @@ export declare enum ErrorCode {
|
|
|
354
354
|
* ```
|
|
355
355
|
*/
|
|
356
356
|
DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER = 8020,
|
|
357
|
+
/**
|
|
358
|
+
* Raised when an `@defer` block defines unreachable or redundant triggers.
|
|
359
|
+
* Examples: multiple main triggers, 'on immediate' together with other mains or any prefetch,
|
|
360
|
+
* prefetch timer delay that is not earlier than the main timer, or an identical prefetch
|
|
361
|
+
*/
|
|
362
|
+
DEFER_TRIGGER_MISCONFIGURATION = 8021,
|
|
357
363
|
/**
|
|
358
364
|
* A two way binding in a template has an incorrect syntax,
|
|
359
365
|
* parentheses outside brackets. For example:
|
|
@@ -31,5 +31,6 @@ export declare enum ExtendedTemplateDiagnosticName {
|
|
|
31
31
|
UNINVOKED_TRACK_FUNCTION = "uninvokedTrackFunction",
|
|
32
32
|
UNUSED_STANDALONE_IMPORTS = "unusedStandaloneImports",
|
|
33
33
|
UNPARENTHESIZED_NULLISH_COALESCING = "unparenthesizedNullishCoalescing",
|
|
34
|
-
UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION = "uninvokedFunctionInTextInterpolation"
|
|
34
|
+
UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION = "uninvokedFunctionInTextInterpolation",
|
|
35
|
+
DEFER_TRIGGER_MISCONFIGURATION = "deferTriggerMisconfiguration"
|
|
35
36
|
}
|
|
@@ -204,6 +204,10 @@ export interface TemplateTypeChecker {
|
|
|
204
204
|
* Retrieve the type checking engine's metadata for the given pipe class, if available.
|
|
205
205
|
*/
|
|
206
206
|
getPipeMetadata(pipe: ts.ClassDeclaration): PipeMeta | null;
|
|
207
|
+
/**
|
|
208
|
+
* Gets the directives that apply to the given template node in a component's template.
|
|
209
|
+
*/
|
|
210
|
+
getDirectivesOfNode(component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate): TypeCheckableDirectiveMeta[] | null;
|
|
207
211
|
/**
|
|
208
212
|
* Gets the directives that have been used in a component's template.
|
|
209
213
|
*/
|
|
@@ -55,16 +55,6 @@ export interface TemplateCheckFactory<Code extends ErrorCode, Name extends Exten
|
|
|
55
55
|
* This abstract class provides a base implementation for the run method.
|
|
56
56
|
*/
|
|
57
57
|
export declare abstract class TemplateCheckWithVisitor<Code extends ErrorCode> implements TemplateCheck<Code> {
|
|
58
|
-
/**
|
|
59
|
-
* When extended diagnostics were first introduced, the visitor wasn't implemented correctly
|
|
60
|
-
* which meant that it wasn't visiting the `templateAttrs` of structural directives (e.g.
|
|
61
|
-
* the expression of `*ngIf`). Fixing the issue causes a lot of internal breakages and will likely
|
|
62
|
-
* need to be done in a major version to avoid external breakages. This flag is used to opt out
|
|
63
|
-
* pre-existing diagnostics from the correct behavior until the breakages have been fixed while
|
|
64
|
-
* ensuring that newly-written diagnostics are correct from the beginning.
|
|
65
|
-
* TODO(crisbeto): remove this flag and fix the internal brekages.
|
|
66
|
-
*/
|
|
67
|
-
readonly canVisitStructuralAttributes: boolean;
|
|
68
58
|
abstract code: Code;
|
|
69
59
|
/**
|
|
70
60
|
* Base implementation for run function, visits all nodes in template and calls
|
|
@@ -0,0 +1,10 @@
|
|
|
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, ExtendedTemplateDiagnosticName } from '../../../../diagnostics';
|
|
9
|
+
import { TemplateCheckFactory } from '../../api';
|
|
10
|
+
export declare const factory: TemplateCheckFactory<ErrorCode.DEFER_TRIGGER_MISCONFIGURATION, ExtendedTemplateDiagnosticName.DEFER_TRIGGER_MISCONFIGURATION>;
|
|
@@ -78,6 +78,7 @@ export declare class TemplateTypeCheckerImpl implements TemplateTypeChecker {
|
|
|
78
78
|
constructor(originalProgram: ts.Program, programDriver: ProgramDriver, typeCheckAdapter: ProgramTypeCheckAdapter, config: TypeCheckingConfig, refEmitter: ReferenceEmitter, reflector: ReflectionHost, compilerHost: Pick<ts.CompilerHost, 'getCanonicalFileName'>, priorBuild: IncrementalBuild<unknown, FileTypeCheckingData>, metaReader: MetadataReader, localMetaReader: MetadataReaderWithIndex, ngModuleIndex: NgModuleIndex, componentScopeReader: ComponentScopeReader, typeCheckScopeRegistry: TypeCheckScopeRegistry, perf: PerfRecorder);
|
|
79
79
|
getTemplate(component: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstNode[] | null;
|
|
80
80
|
getHostElement(directive: ts.ClassDeclaration, optimizeFor?: OptimizeFor): TmplAstHostElement | null;
|
|
81
|
+
getDirectivesOfNode(component: ts.ClassDeclaration, node: TmplAstElement | TmplAstTemplate): TypeCheckableDirectiveMeta[] | null;
|
|
81
82
|
getUsedDirectives(component: ts.ClassDeclaration): TypeCheckableDirectiveMeta[] | null;
|
|
82
83
|
getUsedPipes(component: ts.ClassDeclaration): string[] | null;
|
|
83
84
|
private getLatestComponentState;
|