@angular/compiler-cli 20.2.0-next.0 → 20.2.0-next.2

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 (54) hide show
  1. package/bundles/{chunk-5TMRGUHP.js → chunk-56QTHZ7G.js} +27 -11
  2. package/bundles/{chunk-UZOSFHTN.js → chunk-5LTXARS2.js} +2328 -750
  3. package/bundles/{chunk-SEKYV57I.js → chunk-6HOSNZU5.js} +2 -3
  4. package/bundles/{chunk-FPHHL4UV.js → chunk-BPDNYZBC.js} +253 -49
  5. package/bundles/chunk-DWRM7PIK.js +14 -0
  6. package/bundles/{chunk-TPEB2IXF.js → chunk-GWZQLAGK.js} +35 -7
  7. package/bundles/{chunk-PML5JK7B.js → chunk-HYJ2H3FU.js} +120 -7
  8. package/bundles/{chunk-6ECVYRSU.js → chunk-I2BHWRAU.js} +11 -6
  9. package/bundles/{chunk-YNE6T2TY.js → chunk-MQ6W6B7H.js} +613 -110
  10. package/bundles/{chunk-5JF7HF3W.js → chunk-SZY7NM6F.js} +2 -3
  11. package/bundles/{chunk-JXYBFWGA.js → chunk-UVWZGTBX.js} +19 -7
  12. package/bundles/index.js +34 -19
  13. package/bundles/linker/babel/index.js +70 -18
  14. package/bundles/linker/index.js +11 -5
  15. package/bundles/private/localize.js +5 -6
  16. package/bundles/private/migrations.js +5 -6
  17. package/bundles/private/tooling.js +27 -11
  18. package/bundles/src/bin/ng_xi18n.js +11 -12
  19. package/bundles/src/bin/ngc.js +9 -10
  20. package/linker/src/file_linker/partial_linkers/util.d.ts +1 -1
  21. package/package.json +3 -3
  22. package/src/ngtsc/annotations/component/src/animations.d.ts +15 -0
  23. package/src/ngtsc/diagnostics/src/error_code.d.ts +14 -0
  24. package/src/ngtsc/diagnostics/src/extended_template_diagnostic_name.d.ts +2 -1
  25. package/src/ngtsc/perf/src/api.d.ts +24 -16
  26. package/src/ngtsc/typecheck/api/api.d.ts +1 -1
  27. package/src/ngtsc/typecheck/api/checker.d.ts +15 -0
  28. package/src/ngtsc/typecheck/diagnostics/src/diagnostic.d.ts +7 -1
  29. package/src/ngtsc/typecheck/extended/checks/uninvoked_function_in_text_interpolation/index.d.ts +10 -0
  30. package/src/ngtsc/typecheck/src/checker.d.ts +2 -0
  31. package/src/ngtsc/typecheck/src/dom.d.ts +2 -1
  32. package/src/ngtsc/typecheck/src/ts_util.d.ts +7 -0
  33. package/bundles/chunk-2FHBFXPC.js +0 -34
  34. package/bundles/chunk-2FHBFXPC.js.map +0 -6
  35. package/bundles/chunk-5JF7HF3W.js.map +0 -6
  36. package/bundles/chunk-5TMRGUHP.js.map +0 -6
  37. package/bundles/chunk-6ECVYRSU.js.map +0 -6
  38. package/bundles/chunk-FPHHL4UV.js.map +0 -6
  39. package/bundles/chunk-JXYBFWGA.js.map +0 -6
  40. package/bundles/chunk-KPQ72R34.js +0 -23
  41. package/bundles/chunk-KPQ72R34.js.map +0 -6
  42. package/bundles/chunk-PML5JK7B.js.map +0 -6
  43. package/bundles/chunk-SEKYV57I.js.map +0 -6
  44. package/bundles/chunk-TPEB2IXF.js.map +0 -6
  45. package/bundles/chunk-UZOSFHTN.js.map +0 -6
  46. package/bundles/chunk-YNE6T2TY.js.map +0 -6
  47. package/bundles/index.js.map +0 -6
  48. package/bundles/linker/babel/index.js.map +0 -6
  49. package/bundles/linker/index.js.map +0 -6
  50. package/bundles/private/localize.js.map +0 -6
  51. package/bundles/private/migrations.js.map +0 -6
  52. package/bundles/private/tooling.js.map +0 -6
  53. package/bundles/src/bin/ng_xi18n.js.map +0 -6
  54. package/bundles/src/bin/ngc.js.map +0 -6
