@angular/core 17.1.2 → 17.1.3

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.
Files changed (36) hide show
  1. package/esm2022/src/application/application_ref.mjs +54 -16
  2. package/esm2022/src/authoring/input.mjs +1 -1
  3. package/esm2022/src/authoring/input_signal.mjs +1 -1
  4. package/esm2022/src/authoring/input_type_checking.mjs +1 -1
  5. package/esm2022/src/authoring.mjs +1 -1
  6. package/esm2022/src/defer/instructions.mjs +13 -6
  7. package/esm2022/src/render3/after_render_hooks.mjs +2 -6
  8. package/esm2022/src/render3/component_ref.mjs +1 -1
  9. package/esm2022/src/render3/definition.mjs +1 -1
  10. package/esm2022/src/render3/errors_di.mjs +2 -2
  11. package/esm2022/src/render3/i18n/i18n_locale_id.mjs +2 -2
  12. package/esm2022/src/render3/instructions/change_detection.mjs +6 -6
  13. package/esm2022/src/render3/instructions/write_to_directive_input.mjs +1 -1
  14. package/esm2022/src/render3/util/view_utils.mjs +3 -3
  15. package/esm2022/src/render3/view_ref.mjs +1 -1
  16. package/esm2022/src/util/stringify.mjs +2 -2
  17. package/esm2022/src/version.mjs +1 -1
  18. package/esm2022/testing/src/component_fixture.mjs +4 -4
  19. package/esm2022/testing/src/logger.mjs +3 -3
  20. package/fesm2022/core.mjs +438 -401
  21. package/fesm2022/core.mjs.map +1 -1
  22. package/fesm2022/primitives/signals.mjs +1 -1
  23. package/fesm2022/rxjs-interop.mjs +1 -1
  24. package/fesm2022/testing.mjs +4 -4
  25. package/fesm2022/testing.mjs.map +1 -1
  26. package/index.d.ts +49 -17
  27. package/package.json +1 -1
  28. package/primitives/signals/index.d.ts +1 -1
  29. package/rxjs-interop/index.d.ts +1 -1
  30. package/schematics/migrations/block-template-entities/bundle.js +27 -9
  31. package/schematics/migrations/block-template-entities/bundle.js.map +2 -2
  32. package/schematics/ng-generate/control-flow-migration/bundle.js +27 -9
  33. package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
  34. package/schematics/ng-generate/standalone-migration/bundle.js +176 -77
  35. package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
  36. package/testing/index.d.ts +1 -1
@@ -267,7 +267,7 @@ function isWithinBasePath(base, path4) {
267
267
 
268
268
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
269
269
  var import_fs = __toESM(require("fs"), 1);
270
- var import_module = __toESM(require("module"), 1);
270
+ var import_module = require("module");
271
271
  var p = __toESM(require("path"), 1);
272
272
  var import_url = require("url");
273
273
  var import_meta = {};
@@ -342,7 +342,7 @@ var NodeJSReadonlyFileSystem = class extends NodeJSPathManipulation {
342
342
  return this.resolve(import_fs.default.realpathSync(path4));
343
343
  }
344
344
  getDefaultLibLocation() {
345
- const requireFn = isCommonJS ? require : import_module.default.createRequire(currentFileUrl);
345
+ const requireFn = isCommonJS ? require : (0, import_module.createRequire)(currentFileUrl);
346
346
  return this.resolve(requireFn.resolve("typescript"), "..");
347
347
  }
348
348
  };
@@ -2316,6 +2316,7 @@ var ConstantPool = class {
2316
2316
  this.literals = /* @__PURE__ */ new Map();
2317
2317
  this.literalFactories = /* @__PURE__ */ new Map();
2318
2318
  this.sharedConstants = /* @__PURE__ */ new Map();
2319
+ this._claimedNames = /* @__PURE__ */ new Map();
2319
2320
  this.nextNameIndex = 0;
2320
2321
  }
2321
2322
  getConstLiteral(literal3, forceShared) {
@@ -2408,8 +2409,12 @@ var ConstantPool = class {
2408
2409
  }
2409
2410
  return { literalFactory, literalFactoryArguments };
2410
2411
  }
