@angular/compiler-cli 17.3.0-next.1 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/{chunk-YVYW546M.js → chunk-3ESFLGKJ.js} +61 -31
- package/bundles/chunk-3ESFLGKJ.js.map +6 -0
- package/bundles/{chunk-7VU7HCQZ.js → chunk-6X7GQ6BQ.js} +2 -1
- package/bundles/{chunk-7VU7HCQZ.js.map → chunk-6X7GQ6BQ.js.map} +1 -1
- package/bundles/{chunk-IIZOI4XA.js → chunk-E5DF5SRS.js} +3 -3
- package/bundles/{chunk-FPKC3HSK.js → chunk-GQ63H5AL.js} +2 -2
- package/bundles/{chunk-2CAUFIKU.js → chunk-OXIOYWLB.js} +3 -3
- package/bundles/{chunk-5A5Y7O22.js → chunk-X6GFRI46.js} +187 -132
- package/bundles/chunk-X6GFRI46.js.map +6 -0
- package/bundles/{chunk-Q5Y7HH3O.js → chunk-YUMIYLNL.js} +1 -1
- package/bundles/{chunk-Q5Y7HH3O.js.map → chunk-YUMIYLNL.js.map} +1 -1
- package/bundles/index.js +6 -6
- package/bundles/linker/babel/index.js +2 -2
- package/bundles/linker/index.js +2 -2
- package/bundles/private/migrations.js +3 -3
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +5 -5
- package/bundles/src/bin/ngc.js +5 -5
- package/bundles_metadata.json +1 -1
- package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/component/src/handler.d.ts +2 -0
- package/src/ngtsc/annotations/directive/src/initializer_functions.d.ts +9 -4
- package/src/ngtsc/core/src/compiler.d.ts +1 -7
- package/src/ngtsc/reflection/index.d.ts +1 -1
- package/src/ngtsc/reflection/src/type_to_value.d.ts +1 -0
- package/src/ngtsc/transform/src/api.d.ts +2 -0
- package/src/ngtsc/transform/src/compilation.d.ts +1 -2
- package/src/ngtsc/typecheck/api/checker.d.ts +6 -1
- package/src/ngtsc/typecheck/src/checker.d.ts +2 -1
- package/src/ngtsc/typecheck/src/oob.d.ts +1 -3
- package/src/ngtsc/typecheck/src/symbol_util.d.ts +10 -0
- package/src/ngtsc/typecheck/template_semantics/api/api.d.ts +18 -0
- package/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.d.ts +15 -0
- package/bundles/chunk-5A5Y7O22.js.map +0 -6
- package/bundles/chunk-YVYW546M.js.map +0 -6
- package/src/ngtsc/typecheck/src/template_semantics.d.ts +0 -21
- /package/bundles/{chunk-IIZOI4XA.js.map → chunk-E5DF5SRS.js.map} +0 -0
- /package/bundles/{chunk-FPKC3HSK.js.map → chunk-GQ63H5AL.js.map} +0 -0
- /package/bundles/{chunk-2CAUFIKU.js.map → chunk-OXIOYWLB.js.map} +0 -0
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Reference,
|
|
13
13
|
assertSuccessfulReferenceEmit,
|
|
14
14
|
attachDefaultImportDeclaration,
|
|
15
|
+
entityNameToValue,
|
|
15
16
|
filterToMembersWithDecorator,
|
|
16
17
|
getDefaultImportDeclaration,
|
|
17
18
|
getSourceFile,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
translateStatement,
|
|
30
31
|
translateType,
|
|
31
32
|
typeNodeToValueExpr
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-6X7GQ6BQ.js";
|
|
33
34
|
import {
|
|
34
35
|
PerfEvent,
|
|
35
36
|
PerfPhase
|
|
@@ -2531,7 +2532,7 @@ var TraitCompiler = class {
|
|
|
2531
2532
|
}
|
|
2532
2533
|
}
|
|
2533
2534
|
}
|
|
2534
|
-
|
|
2535
|
+
runAdditionalChecks(sf, check) {
|
|
2535
2536
|
if (this.compilationMode === CompilationMode.LOCAL) {
|
|
2536
2537
|
return [];
|
|
2537
2538
|
}
|
|
@@ -2546,10 +2547,10 @@ var TraitCompiler = class {
|
|
|
2546
2547
|
}
|
|
2547
2548
|
const record = this.classes.get(clazz);
|
|
2548
2549
|
for (const trait of record.traits) {
|
|
2549
|
-
|
|
2550
|
-
|
|
2550
|
+
const result = check(clazz, trait.handler);
|
|
2551
|
+
if (result !== null) {
|
|
2552
|
+
diagnostics.push(...result);
|
|
2551
2553
|
}
|
|
2552
|
-
diagnostics.push(...trait.handler.extendedTemplateCheck(clazz, extendedTemplateChecker));
|
|
2553
2554
|
}
|
|
2554
2555
|
}
|
|
2555
2556
|
return diagnostics;
|
|
@@ -4436,58 +4437,71 @@ import ts23 from "typescript";
|
|
|
4436
4437
|
|
|
4437
4438
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_functions.mjs
|
|
4438
4439
|
import ts20 from "typescript";
|
|
4439
|
-
function tryParseInitializerApiMember(
|
|
4440
|
+
function tryParseInitializerApiMember(functions, member, reflector, importTracker) {
|
|
4440
4441
|
if (member.value === null || !ts20.isCallExpression(member.value)) {
|
|
4441
4442
|
return null;
|
|
4442
4443
|
}
|
|
4443
4444
|
const call = member.value;
|
|
4444
|
-
const staticResult = parseTopLevelCall(call,
|
|
4445
|
+
const staticResult = parseTopLevelCall(call, functions, importTracker) || parseTopLevelRequiredCall(call, functions, importTracker) || parseTopLevelCallFromNamespace(call, functions, importTracker);
|
|
4445
4446
|
if (staticResult === null) {
|
|
4446
4447
|
return null;
|
|
4447
4448
|
}
|
|
4448
|
-
const resolvedImport = reflector.getImportOfIdentifier(staticResult.
|
|
4449
|
-
if (resolvedImport === null ||
|
|
4449
|
+
const resolvedImport = reflector.getImportOfIdentifier(staticResult.apiReference);
|
|
4450
|
+
if (resolvedImport === null || staticResult.api.functionName !== resolvedImport.name || staticResult.api.owningModule !== resolvedImport.from) {
|
|
4450
4451
|
return null;
|
|
4451
4452
|
}
|
|
4452
4453
|
return {
|
|
4454
|
+
api: staticResult.api,
|
|
4453
4455
|
call,
|
|
4454
|
-
isRequired: staticResult.isRequired
|
|
4455
|
-
apiName: resolvedImport.name
|
|
4456
|
+
isRequired: staticResult.isRequired
|
|
4456
4457
|
};
|
|
4457
4458
|
}
|
|
4458
|
-
function parseTopLevelCall(call,
|
|
4459
|
+
function parseTopLevelCall(call, functions, importTracker) {
|
|
4459
4460
|
const node = call.expression;
|
|
4460
4461
|
if (!ts20.isIdentifier(node)) {
|
|
4461
4462
|
return null;
|
|
4462
4463
|
}
|
|
4463
|
-
|
|
4464
|
+
const matchingApi = functions.find((fn) => importTracker.isPotentialReferenceToNamedImport(node, fn.functionName, fn.owningModule));
|
|
4465
|
+
if (matchingApi === void 0) {
|
|
4466
|
+
return null;
|
|
4467
|
+
}
|
|
4468
|
+
return { api: matchingApi, apiReference: node, isRequired: false };
|
|
4464
4469
|
}
|
|
4465
|
-
function parseTopLevelRequiredCall(call,
|
|
4470
|
+
function parseTopLevelRequiredCall(call, functions, importTracker) {
|
|
4466
4471
|
const node = call.expression;
|
|
4467
4472
|
if (!ts20.isPropertyAccessExpression(node) || !ts20.isIdentifier(node.expression) || node.name.text !== "required") {
|
|
4468
4473
|
return null;
|
|
4469
4474
|
}
|
|
4470
4475
|
const expression = node.expression;
|
|
4471
|
-
const
|
|
4472
|
-
|
|
4476
|
+
const matchingApi = functions.find((fn) => importTracker.isPotentialReferenceToNamedImport(expression, fn.functionName, fn.owningModule));
|
|
4477
|
+
if (matchingApi === void 0) {
|
|
4478
|
+
return null;
|
|
4479
|
+
}
|
|
4480
|
+
return { api: matchingApi, apiReference: expression, isRequired: true };
|
|
4473
4481
|
}
|
|
4474
|
-
function parseTopLevelCallFromNamespace(call,
|
|
4482
|
+
function parseTopLevelCallFromNamespace(call, functions, importTracker) {
|
|
4475
4483
|
const node = call.expression;
|
|
4476
4484
|
if (!ts20.isPropertyAccessExpression(node)) {
|
|
4477
4485
|
return null;
|
|
4478
4486
|
}
|
|
4479
4487
|
let apiReference = null;
|
|
4488
|
+
let matchingApi = void 0;
|
|
4480
4489
|
let isRequired = false;
|
|
4481
|
-
if (ts20.isIdentifier(node.expression) && ts20.isIdentifier(node.name)
|
|
4490
|
+
if (ts20.isIdentifier(node.expression) && ts20.isIdentifier(node.name)) {
|
|
4491
|
+
const namespaceRef = node.expression;
|
|
4482
4492
|
apiReference = node.name;
|
|
4483
|
-
|
|
4493
|
+
matchingApi = functions.find((fn) => node.name.text === fn.functionName && importTracker.isPotentialReferenceToNamespaceImport(namespaceRef, fn.owningModule));
|
|
4494
|
+
} else if (ts20.isPropertyAccessExpression(node.expression) && ts20.isIdentifier(node.expression.expression) && ts20.isIdentifier(node.expression.name) && node.name.text === "required") {
|
|
4495
|
+
const potentialName = node.expression.name.text;
|
|
4496
|
+
const namespaceRef = node.expression.expression;
|
|
4484
4497
|
apiReference = node.expression.name;
|
|
4498
|
+
matchingApi = functions.find((fn) => fn.functionName === potentialName && importTracker.isPotentialReferenceToNamespaceImport(namespaceRef, fn.owningModule));
|
|
4485
4499
|
isRequired = true;
|
|
4486
4500
|
}
|
|
4487
|
-
if (
|
|
4501
|
+
if (matchingApi === void 0 || apiReference === null) {
|
|
4488
4502
|
return null;
|
|
4489
4503
|
}
|
|
4490
|
-
return {
|
|
4504
|
+
return { api: matchingApi, apiReference, isRequired };
|
|
4491
4505
|
}
|
|
4492
4506
|
|
|
4493
4507
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_output_parse_options.mjs
|
|
@@ -4511,7 +4525,7 @@ function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
|
4511
4525
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.mjs
|
|
4512
4526
|
function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
4513
4527
|
var _a;
|
|
4514
|
-
const signalInput = tryParseInitializerApiMember(["input"], member, reflector, importTracker);
|
|
4528
|
+
const signalInput = tryParseInitializerApiMember([{ functionName: "input", owningModule: "@angular/core" }], member, reflector, importTracker);
|
|
4515
4529
|
if (signalInput === null) {
|
|
4516
4530
|
return null;
|
|
4517
4531
|
}
|
|
@@ -4530,7 +4544,7 @@ function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
|
4530
4544
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/model_function.mjs
|
|
4531
4545
|
function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
4532
4546
|
var _a;
|
|
4533
|
-
const model = tryParseInitializerApiMember(["model"], member, reflector, importTracker);
|
|
4547
|
+
const model = tryParseInitializerApiMember([{ functionName: "model", owningModule: "@angular/core" }], member, reflector, importTracker);
|
|
4534
4548
|
if (model === null) {
|
|
4535
4549
|
return null;
|
|
4536
4550
|
}
|
|
@@ -4558,14 +4572,17 @@ function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
|
4558
4572
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/output_function.mjs
|
|
4559
4573
|
function tryParseInitializerBasedOutput(member, reflector, importTracker) {
|
|
4560
4574
|
var _a;
|
|
4561
|
-
const output = tryParseInitializerApiMember([
|
|
4575
|
+
const output = tryParseInitializerApiMember([
|
|
4576
|
+
{ functionName: "output", owningModule: "@angular/core" },
|
|
4577
|
+
{ functionName: "outputFromObservable", owningModule: "@angular/core/rxjs-interop" }
|
|
4578
|
+
], member, reflector, importTracker);
|
|
4562
4579
|
if (output === null) {
|
|
4563
4580
|
return null;
|
|
4564
4581
|
}
|
|
4565
4582
|
if (output.isRequired) {
|
|
4566
4583
|
throw new FatalDiagnosticError(ErrorCode.INITIALIZER_API_NO_REQUIRED_FUNCTION, output.call, `Output does not support ".required()".`);
|
|
4567
4584
|
}
|
|
4568
|
-
const optionsNode = output.call.arguments[0];
|
|
4585
|
+
const optionsNode = output.api.functionName === "output" ? output.call.arguments[0] : output.call.arguments[1];
|
|
4569
4586
|
const options = optionsNode !== void 0 ? parseAndValidateInputAndOutputOptions(optionsNode) : null;
|
|
4570
4587
|
const classPropertyName = member.name;
|
|
4571
4588
|
return {
|
|
@@ -4584,11 +4601,13 @@ import ts22 from "typescript";
|
|
|
4584
4601
|
var queryFunctionNames = ["viewChild", "viewChildren", "contentChild", "contentChildren"];
|
|
4585
4602
|
var defaultDescendantsValue = (type) => type !== "contentChildren";
|
|
4586
4603
|
function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
4587
|
-
const
|
|
4604
|
+
const initializerFns = queryFunctionNames.map((fnName) => ({ functionName: fnName, owningModule: "@angular/core" }));
|
|
4605
|
+
const query = tryParseInitializerApiMember(initializerFns, member, reflector, importTracker);
|
|
4588
4606
|
if (query === null) {
|
|
4589
4607
|
return null;
|
|
4590
4608
|
}
|
|
4591
|
-
const
|
|
4609
|
+
const { functionName } = query.api;
|
|
4610
|
+
const isSingleQuery = functionName === "viewChild" || functionName === "contentChild";
|
|
4592
4611
|
const predicateNode = query.call.arguments[0];
|
|
4593
4612
|
if (predicateNode === void 0) {
|
|
4594
4613
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, query.call, "No locator specified.");
|
|
@@ -4599,9 +4618,9 @@ function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
|
4599
4618
|
}
|
|
4600
4619
|
const options = optionsNode && reflectObjectLiteral(optionsNode);
|
|
4601
4620
|
const read = (options == null ? void 0 : options.has("read")) ? parseReadOption(options.get("read")) : null;
|
|
4602
|
-
const descendants = (options == null ? void 0 : options.has("descendants")) ? parseDescendantsOption(options.get("descendants")) : defaultDescendantsValue(
|
|
4621
|
+
const descendants = (options == null ? void 0 : options.has("descendants")) ? parseDescendantsOption(options.get("descendants")) : defaultDescendantsValue(functionName);
|
|
4603
4622
|
return {
|
|
4604
|
-
name:
|
|
4623
|
+
name: functionName,
|
|
4605
4624
|
call: query.call,
|
|
4606
4625
|
metadata: {
|
|
4607
4626
|
isSignal: true,
|
|
@@ -4626,6 +4645,9 @@ function parseLocator(expression, reflector) {
|
|
|
4626
4645
|
return createMayBeForwardRefExpression(new o.WrappedNodeExpr(expression), unwrappedExpression !== null ? 2 : 0);
|
|
4627
4646
|
}
|
|
4628
4647
|
function parseReadOption(value) {
|
|
4648
|
+
if (ts22.isExpressionWithTypeArguments(value) || ts22.isParenthesizedExpression(value) || ts22.isAsExpression(value)) {
|
|
4649
|
+
return parseReadOption(value.expression);
|
|
4650
|
+
}
|
|
4629
4651
|
if (ts22.isPropertyAccessExpression(value) && ts22.isIdentifier(value.expression) || ts22.isIdentifier(value)) {
|
|
4630
4652
|
return new o.WrappedNodeExpr(value);
|
|
4631
4653
|
}
|
|
@@ -5749,7 +5771,12 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
5749
5771
|
if (ts24.isTypeLiteralNode(t)) {
|
|
5750
5772
|
for (const m of t.members) {
|
|
5751
5773
|
const ngModuleType = ts24.isPropertySignature(m) && ts24.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
5752
|
-
|
|
5774
|
+
let ngModuleExpression = null;
|
|
5775
|
+
if (ngModuleType !== null && ts24.isTypeQueryNode(ngModuleType)) {
|
|
5776
|
+
ngModuleExpression = entityNameToValue(ngModuleType.exprName);
|
|
5777
|
+
} else if (ngModuleType !== null) {
|
|
5778
|
+
ngModuleExpression = typeNodeToValueExpr(ngModuleType);
|
|
5779
|
+
}
|
|
5753
5780
|
if (ngModuleExpression) {
|
|
5754
5781
|
return ngModuleExpression;
|
|
5755
5782
|
}
|
|
@@ -7317,6 +7344,9 @@ var ComponentDecoratorHandler = class {
|
|
|
7317
7344
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
7318
7345
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
7319
7346
|
}
|
|
7347
|
+
templateSemanticsCheck(component, templateSemanticsChecker) {
|
|
7348
|
+
return templateSemanticsChecker.getDiagnosticsForComponent(component);
|
|
7349
|
+
}
|
|
7320
7350
|
resolve(node, analysis, symbol) {
|
|
7321
7351
|
const metadata = analysis.meta;
|
|
7322
7352
|
const diagnostics = [];
|
|
@@ -8321,4 +8351,4 @@ export {
|
|
|
8321
8351
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8322
8352
|
* found in the LICENSE file at https://angular.io/license
|
|
8323
8353
|
*/
|
|
8324
|
-
//# sourceMappingURL=chunk-
|
|
8354
|
+
//# sourceMappingURL=chunk-3ESFLGKJ.js.map
|