@@ -16,9 +16,9 @@ import {
16
16
  tryParseSignalInputMapping,
17
17
  tryParseSignalModelMapping,
18
18
  tryParseSignalQueryFromInitializer
19
- } from "./chunk-UZOSFHTN.js";
19
+ } from "./chunk-5LTXARS2.js";
20
20
 
21
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
21
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/downlevel_decorators_transform.js
22
22
  import ts from "typescript";
23
23
  function isAngularDecorator2(decorator, isCore) {
24
24
  return isCore || decorator.import !== null && decorator.import.from === "@angular/core";
@@ -323,10 +323,10 @@ function cloneClassElementWithModifiers(node, modifiers) {
323
323
  return ts.setOriginalNode(clone, node);
324
324
  }
325
325
 
326
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.js
326
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.js
327
327
  import ts4 from "typescript";
328
328
 
329
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform_api.js
329
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform_api.js
330
330
  import ts2 from "typescript";
331
331
  function createSyntheticAngularCoreDecoratorAccess(factory, importManager, ngClassDecorator, sourceFile, decoratorName) {
332
332
  const classDecoratorIdentifier = ts2.isIdentifier(ngClassDecorator.identifier) ? ngClassDecorator.identifier : ngClassDecorator.identifier.expression;
@@ -336,6 +336,9 @@ function createSyntheticAngularCoreDecoratorAccess(factory, importManager, ngCla
336
336
  exportSymbolName: null,
337
337
  requestedFile: sourceFile
338
338
  }),
339
+ // The synthetic identifier may be checked later by the downlevel decorators
340
+ // transform to resolve to an Angular import using `getSymbolAtLocation`. We trick
341
+ // the transform to think it's not synthetic and comes from Angular core.
339
342
  ts2.setOriginalNode(factory.createIdentifier(decoratorName), classDecoratorIdentifier)
340
343
  );
341
344
  }
@@ -343,7 +346,7 @@ function castAsAny(factory, expr) {
343
346
  return factory.createAsExpression(expr, factory.createKeywordTypeNode(ts2.SyntaxKind.AnyKeyword));
344
347
  }
345
348
 