2411
- uniqueName(prefix) {
2412
- return `${prefix}${this.nextNameIndex++}`;
2412
+ uniqueName(name, alwaysIncludeSuffix = true) {
2413
+ var _a2;
2414
+ const count = (_a2 = this._claimedNames.get(name)) != null ? _a2 : 0;
2415
+ const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`;
2416
+ this._claimedNames.set(name, count + 1);
2417
+ return result;
2413
2418
  }
2414
2419
  freshName() {
2415
2420
  return this.uniqueName(CONSTANT_PREFIX);
@@ -10457,7 +10462,10 @@ function createDeferDepsFns(job) {
10457
10462
  const dependencies = [];
10458
10463
  for (const dep of op.metadata.deps) {
10459
10464
  if (dep.isDeferrable) {
10460
- const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(dep.symbolName));
10465
+ const innerFn = arrowFn(
10466
+ [new FnParam("m", DYNAMIC_TYPE)],
10467
+ variable("m").prop(dep.isDefaultImport ? "default" : dep.symbolName)
10468
+ );
10461
10469
  const importExpr2 = new DynamicImportExpr(dep.importPath).prop("then").callFn([innerFn]);
10462
10470
  dependencies.push(importExpr2);
10463
10471
  } else {
@@ -17494,7 +17502,7 @@ function nameFunctionsAndVariables(job) {
17494
17502
  }
17495
17503
  function addNamesToView(unit, baseName, state, compatibility) {
17496
17504
  if (unit.fnName === null) {
17497
- unit.fnName = sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`);
17505
+ unit.fnName = unit.job.pool.uniqueName(sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`), false);
17498
17506
  }
17499
17507
  const varNames = /* @__PURE__ */ new Map();
17500
17508
  for (const op of unit.ops()) {
@@ -20772,11 +20780,18 @@ function asMessage(i18nMeta) {
20772
20780
  function ingestElementBindings(unit, op, element2) {
20773
20781
  var _a2;
20774
20782
  let bindings = new Array();
20783
+ let i18nAttributeBindingNames = /* @__PURE__ */ new Set();
20775
20784
  for (const attr of element2.attributes) {
20776
20785
  const securityContext = domSchema.securityContext(element2.name, attr.name, true);
20777
20786
  bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
20787
+ if (attr.i18n) {
20788
+ i18nAttributeBindingNames.add(attr.name);
20789
+ }
20778
20790
  }
20779
20791
  for (const input of element2.inputs) {
20792
+ if (i18nAttributeBindingNames.has(input.name)) {
20793
+ console.error(`On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`);
20794
+ }
20780
20795
  bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, (_a2 = asMessage(input.i18n)) != null ? _a2 : null, input.sourceSpan));
20781
20796
  }
20782
20797
  unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
@@ -23565,7 +23580,7 @@ var TemplateDefinitionBuilder = class {
23565
23580
  }
23566
23581
  }
23567
23582
  const contextName = `${this.contextName}${contextNameSuffix}_${index}`;
23568
- const name = `${contextName}_Template`;
23583
+ const name = this.constantPool.uniqueName(`${contextName}_Template`, false);
23569
23584
  const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this.allDeferrableDepsFn, this._constants);
23570
23585
  this._nestedTemplateFns.push(() => {
23571
23586
  const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18nMeta, variableAliases);
@@ -23774,7 +23789,10 @@ var TemplateDefinitionBuilder = class {
23774
23789
  const dependencyExp = [];
23775
23790
  for (const deferredDep of metadata.deps) {
23776
23791
  if (deferredDep.isDeferrable) {
23777
- const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(deferredDep.symbolName));
23792
+ const innerFn = arrowFn(
23793
+ [new FnParam("m", DYNAMIC_TYPE)],
23794
+ variable("m").prop(deferredDep.isDefaultImport ? "default" : deferredDep.symbolName)
23795
+ );
23778
23796
  const importExpr2 = new DynamicImportExpr(deferredDep.importPath).prop("then").callFn([innerFn]);
23779
23797
  dependencyExp.push(importExpr2);
23780
23798
  } else {
@@ -24771,8 +24789,8 @@ function compileDirectiveFromMetadata(meta, constantPool, bindingParser) {
24771
24789
  }
24772
24790
  function createDeferredDepsFunction(constantPool, name, deps) {
24773
24791
  const dependencyExp = [];
24774
- for (const [symbolName, importPath] of deps) {
24775
- const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(symbolName));
24792
+ for (const [symbolName, { importPath, isDefaultImport: isDefaultImport2 }] of deps) {
24793
+ const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(isDefaultImport2 ? "default" : symbolName));
24776
24794
  const importExpr2 = new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
24777
24795
  dependencyExp.push(importExpr2);
24778
24796
  }
@@ -26518,7 +26536,7 @@ function publishFacade(global) {
26518
26536
  }
26519
26537
 
26520
26538
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
26521
- var VERSION2 = new Version("17.1.2");
26539
+ var VERSION2 = new Version("17.1.3");
26522
26540
 
26523
26541
  // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
26524
26542
  var _I18N_ATTR = "i18n";
@@ -27536,8 +27554,8 @@ function compileComponentClassMetadata(metadata, deferrableTypes) {
27536
27554
  }
27537
27555
  const dynamicImports = [];
27538
27556
  const importedSymbols = [];
27539
- for (const [symbolName, importPath] of deferrableTypes) {
27540
- const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(symbolName));
27557
+ for (const [symbolName, { importPath, isDefaultImport: isDefaultImport2 }] of deferrableTypes) {
27558
+ const innerFn = arrowFn([new FnParam("m", DYNAMIC_TYPE)], variable("m").prop(isDefaultImport2 ? "default" : symbolName));
27541
27559
  const importExpr2 = new DynamicImportExpr(importPath).prop("then").callFn([innerFn]);
27542
27560
  dynamicImports.push(importExpr2);
27543
27561
  importedSymbols.push(new FnParam(symbolName, DYNAMIC_TYPE));
@@ -27584,7 +27602,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
27584
27602
  function compileDeclareClassMetadata(metadata) {
27585
27603
  const definitionMap = new DefinitionMap();
27586
27604
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
27587
- definitionMap.set("version", literal("17.1.2"));
27605
+ definitionMap.set("version", literal("17.1.3"));
27588
27606
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27589
27607
  definitionMap.set("type", metadata.type);
27590
27608
  definitionMap.set("decorators", metadata.decorators);
@@ -27653,7 +27671,7 @@ function createDirectiveDefinitionMap(meta) {
27653
27671
  const definitionMap = new DefinitionMap();
27654
27672
  const minVersion = getMinimumVersionForPartialOutput(meta);
27655
27673
  definitionMap.set("minVersion", literal(minVersion));
27656
- definitionMap.set("version", literal("17.1.2"));
27674
+ definitionMap.set("version", literal("17.1.3"));
27657
27675
  definitionMap.set("type", meta.type.value);
27658
27676
  if (meta.isStandalone) {
27659
27677
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -27946,7 +27964,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
27946
27964
  function compileDeclareFactoryFunction(meta) {
27947
27965
  const definitionMap = new DefinitionMap();
27948
27966
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
27949
- definitionMap.set("version", literal("17.1.2"));
27967
+ definitionMap.set("version", literal("17.1.3"));
27950
27968
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27951
27969
  definitionMap.set("type", meta.type.value);
27952
27970
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -27969,7 +27987,7 @@ function compileDeclareInjectableFromMetadata(meta) {
27969
27987
  function createInjectableDefinitionMap(meta) {
27970
27988
  const definitionMap = new DefinitionMap();
27971
27989
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
27972
- definitionMap.set("version", literal("17.1.2"));
27990
+ definitionMap.set("version", literal("17.1.3"));
27973
27991
  definitionMap.set("ngImport", importExpr(Identifiers.core));
27974
27992
  definitionMap.set("type", meta.type.value);
27975
27993
  if (meta.providedIn !== void 0) {
@@ -28007,7 +28025,7 @@ function compileDeclareInjectorFromMetadata(meta) {
28007
28025
  function createInjectorDefinitionMap(meta) {
28008
28026
  const definitionMap = new DefinitionMap();
28009
28027
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
28010
- definitionMap.set("version", literal("17.1.2"));
28028
+ definitionMap.set("version", literal("17.1.3"));
28011
28029
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28012
28030
  definitionMap.set("type", meta.type.value);
28013
28031
  definitionMap.set("providers", meta.providers);
@@ -28031,7 +28049,7 @@ function createNgModuleDefinitionMap(meta) {
28031
28049
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
28032
28050
  }
28033
28051
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
28034
- definitionMap.set("version", literal("17.1.2"));
28052
+ definitionMap.set("version", literal("17.1.3"));
28035
28053
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28036
28054
  definitionMap.set("type", meta.type.value);
28037
28055
  if (meta.bootstrap.length > 0) {
@@ -28066,7 +28084,7 @@ function compileDeclarePipeFromMetadata(meta) {
28066
28084
  function createPipeDefinitionMap(meta) {
28067
28085
  const definitionMap = new DefinitionMap();
28068
28086
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
28069
- definitionMap.set("version", literal("17.1.2"));
28087
+ definitionMap.set("version", literal("17.1.3"));
28070
28088
  definitionMap.set("ngImport", importExpr(Identifiers.core));
28071
28089
  definitionMap.set("type", meta.type.value);
28072
28090
  if (meta.isStandalone) {
@@ -28083,7 +28101,7 @@ function createPipeDefinitionMap(meta) {
28083
28101
  publishFacade(_global);
28084
28102
 
28085
28103
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
28086
- var VERSION3 = new Version("17.1.2");
28104
+ var VERSION3 = new Version("17.1.3");
28087
28105
 
28088
28106
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
28089
28107
  var EmitFlags;
@@ -28318,16 +28336,19 @@ function ngErrorCode(code) {
28318
28336
  }
28319
28337
 
28320
28338
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error.mjs
28321
- var FatalDiagnosticError = class {
28322
- constructor(code, node, message, relatedInformation) {
28339
+ var FatalDiagnosticError = class extends Error {
28340
+ constructor(code, node, diagnosticMessage, relatedInformation) {
28341
+ super(`FatalDiagnosticError #${code}: ${diagnosticMessage}`);
28323
28342
  this.code = code;
28324
28343
  this.node = node;
28325
- this.message = message;
28344
+ this.diagnosticMessage = diagnosticMessage;
28326
28345
  this.relatedInformation = relatedInformation;
28346
+ this.message = null;
28327
28347
  this._isFatalDiagnosticError = true;
28348
+ Object.setPrototypeOf(this, new.target.prototype);
28328
28349
  }
28329
28350
  toDiagnostic() {
28330
- return makeDiagnostic(this.code, this.node, this.message, this.relatedInformation);
28351
+ return makeDiagnostic(this.code, this.node, this.diagnosticMessage, this.relatedInformation);
28331
28352
  }
28332
28353
  };
