@angular/compiler 17.3.11 → 17.3.12

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.3.11
2
+ * @license Angular v17.3.12
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -32452,6 +32452,24 @@ function convertDirectiveFacadeToMetadata(facade) {
32452
32452
  });
32453
32453
  }
32454
32454
  }
32455
+ const hostDirectives = facade.hostDirectives?.length ?
32456
+ facade.hostDirectives.map((hostDirective) => {
32457
+ return typeof hostDirective === 'function' ?
32458
+ {
32459
+ directive: wrapReference(hostDirective),
32460
+ inputs: null,
32461
+ outputs: null,
32462
+ isForwardReference: false,
32463
+ } :
32464
+ {
32465
+ directive: wrapReference(hostDirective.directive),
32466
+ isForwardReference: false,
32467
+ inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
32468
+ outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) :
32469
+ null,
32470
+ };
32471
+ }) :
32472
+ null;
32455
32473
  return {
32456
32474
  ...facade,
32457
32475
  typeArgumentCount: 0,
@@ -32468,10 +32486,18 @@ function convertDirectiveFacadeToMetadata(facade) {
32468
32486
  providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null,
32469
32487
  viewQueries: facade.viewQueries.map(convertToR3QueryMetadata),
32470
32488
  fullInheritance: false,
32471
- hostDirectives: convertHostDirectivesToMetadata(facade),
32489
+ hostDirectives,
32472
32490
  };
32473
32491
  }
32474
32492
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
32493
+ const hostDirectives = declaration.hostDirectives?.length ?
32494
+ declaration.hostDirectives.map((dir) => ({
32495
+ directive: wrapReference(dir.directive),
32496
+ isForwardReference: false,
32497
+ inputs: dir.inputs ? getHostDirectiveBindingMapping(dir.inputs) : null,
32498
+ outputs: dir.outputs ? getHostDirectiveBindingMapping(dir.outputs) : null,
32499
+ })) :
32500
+ null;
32475
32501
  return {
32476
32502
  name: declaration.type.name,
32477
32503
  type: wrapReference(declaration.type),
@@ -32492,7 +32518,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
32492
32518
  fullInheritance: false,
32493
32519
  isStandalone: declaration.isStandalone ?? false,
32494
32520
  isSignal: declaration.isSignal ?? false,
32495
- hostDirectives: convertHostDirectivesToMetadata(declaration),
32521
+ hostDirectives,
32496
32522
  };
32497
32523
  }
32498
32524
  function convertHostDeclarationToMetadata(host = {}) {
@@ -32507,25 +32533,17 @@ function convertHostDeclarationToMetadata(host = {}) {
32507
32533
  useTemplatePipeline: SHOULD_USE_TEMPLATE_PIPELINE_FOR_JIT,
32508
32534
  };
32509
32535
  }
