@angular/core 12.2.0-next.1 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/bundles/core-testing.umd.js +15 -4
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core.umd.js +94 -77
  4. package/bundles/core.umd.js.map +1 -1
  5. package/core.d.ts +12 -12
  6. package/core.metadata.json +1 -1
  7. package/esm2015/src/application_init.js +5 -5
  8. package/esm2015/src/application_ref.js +6 -2
  9. package/esm2015/src/change_detection/differs/iterable_differs.js +1 -1
  10. package/esm2015/src/compiler/compiler_facade.js +31 -8
  11. package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
  12. package/esm2015/src/di/jit/injectable.js +4 -3
  13. package/esm2015/src/di/r3_injector.js +5 -2
  14. package/esm2015/src/error_handler.js +4 -8
  15. package/esm2015/src/errors.js +2 -2
  16. package/esm2015/src/event_emitter.js +1 -1
  17. package/esm2015/src/i18n/locale_en.js +4 -38
  18. package/esm2015/src/linker/component_factory_resolver.js +1 -1
  19. package/esm2015/src/linker/template_ref.js +1 -1
  20. package/esm2015/src/linker/view_container_ref.js +1 -1
  21. package/esm2015/src/metadata/di.js +1 -1
  22. package/esm2015/src/render3/component_ref.js +1 -1
  23. package/esm2015/src/render3/definition.js +1 -1
  24. package/esm2015/src/render3/instructions/shared.js +2 -1
  25. package/esm2015/src/render3/jit/directive.js +6 -5
  26. package/esm2015/src/render3/jit/module.js +7 -4
  27. package/esm2015/src/render3/jit/partial.js +27 -9
  28. package/esm2015/src/render3/jit/pipe.js +5 -3
  29. package/esm2015/src/render3/ng_module_ref.js +1 -1
  30. package/esm2015/src/render3/view_ref.js +1 -1
  31. package/esm2015/src/sanitization/bypass.js +1 -1
  32. package/esm2015/src/version.js +1 -1
  33. package/esm2015/src/view/entrypoint.js +1 -1
  34. package/esm2015/src/view/refs.js +1 -1
  35. package/esm2015/testing/src/ng_zone_mock.js +1 -1
  36. package/esm2015/testing/src/r3_test_bed_compiler.js +4 -1
  37. package/esm2015/testing/src/resolvers.js +1 -1
  38. package/esm2015/testing/src/test_bed.js +12 -4
  39. package/fesm2015/core.js +95 -78
  40. package/fesm2015/core.js.map +1 -1
  41. package/fesm2015/testing.js +15 -4
  42. package/fesm2015/testing.js.map +1 -1
  43. package/package.json +2 -2
  44. package/schematics/migrations/missing-injectable/providers_evaluator.js +1 -1
  45. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.js +1 -1
  46. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.js +1 -1
  47. package/schematics/migrations.json +1 -1
  48. package/src/r3_symbols.d.ts +2 -3
  49. package/testing/testing.d.ts +2 -1
  50. package/testing/testing.metadata.json +1 -1
  51. package/testing.d.ts +1 -1
  52. package/schematics/migrations/abstract-control-parent/abstract-control-parent.externs.js +0 -0
  53. package/schematics/migrations/abstract-control-parent/index.mjs +0 -47
  54. package/schematics/migrations/abstract-control-parent/util.mjs +0 -50
  55. package/schematics/migrations/activated-route-snapshot-fragment/activated-route-snapshot-fragment.externs.js +0 -0
  56. package/schematics/migrations/activated-route-snapshot-fragment/index.mjs +0 -48
  57. package/schematics/migrations/activated-route-snapshot-fragment/util.mjs +0 -33
  58. package/schematics/migrations/can-activate-with-redirect-to/can-activate-with-redirect-to.externs.js +0 -0
  59. package/schematics/migrations/can-activate-with-redirect-to/index.mjs +0 -44
  60. package/schematics/migrations/can-activate-with-redirect-to/util.mjs +0 -55
  61. package/schematics/migrations/deep-shadow-piercing-selector/deep-shadow-piercing-selector.externs.js +0 -0
  62. package/schematics/migrations/deep-shadow-piercing-selector/index.mjs +0 -36
  63. package/schematics/migrations/dynamic-queries/dynamic-queries.externs.js +0 -0
  64. package/schematics/migrations/dynamic-queries/index.mjs +0 -51
  65. package/schematics/migrations/dynamic-queries/util.mjs +0 -65
  66. package/schematics/migrations/initial-navigation/collector.mjs +0 -105
  67. package/schematics/migrations/initial-navigation/index.mjs +0 -61
  68. package/schematics/migrations/initial-navigation/initial-navigation.externs.js +0 -0
  69. package/schematics/migrations/initial-navigation/transform.mjs +0 -54
  70. package/schematics/migrations/initial-navigation/update_recorder.mjs +0 -9
  71. package/schematics/migrations/initial-navigation/util.mjs +0 -28
  72. package/schematics/migrations/missing-injectable/definition_collector.mjs +0 -75
  73. package/schematics/migrations/missing-injectable/index.mjs +0 -100
  74. package/schematics/migrations/missing-injectable/missing-injectable.externs.js +0 -0
  75. package/schematics/migrations/missing-injectable/providers_evaluator.mjs +0 -50
  76. package/schematics/migrations/missing-injectable/transform.mjs +0 -187
  77. package/schematics/migrations/missing-injectable/update_recorder.mjs +0 -9
  78. package/schematics/migrations/module-with-providers/collector.mjs +0 -59
  79. package/schematics/migrations/module-with-providers/index.mjs +0 -71
  80. package/schematics/migrations/module-with-providers/module-with-providers.externs.js +0 -0
  81. package/schematics/migrations/module-with-providers/transform.mjs +0 -134
  82. package/schematics/migrations/module-with-providers/util.mjs +0 -25
  83. package/schematics/migrations/move-document/document_import_visitor.mjs +0 -60
  84. package/schematics/migrations/move-document/index.mjs +0 -71
  85. package/schematics/migrations/move-document/move-document.externs.js +0 -0
  86. package/schematics/migrations/move-document/move-import.mjs +0 -45
  87. package/schematics/migrations/native-view-encapsulation/index.mjs +0 -41
  88. package/schematics/migrations/native-view-encapsulation/native-view-encapsulation.externs.js +0 -0
  89. package/schematics/migrations/native-view-encapsulation/util.mjs +0 -34
  90. package/schematics/migrations/navigation-extras-omissions/index.mjs +0 -47
  91. package/schematics/migrations/navigation-extras-omissions/navigation-extras-omissions.externs.js +0 -0
  92. package/schematics/migrations/navigation-extras-omissions/util.mjs +0 -111
  93. package/schematics/migrations/relative-link-resolution/collector.mjs +0 -81
  94. package/schematics/migrations/relative-link-resolution/index.mjs +0 -62
  95. package/schematics/migrations/relative-link-resolution/relative-link-resolution.externs.js +0 -0
  96. package/schematics/migrations/relative-link-resolution/transform.mjs +0 -51
  97. package/schematics/migrations/relative-link-resolution/update_recorder.mjs +0 -9
  98. package/schematics/migrations/relative-link-resolution/util.mjs +0 -28
  99. package/schematics/migrations/renderer-to-renderer2/helpers.mjs +0 -224
  100. package/schematics/migrations/renderer-to-renderer2/index.mjs +0 -113
  101. package/schematics/migrations/renderer-to-renderer2/migration.mjs +0 -211
  102. package/schematics/migrations/renderer-to-renderer2/renderer-to-renderer2.externs.js +0 -0
  103. package/schematics/migrations/renderer-to-renderer2/util.mjs +0 -69
  104. package/schematics/migrations/router-preserve-query-params/index.mjs +0 -50
  105. package/schematics/migrations/router-preserve-query-params/router-preserve-query-params.externs.js +0 -0
  106. package/schematics/migrations/router-preserve-query-params/util.mjs +0 -88
  107. package/schematics/migrations/static-queries/angular/directive_inputs.mjs +0 -70
  108. package/schematics/migrations/static-queries/angular/ng_query_visitor.mjs +0 -113
  109. package/schematics/migrations/static-queries/angular/query-definition.mjs +0 -20
  110. package/schematics/migrations/static-queries/angular/super_class.mjs +0 -21
  111. package/schematics/migrations/static-queries/index.mjs +0 -206
  112. package/schematics/migrations/static-queries/static-queries.externs.js +0 -0
  113. package/schematics/migrations/static-queries/strategies/template_strategy/template_strategy.mjs +0 -200
  114. package/schematics/migrations/static-queries/strategies/test_strategy/test_strategy.mjs +0 -24
  115. package/schematics/migrations/static-queries/strategies/timing-strategy.mjs +0 -9
  116. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.mjs +0 -355
  117. package/schematics/migrations/static-queries/strategies/usage_strategy/super_class_context.mjs +0 -38
  118. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.mjs +0 -80
  119. package/schematics/migrations/static-queries/strategies/usage_strategy/usage_strategy.mjs +0 -154
  120. package/schematics/migrations/static-queries/transform.mjs +0 -88
  121. package/schematics/migrations/template-var-assignment/analyze_template.mjs +0 -25
  122. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.mjs +0 -65
  123. package/schematics/migrations/template-var-assignment/index.mjs +0 -68
  124. package/schematics/migrations/template-var-assignment/template-var-assignment.externs.js +0 -0
  125. package/schematics/migrations/undecorated-classes-with-decorated-fields/index.mjs +0 -92
  126. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.mjs +0 -286
  127. package/schematics/migrations/undecorated-classes-with-decorated-fields/undecorated-classes-with-decorated-fields.externs.js +0 -0
  128. package/schematics/migrations/undecorated-classes-with-decorated-fields/update_recorder.mjs +0 -9
  129. package/schematics/migrations/undecorated-classes-with-di/create_ngc_program.mjs +0 -43
  130. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/convert_directive_metadata.mjs +0 -82
  131. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/decorator_rewriter.mjs +0 -102
  132. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/import_rewrite_visitor.mjs +0 -111
  133. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/path_format.mjs +0 -17
  134. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/source_file_exports.mjs +0 -51
  135. package/schematics/migrations/undecorated-classes-with-di/index.mjs +0 -162
  136. package/schematics/migrations/undecorated-classes-with-di/ng_declaration_collector.mjs +0 -124
  137. package/schematics/migrations/undecorated-classes-with-di/transform.mjs +0 -356
  138. package/schematics/migrations/undecorated-classes-with-di/undecorated-classes-with-di.externs.js +0 -0
  139. package/schematics/migrations/undecorated-classes-with-di/update_recorder.mjs +0 -9
  140. package/schematics/migrations/wait-for-async/index.mjs +0 -76
  141. package/schematics/migrations/wait-for-async/util.mjs +0 -23
  142. package/schematics/migrations/wait-for-async/wait-for-async.externs.js +0 -0
  143. package/schematics/migrations/xhr-factory/index.mjs +0 -91
  144. package/schematics/migrations/xhr-factory/xhr-factory.externs.js +0 -0
  145. package/schematics/utils/import_manager.mjs +0 -197
  146. package/schematics/utils/line_mappings.mjs +0 -60
  147. package/schematics/utils/ng_component_template.mjs +0 -96
  148. package/schematics/utils/ng_decorators.mjs +0 -23
  149. package/schematics/utils/parse_html.mjs +0 -24
  150. package/schematics/utils/project_tsconfig_paths.mjs +0 -74
  151. package/schematics/utils/schematics_prompt.mjs +0 -30
  152. package/schematics/utils/typescript/class_declaration.mjs +0 -33
  153. package/schematics/utils/typescript/compiler_host.mjs +0 -66
  154. package/schematics/utils/typescript/decorators.mjs +0 -20
  155. package/schematics/utils/typescript/find_base_classes.mjs +0 -30
  156. package/schematics/utils/typescript/functions.mjs +0 -28
  157. package/schematics/utils/typescript/imports.mjs +0 -91
  158. package/schematics/utils/typescript/nodes.mjs +0 -57
  159. package/schematics/utils/typescript/parse_tsconfig.mjs +0 -26
  160. package/schematics/utils/typescript/property_name.mjs +0 -23
  161. package/schematics/utils/typescript/symbol.mjs +0 -72
  162. package/schematics/utils/utils.externs.js +0 -0