28333
28354
  function makeDiagnostic(code, node, messageText, relatedInformation) {
@@ -28372,6 +28393,9 @@ function addDiagnosticChain(messageText, add) {
28372
28393
  }
28373
28394
  return messageText;
28374
28395
  }
28396
+ function isFatalDiagnosticError(err) {
28397
+ return err._isFatalDiagnosticError === true;
28398
+ }
28375
28399
 
28376
28400
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.mjs
28377
28401
  var ERROR_DETAILS_PAGE_BASE_URL = "https://angular.io/errors";
@@ -29526,16 +29550,16 @@ function reflectTypeEntityToDeclaration(type, checker) {
29526
29550
  return { node, from: null };
29527
29551
  }
29528
29552
  }
29529
- function filterToMembersWithDecorator(members, name, module3) {
29553
+ function filterToMembersWithDecorator(members, name, module2) {
29530
29554
  return members.filter((member) => !member.isStatic).map((member) => {
29531
29555
  if (member.decorators === null) {
29532
29556
  return null;
29533
29557
  }
29534
29558
  const decorators = member.decorators.filter((dec) => {
29535
29559
  if (dec.import !== null) {
29536
- return dec.import.name === name && (module3 === void 0 || dec.import.from === module3);
29560
+ return dec.import.name === name && (module2 === void 0 || dec.import.from === module2);
29537
29561
  } else {
29538
- return dec.name === name && module3 === void 0;
29562
+ return dec.name === name && module2 === void 0;
29539
29563
  }
29540
29564
  });
29541
29565
  if (decorators.length === 0) {
@@ -29594,7 +29618,14 @@ function getFarLeftIdentifier(propertyAccess) {
29594
29618
  return import_typescript14.default.isIdentifier(propertyAccess.expression) ? propertyAccess.expression : null;
29595
29619
  }
29596
29620
  function getContainingImportDeclaration(node) {
29597
- return import_typescript14.default.isImportSpecifier(node) ? node.parent.parent.parent : import_typescript14.default.isNamespaceImport(node) ? node.parent.parent : null;
29621
+ let parent = node.parent;
29622
+ while (parent && !import_typescript14.default.isSourceFile(parent)) {
29623
+ if (import_typescript14.default.isImportDeclaration(parent)) {
29624
+ return parent;
29625
+ }
29626
+ parent = parent.parent;
29627
+ }
29628
+ return null;
29598
29629
  }
29599
29630
  function getExportedName(decl, originalId) {
29600
29631
  return import_typescript14.default.isImportSpecifier(decl) ? (decl.propertyName !== void 0 ? decl.propertyName : decl.name).text : originalId.text;
@@ -31555,16 +31586,16 @@ var StaticInterpreter = class {
31555
31586
  } else if (lhs instanceof Reference2) {
31556
31587
  const ref = lhs.node;
31557
31588
  if (this.host.isClass(ref)) {
31558
- const module3 = owningModule(context, lhs.bestGuessOwningModule);
31589
+ const module2 = owningModule(context, lhs.bestGuessOwningModule);
31559
31590
  let value = void 0;
31560
31591
  const member = this.host.getMembersOfClass(ref).find((member2) => member2.isStatic && member2.name === strIndex);
31561
31592
  if (member !== void 0) {
31562
31593
  if (member.value !== null) {
31563
31594
  value = this.visitExpression(member.value, context);
31564
31595
  } else if (member.implementation !== null) {
31565
- value = new Reference2(member.implementation, module3);
31596
+ value = new Reference2(member.implementation, module2);
31566
31597
  } else if (member.node) {
31567
- value = new Reference2(member.node, module3);
31598
+ value = new Reference2(member.node, module2);
31568
31599
  }
31569
31600
  }
31570
31601
  return value;
@@ -33203,10 +33234,10 @@ function invalidReexport(decl, rawExpr, isStandalone) {
33203
33234
  }
33204
33235
  return makeDiagnostic(ErrorCode.NGMODULE_INVALID_REEXPORT, getDiagnosticNode(decl, rawExpr), message);
33205
33236
  }
33206
- function reexportCollision(module3, refA, refB) {
33207
- const childMessageText = `This directive/pipe is part of the exports of '${module3.name.text}' and shares the same name as another exported directive/pipe.`;
33208
- return makeDiagnostic(ErrorCode.NGMODULE_REEXPORT_NAME_COLLISION, module3.name, `
33209
- There was a name collision between two classes named '${refA.node.name.text}', which are both part of the exports of '${module3.name.text}'.
33237
+ function reexportCollision(module2, refA, refB) {
33238
+ const childMessageText = `This directive/pipe is part of the exports of '${module2.name.text}' and shares the same name as another exported directive/pipe.`;
33239
+ return makeDiagnostic(ErrorCode.NGMODULE_REEXPORT_NAME_COLLISION, module2.name, `
33240
+ There was a name collision between two classes named '${refA.node.name.text}', which are both part of the exports of '${module2.name.text}'.
33210
33241
 
33211
33242
  Angular generates re-exports of an NgModule's exported directives/pipes from the module's source file in certain cases, using the declared name of the class. If two classes of the same name are exported, this automatic naming does not work.
33212
33243
 
@@ -37524,7 +37555,10 @@ var ComponentDecoratorHandler = class {
37524
37555
  const deferredTypes = this.collectExplicitlyDeferredSymbols(rawDeferredImports);
37525
37556
  for (const [deferredType, importDetails] of deferredTypes) {
37526
37557
  explicitlyDeferredTypes != null ? explicitlyDeferredTypes : explicitlyDeferredTypes = /* @__PURE__ */ new Map();
37527
- explicitlyDeferredTypes.set(importDetails.name, importDetails.from);
37558
+ explicitlyDeferredTypes.set(importDetails.name, {
37559
+ importPath: importDetails.from,
37560
+ isDefaultImport: isDefaultImport(importDetails.node)
37561
+ });
37528
37562
  this.deferredSymbolTracker.markAsDeferrableCandidate(deferredType, importDetails.node, node, true);
37529
37563
  }
37530
37564
  }
@@ -37999,7 +38033,10 @@ var ComponentDecoratorHandler = class {
37999
38033
  if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
38000
38034
  deferBlockDep.isDeferrable = true;
38001
38035
  deferBlockDep.importPath = importDecl.moduleSpecifier.text;
38002
- deferrableTypes.set(deferBlockDep.symbolName, deferBlockDep.importPath);
38036
+ deferrableTypes.set(deferBlockDep.symbolName, {
38037
+ importPath: deferBlockDep.importPath,
38038
+ isDefaultImport: isDefaultImport(importDecl)
38039
+ });
38003
38040
  }
38004
38041
  }
38005
38042
  }
@@ -38058,6 +38095,7 @@ var ComponentDecoratorHandler = class {
38058
38095
  symbolName: decl.ref.node.name.escapedText,
38059
38096
  isDeferrable: false,
38060
38097
  importPath: null,
38098
+ isDefaultImport: false,
38061
38099
  classDeclaration: decl.ref.node
38062
38100
  });
38063
38101
  allDeferredDecls.add(decl.ref.node);
@@ -38192,6 +38230,9 @@ function validateStandaloneImports(importRefs, importExpr2, metaReader, scopeRea
38192
38230
  }
38193
38231
  return diagnostics;
38194
38232
  }
38233
+ function isDefaultImport(node) {
38234
+ return node.importClause !== void 0 && node.importClause.namedBindings === void 0;
38235
+ }
38195
38236
 
38196
38237
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/src/injectable.mjs
38197
38238
  var import_typescript58 = __toESM(require("typescript"), 1);
@@ -38868,7 +38909,8 @@ function extractResolvedTypeString(node, checker) {
38868
38909
 
38869
38910
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/function_extractor.mjs
38870
38911
  var FunctionExtractor = class {
38871
- constructor(declaration, typeChecker) {
38912
+ constructor(name, declaration, typeChecker) {
38913
+ this.name = name;
38872
38914
  this.declaration = declaration;
38873
38915
  this.typeChecker = typeChecker;
38874
38916
  }
@@ -38877,7 +38919,8 @@ var FunctionExtractor = class {
38877
38919
  const returnType = signature ? this.typeChecker.typeToString(this.typeChecker.getReturnTypeOfSignature(signature)) : "unknown";
38878
38920
  return {
38879
38921
  params: this.extractAllParams(this.declaration.parameters),
38880
- name: this.declaration.name.getText(),
38922
+ name: this.name,
38923
+ isNewType: import_typescript62.default.isConstructSignatureDeclaration(this.declaration),
38881
38924
  returnType,
38882
38925
  entryType: EntryType.Function,
38883
38926
  generics: extractGenerics(this.declaration),
@@ -38931,7 +38974,7 @@ var ClassExtractor = class {
38931
38974
  name: this.declaration.name.text,
38932
38975
  isAbstract: this.isAbstract(),
38933
38976
  entryType: import_typescript63.default.isInterfaceDeclaration(this.declaration) ? EntryType.Interface : EntryType.UndecoratedClass,
38934
- members: this.extractAllClassMembers(),
38977
+ members: this.extractSignatures().concat(this.extractAllClassMembers()),
38935
38978
  generics: extractGenerics(this.declaration),
38936
38979
  description: extractJsDocDescription(this.declaration),
38937
38980
  jsdocTags: extractJsDocTags(this.declaration),
@@ -38960,13 +39003,23 @@ var ClassExtractor = class {
38960
39003
  }
38961
39004
  return void 0;
38962
39005
  }
39006
+ extractSignatures() {
39007
+ return this.computeAllSignatureDeclarations().map((s) => this.extractSignature(s));
39008
+ }
38963
39009
  extractMethod(methodDeclaration) {
38964
- const functionExtractor = new FunctionExtractor(methodDeclaration, this.typeChecker);
39010
+ const functionExtractor = new FunctionExtractor(methodDeclaration.name.getText(), methodDeclaration, this.typeChecker);
38965
39011
  return __spreadProps(__spreadValues({}, functionExtractor.extract()), {
38966
39012
  memberType: MemberType.Method,
38967
39013
  memberTags: this.getMemberTags(methodDeclaration)
38968
39014
  });
38969
39015
  }
39016
+ extractSignature(signature) {
39017
+ const functionExtractor = new FunctionExtractor(import_typescript63.default.isConstructSignatureDeclaration(signature) ? "new" : "", signature, this.typeChecker);
39018
+ return __spreadProps(__spreadValues({}, functionExtractor.extract()), {
39019
+ memberType: MemberType.Method,
39020
+ memberTags: []
39021
+ });
39022
+ }
38970
39023
  extractClassProperty(propertyDeclaration) {
38971
39024
  return {
38972
39025
  name: propertyDeclaration.name.getText(),
@@ -38993,6 +39046,21 @@ var ClassExtractor = class {
38993
39046
  }
38994
39047
  return tags;
38995
39048
  }
39049
+ computeAllSignatureDeclarations() {
39050
+ const type = this.typeChecker.getTypeAtLocation(this.declaration);
39051
+ const signatures = [
39052
+ ...type.getCallSignatures(),
39053
+ ...type.getConstructSignatures()
39054
+ ];
39055
+ const result = [];
39056
+ for (const signature of signatures) {
39057
+ const decl = signature.getDeclaration();
39058
+ if (this.isDocumentableSignature(decl) && this.isDocumentableMember(decl)) {
39059
+ result.push(decl);
39060
+ }
39061
+ }
39062
+ return result;
39063
+ }
38996
39064
  getMemberDeclarations() {
38997
39065
  var _a2;
38998
39066
  const type = this.typeChecker.getTypeAtLocation(this.declaration);
@@ -39046,6 +39114,9 @@ var ClassExtractor = class {
39046
39114
  isMethod(member) {
39047
39115
  return import_typescript63.default.isMethodDeclaration(member) || import_typescript63.default.isMethodSignature(member);
39048
39116
  }
39117
+ isDocumentableSignature(signature) {
39118
+ return import_typescript63.default.isConstructSignatureDeclaration(signature) || import_typescript63.default.isCallSignatureDeclaration(signature);
39119
+ }
39049
39120
  isAbstract() {
39050
39121
  var _a2;
39051
39122
  const modifiers = (_a2 = this.declaration.modifiers) != null ? _a2 : [];
@@ -39308,7 +39379,7 @@ var DocsExtractor = class {
39308
39379
  return extractInterface(node, this.typeChecker);
39309
39380
  }
39310
39381
  if (import_typescript66.default.isFunctionDeclaration(node)) {
39311
- const functionExtractor = new FunctionExtractor(node, this.typeChecker);
39382
+ const functionExtractor = new FunctionExtractor(node.name.getText(), node, this.typeChecker);
39312
39383
  return functionExtractor.extract();
39313
39384
  }
39314
39385
  if (import_typescript66.default.isVariableDeclaration(node) && !isSyntheticAngularConstant(node)) {
@@ -39331,7 +39402,7 @@ var DocsExtractor = class {
39331
39402
  for (let i = 0; i < declarationCount; i++) {
39332
39403
  const [exportName, declaration] = exportedDeclarations[i];
39333
39404
  if (import_typescript66.default.isFunctionDeclaration(declaration)) {
39334
- const extractor = new FunctionExtractor(declaration, this.typeChecker);
39405
+ const extractor = new FunctionExtractor(exportName, declaration, this.typeChecker);
39335
39406
  const overloads = extractor.getOverloads().map((overload) => [exportName, overload]);
39336
39407
  exportedDeclarations.push(...overloads);
39337
39408
  }
@@ -44547,6 +44618,7 @@ var SymbolBuilder = class {
44547
44618
  return { kind: SymbolKind.Output, bindings };
44548
44619
  }
44549
44620
  getSymbolOfInputBinding(binding) {
44621
+ var _a2;
44550
44622
  const consumer = this.templateData.boundTarget.getConsumerOfBinding(binding);
44551
44623
  if (consumer === null) {
44552
44624
  return null;
@@ -44561,11 +44633,23 @@ var SymbolBuilder = class {
44561
44633
  if (!isAccessExpression2(node.left)) {
44562
44634
  continue;
44563
44635
  }
44564
- const symbolInfo = this.getSymbolOfTsNode(node.left);
44636
+ const signalInputAssignment = unwrapSignalInputWriteTAccessor(node.left);
44637
+ let symbolInfo = null;
44638
+ if (signalInputAssignment !== null) {
44639
+ const fieldSymbol = this.getSymbolOfTsNode(signalInputAssignment.fieldExpr);
44640
+ const typeSymbol = this.getSymbolOfTsNode(signalInputAssignment.typeExpr);
44641
+ symbolInfo = fieldSymbol === null || typeSymbol === null ? null : {
44642
+ tcbLocation: fieldSymbol.tcbLocation,
44643
+ tsSymbol: fieldSymbol.tsSymbol,
44644
+ tsType: typeSymbol.tsType
44645
+ };
44646
+ } else {
44647
+ symbolInfo = this.getSymbolOfTsNode(node.left);
44648
+ }
44565
44649
  if (symbolInfo === null || symbolInfo.tsSymbol === null) {
44566
44650
  continue;
44567
44651
  }
44568
- const target = this.getDirectiveSymbolForAccessExpression(node.left, consumer);
44652
+ const target = this.getDirectiveSymbolForAccessExpression((_a2 = signalInputAssignment == null ? void 0 : signalInputAssignment.fieldExpr) != null ? _a2 : node.left, consumer);
44569
44653
  if (target === null) {
44570
44654
  continue;
44571
44655
  }
@@ -44580,9 +44664,9 @@ var SymbolBuilder = class {
44580
44664
  }
44581
44665
  return { kind: SymbolKind.Input, bindings };
44582
44666
  }
44583
- getDirectiveSymbolForAccessExpression(node, { isComponent, selector, isStructural }) {
44667
+ getDirectiveSymbolForAccessExpression(fieldAccessExpr, { isComponent, selector, isStructural }) {
44584
44668
  var _a2;
44585
- const tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.expression);
44669
+ const tsSymbol = this.getTypeChecker().getSymbolAtLocation(fieldAccessExpr.expression);
44586
44670
  if ((tsSymbol == null ? void 0 : tsSymbol.declarations) === void 0 || tsSymbol.declarations.length === 0 || selector === null) {
44587
44671
  return null;
44588
44672
  }
@@ -44758,8 +44842,6 @@ var SymbolBuilder = class {
44758
44842
  let tsSymbol;
44759
44843
  if (import_typescript94.default.isPropertyAccessExpression(node)) {
44760
44844
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.name);
44761
- } else if (import_typescript94.default.isElementAccessExpression(node)) {
44762
- tsSymbol = this.getTypeChecker().getSymbolAtLocation(node.argumentExpression);
44763
44845
  } else {
44764
44846
  tsSymbol = this.getTypeChecker().getSymbolAtLocation(node);
44765
44847
  }
@@ -44795,6 +44877,21 @@ function anyNodeFilter(n) {
44795
44877
  function sourceSpanEqual(a, b) {
44796
44878
  return a.start.offset === b.start.offset && a.end.offset === b.end.offset;
44797
44879
  }
44880
+ function unwrapSignalInputWriteTAccessor(expr) {
44881
+ if (!import_typescript94.default.isElementAccessExpression(expr) || !import_typescript94.default.isPropertyAccessExpression(expr.argumentExpression)) {
44882
+ return null;
44883
+ }
44884
+ if (!import_typescript94.default.isIdentifier(expr.argumentExpression.name) || expr.argumentExpression.name.text !== Identifiers.InputSignalBrandWriteType.name) {
44885
+ return null;
44886
+ }
44887
+ if (!import_typescript94.default.isPropertyAccessExpression(expr.expression) && !import_typescript94.default.isElementAccessExpression(expr.expression)) {
44888
+ throw new Error("Unexpected expression for signal input write type.");
44889
+ }
44890
+ return {
44891
+ fieldExpr: expr.expression,
44892
+ typeExpr: expr
44893
+ };
44894
+ }
44798
44895
 
44799
44896
  // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/checker.mjs
44800
44897
  var REGISTRY2 = new DomElementSchemaRegistry();
@@ -45204,11 +45301,11 @@ var TemplateTypeCheckerImpl = class {
45204
45301
  }
45205
45302
  return this.typeCheckScopeRegistry.getTypeCheckDirectiveMetadata(new Reference2(dir));
45206
45303
  }
45207
- getNgModuleMetadata(module3) {
45208
- if (!isNamedClassDeclaration(module3)) {
45304
+ getNgModuleMetadata(module2) {
45305
+ if (!isNamedClassDeclaration(module2)) {
45209
45306
  return null;
45210
45307
  }
45211
- return this.metaReader.getNgModuleMetadata(new Reference2(module3));
45308
+ return this.metaReader.getNgModuleMetadata(new Reference2(module2));
45212
45309
  }
45213
45310
  getPipeMetadata(pipe2) {
45214
45311
  if (!isNamedClassDeclaration(pipe2)) {
@@ -45634,7 +45731,7 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
45634
45731
  }
45635
45732
  };
45636
45733
  function isSignal(symbol) {
45637
- return ((symbol == null ? void 0 : symbol.escapedName) === "WritableSignal" || (symbol == null ? void 0 : symbol.escapedName) === "Signal" || (symbol == null ? void 0 : symbol.escapedName) === "InputSignal") && symbol.parent.escapedName.includes("@angular/core");
45734
+ return ((symbol == null ? void 0 : symbol.escapedName) === "WritableSignal" || (symbol == null ? void 0 : symbol.escapedName) === "Signal" || (symbol == null ? void 0 : symbol.escapedName) === "InputSignal" || (symbol == null ? void 0 : symbol.escapedName) === "InputSignalWithTransform") && symbol.parent.escapedName.includes("@angular/core");
45638
45735
  }
45639
45736
  function buildDiagnosticForSignal(ctx, node, component) {
45640
45737
  const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
@@ -46112,10 +46209,19 @@ var NgCompiler = class {
46112
46209
  return this.incrementalCompilation.depGraph.getResourceDependencies(file);
46113
46210
  }
46114
46211
  getDiagnostics() {
46115
- const diagnostics = [];
46116
- diagnostics.push(...this.getNonTemplateDiagnostics(), ...this.getTemplateDiagnostics());
46117
- if (this.options.strictTemplates) {
46118
- diagnostics.push(...this.getExtendedTemplateDiagnostics());
46212
+ const diagnostics = [
46213
+ ...this.getNonTemplateDiagnostics()
46214
+ ];
46215
+ try {
46216
+ diagnostics.push(...this.getTemplateDiagnostics());
46217
+ if (this.options.strictTemplates) {
46218
+ diagnostics.push(...this.getExtendedTemplateDiagnostics());
46219
+ }
46220
+ } catch (err) {
46221
+ if (!isFatalDiagnosticError(err)) {
46222
+ throw err;
46223
+ }
46224
+ diagnostics.push(err.toDiagnostic());
46119
46225
  }
46120
46226
  return this.addMessageTextDetails(diagnostics);
46121
46227
  }
@@ -46126,11 +46232,11 @@ var NgCompiler = class {
46126
46232
  if (this.options.strictTemplates) {
46127
46233
  diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
46128
46234
  }
46129
- } catch (e) {
46130
- if (e instanceof FatalDiagnosticError) {
46131
- diagnostics.push(e.toDiagnostic());
46235
+ } catch (err) {
46236
+ if (!isFatalDiagnosticError(err)) {
46237
+ throw err;
46132
46238
  }
46133
- throw e;
46239
+ diagnostics.push(err.toDiagnostic());
46134
46240
  }
46135
46241
  return this.addMessageTextDetails(diagnostics);
46136
46242
  }
@@ -46145,7 +46251,7 @@ var NgCompiler = class {
46145
46251
  diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
46146
46252
  }
46147
46253
  } catch (err) {
46148
- if (!(err instanceof FatalDiagnosticError)) {
46254
+ if (!isFatalDiagnosticError(err)) {
46149
46255
  throw err;
46150
46256
  }
46151
46257
  diagnostics.push(err.toDiagnostic());
@@ -46406,14 +46512,7 @@ var NgCompiler = class {
46406
46512
  if (sf.isDeclarationFile || this.adapter.isShim(sf)) {
46407
46513
  continue;
46408
46514
  }
46409
- try {
46410
- diagnostics.push(...compilation.templateTypeChecker.getDiagnosticsForFile(sf, OptimizeFor.WholeProgram));
46411
- } catch (err) {
46412
- if (!(err instanceof FatalDiagnosticError)) {
46413
- throw err;
46414
- }
46415
- diagnostics.push(err.toDiagnostic());
46416
- }
46515
+ diagnostics.push(...compilation.templateTypeChecker.getDiagnosticsForFile(sf, OptimizeFor.WholeProgram));
46417
46516
  }
46418
46517
  const program = this.programDriver.getProgram();
46419
46518
  this.incrementalStrategy.setIncrementalState(this.incrementalCompilation.state, program);
@@ -46863,8 +46962,8 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
46863
46962
  const moduleResolutionCache = import_typescript102.default.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
46864
46963
  return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
46865
46964
  return moduleNames.map((moduleName) => {
46866
- const module3 = import_typescript102.default.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
46867
- return module3.resolvedModule;
46965
+ const module2 = import_typescript102.default.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
46966
+ return module2.resolvedModule;
46868
46967
  });
46869
46968
  };
46870
46969
  }
@@ -48016,11 +48115,11 @@ function toStandalone(sourceFiles, program, printer, fileImportRemapper, compone
48016
48115
  for (const sourceFile of sourceFiles) {
48017
48116
  const modules = findNgModuleClassesToMigrate(sourceFile, typeChecker);
48018
48117
  const testObjects = findTestObjectsToMigrate(sourceFile, typeChecker);
48019
- for (const module3 of modules) {
48020
- const allModuleDeclarations = extractDeclarationsFromModule(module3, templateTypeChecker);
48021
- const unbootstrappedDeclarations = filterNonBootstrappedDeclarations(allModuleDeclarations, module3, templateTypeChecker, typeChecker);
48118
+ for (const module2 of modules) {
48119
+ const allModuleDeclarations = extractDeclarationsFromModule(module2, templateTypeChecker);
48120
+ const unbootstrappedDeclarations = filterNonBootstrappedDeclarations(allModuleDeclarations, module2, templateTypeChecker, typeChecker);
48022
48121
  if (unbootstrappedDeclarations.length > 0) {
48023
- modulesToMigrate.add(module3);
48122
+ modulesToMigrate.add(module2);
48024
48123
  unbootstrappedDeclarations.forEach((decl) => declarations.add(decl));
48025
48124
  }
48026
48125
  }