@angular/compiler-cli 14.0.0-rc.1 → 14.0.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-LX5Q27EF.js → chunk-7J66ZDC5.js} +3 -3
- package/bundles/{chunk-LX5Q27EF.js.map → chunk-7J66ZDC5.js.map} +0 -0
- package/bundles/{chunk-W6KM7BUM.js → chunk-AKU7LV22.js} +6 -6
- package/bundles/{chunk-W6KM7BUM.js.map → chunk-AKU7LV22.js.map} +0 -0
- package/bundles/{chunk-UJXXCVVY.js → chunk-AXU2Z2WN.js} +70 -70
- package/bundles/{chunk-UJXXCVVY.js.map → chunk-AXU2Z2WN.js.map} +0 -0
- package/bundles/{chunk-WGBFSDVQ.js → chunk-BFPVXDJN.js} +7 -7
- package/bundles/{chunk-WGBFSDVQ.js.map → chunk-BFPVXDJN.js.map} +0 -0
- package/bundles/{chunk-UMY2M5GZ.js → chunk-EI6PFDB4.js} +40 -40
- package/bundles/{chunk-UMY2M5GZ.js.map → chunk-EI6PFDB4.js.map} +0 -0
- package/bundles/{chunk-R3C7RFJ4.js → chunk-HMWNYAAE.js} +2 -2
- package/bundles/{chunk-R3C7RFJ4.js.map → chunk-HMWNYAAE.js.map} +0 -0
- package/bundles/{chunk-N4EFPPNE.js → chunk-KIWI22Y5.js} +5 -5
- package/bundles/{chunk-N4EFPPNE.js.map → chunk-KIWI22Y5.js.map} +0 -0
- package/bundles/{chunk-T7MYRXIE.js → chunk-MURZUYM7.js} +7 -7
- package/bundles/{chunk-T7MYRXIE.js.map → chunk-MURZUYM7.js.map} +0 -0
- package/bundles/{chunk-74SXTDBS.js → chunk-NTRR4N4C.js} +212 -164
- package/bundles/chunk-NTRR4N4C.js.map +6 -0
- package/bundles/{chunk-R4NY3TJC.js → chunk-QK4SXRQA.js} +5 -5
- package/bundles/{chunk-R4NY3TJC.js.map → chunk-QK4SXRQA.js.map} +0 -0
- package/bundles/{chunk-TFEYVOY6.js → chunk-RT3OZMJ6.js} +112 -107
- package/bundles/chunk-RT3OZMJ6.js.map +6 -0
- package/bundles/{chunk-JDKMNZ6O.js → chunk-SFACRVMZ.js} +26 -26
- package/bundles/{chunk-JDKMNZ6O.js.map → chunk-SFACRVMZ.js.map} +0 -0
- package/bundles/{chunk-OLGEBPBY.js → chunk-U2VFXNL7.js} +4 -4
- package/bundles/{chunk-OLGEBPBY.js.map → chunk-U2VFXNL7.js.map} +0 -0
- package/bundles/{chunk-7XY4OMWJ.js → chunk-VEAB5CR7.js} +31 -31
- package/bundles/{chunk-7XY4OMWJ.js.map → chunk-VEAB5CR7.js.map} +0 -0
- package/bundles/{chunk-2IMT6JFI.js → chunk-ZJCM37WF.js} +6 -6
- package/bundles/{chunk-2IMT6JFI.js.map → chunk-ZJCM37WF.js.map} +0 -0
- package/bundles/index.js +12 -12
- package/bundles/linker/babel/index.js +16 -16
- package/bundles/linker/babel/index.js.map +1 -1
- package/bundles/linker/index.js +4 -4
- package/bundles/ngcc/index.js +12 -12
- package/bundles/ngcc/main-ngcc.js +13 -13
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +13 -13
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +3 -3
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +2 -2
- package/bundles/src/bin/ng_xi18n.js +10 -10
- package/bundles/src/bin/ngc.js +8 -8
- package/bundles_metadata.json +1 -1
- package/ngcc/src/packages/build_marker.d.ts +1 -1
- package/package.json +2 -2
- package/src/ngtsc/annotations/common/src/util.d.ts +6 -0
- package/src/ngtsc/annotations/ng_module/index.d.ts +1 -0
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +2 -20
- package/src/ngtsc/annotations/ng_module/src/module_with_providers.d.ts +26 -0
- package/src/ngtsc/typecheck/api/api.d.ts +1 -0
- package/src/ngtsc/typecheck/api/context.d.ts +2 -1
- package/src/ngtsc/typecheck/src/context.d.ts +1 -1
- package/src/ngtsc/typecheck/src/dom.d.ts +6 -4
- package/src/ngtsc/typecheck/src/type_check_block.d.ts +2 -1
- package/bundles/chunk-74SXTDBS.js.map +0 -6
- package/bundles/chunk-TFEYVOY6.js.map +0 -6
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
reflectObjectLiteral,
|
|
14
14
|
reflectTypeEntityToDeclaration,
|
|
15
15
|
typeNodeToValueExpr
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZJCM37WF.js";
|
|
17
17
|
import {
|
|
18
18
|
ErrorCode,
|
|
19
19
|
FatalDiagnosticError,
|
|
@@ -33,22 +33,22 @@ import {
|
|
|
33
33
|
translateExpression,
|
|
34
34
|
translateStatement,
|
|
35
35
|
translateType
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-SFACRVMZ.js";
|
|
37
37
|
import {
|
|
38
38
|
absoluteFrom,
|
|
39
39
|
absoluteFromSourceFile,
|
|
40
40
|
relative
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-MURZUYM7.js";
|
|
42
42
|
import {
|
|
43
43
|
PerfEvent,
|
|
44
44
|
PerfPhase
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QK4SXRQA.js";
|
|
46
46
|
import {
|
|
47
47
|
__spreadProps,
|
|
48
48
|
__spreadValues
|
|
49
49
|
} from "./chunk-GMSUYBZP.js";
|
|
50
50
|
|
|
51
|
-
// bazel-out/
|
|
51
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/util.mjs
|
|
52
52
|
import { ExternalExpr, ParseLocation, ParseSourceFile, ParseSourceSpan, ReadPropExpr, WrappedNodeExpr } from "@angular/compiler";
|
|
53
53
|
import ts from "typescript";
|
|
54
54
|
function valueReferenceToExpression(valueRef) {
|
|
@@ -274,8 +274,17 @@ function resolveImportedFile(moduleResolver, importedFile, expr, origin) {
|
|
|
274
274
|
}
|
|
275
275
|
return moduleResolver.resolveModule(expr.value.moduleName, origin.fileName);
|
|
276
276
|
}
|
|
277
|
+
function getOriginNodeForDiagnostics(expr, container) {
|
|
278
|
+
const nodeSf = expr.getSourceFile();
|
|
279
|
+
const exprSf = container.getSourceFile();
|
|
280
|
+
if (nodeSf === exprSf && expr.pos >= container.pos && expr.end <= container.end) {
|
|
281
|
+
return expr;
|
|
282
|
+
} else {
|
|
283
|
+
return container;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
277
286
|
|
|
278
|
-
// bazel-out/
|
|
287
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/dynamic.mjs
|
|
279
288
|
var DynamicValue = class {
|
|
280
289
|
constructor(node, reason, code) {
|
|
281
290
|
this.node = node;
|
|
@@ -365,10 +374,10 @@ var DynamicValue = class {
|
|
|
365
374
|
}
|
|
366
375
|
};
|
|
367
376
|
|
|
368
|
-
// bazel-out/
|
|
377
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
369
378
|
import ts2 from "typescript";
|
|
370
379
|
|
|
371
|
-
// bazel-out/
|
|
380
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/result.mjs
|
|
372
381
|
var ResolvedModule = class {
|
|
373
382
|
constructor(exports, evaluate) {
|
|
374
383
|
this.exports = exports;
|
|
@@ -398,7 +407,7 @@ var EnumValue = class {
|
|
|
398
407
|
var KnownFn = class {
|
|
399
408
|
};
|
|
400
409
|
|
|
401
|
-
// bazel-out/
|
|
410
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/builtin.mjs
|
|
402
411
|
var ArraySliceBuiltinFn = class extends KnownFn {
|
|
403
412
|
constructor(lhs) {
|
|
404
413
|
super();
|
|
@@ -469,7 +478,7 @@ var ObjectAssignBuiltinFn = class extends KnownFn {
|
|
|
469
478
|
}
|
|
470
479
|
};
|
|
471
480
|
|
|
472
|
-
// bazel-out/
|
|
481
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/ts_helpers.mjs
|
|
473
482
|
var AssignHelperFn = class extends ObjectAssignBuiltinFn {
|
|
474
483
|
};
|
|
475
484
|
var SpreadHelperFn = class extends KnownFn {
|
|
@@ -522,7 +531,7 @@ var ReadHelperFn = class extends KnownFn {
|
|
|
522
531
|
}
|
|
523
532
|
};
|
|
524
533
|
|
|
525
|
-
// bazel-out/
|
|
534
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/known_declaration.mjs
|
|
526
535
|
var jsGlobalObjectValue = /* @__PURE__ */ new Map([["assign", new ObjectAssignBuiltinFn()]]);
|
|
527
536
|
var assignTsHelperFn = new AssignHelperFn();
|
|
528
537
|
var spreadTsHelperFn = new SpreadHelperFn();
|
|
@@ -546,14 +555,14 @@ function resolveKnownDeclaration(decl) {
|
|
|
546
555
|
}
|
|
547
556
|
}
|
|
548
557
|
|
|
549
|
-
// bazel-out/
|
|
558
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/synthetic.mjs
|
|
550
559
|
var SyntheticValue = class {
|
|
551
560
|
constructor(value) {
|
|
552
561
|
this.value = value;
|
|
553
562
|
}
|
|
554
563
|
};
|
|
555
564
|
|
|
556
|
-
// bazel-out/
|
|
565
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.mjs
|
|
557
566
|
function literalBinaryOp(op) {
|
|
558
567
|
return { op, literal: true };
|
|
559
568
|
}
|
|
@@ -1135,7 +1144,7 @@ function owningModule(context, override = null) {
|
|
|
1135
1144
|
}
|
|
1136
1145
|
}
|
|
1137
1146
|
|
|
1138
|
-
// bazel-out/
|
|
1147
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.mjs
|
|
1139
1148
|
var PartialEvaluator = class {
|
|
1140
1149
|
constructor(host, checker, dependencyTracker) {
|
|
1141
1150
|
this.host = host;
|
|
@@ -1155,7 +1164,7 @@ var PartialEvaluator = class {
|
|
|
1155
1164
|
}
|
|
1156
1165
|
};
|
|
1157
1166
|
|
|
1158
|
-
// bazel-out/
|
|
1167
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/partial_evaluator/src/diagnostics.mjs
|
|
1159
1168
|
import ts3 from "typescript";
|
|
1160
1169
|
function describeResolvedType(value, maxDepth = 1) {
|
|
1161
1170
|
var _a, _b;
|
|
@@ -1285,7 +1294,7 @@ function getContainerNode(node) {
|
|
|
1285
1294
|
return node.getSourceFile();
|
|
1286
1295
|
}
|
|
1287
1296
|
|
|
1288
|
-
// bazel-out/
|
|
1297
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/di.mjs
|
|
1289
1298
|
import { LiteralExpr, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
|
|
1290
1299
|
import ts4 from "typescript";
|
|
1291
1300
|
function getConstructorDependencies(clazz, reflector, isCore) {
|
|
@@ -1429,7 +1438,7 @@ function createUnsuitableInjectionTokenError(clazz, error) {
|
|
|
1429
1438
|
return new FatalDiagnosticError(ErrorCode.PARAM_MISSING_TOKEN, param.nameNode, chain, hints);
|
|
1430
1439
|
}
|
|
1431
1440
|
|
|
1432
|
-
// bazel-out/
|
|
1441
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/diagnostics.mjs
|
|
1433
1442
|
import ts5 from "typescript";
|
|
1434
1443
|
function makeDuplicateDeclarationError(node, data, kind) {
|
|
1435
1444
|
const context = [];
|
|
@@ -1537,7 +1546,7 @@ function getInheritedUndecoratedCtorDiagnostic(node, baseClass, reader) {
|
|
|
1537
1546
|
return makeDiagnostic(ErrorCode.DIRECTIVE_INHERITS_UNDECORATED_CTOR, node.name, `The ${dirOrComp.toLowerCase()} ${node.name.text} inherits its constructor from ${baseClassName}, but the latter does not have an Angular decorator of its own. Dependency injection will not be able to resolve the parameters of ${baseClassName}'s constructor. Either add a @Directive decorator to ${baseClassName}, or add an explicit constructor to ${node.name.text}.`);
|
|
1538
1547
|
}
|
|
1539
1548
|
|
|
1540
|
-
// bazel-out/
|
|
1549
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/evaluation.mjs
|
|
1541
1550
|
import ts6 from "typescript";
|
|
1542
1551
|
function resolveEnumValue(evaluator, metadata, field, enumSymbolName) {
|
|
1543
1552
|
let resolved = null;
|
|
@@ -1570,7 +1579,7 @@ function resolveLiteral(decorator, literalCache) {
|
|
|
1570
1579
|
return meta;
|
|
1571
1580
|
}
|
|
1572
1581
|
|
|
1573
|
-
// bazel-out/
|
|
1582
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/factory.mjs
|
|
1574
1583
|
import { compileDeclareFactoryFunction, compileFactoryFunction } from "@angular/compiler";
|
|
1575
1584
|
function compileNgFactoryDefField(metadata) {
|
|
1576
1585
|
const res = compileFactoryFunction(metadata);
|
|
@@ -1581,7 +1590,7 @@ function compileDeclareFactory(metadata) {
|
|
|
1581
1590
|
return { name: "\u0275fac", initializer: res.expression, statements: res.statements, type: res.type };
|
|
1582
1591
|
}
|
|
1583
1592
|
|
|
1584
|
-
// bazel-out/
|
|
1593
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/metadata.mjs
|
|
1585
1594
|
import { FunctionExpr, LiteralArrayExpr, LiteralExpr as LiteralExpr2, literalMap, ReturnStatement, WrappedNodeExpr as WrappedNodeExpr3 } from "@angular/compiler";
|
|
1586
1595
|
import ts7 from "typescript";
|
|
1587
1596
|
function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompiler, angularDecoratorTransform = (dec) => dec) {
|
|
@@ -1669,13 +1678,13 @@ function removeIdentifierReferences(node, name) {
|
|
|
1669
1678
|
return result.transformed[0];
|
|
1670
1679
|
}
|
|
1671
1680
|
|
|
1672
|
-
// bazel-out/
|
|
1681
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/references_registry.mjs
|
|
1673
1682
|
var NoopReferencesRegistry = class {
|
|
1674
1683
|
add(source, ...references) {
|
|
1675
1684
|
}
|
|
1676
1685
|
};
|
|
1677
1686
|
|
|
1678
|
-
// bazel-out/
|
|
1687
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/schema.mjs
|
|
1679
1688
|
import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/compiler";
|
|
1680
1689
|
function extractSchemas(rawExpr, evaluator, context) {
|
|
1681
1690
|
const schemas = [];
|
|
@@ -1705,11 +1714,11 @@ function extractSchemas(rawExpr, evaluator, context) {
|
|
|
1705
1714
|
return schemas;
|
|
1706
1715
|
}
|
|
1707
1716
|
|
|
1708
|
-
// bazel-out/
|
|
1717
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
1709
1718
|
import { compileClassMetadata as compileClassMetadata3, compileComponentFromMetadata, compileDeclareClassMetadata as compileDeclareClassMetadata3, compileDeclareComponentFromMetadata, CssSelector as CssSelector2, DEFAULT_INTERPOLATION_CONFIG as DEFAULT_INTERPOLATION_CONFIG2, DomElementSchemaRegistry, FactoryTarget as FactoryTarget3, makeBindingParser as makeBindingParser2, R3TargetBinder, R3TemplateDependencyKind, SelectorMatcher as SelectorMatcher2, ViewEncapsulation, WrappedNodeExpr as WrappedNodeExpr7 } from "@angular/compiler";
|
|
1710
|
-
import
|
|
1719
|
+
import ts24 from "typescript";
|
|
1711
1720
|
|
|
1712
|
-
// bazel-out/
|
|
1721
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/api.mjs
|
|
1713
1722
|
import ts8 from "typescript";
|
|
1714
1723
|
var SemanticSymbol = class {
|
|
1715
1724
|
constructor(decl) {
|
|
@@ -1725,7 +1734,7 @@ function getSymbolIdentifier(decl) {
|
|
|
1725
1734
|
return decl.name.text;
|
|
1726
1735
|
}
|
|
1727
1736
|
|
|
1728
|
-
// bazel-out/
|
|
1737
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/graph.mjs
|
|
1729
1738
|
import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
|
|
1730
1739
|
var OpaqueSymbol = class extends SemanticSymbol {
|
|
1731
1740
|
isPublicApiAffected() {
|
|
@@ -1868,10 +1877,10 @@ function getImportPath(expr) {
|
|
|
1868
1877
|
}
|
|
1869
1878
|
}
|
|
1870
1879
|
|
|
1871
|
-
// bazel-out/
|
|
1880
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1872
1881
|
import ts9 from "typescript";
|
|
1873
1882
|
|
|
1874
|
-
// bazel-out/
|
|
1883
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/util.mjs
|
|
1875
1884
|
function isSymbolEqual(a, b) {
|
|
1876
1885
|
if (a.decl === b.decl) {
|
|
1877
1886
|
return true;
|
|
@@ -1921,7 +1930,7 @@ function isSetEqual(a, b, equalityTester = referenceEquality) {
|
|
|
1921
1930
|
return true;
|
|
1922
1931
|
}
|
|
1923
1932
|
|
|
1924
|
-
// bazel-out/
|
|
1933
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/incremental/semantic_graph/src/type_parameters.mjs
|
|
1925
1934
|
function extractSemanticTypeParameters(node) {
|
|
1926
1935
|
if (!ts9.isClassDeclaration(node) || node.typeParameters === void 0) {
|
|
1927
1936
|
return null;
|
|
@@ -1941,7 +1950,7 @@ function isTypeParameterEqual(a, b) {
|
|
|
1941
1950
|
return a.hasGenericTypeBound === b.hasGenericTypeBound;
|
|
1942
1951
|
}
|
|
1943
1952
|
|
|
1944
|
-
// bazel-out/
|
|
1953
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/api.mjs
|
|
1945
1954
|
var MetaKind;
|
|
1946
1955
|
(function(MetaKind2) {
|
|
1947
1956
|
MetaKind2[MetaKind2["Directive"] = 0] = "Directive";
|
|
@@ -1949,10 +1958,10 @@ var MetaKind;
|
|
|
1949
1958
|
MetaKind2[MetaKind2["NgModule"] = 2] = "NgModule";
|
|
1950
1959
|
})(MetaKind || (MetaKind = {}));
|
|
1951
1960
|
|
|
1952
|
-
// bazel-out/
|
|
1961
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
1953
1962
|
import ts11 from "typescript";
|
|
1954
1963
|
|
|
1955
|
-
// bazel-out/
|
|
1964
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/property_mapping.mjs
|
|
1956
1965
|
var ClassPropertyMapping = class {
|
|
1957
1966
|
constructor(forwardMap) {
|
|
1958
1967
|
this.forwardMap = forwardMap;
|
|
@@ -2028,7 +2037,7 @@ function reverseMapFromForwardMap(forwardMap) {
|
|
|
2028
2037
|
return reverseMap;
|
|
2029
2038
|
}
|
|
2030
2039
|
|
|
2031
|
-
// bazel-out/
|
|
2040
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/util.mjs
|
|
2032
2041
|
import ts10 from "typescript";
|
|
2033
2042
|
function extractReferencesFromType(checker, def, bestGuessOwningModule) {
|
|
2034
2043
|
if (!ts10.isTupleTypeNode(def)) {
|
|
@@ -2208,7 +2217,7 @@ function hasInjectableFields(clazz, host) {
|
|
|
2208
2217
|
return members.some(({ isStatic, name }) => isStatic && (name === "\u0275prov" || name === "\u0275fac"));
|
|
2209
2218
|
}
|
|
2210
2219
|
|
|
2211
|
-
// bazel-out/
|
|
2220
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/dts.mjs
|
|
2212
2221
|
var DtsMetadataReader = class {
|
|
2213
2222
|
constructor(checker, reflector) {
|
|
2214
2223
|
this.checker = checker;
|
|
@@ -2320,7 +2329,7 @@ function readBaseClass2(clazz, checker, reflector) {
|
|
|
2320
2329
|
return null;
|
|
2321
2330
|
}
|
|
2322
2331
|
|
|
2323
|
-
// bazel-out/
|
|
2332
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/inheritance.mjs
|
|
2324
2333
|
function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
2325
2334
|
const topMeta = reader.getDirectiveMetadata(dir);
|
|
2326
2335
|
if (topMeta === null) {
|
|
@@ -2377,7 +2386,7 @@ function flattenInheritedDirectiveMetadata(reader, dir) {
|
|
|
2377
2386
|
});
|
|
2378
2387
|
}
|
|
2379
2388
|
|
|
2380
|
-
// bazel-out/
|
|
2389
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/registry.mjs
|
|
2381
2390
|
var LocalMetadataRegistry = class {
|
|
2382
2391
|
constructor() {
|
|
2383
2392
|
this.directives = /* @__PURE__ */ new Map();
|
|
@@ -2436,7 +2445,7 @@ var InjectableClassRegistry = class {
|
|
|
2436
2445
|
}
|
|
2437
2446
|
};
|
|
2438
2447
|
|
|
2439
|
-
// bazel-out/
|
|
2448
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/metadata/src/resource_registry.mjs
|
|
2440
2449
|
var ResourceRegistry = class {
|
|
2441
2450
|
constructor() {
|
|
2442
2451
|
this.externalTemplateToComponentsMap = /* @__PURE__ */ new Map();
|
|
@@ -2501,14 +2510,14 @@ var ResourceRegistry = class {
|
|
|
2501
2510
|
}
|
|
2502
2511
|
};
|
|
2503
2512
|
|
|
2504
|
-
// bazel-out/
|
|
2513
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/api.mjs
|
|
2505
2514
|
var ComponentScopeKind;
|
|
2506
2515
|
(function(ComponentScopeKind2) {
|
|
2507
2516
|
ComponentScopeKind2[ComponentScopeKind2["NgModule"] = 0] = "NgModule";
|
|
2508
2517
|
ComponentScopeKind2[ComponentScopeKind2["Standalone"] = 1] = "Standalone";
|
|
2509
2518
|
})(ComponentScopeKind || (ComponentScopeKind = {}));
|
|
2510
2519
|
|
|
2511
|
-
// bazel-out/
|
|
2520
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/component_scope.mjs
|
|
2512
2521
|
var CompoundComponentScopeReader = class {
|
|
2513
2522
|
constructor(readers) {
|
|
2514
2523
|
this.readers = readers;
|
|
@@ -2533,7 +2542,7 @@ var CompoundComponentScopeReader = class {
|
|
|
2533
2542
|
}
|
|
2534
2543
|
};
|
|
2535
2544
|
|
|
2536
|
-
// bazel-out/
|
|
2545
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/dependency.mjs
|
|
2537
2546
|
var MetadataDtsModuleScopeResolver = class {
|
|
2538
2547
|
constructor(dtsMetaReader, aliasingHost) {
|
|
2539
2548
|
this.dtsMetaReader = dtsMetaReader;
|
|
@@ -2608,11 +2617,11 @@ var MetadataDtsModuleScopeResolver = class {
|
|
|
2608
2617
|
}
|
|
2609
2618
|
};
|
|
2610
2619
|
|
|
2611
|
-
// bazel-out/
|
|
2620
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2612
2621
|
import { ExternalExpr as ExternalExpr3 } from "@angular/compiler";
|
|
2613
2622
|
import ts12 from "typescript";
|
|
2614
2623
|
|
|
2615
|
-
// bazel-out/
|
|
2624
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/util.mjs
|
|
2616
2625
|
function getDiagnosticNode(ref, rawExpr) {
|
|
2617
2626
|
return rawExpr !== null ? ref.getOriginForDiagnostics(rawExpr) : ref.node.name;
|
|
2618
2627
|
}
|
|
@@ -2638,7 +2647,7 @@ function makeUnknownComponentImportDiagnostic(ref, rawExpr) {
|
|
|
2638
2647
|
return makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, getDiagnosticNode(ref, rawExpr), `Component imports must be standalone components, directives, pipes, or must be NgModules.`);
|
|
2639
2648
|
}
|
|
2640
2649
|
|
|
2641
|
-
// bazel-out/
|
|
2650
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/local.mjs
|
|
2642
2651
|
var LocalModuleScopeRegistry = class {
|
|
2643
2652
|
constructor(localReader, fullReader, dependencyScopeReader, refEmitter, aliasingHost) {
|
|
2644
2653
|
this.localReader = localReader;
|
|
@@ -2977,7 +2986,7 @@ function reexportCollision(module, refA, refB) {
|
|
|
2977
2986
|
]);
|
|
2978
2987
|
}
|
|
2979
2988
|
|
|
2980
|
-
// bazel-out/
|
|
2989
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/scope/src/typecheck.mjs
|
|
2981
2990
|
import { CssSelector, SelectorMatcher } from "@angular/compiler";
|
|
2982
2991
|
import ts13 from "typescript";
|
|
2983
2992
|
var TypeCheckScopeRegistry = class {
|
|
@@ -3039,7 +3048,7 @@ var TypeCheckScopeRegistry = class {
|
|
|
3039
3048
|
}
|
|
3040
3049
|
};
|
|
3041
3050
|
|
|
3042
|
-
// bazel-out/
|
|
3051
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/api.mjs
|
|
3043
3052
|
var CompilationMode;
|
|
3044
3053
|
(function(CompilationMode2) {
|
|
3045
3054
|
CompilationMode2[CompilationMode2["FULL"] = 0] = "FULL";
|
|
@@ -3057,7 +3066,7 @@ var HandlerFlags;
|
|
|
3057
3066
|
HandlerFlags2[HandlerFlags2["FULL_INHERITANCE"] = 1] = "FULL_INHERITANCE";
|
|
3058
3067
|
})(HandlerFlags || (HandlerFlags = {}));
|
|
3059
3068
|
|
|
3060
|
-
// bazel-out/
|
|
3069
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/alias.mjs
|
|
3061
3070
|
import ts14 from "typescript";
|
|
3062
3071
|
function aliasTransformFactory(exportStatements) {
|
|
3063
3072
|
return (context) => {
|
|
@@ -3075,10 +3084,10 @@ function aliasTransformFactory(exportStatements) {
|
|
|
3075
3084
|
};
|
|
3076
3085
|
}
|
|
3077
3086
|
|
|
3078
|
-
// bazel-out/
|
|
3087
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3079
3088
|
import ts15 from "typescript";
|
|
3080
3089
|
|
|
3081
|
-
// bazel-out/
|
|
3090
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/trait.mjs
|
|
3082
3091
|
var TraitState;
|
|
3083
3092
|
(function(TraitState2) {
|
|
3084
3093
|
TraitState2[TraitState2["Pending"] = 0] = "Pending";
|
|
@@ -3133,7 +3142,7 @@ var TraitImpl = class {
|
|
|
3133
3142
|
}
|
|
3134
3143
|
};
|
|
3135
3144
|
|
|
3136
|
-
// bazel-out/
|
|
3145
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/compilation.mjs
|
|
3137
3146
|
var TraitCompiler = class {
|
|
3138
3147
|
constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier) {
|
|
3139
3148
|
this.handlers = handlers;
|
|
@@ -3577,10 +3586,10 @@ function containsErrors(diagnostics) {
|
|
|
3577
3586
|
return diagnostics !== null && diagnostics.some((diag) => diag.category === ts15.DiagnosticCategory.Error);
|
|
3578
3587
|
}
|
|
3579
3588
|
|
|
3580
|
-
// bazel-out/
|
|
3589
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3581
3590
|
import ts17 from "typescript";
|
|
3582
3591
|
|
|
3583
|
-
// bazel-out/
|
|
3592
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/utils.mjs
|
|
3584
3593
|
import ts16 from "typescript";
|
|
3585
3594
|
function addImports(importManager, sf, extraStatements = []) {
|
|
3586
3595
|
const addedImports = importManager.getAllImports(sf.fileName).map((i) => {
|
|
@@ -3608,7 +3617,7 @@ function isImportStatement(stmt) {
|
|
|
3608
3617
|
return ts16.isImportDeclaration(stmt) || ts16.isImportEqualsDeclaration(stmt) || ts16.isNamespaceImport(stmt);
|
|
3609
3618
|
}
|
|
3610
3619
|
|
|
3611
|
-
// bazel-out/
|
|
3620
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/declaration.mjs
|
|
3612
3621
|
var DtsTransformRegistry = class {
|
|
3613
3622
|
constructor() {
|
|
3614
3623
|
this.ivyDeclarationTransforms = /* @__PURE__ */ new Map();
|
|
@@ -3733,11 +3742,11 @@ function markForEmitAsSingleLine(node) {
|
|
|
3733
3742
|
ts17.forEachChild(node, markForEmitAsSingleLine);
|
|
3734
3743
|
}
|
|
3735
3744
|
|
|
3736
|
-
// bazel-out/
|
|
3745
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3737
3746
|
import { ConstantPool } from "@angular/compiler";
|
|
3738
3747
|
import ts19 from "typescript";
|
|
3739
3748
|
|
|
3740
|
-
// bazel-out/
|
|
3749
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/visitor.mjs
|
|
3741
3750
|
import ts18 from "typescript";
|
|
3742
3751
|
function visit(node, visitor, context) {
|
|
3743
3752
|
return visitor._visit(node, context);
|
|
@@ -3799,7 +3808,7 @@ function hasStatements(node) {
|
|
|
3799
3808
|
return block.statements !== void 0 && Array.isArray(block.statements);
|
|
3800
3809
|
}
|
|
3801
3810
|
|
|
3802
|
-
// bazel-out/
|
|
3811
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/src/transform.mjs
|
|
3803
3812
|
var NO_DECORATORS = /* @__PURE__ */ new Set();
|
|
3804
3813
|
var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
|
|
3805
3814
|
function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, perf, isCore, isClosureCompilerEnabled) {
|
|
@@ -3980,10 +3989,10 @@ function createRecorderFn(defaultImportTracker) {
|
|
|
3980
3989
|
};
|
|
3981
3990
|
}
|
|
3982
3991
|
|
|
3983
|
-
// bazel-out/
|
|
3992
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
3984
3993
|
import { compileClassMetadata, compileDeclareClassMetadata, compileDeclareDirectiveFromMetadata, compileDirectiveFromMetadata, FactoryTarget, makeBindingParser, WrappedNodeExpr as WrappedNodeExpr5 } from "@angular/compiler";
|
|
3985
3994
|
|
|
3986
|
-
// bazel-out/
|
|
3995
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/shared.mjs
|
|
3987
3996
|
import { createMayBeForwardRefExpression, emitDistinctChangesOnlyDefaultValue, ExternalExpr as ExternalExpr4, getSafePropertyAccessString, parseHostBindings, verifyHostBindings, WrappedNodeExpr as WrappedNodeExpr4 } from "@angular/compiler";
|
|
3988
3997
|
import ts20 from "typescript";
|
|
3989
3998
|
var EMPTY_OBJECT = {};
|
|
@@ -4347,7 +4356,7 @@ function evaluateHostExpressionBindings(hostExpr, evaluator) {
|
|
|
4347
4356
|
return bindings;
|
|
4348
4357
|
}
|
|
4349
4358
|
|
|
4350
|
-
// bazel-out/
|
|
4359
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/symbol.mjs
|
|
4351
4360
|
var DirectiveSymbol = class extends SemanticSymbol {
|
|
4352
4361
|
constructor(decl, selector, inputs, outputs, exportAs, typeCheckMeta, typeParameters) {
|
|
4353
4362
|
super(decl);
|
|
@@ -4424,7 +4433,7 @@ function isBaseClassEqual(current, previous) {
|
|
|
4424
4433
|
return isSymbolEqual(current, previous);
|
|
4425
4434
|
}
|
|
4426
4435
|
|
|
4427
|
-
// bazel-out/
|
|
4436
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.mjs
|
|
4428
4437
|
var FIELD_DECORATORS = [
|
|
4429
4438
|
"Input",
|
|
4430
4439
|
"Output",
|
|
@@ -4568,9 +4577,78 @@ var DirectiveDecoratorHandler = class {
|
|
|
4568
4577
|
}
|
|
4569
4578
|
};
|
|
4570
4579
|
|
|
4571
|
-
// bazel-out/
|
|
4572
|
-
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3SelectorScopeMode, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
4580
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4581
|
+
import { compileClassMetadata as compileClassMetadata2, compileDeclareClassMetadata as compileDeclareClassMetadata2, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileInjector, compileNgModule, ExternalExpr as ExternalExpr5, FactoryTarget as FactoryTarget2, FunctionExpr as FunctionExpr2, InvokeFunctionExpr, LiteralArrayExpr as LiteralArrayExpr2, R3Identifiers, R3SelectorScopeMode, ReturnStatement as ReturnStatement2, WrappedNodeExpr as WrappedNodeExpr6 } from "@angular/compiler";
|
|
4582
|
+
import ts22 from "typescript";
|
|
4583
|
+
|
|
4584
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/module_with_providers.mjs
|
|
4573
4585
|
import ts21 from "typescript";
|
|
4586
|
+
function createModuleWithProvidersResolver(reflector, isCore) {
|
|
4587
|
+
function _reflectModuleFromTypeParam(type, node) {
|
|
4588
|
+
if (!ts21.isTypeReferenceNode(type)) {
|
|
4589
|
+
return null;
|
|
4590
|
+
}
|
|
4591
|
+
const typeName = type && (ts21.isIdentifier(type.typeName) && type.typeName || ts21.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
4592
|
+
if (typeName === null) {
|
|
4593
|
+
return null;
|
|
4594
|
+
}
|
|
4595
|
+
const id = reflector.getImportOfIdentifier(typeName);
|
|
4596
|
+
if (id === null || id.name !== "ModuleWithProviders") {
|
|
4597
|
+
return null;
|
|
4598
|
+
}
|
|
4599
|
+
if (!isCore && id.from !== "@angular/core") {
|
|
4600
|
+
return null;
|
|
4601
|
+
}
|
|
4602
|
+
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
4603
|
+
const parent = ts21.isMethodDeclaration(node) && ts21.isClassDeclaration(node.parent) ? node.parent : null;
|
|
4604
|
+
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
4605
|
+
throw new FatalDiagnosticError(ErrorCode.NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC, type, `${symbolName} returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.`);
|
|
4606
|
+
}
|
|
4607
|
+
const arg = type.typeArguments[0];
|
|
4608
|
+
return typeNodeToValueExpr(arg);
|
|
4609
|
+
}
|
|
4610
|
+
function _reflectModuleFromLiteralType(type) {
|
|
4611
|
+
if (!ts21.isIntersectionTypeNode(type)) {
|
|
4612
|
+
return null;
|
|
4613
|
+
}
|
|
4614
|
+
for (const t of type.types) {
|
|
4615
|
+
if (ts21.isTypeLiteralNode(t)) {
|
|
4616
|
+
for (const m of t.members) {
|
|
4617
|
+
const ngModuleType = ts21.isPropertySignature(m) && ts21.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
4618
|
+
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
4619
|
+
if (ngModuleExpression) {
|
|
4620
|
+
return ngModuleExpression;
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
}
|
|
4625
|
+
return null;
|
|
4626
|
+
}
|
|
4627
|
+
return (fn, callExpr, resolve, unresolvable) => {
|
|
4628
|
+
var _a;
|
|
4629
|
+
const rawType = fn.node.type;
|
|
4630
|
+
if (rawType === void 0) {
|
|
4631
|
+
return unresolvable;
|
|
4632
|
+
}
|
|
4633
|
+
const type = (_a = _reflectModuleFromTypeParam(rawType, fn.node)) != null ? _a : _reflectModuleFromLiteralType(rawType);
|
|
4634
|
+
if (type === null) {
|
|
4635
|
+
return unresolvable;
|
|
4636
|
+
}
|
|
4637
|
+
const ngModule = resolve(type);
|
|
4638
|
+
if (!(ngModule instanceof Reference) || !isNamedClassDeclaration(ngModule.node)) {
|
|
4639
|
+
return unresolvable;
|
|
4640
|
+
}
|
|
4641
|
+
return new SyntheticValue({
|
|
4642
|
+
ngModule,
|
|
4643
|
+
mwpCall: callExpr
|
|
4644
|
+
});
|
|
4645
|
+
};
|
|
4646
|
+
}
|
|
4647
|
+
function isResolvedModuleWithProviders(sv) {
|
|
4648
|
+
return typeof sv.value === "object" && sv.value != null && sv.value.hasOwnProperty("ngModule") && sv.value.hasOwnProperty("mwpCall");
|
|
4649
|
+
}
|
|
4650
|
+
|
|
4651
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.mjs
|
|
4574
4652
|
var NgModuleSymbol = class extends SemanticSymbol {
|
|
4575
4653
|
constructor() {
|
|
4576
4654
|
super(...arguments);
|
|
@@ -4653,8 +4731,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4653
4731
|
if (decorator.args === null || decorator.args.length > 1) {
|
|
4654
4732
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), `Incorrect number of arguments to @NgModule decorator`);
|
|
4655
4733
|
}
|
|
4656
|
-
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) :
|
|
4657
|
-
if (!
|
|
4734
|
+
const meta = decorator.args.length === 1 ? unwrapExpression(decorator.args[0]) : ts22.factory.createObjectLiteralExpression([]);
|
|
4735
|
+
if (!ts22.isObjectLiteralExpression(meta)) {
|
|
4658
4736
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@NgModule argument must be an object literal");
|
|
4659
4737
|
}
|
|
4660
4738
|
const ngModule = reflectObjectLiteral(meta);
|
|
@@ -4662,7 +4740,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4662
4740
|
return {};
|
|
4663
4741
|
}
|
|
4664
4742
|
const moduleResolvers = combineResolvers([
|
|
4665
|
-
(
|
|
4743
|
+
createModuleWithProvidersResolver(this.reflector, this.isCore),
|
|
4666
4744
|
forwardRefResolver
|
|
4667
4745
|
]);
|
|
4668
4746
|
const diagnostics = [];
|
|
@@ -4717,7 +4795,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4717
4795
|
id = new WrappedNodeExpr6(idExpr);
|
|
4718
4796
|
} else {
|
|
4719
4797
|
const diag = makeDiagnostic(ErrorCode.WARN_NGMODULE_ID_UNNECESSARY, idExpr, `Using 'module.id' for NgModule.id is a common anti-pattern that is ignored by the Angular compiler.`);
|
|
4720
|
-
diag.category =
|
|
4798
|
+
diag.category = ts22.DiagnosticCategory.Warning;
|
|
4721
4799
|
diagnostics.push(diag);
|
|
4722
4800
|
}
|
|
4723
4801
|
}
|
|
@@ -4755,9 +4833,9 @@ var NgModuleDecoratorHandler = class {
|
|
|
4755
4833
|
if (ngModule.has("imports")) {
|
|
4756
4834
|
const rawImports2 = unwrapExpression(ngModule.get("imports"));
|
|
4757
4835
|
let topLevelExpressions = [];
|
|
4758
|
-
if (
|
|
4836
|
+
if (ts22.isArrayLiteralExpression(rawImports2)) {
|
|
4759
4837
|
for (const element of rawImports2.elements) {
|
|
4760
|
-
if (
|
|
4838
|
+
if (ts22.isSpreadElement(element)) {
|
|
4761
4839
|
topLevelExpressions.push(element.expression);
|
|
4762
4840
|
continue;
|
|
4763
4841
|
}
|
|
@@ -4792,6 +4870,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4792
4870
|
deps: getValidConstructorDependencies(node, this.reflector, this.isCore),
|
|
4793
4871
|
target: FactoryTarget2.NgModule
|
|
4794
4872
|
};
|
|
4873
|
+
const remoteScopesMayRequireCycleProtection = declarationRefs.some(isSyntheticReference) || importRefs.some(isSyntheticReference);
|
|
4795
4874
|
return {
|
|
4796
4875
|
diagnostics: diagnostics.length > 0 ? diagnostics : void 0,
|
|
4797
4876
|
analysis: {
|
|
@@ -4810,7 +4889,8 @@ var NgModuleDecoratorHandler = class {
|
|
|
4810
4889
|
providers: rawProviders,
|
|
4811
4890
|
providersRequiringFactory: rawProviders ? resolveProvidersRequiringFactory(rawProviders, this.reflector, this.evaluator) : null,
|
|
4812
4891
|
classMetadata: extractClassMetadata(node, this.reflector, this.isCore, this.annotateForClosureCompiler),
|
|
4813
|
-
factorySymbolName: node.name.text
|
|
4892
|
+
factorySymbolName: node.name.text,
|
|
4893
|
+
remoteScopesMayRequireCycleProtection
|
|
4814
4894
|
}
|
|
4815
4895
|
};
|
|
4816
4896
|
}
|
|
@@ -4910,7 +4990,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4910
4990
|
};
|
|
4911
4991
|
}
|
|
4912
4992
|
}
|
|
4913
|
-
compileFull(node, { inj, mod, fac, classMetadata, declarations }, { injectorImports }) {
|
|
4993
|
+
compileFull(node, { inj, mod, fac, classMetadata, declarations, remoteScopesMayRequireCycleProtection }, { injectorImports }) {
|
|
4914
4994
|
const factoryFn = compileNgFactoryDefField(fac);
|
|
4915
4995
|
const ngInjectorDef = compileInjector(__spreadProps(__spreadValues({}, inj), {
|
|
4916
4996
|
imports: injectorImports
|
|
@@ -4919,7 +4999,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4919
4999
|
const statements = ngModuleDef.statements;
|
|
4920
5000
|
const metadata = classMetadata !== null ? compileClassMetadata2(classMetadata) : null;
|
|
4921
5001
|
this.insertMetadataStatement(statements, metadata);
|
|
4922
|
-
this.appendRemoteScopingStatements(statements, node, declarations);
|
|
5002
|
+
this.appendRemoteScopingStatements(statements, node, declarations, remoteScopesMayRequireCycleProtection);
|
|
4923
5003
|
return this.compileNgModule(factoryFn, ngInjectorDef, ngModuleDef);
|
|
4924
5004
|
}
|
|
4925
5005
|
compilePartial(node, { inj, fac, mod, classMetadata }, { injectorImports }) {
|
|
@@ -4937,7 +5017,7 @@ var NgModuleDecoratorHandler = class {
|
|
|
4937
5017
|
ngModuleStatements.unshift(metadata.toStmt());
|
|
4938
5018
|
}
|
|
4939
5019
|
}
|
|
4940
|
-
appendRemoteScopingStatements(ngModuleStatements, node, declarations) {
|
|
5020
|
+
appendRemoteScopingStatements(ngModuleStatements, node, declarations, remoteScopesMayRequireCycleProtection) {
|
|
4941
5021
|
const context = getSourceFile(node);
|
|
4942
5022
|
for (const decl of declarations) {
|
|
4943
5023
|
const remoteScope = this.scopeRegistry.getRemoteScope(decl.node);
|
|
@@ -4954,11 +5034,13 @@ var NgModuleDecoratorHandler = class {
|
|
|
4954
5034
|
});
|
|
4955
5035
|
const directiveArray = new LiteralArrayExpr2(directives);
|
|
4956
5036
|
const pipesArray = new LiteralArrayExpr2(pipes);
|
|
5037
|
+
const directiveExpr = remoteScopesMayRequireCycleProtection && directives.length > 0 ? new FunctionExpr2([], [new ReturnStatement2(directiveArray)]) : directiveArray;
|
|
5038
|
+
const pipesExpr = remoteScopesMayRequireCycleProtection && pipes.length > 0 ? new FunctionExpr2([], [new ReturnStatement2(pipesArray)]) : pipesArray;
|
|
4957
5039
|
const componentType = this.refEmitter.emit(decl, context);
|
|
4958
5040
|
assertSuccessfulReferenceEmit(componentType, node, "component");
|
|
4959
5041
|
const declExpr = componentType.expression;
|
|
4960
5042
|
const setComponentScope = new ExternalExpr5(R3Identifiers.setComponentScope);
|
|
4961
|
-
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr,
|
|
5043
|
+
const callExpr = new InvokeFunctionExpr(setComponentScope, [declExpr, directiveExpr, pipesExpr]);
|
|
4962
5044
|
ngModuleStatements.push(callExpr.toStmt());
|
|
4963
5045
|
}
|
|
4964
5046
|
}
|
|
@@ -4993,61 +5075,6 @@ var NgModuleDecoratorHandler = class {
|
|
|
4993
5075
|
return toR3Reference(origin, valueRef, typeRef, valueContext, typeContext, this.refEmitter);
|
|
4994
5076
|
}
|
|
4995
5077
|
}
|
|
4996
|
-
_extractModuleFromModuleWithProvidersFn(fn, node, resolve, unresolvable) {
|
|
4997
|
-
const rawType = fn.node.type || null;
|
|
4998
|
-
const type = rawType && (this._reflectModuleFromTypeParam(rawType, fn.node) || this._reflectModuleFromLiteralType(rawType));
|
|
4999
|
-
if (type === null) {
|
|
5000
|
-
return unresolvable;
|
|
5001
|
-
}
|
|
5002
|
-
const ngModule = resolve(type);
|
|
5003
|
-
if (!(ngModule instanceof Reference) || !isNamedClassDeclaration(ngModule.node)) {
|
|
5004
|
-
return unresolvable;
|
|
5005
|
-
}
|
|
5006
|
-
return new SyntheticValue({
|
|
5007
|
-
ngModule,
|
|
5008
|
-
mwpCall: node
|
|
5009
|
-
});
|
|
5010
|
-
}
|
|
5011
|
-
_reflectModuleFromTypeParam(type, node) {
|
|
5012
|
-
if (!ts21.isTypeReferenceNode(type)) {
|
|
5013
|
-
return null;
|
|
5014
|
-
}
|
|
5015
|
-
const typeName = type && (ts21.isIdentifier(type.typeName) && type.typeName || ts21.isQualifiedName(type.typeName) && type.typeName.right) || null;
|
|
5016
|
-
if (typeName === null) {
|
|
5017
|
-
return null;
|
|
5018
|
-
}
|
|
5019
|
-
const id = this.reflector.getImportOfIdentifier(typeName);
|
|
5020
|
-
if (id === null || id.name !== "ModuleWithProviders") {
|
|
5021
|
-
return null;
|
|
5022
|
-
}
|
|
5023
|
-
if (!this.isCore && id.from !== "@angular/core") {
|
|
5024
|
-
return null;
|
|
5025
|
-
}
|
|
5026
|
-
if (type.typeArguments === void 0 || type.typeArguments.length !== 1) {
|
|
5027
|
-
const parent = ts21.isMethodDeclaration(node) && ts21.isClassDeclaration(node.parent) ? node.parent : null;
|
|
5028
|
-
const symbolName = (parent && parent.name ? parent.name.getText() + "." : "") + (node.name ? node.name.getText() : "anonymous");
|
|
5029
|
-
throw new FatalDiagnosticError(ErrorCode.NGMODULE_MODULE_WITH_PROVIDERS_MISSING_GENERIC, type, `${symbolName} returns a ModuleWithProviders type without a generic type argument. Please add a generic type argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.`);
|
|
5030
|
-
}
|
|
5031
|
-
const arg = type.typeArguments[0];
|
|
5032
|
-
return typeNodeToValueExpr(arg);
|
|
5033
|
-
}
|
|
5034
|
-
_reflectModuleFromLiteralType(type) {
|
|
5035
|
-
if (!ts21.isIntersectionTypeNode(type)) {
|
|
5036
|
-
return null;
|
|
5037
|
-
}
|
|
5038
|
-
for (const t of type.types) {
|
|
5039
|
-
if (ts21.isTypeLiteralNode(t)) {
|
|
5040
|
-
for (const m of t.members) {
|
|
5041
|
-
const ngModuleType = ts21.isPropertySignature(m) && ts21.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
5042
|
-
const ngModuleExpression = ngModuleType && typeNodeToValueExpr(ngModuleType);
|
|
5043
|
-
if (ngModuleExpression) {
|
|
5044
|
-
return ngModuleExpression;
|
|
5045
|
-
}
|
|
5046
|
-
}
|
|
5047
|
-
}
|
|
5048
|
-
}
|
|
5049
|
-
return null;
|
|
5050
|
-
}
|
|
5051
5078
|
isClassDeclarationReference(ref) {
|
|
5052
5079
|
return this.reflector.isClass(ref.node);
|
|
5053
5080
|
}
|
|
@@ -5091,10 +5118,7 @@ function isNgModule(node, compilation) {
|
|
|
5091
5118
|
return !compilation.dependencies.some((dep) => dep.ref.node === node);
|
|
5092
5119
|
}
|
|
5093
5120
|
function isModuleIdExpression(expr) {
|
|
5094
|
-
return
|
|
5095
|
-
}
|
|
5096
|
-
function isResolvedModuleWithProviders(sv) {
|
|
5097
|
-
return typeof sv.value === "object" && sv.value != null && sv.value.hasOwnProperty("ngModule") && sv.value.hasOwnProperty("mwpCall");
|
|
5121
|
+
return ts22.isPropertyAccessExpression(expr) && ts22.isIdentifier(expr.expression) && expr.expression.text === "module" && expr.name.text === "id";
|
|
5098
5122
|
}
|
|
5099
5123
|
function makeStandaloneBootstrapDiagnostic(ngModuleClass, bootstrappedClassRef, rawBootstrapExpr) {
|
|
5100
5124
|
const componentClassName = bootstrappedClassRef.node.name.text;
|
|
@@ -5102,8 +5126,11 @@ function makeStandaloneBootstrapDiagnostic(ngModuleClass, bootstrappedClassRef,
|
|
|
5102
5126
|
const relatedInformation = [makeRelatedInformation(ngModuleClass, `The 'bootstrap' array is present on this NgModule.`)];
|
|
5103
5127
|
return makeDiagnostic(ErrorCode.NGMODULE_BOOTSTRAP_IS_STANDALONE, getDiagnosticNode(bootstrappedClassRef, rawBootstrapExpr), message, relatedInformation);
|
|
5104
5128
|
}
|
|
5129
|
+
function isSyntheticReference(ref) {
|
|
5130
|
+
return ref.synthetic;
|
|
5131
|
+
}
|
|
5105
5132
|
|
|
5106
|
-
// bazel-out/
|
|
5133
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/diagnostics.mjs
|
|
5107
5134
|
function makeCyclicImportInfo(ref, type, cycle) {
|
|
5108
5135
|
const name = ref.debugName || "(unknown)";
|
|
5109
5136
|
const path = cycle.getPath().map((sf) => sf.fileName).join(" -> ");
|
|
@@ -5126,9 +5153,9 @@ function checkCustomElementSelectorForErrors(selector) {
|
|
|
5126
5153
|
return null;
|
|
5127
5154
|
}
|
|
5128
5155
|
|
|
5129
|
-
// bazel-out/
|
|
5156
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/resources.mjs
|
|
5130
5157
|
import { DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, ParseSourceFile as ParseSourceFile2, parseTemplate } from "@angular/compiler";
|
|
5131
|
-
import
|
|
5158
|
+
import ts23 from "typescript";
|
|
5132
5159
|
function getTemplateDeclarationNodeForError(declaration) {
|
|
5133
5160
|
switch (declaration.isInline) {
|
|
5134
5161
|
case true:
|
|
@@ -5145,7 +5172,7 @@ function extractTemplate(node, template, evaluator, depTracker, resourceLoader,
|
|
|
5145
5172
|
let sourceMapping;
|
|
5146
5173
|
let escapedString = false;
|
|
5147
5174
|
let sourceMapUrl;
|
|
5148
|
-
if (
|
|
5175
|
+
if (ts23.isStringLiteral(template.expression) || ts23.isNoSubstitutionTemplateLiteral(template.expression)) {
|
|
5149
5176
|
sourceParseRange = getTemplateRange(template.expression);
|
|
5150
5177
|
sourceStr = template.expression.getSourceFile().text;
|
|
5151
5178
|
templateContent = template.expression.text;
|
|
@@ -5303,7 +5330,7 @@ function preloadAndParseTemplate(evaluator, resourceLoader, depTracker, preanaly
|
|
|
5303
5330
|
}
|
|
5304
5331
|
function getTemplateRange(templateExpr) {
|
|
5305
5332
|
const startPos = templateExpr.getStart() + 1;
|
|
5306
|
-
const { line, character } =
|
|
5333
|
+
const { line, character } = ts23.getLineAndCharacterOfPosition(templateExpr.getSourceFile(), startPos);
|
|
5307
5334
|
return {
|
|
5308
5335
|
startPos,
|
|
5309
5336
|
startLine: line,
|
|
@@ -5336,7 +5363,7 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
5336
5363
|
const metadata = new Map(component);
|
|
5337
5364
|
if (metadata.has("templateUrl")) {
|
|
5338
5365
|
metadata.delete("templateUrl");
|
|
5339
|
-
metadata.set("template",
|
|
5366
|
+
metadata.set("template", ts23.factory.createStringLiteral(template.content));
|
|
5340
5367
|
}
|
|
5341
5368
|
if (metadata.has("styleUrls") || metadata.has("styles")) {
|
|
5342
5369
|
metadata.delete("styles");
|
|
@@ -5344,20 +5371,20 @@ function transformDecoratorResources(dec, component, styles, template) {
|
|
|
5344
5371
|
if (styles.length > 0) {
|
|
5345
5372
|
const styleNodes = styles.reduce((result, style) => {
|
|
5346
5373
|
if (style.trim().length > 0) {
|
|
5347
|
-
result.push(
|
|
5374
|
+
result.push(ts23.factory.createStringLiteral(style));
|
|
5348
5375
|
}
|
|
5349
5376
|
return result;
|
|
5350
5377
|
}, []);
|
|
5351
5378
|
if (styleNodes.length > 0) {
|
|
5352
|
-
metadata.set("styles",
|
|
5379
|
+
metadata.set("styles", ts23.factory.createArrayLiteralExpression(styleNodes));
|
|
5353
5380
|
}
|
|
5354
5381
|
}
|
|
5355
5382
|
}
|
|
5356
5383
|
const newMetadataFields = [];
|
|
5357
5384
|
for (const [name, value] of metadata.entries()) {
|
|
5358
|
-
newMetadataFields.push(
|
|
5385
|
+
newMetadataFields.push(ts23.factory.createPropertyAssignment(name, value));
|
|
5359
5386
|
}
|
|
5360
|
-
return __spreadProps(__spreadValues({}, dec), { args: [
|
|
5387
|
+
return __spreadProps(__spreadValues({}, dec), { args: [ts23.factory.createObjectLiteralExpression(newMetadataFields)] });
|
|
5361
5388
|
}
|
|
5362
5389
|
function extractComponentStyleUrls(evaluator, component) {
|
|
5363
5390
|
if (!component.has("styleUrls")) {
|
|
@@ -5367,9 +5394,9 @@ function extractComponentStyleUrls(evaluator, component) {
|
|
|
5367
5394
|
}
|
|
5368
5395
|
function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
5369
5396
|
const styleUrls = [];
|
|
5370
|
-
if (
|
|
5397
|
+
if (ts23.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5371
5398
|
for (const styleUrlExpr of styleUrlsExpr.elements) {
|
|
5372
|
-
if (
|
|
5399
|
+
if (ts23.isSpreadElement(styleUrlExpr)) {
|
|
5373
5400
|
styleUrls.push(...extractStyleUrlsFromExpression(evaluator, styleUrlExpr.expression));
|
|
5374
5401
|
} else {
|
|
5375
5402
|
const styleUrl = evaluator.evaluate(styleUrlExpr);
|
|
@@ -5401,10 +5428,10 @@ function extractStyleUrlsFromExpression(evaluator, styleUrlsExpr) {
|
|
|
5401
5428
|
function extractStyleResources(resourceLoader, component, containingFile) {
|
|
5402
5429
|
const styles = /* @__PURE__ */ new Set();
|
|
5403
5430
|
function stringLiteralElements(array) {
|
|
5404
|
-
return array.elements.filter((e) =>
|
|
5431
|
+
return array.elements.filter((e) => ts23.isStringLiteralLike(e));
|
|
5405
5432
|
}
|
|
5406
5433
|
const styleUrlsExpr = component.get("styleUrls");
|
|
5407
|
-
if (styleUrlsExpr !== void 0 &&
|
|
5434
|
+
if (styleUrlsExpr !== void 0 && ts23.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
5408
5435
|
for (const expression of stringLiteralElements(styleUrlsExpr)) {
|
|
5409
5436
|
try {
|
|
5410
5437
|
const resourceUrl = resourceLoader.resolve(expression.text, containingFile);
|
|
@@ -5414,7 +5441,7 @@ function extractStyleResources(resourceLoader, component, containingFile) {
|
|
|
5414
5441
|
}
|
|
5415
5442
|
}
|
|
5416
5443
|
const stylesExpr = component.get("styles");
|
|
5417
|
-
if (stylesExpr !== void 0 &&
|
|
5444
|
+
if (stylesExpr !== void 0 && ts23.isArrayLiteralExpression(stylesExpr)) {
|
|
5418
5445
|
for (const expression of stringLiteralElements(stylesExpr)) {
|
|
5419
5446
|
styles.add({ path: null, expression });
|
|
5420
5447
|
}
|
|
@@ -5429,7 +5456,7 @@ function _extractTemplateStyleUrls(template) {
|
|
|
5429
5456
|
return template.styleUrls.map((url) => ({ url, source: 1, nodeForError }));
|
|
5430
5457
|
}
|
|
5431
5458
|
|
|
5432
|
-
// bazel-out/
|
|
5459
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/symbol.mjs
|
|
5433
5460
|
var ComponentSymbol = class extends DirectiveSymbol {
|
|
5434
5461
|
constructor() {
|
|
5435
5462
|
super(...arguments);
|
|
@@ -5464,7 +5491,7 @@ var ComponentSymbol = class extends DirectiveSymbol {
|
|
|
5464
5491
|
}
|
|
5465
5492
|
};
|
|
5466
5493
|
|
|
5467
|
-
// bazel-out/
|
|
5494
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/util.mjs
|
|
5468
5495
|
function collectAnimationNames(value, animationTriggerNames) {
|
|
5469
5496
|
if (value instanceof Map) {
|
|
5470
5497
|
const name = value.get("name");
|
|
@@ -5518,14 +5545,29 @@ function validateAndFlattenComponentImports(imports, expr) {
|
|
|
5518
5545
|
} else {
|
|
5519
5546
|
diagnostics.push(createValueHasWrongTypeError(ref.getOriginForDiagnostics(expr), ref, `'imports' must be an array of components, directives, pipes, or NgModules`).toDiagnostic());
|
|
5520
5547
|
}
|
|
5548
|
+
} else if (isLikelyModuleWithProviders(ref)) {
|
|
5549
|
+
let origin = expr;
|
|
5550
|
+
if (ref instanceof SyntheticValue) {
|
|
5551
|
+
origin = getOriginNodeForDiagnostics(ref.value.mwpCall, expr);
|
|
5552
|
+
}
|
|
5553
|
+
diagnostics.push(makeDiagnostic(ErrorCode.COMPONENT_UNKNOWN_IMPORT, origin, `'imports' contains a ModuleWithProviders value, likely the result of a 'Module.forRoot()'-style call. These calls are not used to configure components and are not valid in standalone component imports - consider importing them in the application bootstrap instead.`));
|
|
5521
5554
|
} else {
|
|
5522
5555
|
diagnostics.push(createValueHasWrongTypeError(expr, imports, `'imports' must be an array of components, directives, pipes, or NgModules`).toDiagnostic());
|
|
5523
5556
|
}
|
|
5524
5557
|
}
|
|
5525
5558
|
return { imports: flattened, diagnostics };
|
|
5526
5559
|
}
|
|
5560
|
+
function isLikelyModuleWithProviders(value) {
|
|
5561
|
+
if (value instanceof SyntheticValue && isResolvedModuleWithProviders(value)) {
|
|
5562
|
+
return true;
|
|
5563
|
+
}
|
|
5564
|
+
if (value instanceof Map && value.has("ngModule")) {
|
|
5565
|
+
return true;
|
|
5566
|
+
}
|
|
5567
|
+
return false;
|
|
5568
|
+
}
|
|
5527
5569
|
|
|
5528
|
-
// bazel-out/
|
|
5570
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
5529
5571
|
var EMPTY_ARRAY = [];
|
|
5530
5572
|
var ComponentDecoratorHandler = class {
|
|
5531
5573
|
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf) {
|
|
@@ -5675,7 +5717,11 @@ var ComponentDecoratorHandler = class {
|
|
|
5675
5717
|
isPoisoned = true;
|
|
5676
5718
|
} else if (component.has("imports")) {
|
|
5677
5719
|
const expr = component.get("imports");
|
|
5678
|
-
const
|
|
5720
|
+
const importResolvers = combineResolvers([
|
|
5721
|
+
createModuleWithProvidersResolver(this.reflector, this.isCore),
|
|
5722
|
+
forwardRefResolver
|
|
5723
|
+
]);
|
|
5724
|
+
const imported = this.evaluator.evaluate(expr, importResolvers);
|
|
5679
5725
|
const { imports: flattened, diagnostics: importDiagnostics } = validateAndFlattenComponentImports(imported, expr);
|
|
5680
5726
|
resolvedImports = flattened;
|
|
5681
5727
|
rawImports = expr;
|
|
@@ -5869,7 +5915,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5869
5915
|
});
|
|
5870
5916
|
}
|
|
5871
5917
|
typeCheck(ctx, node, meta) {
|
|
5872
|
-
if (this.typeCheckScopeRegistry === null || !
|
|
5918
|
+
if (this.typeCheckScopeRegistry === null || !ts24.isClassDeclaration(node)) {
|
|
5873
5919
|
return;
|
|
5874
5920
|
}
|
|
5875
5921
|
if (meta.isPoisoned && !this.usePoisonedData) {
|
|
@@ -5880,7 +5926,7 @@ var ComponentDecoratorHandler = class {
|
|
|
5880
5926
|
return;
|
|
5881
5927
|
}
|
|
5882
5928
|
const binder = new R3TargetBinder(scope.matcher);
|
|
5883
|
-
ctx.addTemplate(new Reference(node), binder, meta.template.diagNodes, scope.pipes, scope.schemas, meta.template.sourceMapping, meta.template.file, meta.template.errors);
|
|
5929
|
+
ctx.addTemplate(new Reference(node), binder, meta.template.diagNodes, scope.pipes, scope.schemas, meta.template.sourceMapping, meta.template.file, meta.template.errors, meta.meta.isStandalone);
|
|
5884
5930
|
}
|
|
5885
5931
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
5886
5932
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
@@ -5998,12 +6044,14 @@ var ComponentDecoratorHandler = class {
|
|
|
5998
6044
|
}
|
|
5999
6045
|
}
|
|
6000
6046
|
}
|
|
6047
|
+
const standaloneImportMayBeForwardDeclared = analysis.resolvedImports !== null && analysis.resolvedImports.some((ref) => ref.synthetic);
|
|
6001
6048
|
const cycleDetected = cyclesFromDirectives.size !== 0 || cyclesFromPipes.size !== 0;
|
|
6002
6049
|
if (!cycleDetected) {
|
|
6003
6050
|
for (const { type, importedFile } of declarations) {
|
|
6004
6051
|
this.maybeRecordSyntheticImport(importedFile, type, context);
|
|
6005
6052
|
}
|
|
6006
|
-
const
|
|
6053
|
+
const declarationIsForwardDeclared = declarations.some((decl) => isExpressionForwardReference(decl.type, node.name, context));
|
|
6054
|
+
const wrapDirectivesAndPipesInClosure = declarationIsForwardDeclared || standaloneImportMayBeForwardDeclared;
|
|
6007
6055
|
data.declarations = declarations;
|
|
6008
6056
|
data.declarationListEmitMode = wrapDirectivesAndPipesInClosure ? 1 : 0;
|
|
6009
6057
|
} else {
|
|
@@ -6148,9 +6196,9 @@ function validateStandaloneImports(importRefs, importExpr, metaReader, scopeRead
|
|
|
6148
6196
|
return diagnostics;
|
|
6149
6197
|
}
|
|
6150
6198
|
|
|
6151
|
-
// bazel-out/
|
|
6199
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
|
|
6152
6200
|
import { compileClassMetadata as compileClassMetadata4, compileDeclareClassMetadata as compileDeclareClassMetadata4, compileDeclareInjectableFromMetadata, compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, FactoryTarget as FactoryTarget4, LiteralExpr as LiteralExpr3, WrappedNodeExpr as WrappedNodeExpr8 } from "@angular/compiler";
|
|
6153
|
-
import
|
|
6201
|
+
import ts25 from "typescript";
|
|
6154
6202
|
var InjectableDecoratorHandler = class {
|
|
6155
6203
|
constructor(reflector, isCore, strictCtorDeps, injectableRegistry, perf, errorOnDuplicateProv = true) {
|
|
6156
6204
|
this.reflector = reflector;
|
|
@@ -6241,7 +6289,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
6241
6289
|
};
|
|
6242
6290
|
} else if (decorator.args.length === 1) {
|
|
6243
6291
|
const metaNode = decorator.args[0];
|
|
6244
|
-
if (!
|
|
6292
|
+
if (!ts25.isObjectLiteralExpression(metaNode)) {
|
|
6245
6293
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, metaNode, `@Injectable argument must be an object literal`);
|
|
6246
6294
|
}
|
|
6247
6295
|
const meta = reflectObjectLiteral(metaNode);
|
|
@@ -6249,7 +6297,7 @@ function extractInjectableMetadata(clazz, decorator, reflector) {
|
|
|
6249
6297
|
let deps = void 0;
|
|
6250
6298
|
if ((meta.has("useClass") || meta.has("useFactory")) && meta.has("deps")) {
|
|
6251
6299
|
const depsExpr = meta.get("deps");
|
|
6252
|
-
if (!
|
|
6300
|
+
if (!ts25.isArrayLiteralExpression(depsExpr)) {
|
|
6253
6301
|
throw new FatalDiagnosticError(ErrorCode.VALUE_NOT_LITERAL, depsExpr, `@Injectable deps metadata must be an inline array`);
|
|
6254
6302
|
}
|
|
6255
6303
|
deps = depsExpr.elements.map((dep) => getDep(dep, reflector));
|
|
@@ -6331,12 +6379,12 @@ function getDep(dep, reflector) {
|
|
|
6331
6379
|
}
|
|
6332
6380
|
return true;
|
|
6333
6381
|
}
|
|
6334
|
-
if (
|
|
6382
|
+
if (ts25.isArrayLiteralExpression(dep)) {
|
|
6335
6383
|
dep.elements.forEach((el) => {
|
|
6336
6384
|
let isDecorator = false;
|
|
6337
|
-
if (
|
|
6385
|
+
if (ts25.isIdentifier(el)) {
|
|
6338
6386
|
isDecorator = maybeUpdateDecorator(el, reflector);
|
|
6339
|
-
} else if (
|
|
6387
|
+
} else if (ts25.isNewExpression(el) && ts25.isIdentifier(el.expression)) {
|
|
6340
6388
|
const token = el.arguments && el.arguments.length > 0 && el.arguments[0] || void 0;
|
|
6341
6389
|
isDecorator = maybeUpdateDecorator(el.expression, reflector, token);
|
|
6342
6390
|
}
|
|
@@ -6348,9 +6396,9 @@ function getDep(dep, reflector) {
|
|
|
6348
6396
|
return meta;
|
|
6349
6397
|
}
|
|
6350
6398
|
|
|
6351
|
-
// bazel-out/
|
|
6399
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/pipe.mjs
|
|
6352
6400
|
import { compileClassMetadata as compileClassMetadata5, compileDeclareClassMetadata as compileDeclareClassMetadata5, compileDeclarePipeFromMetadata, compilePipeFromMetadata, FactoryTarget as FactoryTarget5, WrappedNodeExpr as WrappedNodeExpr9 } from "@angular/compiler";
|
|
6353
|
-
import
|
|
6401
|
+
import ts26 from "typescript";
|
|
6354
6402
|
var PipeSymbol = class extends SemanticSymbol {
|
|
6355
6403
|
constructor(decl, name) {
|
|
6356
6404
|
super(decl);
|
|
@@ -6405,7 +6453,7 @@ var PipeDecoratorHandler = class {
|
|
|
6405
6453
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARITY_WRONG, Decorator.nodeForError(decorator), "@Pipe must have exactly one argument");
|
|
6406
6454
|
}
|
|
6407
6455
|
const meta = unwrapExpression(decorator.args[0]);
|
|
6408
|
-
if (!
|
|
6456
|
+
if (!ts26.isObjectLiteralExpression(meta)) {
|
|
6409
6457
|
throw new FatalDiagnosticError(ErrorCode.DECORATOR_ARG_NOT_LITERAL, meta, "@Pipe must have a literal argument");
|
|
6410
6458
|
}
|
|
6411
6459
|
const pipe = reflectObjectLiteral(meta);
|
|
@@ -6530,4 +6578,4 @@ export {
|
|
|
6530
6578
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6531
6579
|
* found in the LICENSE file at https://angular.io/license
|
|
6532
6580
|
*/
|
|
6533
|
-
//# sourceMappingURL=chunk-
|
|
6581
|
+
//# sourceMappingURL=chunk-NTRR4N4C.js.map
|