package/fesm2015/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.2.0-next.1
2
+ * @license Angular v12.2.0
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4025,15 +4025,38 @@ var ViewEncapsulation$1;
4025
4025
  * Use of this source code is governed by an MIT-style license that can be
4026
4026
  * found in the LICENSE file at https://angular.io/license
4027
4027
  */
4028
- function getCompilerFacade() {
4028
+ function getCompilerFacade(request) {
4029
4029
  const globalNg = _global['ng'];
4030
- if (!globalNg || !globalNg.ɵcompilerFacade) {
4031
- throw new Error(`Angular JIT compilation failed: '@angular/compiler' not loaded!\n` +
4032
- ` - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\n` +
4033
- ` - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\n` +
4034
- ` - Alternatively provide the compiler with 'import "@angular/compiler";' before bootstrapping.`);
4030
+ if (globalNg && globalNg.ɵcompilerFacade) {
4031
+ return globalNg.ɵcompilerFacade;
4032
+ }
4033
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
4034
+ // Log the type as an error so that a developer can easily navigate to the type from the
4035
+ // console.
4036
+ console.error(`JIT compilation failed for ${request.kind}`, request.type);
4037
+ let message = `The ${request.kind} '${request
4038
+ .type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`;
4039
+ if (request.usage === 1 /* PartialDeclaration */) {
4040
+ message += `The ${request.kind} is part of a library that has been partially compiled.\n`;
4041
+ message +=
4042
+ `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`;
4043
+ message += '\n';
4044
+ message +=
4045
+ `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n`;
4046
+ }
4047
+ else {
4048
+ message +=
4049
+ `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`;
4050
+ }
4051
+ message +=
4052
+ `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n`;
4053
+ message +=
4054
+ `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`;
4055
+ throw new Error(message);
4056
+ }
4057
+ else {
4058
+ throw new Error('JIT compiler unavailable');
4035
4059
  }
4036
- return globalNg.ɵcompilerFacade;
4037
4060
  }
4038
4061
 
4039
4062
  /**
@@ -6450,7 +6473,7 @@ function getOriginalError(error) {
6450
6473
  return error[ERROR_ORIGINAL_ERROR];
6451
6474
  }
6452
6475
  function getErrorLogger(error) {
6453
- return error[ERROR_LOGGER] || defaultErrorLogger;
6476
+ return error && error[ERROR_LOGGER] || defaultErrorLogger;
6454
6477
  }
6455
6478
  function defaultErrorLogger(console, ...values) {
6456
6479
  console.error(...values);
@@ -6511,19 +6534,15 @@ class ErrorHandler {
6511
6534
  }
6512
6535
  /** @internal */
6513
6536
  _findContext(error) {
6514
- if (error) {
6515
- return getDebugContext(error) ? getDebugContext(error) :
6516
- this._findContext(getOriginalError(error));
6517
- }
6518
- return null;
6537
+ return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
6519
6538
  }
6520
6539
  /** @internal */
6521
6540
  _findOriginalError(error) {
6522
- let e = getOriginalError(error);
6541
+ let e = error && getOriginalError(error);
6523
6542
  while (e && getOriginalError(e)) {
6524
6543
  e = getOriginalError(e);
6525
6544
  }
6526
- return e;
6545
+ return e || null;
6527
6546
  }
6528
6547
  }