32510
- function convertHostDirectivesToMetadata(metadata) {
32511
- if (metadata.hostDirectives?.length) {
32512
- return metadata.hostDirectives.map(hostDirective => {
32513
- return typeof hostDirective === 'function' ?
32514
- {
32515
- directive: wrapReference(hostDirective),
32516
- inputs: null,
32517
- outputs: null,
32518
- isForwardReference: false
32519
- } :
32520
- {
32521
- directive: wrapReference(hostDirective.directive),
32522
- isForwardReference: false,
32523
- inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
32524
- outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null,
32525
- };
32526
- });
32536
+ /*
32537
+ * Parses a host directive mapping where each odd array key is the name of an input/output
32538
+ * and each even key is its public name, e.g. `['one', 'oneAlias', 'two', 'two']`.
32539
+ */
32540
+ function getHostDirectiveBindingMapping(array) {
32541
+ let result = null;
32542
+ for (let i = 1; i < array.length; i += 2) {
32543
+ result = result || {};
32544
+ result[array[i - 1]] = array[i];
32527
32545
  }
32528
- return null;
32546
+ return result;
32529
32547
  }
32530
32548
  function convertOpaqueValuesToExpressions(obj) {
32531
32549
  const result = {};
@@ -32859,7 +32877,7 @@ function publishFacade(global) {
32859
32877
  * @description
32860
32878
  * Entry point for all public APIs of the compiler package.
32861
32879
  */
32862
- const VERSION = new Version('17.3.11');
32880
+ const VERSION = new Version('17.3.12');
32863
32881
 
32864
32882
  class CompilerConfig {
32865
32883
  constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters } = {}) {
@@ -34427,7 +34445,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
34427
34445
  function compileDeclareClassMetadata(metadata) {
34428
34446
  const definitionMap = new DefinitionMap();
34429
34447
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
34430
- definitionMap.set('version', literal('17.3.11'));
34448
+ definitionMap.set('version', literal('17.3.12'));
34431
34449
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34432
34450
  definitionMap.set('type', metadata.type);
34433
34451
  definitionMap.set('decorators', metadata.decorators);
@@ -34523,7 +34541,7 @@ function createDirectiveDefinitionMap(meta) {
34523
34541
  const definitionMap = new DefinitionMap();
34524
34542
  const minVersion = getMinimumVersionForPartialOutput(meta);
34525
34543
  definitionMap.set('minVersion', literal(minVersion));
34526
- definitionMap.set('version', literal('17.3.11'));
34544
+ definitionMap.set('version', literal('17.3.12'));
34527
34545
  // e.g. `type: MyDirective`
34528
34546
  definitionMap.set('type', meta.type.value);
34529
34547
  if (meta.isStandalone) {
@@ -34915,7 +34933,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
34915
34933
  function compileDeclareFactoryFunction(meta) {
34916
34934
  const definitionMap = new DefinitionMap();
34917
34935
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
34918
- definitionMap.set('version', literal('17.3.11'));
34936
+ definitionMap.set('version', literal('17.3.12'));
34919
34937
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34920
34938
  definitionMap.set('type', meta.type.value);
34921
34939
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -34950,7 +34968,7 @@ function compileDeclareInjectableFromMetadata(meta) {
34950
34968
  function createInjectableDefinitionMap(meta) {
34951
34969
  const definitionMap = new DefinitionMap();
34952
34970
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
34953
- definitionMap.set('version', literal('17.3.11'));
34971
+ definitionMap.set('version', literal('17.3.12'));
34954
34972
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34955
34973
  definitionMap.set('type', meta.type.value);
34956
34974
  // Only generate providedIn property if it has a non-null value
@@ -35001,7 +35019,7 @@ function compileDeclareInjectorFromMetadata(meta) {
35001
35019
  function createInjectorDefinitionMap(meta) {
35002
35020
  const definitionMap = new DefinitionMap();
35003
35021
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
35004
- definitionMap.set('version', literal('17.3.11'));
35022
+ definitionMap.set('version', literal('17.3.12'));
35005
35023
  definitionMap.set('ngImport', importExpr(Identifiers.core));
35006
35024
  definitionMap.set('type', meta.type.value);
35007
35025
  definitionMap.set('providers', meta.providers);
@@ -35034,7 +35052,7 @@ function createNgModuleDefinitionMap(meta) {
35034
35052
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
35035
35053
  }
35036
35054
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
35037
- definitionMap.set('version', literal('17.3.11'));
35055
+ definitionMap.set('version', literal('17.3.12'));
35038
35056
  definitionMap.set('ngImport', importExpr(Identifiers.core));
35039
35057
  definitionMap.set('type', meta.type.value);
35040
35058
  // We only generate the keys in the metadata if the arrays contain values.
@@ -35085,7 +35103,7 @@ function compileDeclarePipeFromMetadata(meta) {
35085
35103
  function createPipeDefinitionMap(meta) {
35086
35104
  const definitionMap = new DefinitionMap();
35087
35105
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
35088
- definitionMap.set('version', literal('17.3.11'));
35106
+ definitionMap.set('version', literal('17.3.12'));
35089
35107
  definitionMap.set('ngImport', importExpr(Identifiers.core));
35090
35108
  // e.g. `type: MyPipe`
35091
35109
  definitionMap.set('type', meta.type.value);