@angular/core 18.1.1 → 18.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/render3/component_ref.mjs +1 -1
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +3 -3
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +1 -1
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +1 -1
- package/schematics/ng-generate/control-flow-migration/bundle.js +1 -1
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +562 -32
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -26080,7 +26080,7 @@ function publishFacade(global) {
|
|
|
26080
26080
|
}
|
|
26081
26081
|
|
|
26082
26082
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
26083
|
-
var VERSION2 = new Version("18.
|
|
26083
|
+
var VERSION2 = new Version("18.2.0-next.1");
|
|
26084
26084
|
|
|
26085
26085
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
26086
26086
|
var _I18N_ATTR = "i18n";
|
|
@@ -27184,7 +27184,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
|
|
|
27184
27184
|
function compileDeclareClassMetadata(metadata) {
|
|
27185
27185
|
const definitionMap = new DefinitionMap();
|
|
27186
27186
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
27187
|
-
definitionMap.set("version", literal("18.
|
|
27187
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27188
27188
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27189
27189
|
definitionMap.set("type", metadata.type);
|
|
27190
27190
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -27203,7 +27203,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
27203
27203
|
callbackReturnDefinitionMap.set("ctorParameters", (_a2 = metadata.ctorParameters) != null ? _a2 : literal(null));
|
|
27204
27204
|
callbackReturnDefinitionMap.set("propDecorators", (_b2 = metadata.propDecorators) != null ? _b2 : literal(null));
|
|
27205
27205
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
27206
|
-
definitionMap.set("version", literal("18.
|
|
27206
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27207
27207
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27208
27208
|
definitionMap.set("type", metadata.type);
|
|
27209
27209
|
definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -27271,7 +27271,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
27271
27271
|
const definitionMap = new DefinitionMap();
|
|
27272
27272
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
27273
27273
|
definitionMap.set("minVersion", literal(minVersion));
|
|
27274
|
-
definitionMap.set("version", literal("18.
|
|
27274
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27275
27275
|
definitionMap.set("type", meta.type.value);
|
|
27276
27276
|
if (meta.isStandalone) {
|
|
27277
27277
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -27589,7 +27589,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
27589
27589
|
function compileDeclareFactoryFunction(meta) {
|
|
27590
27590
|
const definitionMap = new DefinitionMap();
|
|
27591
27591
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
27592
|
-
definitionMap.set("version", literal("18.
|
|
27592
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27593
27593
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27594
27594
|
definitionMap.set("type", meta.type.value);
|
|
27595
27595
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -27612,7 +27612,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
27612
27612
|
function createInjectableDefinitionMap(meta) {
|
|
27613
27613
|
const definitionMap = new DefinitionMap();
|
|
27614
27614
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
27615
|
-
definitionMap.set("version", literal("18.
|
|
27615
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27616
27616
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27617
27617
|
definitionMap.set("type", meta.type.value);
|
|
27618
27618
|
if (meta.providedIn !== void 0) {
|
|
@@ -27650,7 +27650,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
27650
27650
|
function createInjectorDefinitionMap(meta) {
|
|
27651
27651
|
const definitionMap = new DefinitionMap();
|
|
27652
27652
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
27653
|
-
definitionMap.set("version", literal("18.
|
|
27653
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27654
27654
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27655
27655
|
definitionMap.set("type", meta.type.value);
|
|
27656
27656
|
definitionMap.set("providers", meta.providers);
|
|
@@ -27674,7 +27674,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
27674
27674
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27675
27675
|
}
|
|
27676
27676
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
27677
|
-
definitionMap.set("version", literal("18.
|
|
27677
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27678
27678
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27679
27679
|
definitionMap.set("type", meta.type.value);
|
|
27680
27680
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27709,7 +27709,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27709
27709
|
function createPipeDefinitionMap(meta) {
|
|
27710
27710
|
const definitionMap = new DefinitionMap();
|
|
27711
27711
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27712
|
-
definitionMap.set("version", literal("18.
|
|
27712
|
+
definitionMap.set("version", literal("18.2.0-next.1"));
|
|
27713
27713
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27714
27714
|
definitionMap.set("type", meta.type.value);
|
|
27715
27715
|
if (meta.isStandalone) {
|
|
@@ -27726,7 +27726,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27726
27726
|
publishFacade(_global);
|
|
27727
27727
|
|
|
27728
27728
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27729
|
-
var VERSION3 = new Version("18.
|
|
27729
|
+
var VERSION3 = new Version("18.2.0-next.1");
|
|
27730
27730
|
|
|
27731
27731
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
27732
27732
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
@@ -29533,11 +29533,313 @@ var ModuleResolver = class {
|
|
|
29533
29533
|
}
|
|
29534
29534
|
};
|
|
29535
29535
|
|
|
29536
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/
|
|
29536
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.mjs
|
|
29537
29537
|
var import_typescript21 = __toESM(require("typescript"), 1);
|
|
29538
|
+
function isAngularDecorator(decorator, isCore) {
|
|
29539
|
+
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
29540
|
+
}
|
|
29541
|
+
var DECORATOR_INVOCATION_JSDOC_TYPE = "!Array<{type: !Function, args: (undefined|!Array<?>)}>";
|
|
29542
|
+
function extractMetadataFromSingleDecorator(decorator, diagnostics) {
|
|
29543
|
+
const metadataProperties = [];
|
|
29544
|
+
const expr = decorator.expression;
|
|
29545
|
+
switch (expr.kind) {
|
|
29546
|
+
case import_typescript21.default.SyntaxKind.Identifier:
|
|
29547
|
+
metadataProperties.push(import_typescript21.default.factory.createPropertyAssignment("type", expr));
|
|
29548
|
+
break;
|
|
29549
|
+
case import_typescript21.default.SyntaxKind.CallExpression:
|
|
29550
|
+
const call2 = expr;
|
|
29551
|
+
metadataProperties.push(import_typescript21.default.factory.createPropertyAssignment("type", call2.expression));
|
|
29552
|
+
if (call2.arguments.length) {
|
|
29553
|
+
const args = [];
|
|
29554
|
+
for (const arg of call2.arguments) {
|
|
29555
|
+
args.push(arg);
|
|
29556
|
+
}
|
|
29557
|
+
const argsArrayLiteral = import_typescript21.default.factory.createArrayLiteralExpression(import_typescript21.default.factory.createNodeArray(args, true));
|
|
29558
|
+
metadataProperties.push(import_typescript21.default.factory.createPropertyAssignment("args", argsArrayLiteral));
|
|
29559
|
+
}
|
|
29560
|
+
break;
|
|
29561
|
+
default:
|
|
29562
|
+
diagnostics.push({
|
|
29563
|
+
file: decorator.getSourceFile(),
|
|
29564
|
+
start: decorator.getStart(),
|
|
29565
|
+
length: decorator.getEnd() - decorator.getStart(),
|
|
29566
|
+
messageText: `${import_typescript21.default.SyntaxKind[decorator.kind]} not implemented in gathering decorator metadata.`,
|
|
29567
|
+
category: import_typescript21.default.DiagnosticCategory.Error,
|
|
29568
|
+
code: 0
|
|
29569
|
+
});
|
|
29570
|
+
break;
|
|
29571
|
+
}
|
|
29572
|
+
return import_typescript21.default.factory.createObjectLiteralExpression(metadataProperties);
|
|
29573
|
+
}
|
|
29574
|
+
function createCtorParametersClassProperty(diagnostics, entityNameToExpression, ctorParameters, isClosureCompilerEnabled) {
|
|
29575
|
+
const params = [];
|
|
29576
|
+
for (const ctorParam of ctorParameters) {
|
|
29577
|
+
if (!ctorParam.type && ctorParam.decorators.length === 0) {
|
|
29578
|
+
params.push(import_typescript21.default.factory.createNull());
|
|
29579
|
+
continue;
|
|
29580
|
+
}
|
|
29581
|
+
const paramType = ctorParam.type ? typeReferenceToExpression(entityNameToExpression, ctorParam.type) : void 0;
|
|
29582
|
+
const members = [
|
|
29583
|
+
import_typescript21.default.factory.createPropertyAssignment("type", paramType || import_typescript21.default.factory.createIdentifier("undefined"))
|
|
29584
|
+
];
|
|
29585
|
+
const decorators = [];
|
|
29586
|
+
for (const deco of ctorParam.decorators) {
|
|
29587
|
+
decorators.push(extractMetadataFromSingleDecorator(deco, diagnostics));
|
|
29588
|
+
}
|
|
29589
|
+
if (decorators.length) {
|
|
29590
|
+
members.push(import_typescript21.default.factory.createPropertyAssignment("decorators", import_typescript21.default.factory.createArrayLiteralExpression(decorators)));
|
|
29591
|
+
}
|
|
29592
|
+
params.push(import_typescript21.default.factory.createObjectLiteralExpression(members));
|
|
29593
|
+
}
|
|
29594
|
+
const initializer = import_typescript21.default.factory.createArrowFunction(void 0, void 0, [], void 0, import_typescript21.default.factory.createToken(import_typescript21.default.SyntaxKind.EqualsGreaterThanToken), import_typescript21.default.factory.createArrayLiteralExpression(params, true));
|
|
29595
|
+
const ctorProp = import_typescript21.default.factory.createPropertyDeclaration([import_typescript21.default.factory.createToken(import_typescript21.default.SyntaxKind.StaticKeyword)], "ctorParameters", void 0, void 0, initializer);
|
|
29596
|
+
if (isClosureCompilerEnabled) {
|
|
29597
|
+
import_typescript21.default.setSyntheticLeadingComments(ctorProp, [
|
|
29598
|
+
{
|
|
29599
|
+
kind: import_typescript21.default.SyntaxKind.MultiLineCommentTrivia,
|
|
29600
|
+
text: [
|
|
29601
|
+
`*`,
|
|
29602
|
+
` * @type {function(): !Array<(null|{`,
|
|
29603
|
+
` * type: ?,`,
|
|
29604
|
+
` * decorators: (undefined|${DECORATOR_INVOCATION_JSDOC_TYPE}),`,
|
|
29605
|
+
` * })>}`,
|
|
29606
|
+
` * @nocollapse`,
|
|
29607
|
+
` `
|
|
29608
|
+
].join("\n"),
|
|
29609
|
+
pos: -1,
|
|
29610
|
+
end: -1,
|
|
29611
|
+
hasTrailingNewLine: true
|
|
29612
|
+
}
|
|
29613
|
+
]);
|
|
29614
|
+
}
|
|
29615
|
+
return ctorProp;
|
|
29616
|
+
}
|
|
29617
|
+
function typeReferenceToExpression(entityNameToExpression, node) {
|
|
29618
|
+
let kind = node.kind;
|
|
29619
|
+
if (import_typescript21.default.isLiteralTypeNode(node)) {
|
|
29620
|
+
kind = node.literal.kind;
|
|
29621
|
+
}
|
|
29622
|
+
switch (kind) {
|
|
29623
|
+
case import_typescript21.default.SyntaxKind.FunctionType:
|
|
29624
|
+
case import_typescript21.default.SyntaxKind.ConstructorType:
|
|
29625
|
+
return import_typescript21.default.factory.createIdentifier("Function");
|
|
29626
|
+
case import_typescript21.default.SyntaxKind.ArrayType:
|
|
29627
|
+
case import_typescript21.default.SyntaxKind.TupleType:
|
|
29628
|
+
return import_typescript21.default.factory.createIdentifier("Array");
|
|
29629
|
+
case import_typescript21.default.SyntaxKind.TypePredicate:
|
|
29630
|
+
case import_typescript21.default.SyntaxKind.TrueKeyword:
|
|
29631
|
+
case import_typescript21.default.SyntaxKind.FalseKeyword:
|
|
29632
|
+
case import_typescript21.default.SyntaxKind.BooleanKeyword:
|
|
29633
|
+
return import_typescript21.default.factory.createIdentifier("Boolean");
|
|
29634
|
+
case import_typescript21.default.SyntaxKind.StringLiteral:
|
|
29635
|
+
case import_typescript21.default.SyntaxKind.StringKeyword:
|
|
29636
|
+
return import_typescript21.default.factory.createIdentifier("String");
|
|
29637
|
+
case import_typescript21.default.SyntaxKind.ObjectKeyword:
|
|
29638
|
+
return import_typescript21.default.factory.createIdentifier("Object");
|
|
29639
|
+
case import_typescript21.default.SyntaxKind.NumberKeyword:
|
|
29640
|
+
case import_typescript21.default.SyntaxKind.NumericLiteral:
|
|
29641
|
+
return import_typescript21.default.factory.createIdentifier("Number");
|
|
29642
|
+
case import_typescript21.default.SyntaxKind.TypeReference:
|
|
29643
|
+
const typeRef = node;
|
|
29644
|
+
return entityNameToExpression(typeRef.typeName);
|
|
29645
|
+
case import_typescript21.default.SyntaxKind.UnionType:
|
|
29646
|
+
const childTypeNodes = node.types.filter((t) => !(import_typescript21.default.isLiteralTypeNode(t) && t.literal.kind === import_typescript21.default.SyntaxKind.NullKeyword));
|
|
29647
|
+
return childTypeNodes.length === 1 ? typeReferenceToExpression(entityNameToExpression, childTypeNodes[0]) : void 0;
|
|
29648
|
+
default:
|
|
29649
|
+
return void 0;
|
|
29650
|
+
}
|
|
29651
|
+
}
|
|
29652
|
+
function symbolIsRuntimeValue(typeChecker, symbol) {
|
|
29653
|
+
if (symbol.flags & import_typescript21.default.SymbolFlags.Alias) {
|
|
29654
|
+
symbol = typeChecker.getAliasedSymbol(symbol);
|
|
29655
|
+
}
|
|
29656
|
+
return (symbol.flags & import_typescript21.default.SymbolFlags.Value & import_typescript21.default.SymbolFlags.ConstEnumExcludes) !== 0;
|
|
29657
|
+
}
|
|
29658
|
+
function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore, isClosureCompilerEnabled, shouldTransformClass) {
|
|
29659
|
+
function addJSDocTypeAnnotation(node, jsdocType) {
|
|
29660
|
+
if (!isClosureCompilerEnabled) {
|
|
29661
|
+
return;
|
|
29662
|
+
}
|
|
29663
|
+
import_typescript21.default.setSyntheticLeadingComments(node, [
|
|
29664
|
+
{
|
|
29665
|
+
kind: import_typescript21.default.SyntaxKind.MultiLineCommentTrivia,
|
|
29666
|
+
text: `* @type {${jsdocType}} `,
|
|
29667
|
+
pos: -1,
|
|
29668
|
+
end: -1,
|
|
29669
|
+
hasTrailingNewLine: true
|
|
29670
|
+
}
|
|
29671
|
+
]);
|
|
29672
|
+
}
|
|
29673
|
+
function createPropDecoratorsClassProperty(diagnostics2, properties) {
|
|
29674
|
+
const entries = [];
|
|
29675
|
+
for (const [name, decorators] of properties.entries()) {
|
|
29676
|
+
entries.push(import_typescript21.default.factory.createPropertyAssignment(name, import_typescript21.default.factory.createArrayLiteralExpression(decorators.map((deco) => extractMetadataFromSingleDecorator(deco, diagnostics2)))));
|
|
29677
|
+
}
|
|
29678
|
+
const initializer = import_typescript21.default.factory.createObjectLiteralExpression(entries, true);
|
|
29679
|
+
const prop = import_typescript21.default.factory.createPropertyDeclaration([import_typescript21.default.factory.createToken(import_typescript21.default.SyntaxKind.StaticKeyword)], "propDecorators", void 0, void 0, initializer);
|
|
29680
|
+
addJSDocTypeAnnotation(prop, `!Object<string, ${DECORATOR_INVOCATION_JSDOC_TYPE}>`);
|
|
29681
|
+
return prop;
|
|
29682
|
+
}
|
|
29683
|
+
return (context) => {
|
|
29684
|
+
const referencedParameterTypes = loadIsReferencedAliasDeclarationPatch(context);
|
|
29685
|
+
function entityNameToExpression(name) {
|
|
29686
|
+
const symbol = typeChecker.getSymbolAtLocation(name);
|
|
29687
|
+
if (!symbol || !symbolIsRuntimeValue(typeChecker, symbol) || !symbol.declarations || symbol.declarations.length === 0) {
|
|
29688
|
+
return void 0;
|
|
29689
|
+
}
|
|
29690
|
+
if (import_typescript21.default.isQualifiedName(name)) {
|
|
29691
|
+
const containerExpr = entityNameToExpression(name.left);
|
|
29692
|
+
if (containerExpr === void 0) {
|
|
29693
|
+
return void 0;
|
|
29694
|
+
}
|
|
29695
|
+
return import_typescript21.default.factory.createPropertyAccessExpression(containerExpr, name.right);
|
|
29696
|
+
}
|
|
29697
|
+
const decl = symbol.declarations[0];
|
|
29698
|
+
if (isAliasImportDeclaration(decl)) {
|
|
29699
|
+
referencedParameterTypes.add(decl);
|
|
29700
|
+
if (decl.name !== void 0) {
|
|
29701
|
+
return import_typescript21.default.setOriginalNode(import_typescript21.default.factory.createIdentifier(decl.name.text), decl.name);
|
|
29702
|
+
}
|
|
29703
|
+
}
|
|
29704
|
+
return import_typescript21.default.setOriginalNode(import_typescript21.default.factory.createIdentifier(name.text), name);
|
|
29705
|
+
}
|
|
29706
|
+
function transformClassElement(element2) {
|
|
29707
|
+
element2 = import_typescript21.default.visitEachChild(element2, decoratorDownlevelVisitor, context);
|
|
29708
|
+
const decoratorsToKeep = [];
|
|
29709
|
+
const toLower = [];
|
|
29710
|
+
const decorators = host.getDecoratorsOfDeclaration(element2) || [];
|
|
29711
|
+
for (const decorator of decorators) {
|
|
29712
|
+
const decoratorNode = decorator.node;
|
|
29713
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
29714
|
+
decoratorsToKeep.push(decoratorNode);
|
|
29715
|
+
continue;
|
|
29716
|
+
}
|
|
29717
|
+
toLower.push(decoratorNode);
|
|
29718
|
+
}
|
|
29719
|
+
if (!toLower.length)
|
|
29720
|
+
return [void 0, element2, []];
|
|
29721
|
+
if (!element2.name || !import_typescript21.default.isIdentifier(element2.name)) {
|
|
29722
|
+
diagnostics.push({
|
|
29723
|
+
file: element2.getSourceFile(),
|
|
29724
|
+
start: element2.getStart(),
|
|
29725
|
+
length: element2.getEnd() - element2.getStart(),
|
|
29726
|
+
messageText: `Cannot process decorators for class element with non-analyzable name.`,
|
|
29727
|
+
category: import_typescript21.default.DiagnosticCategory.Error,
|
|
29728
|
+
code: 0
|
|
29729
|
+
});
|
|
29730
|
+
return [void 0, element2, []];
|
|
29731
|
+
}
|
|
29732
|
+
const elementModifiers = import_typescript21.default.canHaveModifiers(element2) ? import_typescript21.default.getModifiers(element2) : void 0;
|
|
29733
|
+
let modifiers;
|
|
29734
|
+
if (decoratorsToKeep.length || (elementModifiers == null ? void 0 : elementModifiers.length)) {
|
|
29735
|
+
modifiers = import_typescript21.default.setTextRange(import_typescript21.default.factory.createNodeArray([...decoratorsToKeep, ...elementModifiers || []]), element2.modifiers);
|
|
29736
|
+
}
|
|
29737
|
+
return [element2.name.text, cloneClassElementWithModifiers(element2, modifiers), toLower];
|
|
29738
|
+
}
|
|
29739
|
+
function transformConstructor(ctor) {
|
|
29740
|
+
ctor = import_typescript21.default.visitEachChild(ctor, decoratorDownlevelVisitor, context);
|
|
29741
|
+
const newParameters = [];
|
|
29742
|
+
const oldParameters = ctor.parameters;
|
|
29743
|
+
const parametersInfo = [];
|
|
29744
|
+
for (const param of oldParameters) {
|
|
29745
|
+
const decoratorsToKeep = [];
|
|
29746
|
+
const paramInfo = { decorators: [], type: null };
|
|
29747
|
+
const decorators = host.getDecoratorsOfDeclaration(param) || [];
|
|
29748
|
+
for (const decorator of decorators) {
|
|
29749
|
+
const decoratorNode = decorator.node;
|
|
29750
|
+
if (!isAngularDecorator(decorator, isCore)) {
|
|
29751
|
+
decoratorsToKeep.push(decoratorNode);
|
|
29752
|
+
continue;
|
|
29753
|
+
}
|
|
29754
|
+
paramInfo.decorators.push(decoratorNode);
|
|
29755
|
+
}
|
|
29756
|
+
if (param.type) {
|
|
29757
|
+
paramInfo.type = param.type;
|
|
29758
|
+
}
|
|
29759
|
+
parametersInfo.push(paramInfo);
|
|
29760
|
+
let modifiers;
|
|
29761
|
+
const paramModifiers = import_typescript21.default.getModifiers(param);
|
|
29762
|
+
if (decoratorsToKeep.length || (paramModifiers == null ? void 0 : paramModifiers.length)) {
|
|
29763
|
+
modifiers = [...decoratorsToKeep, ...paramModifiers || []];
|
|
29764
|
+
}
|
|
29765
|
+
const newParam = import_typescript21.default.factory.updateParameterDeclaration(param, modifiers, param.dotDotDotToken, param.name, param.questionToken, param.type, param.initializer);
|
|
29766
|
+
newParameters.push(newParam);
|
|
29767
|
+
}
|
|
29768
|
+
const updated = import_typescript21.default.factory.updateConstructorDeclaration(ctor, import_typescript21.default.getModifiers(ctor), newParameters, ctor.body);
|
|
29769
|
+
return [updated, parametersInfo];
|
|
29770
|
+
}
|
|
29771
|
+
function transformClassDeclaration(classDecl) {
|
|
29772
|
+
const newMembers = [];
|
|
29773
|
+
const decoratedProperties = /* @__PURE__ */ new Map();
|
|
29774
|
+
let classParameters = null;
|
|
29775
|
+
for (const member of classDecl.members) {
|
|
29776
|
+
switch (member.kind) {
|
|
29777
|
+
case import_typescript21.default.SyntaxKind.PropertyDeclaration:
|
|
29778
|
+
case import_typescript21.default.SyntaxKind.GetAccessor:
|
|
29779
|
+
case import_typescript21.default.SyntaxKind.SetAccessor:
|
|
29780
|
+
case import_typescript21.default.SyntaxKind.MethodDeclaration: {
|
|
29781
|
+
const [name, newMember, decorators] = transformClassElement(member);
|
|
29782
|
+
newMembers.push(newMember);
|
|
29783
|
+
if (name)
|
|
29784
|
+
decoratedProperties.set(name, decorators);
|
|
29785
|
+
continue;
|
|
29786
|
+
}
|
|
29787
|
+
case import_typescript21.default.SyntaxKind.Constructor: {
|
|
29788
|
+
const ctor = member;
|
|
29789
|
+
if (!ctor.body)
|
|
29790
|
+
break;
|
|
29791
|
+
const [newMember, parametersInfo] = transformConstructor(member);
|
|
29792
|
+
classParameters = parametersInfo;
|
|
29793
|
+
newMembers.push(newMember);
|
|
29794
|
+
continue;
|
|
29795
|
+
}
|
|
29796
|
+
default:
|
|
29797
|
+
break;
|
|
29798
|
+
}
|
|
29799
|
+
newMembers.push(import_typescript21.default.visitEachChild(member, decoratorDownlevelVisitor, context));
|
|
29800
|
+
}
|
|
29801
|
+
const possibleAngularDecorators = host.getDecoratorsOfDeclaration(classDecl) || [];
|
|
29802
|
+
const hasAngularDecorator = possibleAngularDecorators.some((d) => isAngularDecorator(d, isCore));
|
|
29803
|
+
if (classParameters) {
|
|
29804
|
+
if (hasAngularDecorator || classParameters.some((p2) => !!p2.decorators.length)) {
|
|
29805
|
+
newMembers.push(createCtorParametersClassProperty(diagnostics, entityNameToExpression, classParameters, isClosureCompilerEnabled));
|
|
29806
|
+
}
|
|
29807
|
+
}
|
|
29808
|
+
if (decoratedProperties.size) {
|
|
29809
|
+
newMembers.push(createPropDecoratorsClassProperty(diagnostics, decoratedProperties));
|
|
29810
|
+
}
|
|
29811
|
+
const members = import_typescript21.default.setTextRange(import_typescript21.default.factory.createNodeArray(newMembers, classDecl.members.hasTrailingComma), classDecl.members);
|
|
29812
|
+
return import_typescript21.default.factory.updateClassDeclaration(classDecl, classDecl.modifiers, classDecl.name, classDecl.typeParameters, classDecl.heritageClauses, members);
|
|
29813
|
+
}
|
|
29814
|
+
function decoratorDownlevelVisitor(node) {
|
|
29815
|
+
if (import_typescript21.default.isClassDeclaration(node) && (shouldTransformClass === void 0 || shouldTransformClass(node))) {
|
|
29816
|
+
return transformClassDeclaration(node);
|
|
29817
|
+
}
|
|
29818
|
+
return import_typescript21.default.visitEachChild(node, decoratorDownlevelVisitor, context);
|
|
29819
|
+
}
|
|
29820
|
+
return (sf) => {
|
|
29821
|
+
return import_typescript21.default.visitEachChild(sf, decoratorDownlevelVisitor, context);
|
|
29822
|
+
};
|
|
29823
|
+
};
|
|
29824
|
+
}
|
|
29825
|
+
function cloneClassElementWithModifiers(node, modifiers) {
|
|
29826
|
+
let clone;
|
|
29827
|
+
if (import_typescript21.default.isMethodDeclaration(node)) {
|
|
29828
|
+
clone = import_typescript21.default.factory.createMethodDeclaration(modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body);
|
|
29829
|
+
} else if (import_typescript21.default.isPropertyDeclaration(node)) {
|
|
29830
|
+
clone = import_typescript21.default.factory.createPropertyDeclaration(modifiers, node.name, node.questionToken, node.type, node.initializer);
|
|
29831
|
+
} else if (import_typescript21.default.isGetAccessor(node)) {
|
|
29832
|
+
clone = import_typescript21.default.factory.createGetAccessorDeclaration(modifiers, node.name, node.parameters, node.type, node.body);
|
|
29833
|
+
} else if (import_typescript21.default.isSetAccessor(node)) {
|
|
29834
|
+
clone = import_typescript21.default.factory.createSetAccessorDeclaration(modifiers, node.name, node.parameters, node.body);
|
|
29835
|
+
} else {
|
|
29836
|
+
throw new Error(`Unsupported decorated member with kind ${import_typescript21.default.SyntaxKind[node.kind]}`);
|
|
29837
|
+
}
|
|
29838
|
+
return import_typescript21.default.setOriginalNode(clone, node);
|
|
29839
|
+
}
|
|
29538
29840
|
|
|
29539
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/
|
|
29540
|
-
var
|
|
29841
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.mjs
|
|
29842
|
+
var import_typescript94 = __toESM(require("typescript"), 1);
|
|
29541
29843
|
|
|
29542
29844
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/di.mjs
|
|
29543
29845
|
var import_typescript23 = __toESM(require("typescript"), 1);
|
|
@@ -29584,9 +29886,9 @@ function isAngularCoreReference(reference2, symbolName) {
|
|
|
29584
29886
|
return reference2.ownedByModuleGuess === CORE_MODULE2 && reference2.debugName === symbolName;
|
|
29585
29887
|
}
|
|
29586
29888
|
function findAngularDecorator(decorators, name, isCore) {
|
|
29587
|
-
return decorators.find((decorator) =>
|
|
29889
|
+
return decorators.find((decorator) => isAngularDecorator2(decorator, name, isCore));
|
|
29588
29890
|
}
|
|
29589
|
-
function
|
|
29891
|
+
function isAngularDecorator2(decorator, name, isCore) {
|
|
29590
29892
|
if (isCore) {
|
|
29591
29893
|
return decorator.name === name;
|
|
29592
29894
|
} else if (isAngularCore(decorator)) {
|
|
@@ -31702,6 +32004,8 @@ var PerfPhase;
|
|
|
31702
32004
|
PerfPhase2[PerfPhase2["LAST"] = 25] = "LAST";
|
|
31703
32005
|
PerfPhase2[PerfPhase2["LsCodeFixes"] = 26] = "LsCodeFixes";
|
|
31704
32006
|
PerfPhase2[PerfPhase2["LsCodeFixesAll"] = 27] = "LsCodeFixesAll";
|
|
32007
|
+
PerfPhase2[PerfPhase2["LSComputeApplicableRefactorings"] = 28] = "LSComputeApplicableRefactorings";
|
|
32008
|
+
PerfPhase2[PerfPhase2["LSApplyRefactoring"] = 29] = "LSApplyRefactoring";
|
|
31705
32009
|
})(PerfPhase || (PerfPhase = {}));
|
|
31706
32010
|
var PerfEvent;
|
|
31707
32011
|
(function(PerfEvent2) {
|
|
@@ -34236,7 +34540,7 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
34236
34540
|
if (classDecorators === null) {
|
|
34237
34541
|
return null;
|
|
34238
34542
|
}
|
|
34239
|
-
const ngClassDecorators = classDecorators.filter((dec) =>
|
|
34543
|
+
const ngClassDecorators = classDecorators.filter((dec) => isAngularDecorator3(dec, isCore)).map((decorator) => decoratorToMetadata(angularDecoratorTransform(decorator), annotateForClosureCompiler)).map((decorator) => removeIdentifierReferences(decorator, id.text));
|
|
34240
34544
|
if (ngClassDecorators.length === 0) {
|
|
34241
34545
|
return null;
|
|
34242
34546
|
}
|
|
@@ -34273,14 +34577,14 @@ function ctorParameterToMetadata(param, isCore) {
|
|
|
34273
34577
|
{ key: "type", value: type, quoted: false }
|
|
34274
34578
|
];
|
|
34275
34579
|
if (param.decorators !== null) {
|
|
34276
|
-
const ngDecorators = param.decorators.filter((dec) =>
|
|
34580
|
+
const ngDecorators = param.decorators.filter((dec) => isAngularDecorator3(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
34277
34581
|
const value = new WrappedNodeExpr(import_typescript49.default.factory.createArrayLiteralExpression(ngDecorators));
|
|
34278
34582
|
mapEntries.push({ key: "decorators", value, quoted: false });
|
|
34279
34583
|
}
|
|
34280
34584
|
return literalMap(mapEntries);
|
|
34281
34585
|
}
|
|
34282
34586
|
function classMemberToMetadata(name, decorators, isCore) {
|
|
34283
|
-
const ngDecorators = decorators.filter((dec) =>
|
|
34587
|
+
const ngDecorators = decorators.filter((dec) => isAngularDecorator3(dec, isCore)).map((decorator) => decoratorToMetadata(decorator));
|
|
34284
34588
|
const decoratorMeta = import_typescript49.default.factory.createArrayLiteralExpression(ngDecorators);
|
|
34285
34589
|
return import_typescript49.default.factory.createPropertyAssignment(name, decoratorMeta);
|
|
34286
34590
|
}
|
|
@@ -34299,7 +34603,7 @@ function decoratorToMetadata(decorator, wrapFunctionsInParens) {
|
|
|
34299
34603
|
}
|
|
34300
34604
|
return import_typescript49.default.factory.createObjectLiteralExpression(properties, true);
|
|
34301
34605
|
}
|
|
34302
|
-
function
|
|
34606
|
+
function isAngularDecorator3(decorator, isCore) {
|
|
34303
34607
|
return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
|
|
34304
34608
|
}
|
|
34305
34609
|
function removeIdentifierReferences(node, names) {
|
|
@@ -34389,6 +34693,13 @@ function compileInputTransformFields(inputs) {
|
|
|
34389
34693
|
return extraFields;
|
|
34390
34694
|
}
|
|
34391
34695
|
|
|
34696
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/common/src/jit_declaration_registry.mjs
|
|
34697
|
+
var JitDeclarationRegistry = class {
|
|
34698
|
+
constructor() {
|
|
34699
|
+
this.jitDeclarations = /* @__PURE__ */ new Set();
|
|
34700
|
+
}
|
|
34701
|
+
};
|
|
34702
|
+
|
|
34392
34703
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/component/src/handler.mjs
|
|
34393
34704
|
var import_typescript88 = __toESM(require("typescript"), 1);
|
|
34394
34705
|
|
|
@@ -35505,7 +35816,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
35505
35816
|
directive = reflectObjectLiteral(meta);
|
|
35506
35817
|
}
|
|
35507
35818
|
if (directive.has("jit")) {
|
|
35508
|
-
return
|
|
35819
|
+
return { jitForced: true };
|
|
35509
35820
|
}
|
|
35510
35821
|
const members = reflector.getMembersOfClass(clazz);
|
|
35511
35822
|
const decoratedElements = members.filter((member) => !member.isStatic && member.decorators !== null);
|
|
@@ -35613,6 +35924,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
35613
35924
|
hostDirectives: (hostDirectives == null ? void 0 : hostDirectives.map((hostDir) => toHostDirectiveMetadata(hostDir, sourceFile, refEmitter))) || null
|
|
35614
35925
|
};
|
|
35615
35926
|
return {
|
|
35927
|
+
jitForced: false,
|
|
35616
35928
|
decorator: directive,
|
|
35617
35929
|
metadata,
|
|
35618
35930
|
inputs,
|
|
@@ -35916,7 +36228,7 @@ function tryGetDecoratorOnMember(member, decoratorName, isCore) {
|
|
|
35916
36228
|
return null;
|
|
35917
36229
|
}
|
|
35918
36230
|
for (const decorator of member.decorators) {
|
|
35919
|
-
if (
|
|
36231
|
+
if (isAngularDecorator2(decorator, decoratorName, isCore)) {
|
|
35920
36232
|
return decorator;
|
|
35921
36233
|
}
|
|
35922
36234
|
}
|
|
@@ -36382,7 +36694,7 @@ var LIFECYCLE_HOOKS = /* @__PURE__ */ new Set([
|
|
|
36382
36694
|
"ngAfterContentChecked"
|
|
36383
36695
|
]);
|
|
36384
36696
|
var DirectiveDecoratorHandler = class {
|
|
36385
|
-
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode,
|
|
36697
|
+
constructor(reflector, evaluator, metaRegistry, scopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, annotateForClosureCompiler, perf, importTracker, includeClassMetadata, compilationMode, jitDeclarationRegistry) {
|
|
36386
36698
|
this.reflector = reflector;
|
|
36387
36699
|
this.evaluator = evaluator;
|
|
36388
36700
|
this.metaRegistry = metaRegistry;
|
|
@@ -36399,7 +36711,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
36399
36711
|
this.importTracker = importTracker;
|
|
36400
36712
|
this.includeClassMetadata = includeClassMetadata;
|
|
36401
36713
|
this.compilationMode = compilationMode;
|
|
36402
|
-
this.
|
|
36714
|
+
this.jitDeclarationRegistry = jitDeclarationRegistry;
|
|
36403
36715
|
this.precedence = HandlerPrecedence.PRIMARY;
|
|
36404
36716
|
this.name = "DirectiveDecoratorHandler";
|
|
36405
36717
|
}
|
|
@@ -36434,7 +36746,8 @@ var DirectiveDecoratorHandler = class {
|
|
|
36434
36746
|
this.compilationMode,
|
|
36435
36747
|
null
|
|
36436
36748
|
);
|
|
36437
|
-
if (directiveResult
|
|
36749
|
+
if (directiveResult.jitForced) {
|
|
36750
|
+
this.jitDeclarationRegistry.jitDeclarations.add(node);
|
|
36438
36751
|
return {};
|
|
36439
36752
|
}
|
|
36440
36753
|
const analysis = directiveResult.metadata;
|
|
@@ -36546,7 +36859,7 @@ var DirectiveDecoratorHandler = class {
|
|
|
36546
36859
|
return true;
|
|
36547
36860
|
}
|
|
36548
36861
|
if (member.decorators) {
|
|
36549
|
-
return member.decorators.some((decorator) => FIELD_DECORATORS.some((decoratorName) =>
|
|
36862
|
+
return member.decorators.some((decorator) => FIELD_DECORATORS.some((decoratorName) => isAngularDecorator2(decorator, decoratorName, this.isCore)));
|
|
36550
36863
|
}
|
|
36551
36864
|
return false;
|
|
36552
36865
|
});
|
|
@@ -44025,7 +44338,7 @@ var EMPTY_ARRAY2 = [];
|
|
|
44025
44338
|
var isUsedDirective = (decl) => decl.kind === R3TemplateDependencyKind.Directive;
|
|
44026
44339
|
var isUsedPipe = (decl) => decl.kind === R3TemplateDependencyKind.Pipe;
|
|
44027
44340
|
var ComponentDecoratorHandler = class {
|
|
44028
|
-
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, enableLetSyntax, localCompilationExtraImportsTracker) {
|
|
44341
|
+
constructor(reflector, evaluator, metaRegistry, metaReader, scopeReader, dtsScopeReader, scopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, resourceLoader, rootDirs, defaultPreserveWhitespaces, i18nUseExternalIds, enableI18nLegacyMessageIdFormat, usePoisonedData, i18nNormalizeLineEndingsInICUs, moduleResolver, cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, depTracker, injectableRegistry, semanticDepGraphUpdater, annotateForClosureCompiler, perf, hostDirectivesResolver, importTracker, includeClassMetadata, compilationMode, deferredSymbolTracker, forbidOrphanRendering, enableBlockSyntax, enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry) {
|
|
44029
44342
|
this.reflector = reflector;
|
|
44030
44343
|
this.evaluator = evaluator;
|
|
44031
44344
|
this.metaRegistry = metaRegistry;
|
|
@@ -44063,6 +44376,7 @@ var ComponentDecoratorHandler = class {
|
|
|
44063
44376
|
this.enableBlockSyntax = enableBlockSyntax;
|
|
44064
44377
|
this.enableLetSyntax = enableLetSyntax;
|
|
44065
44378
|
this.localCompilationExtraImportsTracker = localCompilationExtraImportsTracker;
|
|
44379
|
+
this.jitDeclarationRegistry = jitDeclarationRegistry;
|
|
44066
44380
|
this.literalCache = /* @__PURE__ */ new Map();
|
|
44067
44381
|
this.elementSchemaRegistry = new DomElementSchemaRegistry();
|
|
44068
44382
|
this.preanalyzeTemplateCache = /* @__PURE__ */ new Map();
|
|
@@ -44141,7 +44455,8 @@ var ComponentDecoratorHandler = class {
|
|
|
44141
44455
|
let diagnostics;
|
|
44142
44456
|
let isPoisoned = false;
|
|
44143
44457
|
const directiveResult = extractDirectiveMetadata(node, decorator, this.reflector, this.importTracker, this.evaluator, this.refEmitter, this.referencesRegistry, this.isCore, this.annotateForClosureCompiler, this.compilationMode, this.elementSchemaRegistry.getDefaultComponentElementName());
|
|
44144
|
-
if (directiveResult
|
|
44458
|
+
if (directiveResult.jitForced) {
|
|
44459
|
+
this.jitDeclarationRegistry.jitDeclarations.add(node);
|
|
44145
44460
|
return {};
|
|
44146
44461
|
}
|
|
44147
44462
|
const { decorator: component, metadata, inputs, outputs, hostDirectives, rawHostDirectives } = directiveResult;
|
|
@@ -45426,11 +45741,204 @@ var PipeDecoratorHandler = class {
|
|
|
45426
45741
|
}
|
|
45427
45742
|
};
|
|
45428
45743
|
|
|
45429
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/
|
|
45744
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform_api.mjs
|
|
45430
45745
|
var import_typescript92 = __toESM(require("typescript"), 1);
|
|
45746
|
+
function createSyntheticAngularCoreDecoratorAccess(factory10, importManager, ngClassDecorator, sourceFile, decoratorName) {
|
|
45747
|
+
const classDecoratorIdentifier = import_typescript92.default.isIdentifier(ngClassDecorator.identifier) ? ngClassDecorator.identifier : ngClassDecorator.identifier.expression;
|
|
45748
|
+
return factory10.createPropertyAccessExpression(
|
|
45749
|
+
importManager.addImport({
|
|
45750
|
+
exportModuleSpecifier: "@angular/core",
|
|
45751
|
+
exportSymbolName: null,
|
|
45752
|
+
requestedFile: sourceFile
|
|
45753
|
+
}),
|
|
45754
|
+
import_typescript92.default.setOriginalNode(factory10.createIdentifier(decoratorName), classDecoratorIdentifier)
|
|
45755
|
+
);
|
|
45756
|
+
}
|
|
45757
|
+
function castAsAny(factory10, expr) {
|
|
45758
|
+
return factory10.createAsExpression(expr, factory10.createKeywordTypeNode(import_typescript92.default.SyntaxKind.AnyKeyword));
|
|
45759
|
+
}
|
|
45431
45760
|
|
|
45432
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/
|
|
45761
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/input_function.mjs
|
|
45762
|
+
var signalInputsTransform = (member, host, factory10, importTracker, importManager, classDecorator, isCore) => {
|
|
45763
|
+
var _a2, _b2;
|
|
45764
|
+
if ((_a2 = host.getDecoratorsOfDeclaration(member.node)) == null ? void 0 : _a2.some((d) => isAngularDecorator2(d, "Input", isCore))) {
|
|
45765
|
+
return member.node;
|
|
45766
|
+
}
|
|
45767
|
+
const inputMapping = tryParseSignalInputMapping(member, host, importTracker);
|
|
45768
|
+
if (inputMapping === null) {
|
|
45769
|
+
return member.node;
|
|
45770
|
+
}
|
|
45771
|
+
const fields = {
|
|
45772
|
+
"isSignal": factory10.createTrue(),
|
|
45773
|
+
"alias": factory10.createStringLiteral(inputMapping.bindingPropertyName),
|
|
45774
|
+
"required": inputMapping.required ? factory10.createTrue() : factory10.createFalse(),
|
|
45775
|
+
"transform": factory10.createIdentifier("undefined")
|
|
45776
|
+
};
|
|
45777
|
+
const sourceFile = member.node.getSourceFile();
|
|
45778
|
+
const newDecorator = factory10.createDecorator(factory10.createCallExpression(createSyntheticAngularCoreDecoratorAccess(factory10, importManager, classDecorator, sourceFile, "Input"), void 0, [
|
|
45779
|
+
castAsAny(factory10, factory10.createObjectLiteralExpression(Object.entries(fields).map(([name, value]) => factory10.createPropertyAssignment(name, value))))
|
|
45780
|
+
]));
|
|
45781
|
+
return factory10.updatePropertyDeclaration(member.node, [newDecorator, ...(_b2 = member.node.modifiers) != null ? _b2 : []], member.name, member.node.questionToken, member.node.type, member.node.initializer);
|
|
45782
|
+
};
|
|
45783
|
+
|
|
45784
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/model_function.mjs
|
|
45433
45785
|
var import_typescript93 = __toESM(require("typescript"), 1);
|
|
45786
|
+
var signalModelTransform = (member, host, factory10, importTracker, importManager, classDecorator, isCore) => {
|
|
45787
|
+
var _a2, _b2;
|
|
45788
|
+
if ((_a2 = host.getDecoratorsOfDeclaration(member.node)) == null ? void 0 : _a2.some((d) => {
|
|
45789
|
+
return isAngularDecorator2(d, "Input", isCore) || isAngularDecorator2(d, "Output", isCore);
|
|
45790
|
+
})) {
|
|
45791
|
+
return member.node;
|
|
45792
|
+
}
|
|
45793
|
+
const modelMapping = tryParseSignalModelMapping(member, host, importTracker);
|
|
45794
|
+
if (modelMapping === null) {
|
|
45795
|
+
return member.node;
|
|
45796
|
+
}
|
|
45797
|
+
const inputConfig = factory10.createObjectLiteralExpression([
|
|
45798
|
+
factory10.createPropertyAssignment("isSignal", modelMapping.input.isSignal ? factory10.createTrue() : factory10.createFalse()),
|
|
45799
|
+
factory10.createPropertyAssignment("alias", factory10.createStringLiteral(modelMapping.input.bindingPropertyName)),
|
|
45800
|
+
factory10.createPropertyAssignment("required", modelMapping.input.required ? factory10.createTrue() : factory10.createFalse())
|
|
45801
|
+
]);
|
|
45802
|
+
const sourceFile = member.node.getSourceFile();
|
|
45803
|
+
const inputDecorator = createDecorator(
|
|
45804
|
+
"Input",
|
|
45805
|
+
factory10.createAsExpression(inputConfig, factory10.createKeywordTypeNode(import_typescript93.default.SyntaxKind.AnyKeyword)),
|
|
45806
|
+
classDecorator,
|
|
45807
|
+
factory10,
|
|
45808
|
+
sourceFile,
|
|
45809
|
+
importManager
|
|
45810
|
+
);
|
|
45811
|
+
const outputDecorator = createDecorator("Output", factory10.createStringLiteral(modelMapping.output.bindingPropertyName), classDecorator, factory10, sourceFile, importManager);
|
|
45812
|
+
return factory10.updatePropertyDeclaration(member.node, [inputDecorator, outputDecorator, ...(_b2 = member.node.modifiers) != null ? _b2 : []], member.node.name, member.node.questionToken, member.node.type, member.node.initializer);
|
|
45813
|
+
};
|
|
45814
|
+
function createDecorator(name, config, classDecorator, factory10, sourceFile, importManager) {
|
|
45815
|
+
const callTarget = createSyntheticAngularCoreDecoratorAccess(factory10, importManager, classDecorator, sourceFile, name);
|
|
45816
|
+
return factory10.createDecorator(factory10.createCallExpression(callTarget, void 0, [config]));
|
|
45817
|
+
}
|
|
45818
|
+
|
|
45819
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/output_function.mjs
|
|
45820
|
+
var initializerApiOutputTransform = (member, host, factory10, importTracker, importManager, classDecorator, isCore) => {
|
|
45821
|
+
var _a2, _b2;
|
|
45822
|
+
if ((_a2 = host.getDecoratorsOfDeclaration(member.node)) == null ? void 0 : _a2.some((d) => isAngularDecorator2(d, "Output", isCore))) {
|
|
45823
|
+
return member.node;
|
|
45824
|
+
}
|
|
45825
|
+
const output = tryParseInitializerBasedOutput(member, host, importTracker);
|
|
45826
|
+
if (output === null) {
|
|
45827
|
+
return member.node;
|
|
45828
|
+
}
|
|
45829
|
+
const sourceFile = member.node.getSourceFile();
|
|
45830
|
+
const newDecorator = factory10.createDecorator(factory10.createCallExpression(createSyntheticAngularCoreDecoratorAccess(factory10, importManager, classDecorator, sourceFile, "Output"), void 0, [factory10.createStringLiteral(output.metadata.bindingPropertyName)]));
|
|
45831
|
+
return factory10.updatePropertyDeclaration(member.node, [newDecorator, ...(_b2 = member.node.modifiers) != null ? _b2 : []], member.node.name, member.node.questionToken, member.node.type, member.node.initializer);
|
|
45832
|
+
};
|
|
45833
|
+
|
|
45834
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/query_functions.mjs
|
|
45835
|
+
var queryFunctionToDecorator = {
|
|
45836
|
+
viewChild: "ViewChild",
|
|
45837
|
+
viewChildren: "ViewChildren",
|
|
45838
|
+
contentChild: "ContentChild",
|
|
45839
|
+
contentChildren: "ContentChildren"
|
|
45840
|
+
};
|
|
45841
|
+
var queryFunctionsTransforms = (member, host, factory10, importTracker, importManager, classDecorator, isCore) => {
|
|
45842
|
+
var _a2;
|
|
45843
|
+
const decorators = host.getDecoratorsOfDeclaration(member.node);
|
|
45844
|
+
const queryDecorators = decorators && getAngularDecorators(decorators, queryDecoratorNames, isCore);
|
|
45845
|
+
if (queryDecorators !== null && queryDecorators.length > 0) {
|
|
45846
|
+
return member.node;
|
|
45847
|
+
}
|
|
45848
|
+
const queryDefinition = tryParseSignalQueryFromInitializer(member, host, importTracker);
|
|
45849
|
+
if (queryDefinition === null) {
|
|
45850
|
+
return member.node;
|
|
45851
|
+
}
|
|
45852
|
+
const sourceFile = member.node.getSourceFile();
|
|
45853
|
+
const callArgs = queryDefinition.call.arguments;
|
|
45854
|
+
const newDecorator = factory10.createDecorator(factory10.createCallExpression(
|
|
45855
|
+
createSyntheticAngularCoreDecoratorAccess(factory10, importManager, classDecorator, sourceFile, queryFunctionToDecorator[queryDefinition.name]),
|
|
45856
|
+
void 0,
|
|
45857
|
+
[
|
|
45858
|
+
queryDefinition.call.arguments[0],
|
|
45859
|
+
castAsAny(factory10, factory10.createObjectLiteralExpression([
|
|
45860
|
+
...callArgs.length > 1 ? [factory10.createSpreadAssignment(callArgs[1])] : [],
|
|
45861
|
+
factory10.createPropertyAssignment("isSignal", factory10.createTrue())
|
|
45862
|
+
]))
|
|
45863
|
+
]
|
|
45864
|
+
));
|
|
45865
|
+
return factory10.updatePropertyDeclaration(member.node, [newDecorator, ...(_a2 = member.node.modifiers) != null ? _a2 : []], member.node.name, member.node.questionToken, member.node.type, member.node.initializer);
|
|
45866
|
+
};
|
|
45867
|
+
|
|
45868
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.mjs
|
|
45869
|
+
var decoratorsWithInputs = ["Directive", "Component"];
|
|
45870
|
+
var propertyTransforms = [
|
|
45871
|
+
signalInputsTransform,
|
|
45872
|
+
initializerApiOutputTransform,
|
|
45873
|
+
queryFunctionsTransforms,
|
|
45874
|
+
signalModelTransform
|
|
45875
|
+
];
|
|
45876
|
+
function getInitializerApiJitTransform(host, importTracker, isCore, shouldTransformClass) {
|
|
45877
|
+
return (ctx) => {
|
|
45878
|
+
return (sourceFile) => {
|
|
45879
|
+
const importManager = new ImportManager();
|
|
45880
|
+
sourceFile = import_typescript94.default.visitNode(sourceFile, createTransformVisitor(ctx, host, importManager, importTracker, isCore, shouldTransformClass), import_typescript94.default.isSourceFile);
|
|
45881
|
+
return importManager.transformTsFile(ctx, sourceFile);
|
|
45882
|
+
};
|
|
45883
|
+
};
|
|
45884
|
+
}
|
|
45885
|
+
function createTransformVisitor(ctx, host, importManager, importTracker, isCore, shouldTransformClass) {
|
|
45886
|
+
const visitor = (node) => {
|
|
45887
|
+
var _a2;
|
|
45888
|
+
if (import_typescript94.default.isClassDeclaration(node) && node.name !== void 0) {
|
|
45889
|
+
const originalNode = import_typescript94.default.getOriginalNode(node, import_typescript94.default.isClassDeclaration);
|
|
45890
|
+
const angularDecorator = (_a2 = host.getDecoratorsOfDeclaration(originalNode)) == null ? void 0 : _a2.find((d) => decoratorsWithInputs.some((name) => isAngularDecorator2(d, name, isCore)));
|
|
45891
|
+
if (angularDecorator !== void 0 && (shouldTransformClass === void 0 || shouldTransformClass(node))) {
|
|
45892
|
+
let hasChanged = false;
|
|
45893
|
+
const members = node.members.map((memberNode) => {
|
|
45894
|
+
if (!import_typescript94.default.isPropertyDeclaration(memberNode)) {
|
|
45895
|
+
return memberNode;
|
|
45896
|
+
}
|
|
45897
|
+
const member = reflectClassMember(memberNode);
|
|
45898
|
+
if (member === null) {
|
|
45899
|
+
return memberNode;
|
|
45900
|
+
}
|
|
45901
|
+
for (const transform2 of propertyTransforms) {
|
|
45902
|
+
const newNode = transform2(__spreadProps(__spreadValues({}, member), { node: memberNode }), host, ctx.factory, importTracker, importManager, angularDecorator, isCore);
|
|
45903
|
+
if (newNode !== member.node) {
|
|
45904
|
+
hasChanged = true;
|
|
45905
|
+
return newNode;
|
|
45906
|
+
}
|
|
45907
|
+
}
|
|
45908
|
+
return memberNode;
|
|
45909
|
+
});
|
|
45910
|
+
if (hasChanged) {
|
|
45911
|
+
return ctx.factory.updateClassDeclaration(node, node.modifiers, node.name, node.typeParameters, node.heritageClauses, members);
|
|
45912
|
+
}
|
|
45913
|
+
}
|
|
45914
|
+
}
|
|
45915
|
+
return import_typescript94.default.visitEachChild(node, visitor, ctx);
|
|
45916
|
+
};
|
|
45917
|
+
return visitor;
|
|
45918
|
+
}
|
|
45919
|
+
|
|
45920
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/index.mjs
|
|
45921
|
+
function angularJitApplicationTransform(program, isCore = false, shouldTransformClass) {
|
|
45922
|
+
const typeChecker = program.getTypeChecker();
|
|
45923
|
+
const reflectionHost = new TypeScriptReflectionHost(typeChecker);
|
|
45924
|
+
const importTracker = new ImportedSymbolsTracker();
|
|
45925
|
+
const downlevelDecoratorTransform = getDownlevelDecoratorsTransform(
|
|
45926
|
+
typeChecker,
|
|
45927
|
+
reflectionHost,
|
|
45928
|
+
[],
|
|
45929
|
+
isCore,
|
|
45930
|
+
false,
|
|
45931
|
+
shouldTransformClass
|
|
45932
|
+
);
|
|
45933
|
+
const initializerApisJitTransform = getInitializerApiJitTransform(reflectionHost, importTracker, isCore, shouldTransformClass);
|
|
45934
|
+
return (ctx) => {
|
|
45935
|
+
return (sourceFile) => {
|
|
45936
|
+
sourceFile = initializerApisJitTransform(ctx)(sourceFile);
|
|
45937
|
+
sourceFile = downlevelDecoratorTransform(ctx)(sourceFile);
|
|
45938
|
+
return sourceFile;
|
|
45939
|
+
};
|
|
45940
|
+
};
|
|
45941
|
+
}
|
|
45434
45942
|
|
|
45435
45943
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
45436
45944
|
var EmitFlags;
|
|
@@ -48805,6 +49313,25 @@ var NgCompiler = class {
|
|
|
48805
49313
|
aliasTransformFactory(compilation.traitCompiler.exportStatements),
|
|
48806
49314
|
defaultImportTracker.importPreservingTransformer()
|
|
48807
49315
|
];
|
|
49316
|
+
if (compilation.supportJitMode && compilation.jitDeclarationRegistry.jitDeclarations.size > 0) {
|
|
49317
|
+
const { jitDeclarations } = compilation.jitDeclarationRegistry;
|
|
49318
|
+
const jitDeclarationsArray = Array.from(jitDeclarations);
|
|
49319
|
+
const jitDeclarationOriginalNodes = new Set(jitDeclarationsArray.map((d) => import_typescript119.default.getOriginalNode(d)));
|
|
49320
|
+
const sourceFilesWithJit = new Set(jitDeclarationsArray.map((d) => d.getSourceFile().fileName));
|
|
49321
|
+
before.push((ctx) => {
|
|
49322
|
+
const reflectionHost = new TypeScriptReflectionHost(this.inputProgram.getTypeChecker());
|
|
49323
|
+
const jitTransform = angularJitApplicationTransform(this.inputProgram, compilation.isCore, (node) => {
|
|
49324
|
+
node = import_typescript119.default.getOriginalNode(node, import_typescript119.default.isClassDeclaration);
|
|
49325
|
+
return reflectionHost.isClass(node) && jitDeclarationOriginalNodes.has(node);
|
|
49326
|
+
})(ctx);
|
|
49327
|
+
return (sourceFile) => {
|
|
49328
|
+
if (!sourceFilesWithJit.has(sourceFile.fileName)) {
|
|
49329
|
+
return sourceFile;
|
|
49330
|
+
}
|
|
49331
|
+
return jitTransform(sourceFile);
|
|
49332
|
+
};
|
|
49333
|
+
});
|
|
49334
|
+
}
|
|
48808
49335
|
const afterDeclarations = [];
|
|
48809
49336
|
if (this.options.compilationMode !== "experimental-local" && compilation.dtsTransforms !== null) {
|
|
48810
49337
|
afterDeclarations.push(declarationTransformFactory(compilation.dtsTransforms, compilation.reflector, compilation.refEmitter, importRewriter));
|
|
@@ -49121,9 +49648,10 @@ var NgCompiler = class {
|
|
|
49121
49648
|
if (supportJitMode === false && this.options.forbidOrphanComponents) {
|
|
49122
49649
|
throw new Error('JIT mode support ("supportJitMode" option) cannot be disabled when forbidOrphanComponents is set to true');
|
|
49123
49650
|
}
|
|
49651
|
+
const jitDeclarationRegistry = new JitDeclarationRegistry();
|
|
49124
49652
|
const handlers = [
|
|
49125
|
-
new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, importTracker, supportTestBed, compilationMode, deferredSymbolsTracker, !!this.options.forbidOrphanComponents, this.enableBlockSyntax, this.enableLetSyntax, localCompilationExtraImportsTracker),
|
|
49126
|
-
new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, importTracker, supportTestBed, compilationMode,
|
|
49653
|
+
new ComponentDecoratorHandler(reflector, evaluator, metaRegistry, metaReader, scopeReader, depScopeReader, ngModuleScopeRegistry, typeCheckScopeRegistry, resourceRegistry, isCore, strictCtorDeps, this.resourceManager, this.adapter.rootDirs, this.options.preserveWhitespaces || false, this.options.i18nUseExternalIds !== false, this.options.enableI18nLegacyMessageIdFormat !== false, this.usePoisonedData, this.options.i18nNormalizeLineEndingsInICUs === true, this.moduleResolver, this.cycleAnalyzer, cycleHandlingStrategy, refEmitter, referencesRegistry, this.incrementalCompilation.depGraph, injectableRegistry, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, hostDirectivesResolver, importTracker, supportTestBed, compilationMode, deferredSymbolsTracker, !!this.options.forbidOrphanComponents, this.enableBlockSyntax, this.enableLetSyntax, localCompilationExtraImportsTracker, jitDeclarationRegistry),
|
|
49654
|
+
new DirectiveDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, metaReader, injectableRegistry, refEmitter, referencesRegistry, isCore, strictCtorDeps, semanticDepGraphUpdater, this.closureCompilerEnabled, this.delegatingPerfRecorder, importTracker, supportTestBed, compilationMode, jitDeclarationRegistry),
|
|
49127
49655
|
new PipeDecoratorHandler(reflector, evaluator, metaRegistry, ngModuleScopeRegistry, injectableRegistry, isCore, this.delegatingPerfRecorder, supportTestBed, compilationMode, !!this.options.generateExtraImportsInLocalMode),
|
|
49128
49656
|
new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
|
|
49129
49657
|
new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, exportedProviderStatusResolver, semanticDepGraphUpdater, isCore, refEmitter, this.closureCompilerEnabled, (_d2 = this.options.onlyPublishPublicTypingsForNgModules) != null ? _d2 : false, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, supportJitMode, compilationMode, localCompilationExtraImportsTracker)
|
|
@@ -49152,8 +49680,10 @@ var NgCompiler = class {
|
|
|
49152
49680
|
resourceRegistry,
|
|
49153
49681
|
extendedTemplateChecker,
|
|
49154
49682
|
localCompilationExtraImportsTracker,
|
|
49683
|
+
jitDeclarationRegistry,
|
|
49155
49684
|
templateSemanticsChecker,
|
|
49156
|
-
sourceFileValidator
|
|
49685
|
+
sourceFileValidator,
|
|
49686
|
+
supportJitMode
|
|
49157
49687
|
};
|
|
49158
49688
|
}
|
|
49159
49689
|
};
|