6529
6548
 
@@ -9413,6 +9432,7 @@ function renderView(tView, lView, context) {
9413
9432
  // an error, mark the view as corrupted so we can try to recover.
9414
9433
  if (tView.firstCreatePass) {
9415
9434
  tView.incompleteFirstPass = true;
9435
+ tView.firstCreatePass = false;
9416
9436
  }
9417
9437
  throw error;
9418
9438
  }
@@ -11212,6 +11232,7 @@ class R3Injector {
11212
11232
  this.assertNotDestroyed();
11213
11233
  // Set the injection context.
11214
11234
  const previousInjector = setCurrentInjector(this);
11235
+ const previousInjectImplementation = setInjectImplementation(undefined);
11215
11236
  try {
11216
11237
  // Check for the SkipSelf flag.
11217
11238
  if (!(flags & InjectFlags.SkipSelf)) {
@@ -11264,7 +11285,8 @@ class R3Injector {
11264
11285
  }
11265
11286
  }
11266
11287
  finally {
11267
- // Lastly, clean up the state by restoring the previous injector.
11288
+ // Lastly, restore the previous injection context.
11289
+ setInjectImplementation(previousInjectImplementation);
11268
11290
  setCurrentInjector(previousInjector);
11269
11291
  }
11270
11292
  }
@@ -13673,7 +13695,8 @@ function compileInjectable(type, meta) {
13673
13695
  Object.defineProperty(type, NG_PROV_DEF, {
13674
13696
  get: () => {
13675
13697
  if (ngInjectableDef === null) {
13676
- ngInjectableDef = getCompilerFacade().compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));
13698
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
13699
+ ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta));
13677
13700
  }
13678
13701
  return ngInjectableDef;
13679
13702
  },