346
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/input_function.js
349
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/input_function.js
347
350
  var signalInputsTransform = (member, sourceFile, host, factory, importTracker, importManager, classDecorator, isCore) => {
348
351
  if (host.getDecoratorsOfDeclaration(member.node)?.some((d) => isAngularDecorator(d, "Input", isCore))) {
349
352
  return member.node;
@@ -356,15 +359,21 @@ var signalInputsTransform = (member, sourceFile, host, factory, importTracker, i
356
359
  "isSignal": factory.createTrue(),
357
360
  "alias": factory.createStringLiteral(inputMapping.bindingPropertyName),
358
361
  "required": inputMapping.required ? factory.createTrue() : factory.createFalse(),
362
+ // For signal inputs, transforms are captured by the input signal. The runtime will
363
+ // determine whether a transform needs to be run via the input signal, so the `transform`
364
+ // option is always `undefined`.
359
365
  "transform": factory.createIdentifier("undefined")
360
366
  };
361
367
  const newDecorator = factory.createDecorator(factory.createCallExpression(createSyntheticAngularCoreDecoratorAccess(factory, importManager, classDecorator, sourceFile, "Input"), void 0, [
368
+ // Cast to `any` because `isSignal` will be private, and in case this
369
+ // transform is used directly as a pre-compilation step, the decorator should
370
+ // not fail. It is already validated now due to us parsing the input metadata.
362
371
  castAsAny(factory, factory.createObjectLiteralExpression(Object.entries(fields).map(([name, value]) => factory.createPropertyAssignment(name, value))))
363
372
  ]));
364
373
  return factory.updatePropertyDeclaration(member.node, [newDecorator, ...member.node.modifiers ?? []], member.name, member.node.questionToken, member.node.type, member.node.initializer);
365
374
  };
366
375
 
367
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/model_function.js
376
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/model_function.js
368
377
  import ts3 from "typescript";
369
378
  var signalModelTransform = (member, sourceFile, host, factory, importTracker, importManager, classDecorator, isCore) => {
370
379
  if (host.getDecoratorsOfDeclaration(member.node)?.some((d) => {
@@ -383,6 +392,9 @@ var signalModelTransform = (member, sourceFile, host, factory, importTracker, im
383
392
  ]);
384
393
  const inputDecorator = createDecorator(
385
394
  "Input",
395
+ // Config is cast to `any` because `isSignal` will be private, and in case this
396
+ // transform is used directly as a pre-compilation step, the decorator should
397
+ // not fail. It is already validated now due to us parsing the input metadata.
386
398
  factory.createAsExpression(inputConfig, factory.createKeywordTypeNode(ts3.SyntaxKind.AnyKeyword)),
387
399
  classDecorator,
388
400
  factory,
@@ -397,7 +409,7 @@ function createDecorator(name, config, classDecorator, factory, sourceFile, impo
397
409
  return factory.createDecorator(factory.createCallExpression(callTarget, void 0, [config]));
398
410
  }
399
411
 
400
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/output_function.js
412
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/output_function.js
401
413
  var initializerApiOutputTransform = (member, sourceFile, host, factory, importTracker, importManager, classDecorator, isCore) => {
402
414
  if (host.getDecoratorsOfDeclaration(member.node)?.some((d) => isAngularDecorator(d, "Output", isCore))) {
403
415
  return member.node;
@@ -410,7 +422,7 @@ var initializerApiOutputTransform = (member, sourceFile, host, factory, importTr
410
422
  return factory.updatePropertyDeclaration(member.node, [newDecorator, ...member.node.modifiers ?? []], member.node.name, member.node.questionToken, member.node.type, member.node.initializer);
411
423
  };
412
424
 
413
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/query_functions.js
425
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/query_functions.js
414
426
  var queryFunctionToDecorator = {
415
427
  viewChild: "ViewChild",
416
428
  viewChildren: "ViewChildren",
@@ -431,8 +443,12 @@ var queryFunctionsTransforms = (member, sourceFile, host, factory, importTracker
431
443
  const newDecorator = factory.createDecorator(factory.createCallExpression(
432
444
  createSyntheticAngularCoreDecoratorAccess(factory, importManager, classDecorator, sourceFile, queryFunctionToDecorator[queryDefinition.name]),
433
445
  void 0,
446
+ // All positional arguments of the query functions can be mostly re-used as is
447
+ // for the decorator. i.e. predicate is always first argument. Options are second.
434
448
  [
435
449
  queryDefinition.call.arguments[0],
450
+ // Note: Casting as `any` because `isSignal` is not publicly exposed and this
451
+ // transform might pre-transform TS sources.
436
452
  castAsAny(factory, factory.createObjectLiteralExpression([
437
453
  ...callArgs.length > 1 ? [factory.createSpreadAssignment(callArgs[1])] : [],
438
454
  factory.createPropertyAssignment("isSignal", factory.createTrue())
@@ -442,7 +458,7 @@ var queryFunctionsTransforms = (member, sourceFile, host, factory, importTracker
442
458
  return factory.updatePropertyDeclaration(member.node, [newDecorator, ...member.node.modifiers ?? []], member.node.name, member.node.questionToken, member.node.type, member.node.initializer);
443
459
  };
444
460
 
445
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.js
461
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/initializer_api_transforms/transform.js
446
462
  var decoratorsWithInputs = ["Directive", "Component"];
447
463
  var propertyTransforms = [
448
464
  signalInputsTransform,
@@ -494,7 +510,7 @@ function createTransformVisitor(ctx, host, importManager, importTracker, isCore,
494
510
  return visitor;
495
511
  }
496
512
 
497
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/transform/jit/src/index.js
513
+ // packages/compiler-cli/src/ngtsc/transform/jit/src/index.js
498
514
  function angularJitApplicationTransform(program, isCore = false, shouldTransformClass) {
499
515
  const typeChecker = program.getTypeChecker();
500
516
  const reflectionHost = new TypeScriptReflectionHost(typeChecker);
@@ -504,6 +520,7 @@ function angularJitApplicationTransform(program, isCore = false, shouldTransform
504
520
  reflectionHost,
505
521
  [],
506
522
  isCore,
523
+ /* enableClosureCompiler */
507
524
  false,
508
525
  shouldTransformClass
509
526
  );
@@ -529,4 +546,3 @@ export {
529
546
  * Use of this source code is governed by an MIT-style license that can be
530
547
  * found in the LICENSE file at https://angular.dev/license
531
548
  */
532
- //# sourceMappingURL=chunk-5TMRGUHP.js.map