@@ -13684,7 +13707,7 @@ function compileInjectable(type, meta) {
13684
13707
  Object.defineProperty(type, NG_FACTORY_DEF, {
13685
13708
  get: () => {
13686
13709
  if (ngFactoryDef === null) {
13687
- const compiler = getCompilerFacade();
13710
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'injectable', type });
13688
13711
  ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, {
13689
13712
  name: type.name,
13690
13713
  type,
@@ -18786,49 +18809,15 @@ if (typeof ngI18nClosureMode === 'undefined') {
18786
18809
  * Use of this source code is governed by an MIT-style license that can be
18787
18810
  * found in the LICENSE file at https://angular.io/license
18788
18811
  */
18789
- // THIS CODE IS GENERATED - DO NOT MODIFY
18790
- // See angular/tools/gulp-tasks/cldr/extract.js
18812
+ // THIS CODE IS GENERATED - DO NOT MODIFY.
18791
18813
  const u = undefined;
18792
18814
  function plural(n) {
18793
- let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
18815
+ const i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
18794
18816
  if (i === 1 && v === 0)
18795
18817
  return 1;
18796
18818
  return 5;
18797
18819
  }
18798
- var localeEn = [
18799
- 'en',
18800
- [['a', 'p'], ['AM', 'PM'], u],
18801
- [['AM', 'PM'], u, u],
18802
- [
18803
- ['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
18804
- ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
18805
- ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
18806
- ],
18807
- u,
18808
- [
18809
- ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
18810
- ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
18811
- [
18812
- 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',
18813
- 'October', 'November', 'December'
18814
- ]
18815
- ],
18816
- u,
18817
- [['B', 'A'], ['BC', 'AD'], ['Before Christ', 'Anno Domini']],
18818
- 0,
18819
- [6, 0],
18820
- ['M/d/yy', 'MMM d, y', 'MMMM d, y', 'EEEE, MMMM d, y'],
18821
- ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'],
18822
- ['{1}, {0}', u, '{1} \'at\' {0}', u],
18823
- ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],
18824
- ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'],
18825
- 'USD',
18826
- '$',
18827
- 'US Dollar',
18828
- {},
18829
- 'ltr',
18830
- plural
18831
- ];
18820
+ var localeEn = ["en", [["a", "p"], ["AM", "PM"], u], [["AM", "PM"], u, u], [["S", "M", "T", "W", "T", "F", "S"], ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]], u, [["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]], u, [["B", "A"], ["BC", "AD"], ["Before Christ", "Anno Domini"]], 0, [6, 0], ["M/d/yy", "MMM d, y", "MMMM d, y", "EEEE, MMMM d, y"], ["h:mm a", "h:mm:ss a", "h:mm:ss a z", "h:mm:ss a zzzz"], ["{1}, {0}", u, "{1} 'at' {0}", u], [".", ",", ";", "%", "+", "-", "E", "×", "‰", "∞", "NaN", ":"], ["#,##0.###", "#,##0%", "¤#,##0.00", "#E0"], "USD", "$", "US Dollar", {}, "ltr", plural];
18832
18821
 
18833
18822
  /**
18834
18823
  * @license
@@ -21469,7 +21458,7 @@ class Version {
21469
21458
  /**
21470
21459
  * @publicApi
21471
21460
  */
21472
- const VERSION = new Version('12.2.0-next.1');
21461
+ const VERSION = new Version('12.2.0');
21473
21462
 
21474
21463
  /**
21475
21464
  * @license
@@ -26928,7 +26917,8 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
26928
26917
  // go into an infinite loop before we've reached the point where we throw all the errors.
26929
26918
  throw new Error(`'${stringifyForError(moduleType)}' module can't import itself`);
26930
26919
  }
26931
- ngModuleDef = getCompilerFacade().compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {
26920
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
26921
+ ngModuleDef = compiler.compileNgModule(angularCoreEnv, `ng:///${moduleType.name}/ɵmod.js`, {
26932
26922
  type: moduleType,
26933
26923
  bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY).map(resolveForwardRef),
26934
26924
  declarations: declarations.map(resolveForwardRef),
@@ -26956,7 +26946,7 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
26956
26946
  Object.defineProperty(moduleType, NG_FACTORY_DEF, {
26957
26947
  get: () => {
26958
26948
  if (ngFactoryDef === null) {
26959
- const compiler = getCompilerFacade();
26949
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
26960
26950
  ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${moduleType.name}/ɵfac.js`, {
26961
26951
  name: moduleType.name,
26962
26952
  type: moduleType,
@@ -26985,7 +26975,9 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
26985
26975
  (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),
26986
26976
  ],
26987
26977
  };
26988
- ngInjectorDef = getCompilerFacade().compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);
26978
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'NgModule', type: moduleType });
26979
+ ngInjectorDef =
26980
+ compiler.compileInjector(angularCoreEnv, `ng:///${moduleType.name}/ɵinj.js`, meta);
26989
26981
  }
26990
26982
  return ngInjectorDef;
26991
26983
  },
@@ -27351,7 +27343,7 @@ function compileComponent(type, metadata) {
27351
27343
  Object.defineProperty(type, NG_COMP_DEF, {
27352
27344
  get: () => {
27353
27345
  if (ngComponentDef === null) {
27354
- const compiler = getCompilerFacade();
27346
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'component', type: type });
27355
27347
  if (componentNeedsResolution(metadata)) {
27356
27348
  const error = [`Component '${type.name}' is not resolved:`];
27357
27349
  if (metadata.templateUrl) {
@@ -27442,8 +27434,9 @@ function compileDirective(type, directive) {
27442
27434
  // that use `@Directive()` with no selector. In that case, pass empty object to the
27443
27435
  // `directiveMetadata` function instead of null.
27444
27436
  const meta = getDirectiveMetadata$1(type, directive || {});
27437
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
27445
27438
  ngDirectiveDef =
27446
- getCompilerFacade().compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
27439
+ compiler.compileDirective(angularCoreEnv, meta.sourceMapUrl, meta.metadata);
27447
27440
  }
27448
27441
  return ngDirectiveDef;
27449
27442
  },
@@ -27454,7 +27447,7 @@ function compileDirective(type, directive) {
27454
27447
  function getDirectiveMetadata$1(type, metadata) {
27455
27448
  const name = type && type.name;
27456
27449
  const sourceMapUrl = `ng:///${name}/ɵdir.js`;
27457
- const compiler = getCompilerFacade();
27450
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
27458
27451
  const facade = directiveMetadata(type, metadata);
27459
27452
  facade.typeSourceSpan = compiler.createParseSourceSpan('Directive', name, sourceMapUrl);
27460
27453
  if (facade.usesInheritance) {
@@ -27468,7 +27461,7 @@ function addDirectiveFactoryDef(type, metadata) {
27468
27461
  get: () => {
27469
27462
  if (ngFactoryDef === null) {
27470
27463
  const meta = getDirectiveMetadata$1(type, metadata);
27471
- const compiler = getCompilerFacade();
27464
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'directive', type });
27472
27465
  ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${type.name}/ɵfac.js`, {
27473
27466
  name: meta.metadata.name,
27474
27467
  type: meta.metadata.type,
@@ -27619,7 +27612,7 @@ function compilePipe(type, meta) {
27619
27612
  get: () => {
27620
27613
  if (ngFactoryDef === null) {
27621
27614
  const metadata = getPipeMetadata(type, meta);
27622
- const compiler = getCompilerFacade();
27615
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
27623
27616
  ngFactoryDef = compiler.compileFactory(angularCoreEnv, `ng:///${metadata.name}/ɵfac.js`, {
27624
27617
  name: metadata.name,
27625
27618
  type: metadata.type,
@@ -27637,7 +27630,9 @@ function compilePipe(type, meta) {
27637
27630
  get: () => {
27638
27631
  if (ngPipeDef === null) {
27639
27632
  const metadata = getPipeMetadata(type, meta);
27640
- ngPipeDef = getCompilerFacade().compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);
27633
+ const compiler = getCompilerFacade({ usage: 0 /* Decorator */, kind: 'pipe', type: metadata.type });
27634
+ ngPipeDef =
27635
+ compiler.compilePipe(angularCoreEnv, `ng:///${metadata.name}/ɵpipe.js`, metadata);
27641
27636
  }
27642
27637
  return ngPipeDef;
27643
27638
  },
@@ -27877,11 +27872,11 @@ const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;
27877
27872
  * through DI.
27878
27873
  *
27879
27874
  * ```
27880
- * function initializeApp(httpClient: HttpClient): Observable<any> {
27881
- * return httpClient.get("https://someUrl.com/api/user")
27875
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
27876
+ * return () => httpClient.get("https://someUrl.com/api/user")
27882
27877
  * .pipe(
27883
27878
  * tap(user => { ... })
27884
- * )
27879
+ * );
27885
27880
  * }
27886
27881
  *
27887
27882
  * @NgModule({
@@ -27890,7 +27885,7 @@ const SWITCH_COMPILE_NGMODULE = SWITCH_COMPILE_NGMODULE__PRE_R3__;
27890
27885
  * bootstrap: [AppComponent],
27891
27886
  * providers: [{
27892
27887
  * provide: APP_INITIALIZER,
27893
- * useFactory: initializeApp,
27888
+ * useFactory: initializeAppFactory,
27894
27889
  * deps: [HttpClient],
27895
27890
  * multi: true
27896
27891
  * }]
@@ -29085,7 +29080,11 @@ function compileNgModuleFactory__POST_R3__(injector, options, moduleType) {
29085
29080
  if (compilerProviders.length === 0) {
29086
29081
  return Promise.resolve(moduleFactory);
29087
29082
  }
29088
- const compiler = getCompilerFacade();
29083
+ const compiler = getCompilerFacade({
29084
+ usage: 0 /* Decorator */,
29085
+ kind: 'NgModule',
29086
+ type: moduleType,
29087
+ });
29089
29088
  const compilerInjector = Injector.create({ providers: compilerProviders });
29090
29089
  const resourceLoader = compilerInjector.get(compiler.ResourceLoader);
29091
29090
  // The resource loader can also return a string while the "resolveComponentResources"
@@ -33027,7 +33026,7 @@ class NgModuleFactory_ extends NgModuleFactory {
33027
33026
  * @codeGenApi
33028
33027
  */
33029
33028
  function ɵɵngDeclareDirective(decl) {
33030
- const compiler = getCompilerFacade();
33029
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'directive', type: decl.type });
33031
33030
  return compiler.compileDirectiveDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
33032
33031
  }
33033
33032
  /**
@@ -33045,7 +33044,7 @@ function ɵɵngDeclareClassMetadata(decl) {
33045
33044
  * @codeGenApi
33046
33045
  */
33047
33046
  function ɵɵngDeclareComponent(decl) {
33048
- const compiler = getCompilerFacade();
33047
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'component', type: decl.type });
33049
33048
  return compiler.compileComponentDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵcmp.js`, decl);
33050
33049
  }
33051
33050
  /**
@@ -33054,16 +33053,34 @@ function ɵɵngDeclareComponent(decl) {
33054
33053
  * @codeGenApi
33055
33054
  */
33056
33055
  function ɵɵngDeclareFactory(decl) {
33057
- const compiler = getCompilerFacade();
33056
+ const compiler = getCompilerFacade({
33057
+ usage: 1 /* PartialDeclaration */,
33058
+ kind: getFactoryKind(decl.target),
33059
+ type: decl.type
33060
+ });
33058
33061
  return compiler.compileFactoryDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵfac.js`, decl);
33059
33062
  }
33063
+ function getFactoryKind(target) {
33064
+ switch (target) {
33065
+ case FactoryTarget.Directive:
33066
+ return 'directive';
33067
+ case FactoryTarget.Component:
33068
+ return 'component';
33069
+ case FactoryTarget.Injectable:
33070
+ return 'injectable';
33071
+ case FactoryTarget.Pipe:
33072
+ return 'pipe';
33073
+ case FactoryTarget.NgModule:
33074
+ return 'NgModule';
33075
+ }
33076
+ }
33060
33077
  /**
33061
33078
  * Compiles a partial injectable declaration object into a full injectable definition object.
33062
33079
  *
33063
33080
  * @codeGenApi
33064
33081
  */
33065
33082
  function ɵɵngDeclareInjectable(decl) {
33066
- const compiler = getCompilerFacade();
33083
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'injectable', type: decl.type });
33067
33084
  return compiler.compileInjectableDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵprov.js`, decl);
33068
33085
  }
33069
33086
  /**
@@ -33072,7 +33089,7 @@ function ɵɵngDeclareInjectable(decl) {
33072
33089
  * @codeGenApi
33073
33090
  */
33074
33091
  function ɵɵngDeclareInjector(decl) {
33075
- const compiler = getCompilerFacade();
33092
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
33076
33093
  return compiler.compileInjectorDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵinj.js`, decl);
33077
33094
  }
33078
33095
  /**
@@ -33081,7 +33098,7 @@ function ɵɵngDeclareInjector(decl) {
33081
33098
  * @codeGenApi
33082
33099
  */
33083
33100
  function ɵɵngDeclareNgModule(decl) {
33084
- const compiler = getCompilerFacade();
33101
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'NgModule', type: decl.type });
33085
33102
  return compiler.compileNgModuleDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵmod.js`, decl);
33086
33103
  }
33087
33104
  /**
@@ -33090,7 +33107,7 @@ function ɵɵngDeclareNgModule(decl) {
33090
33107
  * @codeGenApi
33091
33108
  */
33092
33109
  function ɵɵngDeclarePipe(decl) {
33093
- const compiler = getCompilerFacade();
33110
+ const compiler = getCompilerFacade({ usage: 1 /* PartialDeclaration */, kind: 'pipe', type: decl.type });
33094
33111
  return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
33095
33112
  }
33096
33113