@angular/core 12.1.0-next.5 → 12.1.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 (158) hide show
  1. package/bundles/core-testing.umd.js +239 -46
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core.umd.js +60 -37
  4. package/bundles/core.umd.js.map +1 -1
  5. package/core.d.ts +45 -19
  6. package/core.metadata.json +1 -1
  7. package/esm2015/src/application_init.js +5 -5
  8. package/esm2015/src/application_ref.js +29 -8
  9. package/esm2015/src/change_detection/differs/iterable_differs.js +1 -1
  10. package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
  11. package/esm2015/src/error_handler.js +2 -6
  12. package/esm2015/src/event_emitter.js +1 -1
  13. package/esm2015/src/linker/component_factory_resolver.js +1 -1
  14. package/esm2015/src/linker/template_ref.js +1 -1
  15. package/esm2015/src/linker/view_container_ref.js +1 -1
  16. package/esm2015/src/metadata/di.js +1 -1
  17. package/esm2015/src/metadata/do_boostrap.js +1 -1
  18. package/esm2015/src/render3/component_ref.js +1 -1
  19. package/esm2015/src/render3/definition.js +16 -16
  20. package/esm2015/src/render3/ng_module_ref.js +1 -1
  21. package/esm2015/src/render3/view_ref.js +1 -1
  22. package/esm2015/src/sanitization/bypass.js +1 -1
  23. package/esm2015/src/version.js +1 -1
  24. package/esm2015/src/view/entrypoint.js +1 -1
  25. package/esm2015/src/view/refs.js +1 -1
  26. package/esm2015/testing/src/ng_zone_mock.js +1 -1
  27. package/esm2015/testing/src/r3_test_bed.js +84 -7
  28. package/esm2015/testing/src/r3_test_bed_compiler.js +4 -1
  29. package/esm2015/testing/src/resolvers.js +1 -1
  30. package/esm2015/testing/src/test_bed.js +110 -21
  31. package/esm2015/testing/src/test_bed_common.js +7 -1
  32. package/esm2015/testing/src/test_hooks.js +45 -0
  33. package/esm2015/testing/src/testing.js +3 -3
  34. package/fesm2015/core.js +50 -33
  35. package/fesm2015/core.js.map +1 -1
  36. package/fesm2015/testing.js +216 -29
  37. package/fesm2015/testing.js.map +1 -1
  38. package/package.json +1 -1
  39. package/schematics/migrations/missing-injectable/providers_evaluator.js +1 -1
  40. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.js +1 -1
  41. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.js +1 -1
  42. package/schematics/migrations.json +1 -1
  43. package/src/r3_symbols.d.ts +2 -3
  44. package/testing/testing.d.ts +64 -5
  45. package/testing/testing.metadata.json +1 -1
  46. package/testing.d.ts +1 -1
  47. package/esm2015/testing/src/before_each.js +0 -33
  48. package/schematics/migrations/abstract-control-parent/abstract-control-parent.externs.js +0 -0
  49. package/schematics/migrations/abstract-control-parent/index.mjs +0 -47
  50. package/schematics/migrations/abstract-control-parent/util.mjs +0 -50
  51. package/schematics/migrations/activated-route-snapshot-fragment/activated-route-snapshot-fragment.externs.js +0 -0
  52. package/schematics/migrations/activated-route-snapshot-fragment/index.mjs +0 -48
  53. package/schematics/migrations/activated-route-snapshot-fragment/util.mjs +0 -33
  54. package/schematics/migrations/can-activate-with-redirect-to/can-activate-with-redirect-to.externs.js +0 -0
  55. package/schematics/migrations/can-activate-with-redirect-to/index.mjs +0 -44
  56. package/schematics/migrations/can-activate-with-redirect-to/util.mjs +0 -55
  57. package/schematics/migrations/deep-shadow-piercing-selector/deep-shadow-piercing-selector.externs.js +0 -0
  58. package/schematics/migrations/deep-shadow-piercing-selector/index.mjs +0 -36
  59. package/schematics/migrations/dynamic-queries/dynamic-queries.externs.js +0 -0
  60. package/schematics/migrations/dynamic-queries/index.mjs +0 -51
  61. package/schematics/migrations/dynamic-queries/util.mjs +0 -65
  62. package/schematics/migrations/initial-navigation/collector.mjs +0 -105
  63. package/schematics/migrations/initial-navigation/index.mjs +0 -61
  64. package/schematics/migrations/initial-navigation/initial-navigation.externs.js +0 -0
  65. package/schematics/migrations/initial-navigation/transform.mjs +0 -54
  66. package/schematics/migrations/initial-navigation/update_recorder.mjs +0 -9
  67. package/schematics/migrations/initial-navigation/util.mjs +0 -28
  68. package/schematics/migrations/missing-injectable/definition_collector.mjs +0 -75
  69. package/schematics/migrations/missing-injectable/index.mjs +0 -100
  70. package/schematics/migrations/missing-injectable/missing-injectable.externs.js +0 -0
  71. package/schematics/migrations/missing-injectable/providers_evaluator.mjs +0 -50
  72. package/schematics/migrations/missing-injectable/transform.mjs +0 -187
  73. package/schematics/migrations/missing-injectable/update_recorder.mjs +0 -9
  74. package/schematics/migrations/module-with-providers/collector.mjs +0 -59
  75. package/schematics/migrations/module-with-providers/index.mjs +0 -71
  76. package/schematics/migrations/module-with-providers/module-with-providers.externs.js +0 -0
  77. package/schematics/migrations/module-with-providers/transform.mjs +0 -134
  78. package/schematics/migrations/module-with-providers/util.mjs +0 -25
  79. package/schematics/migrations/move-document/document_import_visitor.mjs +0 -60
  80. package/schematics/migrations/move-document/index.mjs +0 -71
  81. package/schematics/migrations/move-document/move-document.externs.js +0 -0
  82. package/schematics/migrations/move-document/move-import.mjs +0 -45
  83. package/schematics/migrations/native-view-encapsulation/index.mjs +0 -41
  84. package/schematics/migrations/native-view-encapsulation/native-view-encapsulation.externs.js +0 -0
  85. package/schematics/migrations/native-view-encapsulation/util.mjs +0 -34
  86. package/schematics/migrations/navigation-extras-omissions/index.mjs +0 -47
  87. package/schematics/migrations/navigation-extras-omissions/navigation-extras-omissions.externs.js +0 -0
  88. package/schematics/migrations/navigation-extras-omissions/util.mjs +0 -111
  89. package/schematics/migrations/relative-link-resolution/collector.mjs +0 -81
  90. package/schematics/migrations/relative-link-resolution/index.mjs +0 -62
  91. package/schematics/migrations/relative-link-resolution/relative-link-resolution.externs.js +0 -0
  92. package/schematics/migrations/relative-link-resolution/transform.mjs +0 -51
  93. package/schematics/migrations/relative-link-resolution/update_recorder.mjs +0 -9
  94. package/schematics/migrations/relative-link-resolution/util.mjs +0 -28
  95. package/schematics/migrations/renderer-to-renderer2/helpers.mjs +0 -224
  96. package/schematics/migrations/renderer-to-renderer2/index.mjs +0 -113
  97. package/schematics/migrations/renderer-to-renderer2/migration.mjs +0 -211
  98. package/schematics/migrations/renderer-to-renderer2/renderer-to-renderer2.externs.js +0 -0
  99. package/schematics/migrations/renderer-to-renderer2/util.mjs +0 -69
  100. package/schematics/migrations/router-preserve-query-params/index.mjs +0 -50
  101. package/schematics/migrations/router-preserve-query-params/router-preserve-query-params.externs.js +0 -0
  102. package/schematics/migrations/router-preserve-query-params/util.mjs +0 -88
  103. package/schematics/migrations/static-queries/angular/directive_inputs.mjs +0 -70
  104. package/schematics/migrations/static-queries/angular/ng_query_visitor.mjs +0 -113
  105. package/schematics/migrations/static-queries/angular/query-definition.mjs +0 -20
  106. package/schematics/migrations/static-queries/angular/super_class.mjs +0 -21
  107. package/schematics/migrations/static-queries/index.mjs +0 -206
  108. package/schematics/migrations/static-queries/static-queries.externs.js +0 -0
  109. package/schematics/migrations/static-queries/strategies/template_strategy/template_strategy.mjs +0 -200
  110. package/schematics/migrations/static-queries/strategies/test_strategy/test_strategy.mjs +0 -24
  111. package/schematics/migrations/static-queries/strategies/timing-strategy.mjs +0 -9
  112. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.mjs +0 -355
  113. package/schematics/migrations/static-queries/strategies/usage_strategy/super_class_context.mjs +0 -38
  114. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.mjs +0 -80
  115. package/schematics/migrations/static-queries/strategies/usage_strategy/usage_strategy.mjs +0 -154
  116. package/schematics/migrations/static-queries/transform.mjs +0 -88
  117. package/schematics/migrations/template-var-assignment/analyze_template.mjs +0 -25
  118. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.mjs +0 -65
  119. package/schematics/migrations/template-var-assignment/index.mjs +0 -68
  120. package/schematics/migrations/template-var-assignment/template-var-assignment.externs.js +0 -0
  121. package/schematics/migrations/undecorated-classes-with-decorated-fields/index.mjs +0 -92
  122. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.mjs +0 -286
  123. package/schematics/migrations/undecorated-classes-with-decorated-fields/undecorated-classes-with-decorated-fields.externs.js +0 -0
  124. package/schematics/migrations/undecorated-classes-with-decorated-fields/update_recorder.mjs +0 -9
  125. package/schematics/migrations/undecorated-classes-with-di/create_ngc_program.mjs +0 -43
  126. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/convert_directive_metadata.mjs +0 -82
  127. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/decorator_rewriter.mjs +0 -102
  128. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/import_rewrite_visitor.mjs +0 -111
  129. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/path_format.mjs +0 -17
  130. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/source_file_exports.mjs +0 -51
  131. package/schematics/migrations/undecorated-classes-with-di/index.mjs +0 -162
  132. package/schematics/migrations/undecorated-classes-with-di/ng_declaration_collector.mjs +0 -124
  133. package/schematics/migrations/undecorated-classes-with-di/transform.mjs +0 -356
  134. package/schematics/migrations/undecorated-classes-with-di/undecorated-classes-with-di.externs.js +0 -0
  135. package/schematics/migrations/undecorated-classes-with-di/update_recorder.mjs +0 -9
  136. package/schematics/migrations/wait-for-async/index.mjs +0 -76
  137. package/schematics/migrations/wait-for-async/util.mjs +0 -23
  138. package/schematics/migrations/wait-for-async/wait-for-async.externs.js +0 -0
  139. package/schematics/migrations/xhr-factory/index.mjs +0 -91
  140. package/schematics/migrations/xhr-factory/xhr-factory.externs.js +0 -0
  141. package/schematics/utils/import_manager.mjs +0 -197
  142. package/schematics/utils/line_mappings.mjs +0 -60
  143. package/schematics/utils/ng_component_template.mjs +0 -96
  144. package/schematics/utils/ng_decorators.mjs +0 -23
  145. package/schematics/utils/parse_html.mjs +0 -24
  146. package/schematics/utils/project_tsconfig_paths.mjs +0 -74
  147. package/schematics/utils/schematics_prompt.mjs +0 -30
  148. package/schematics/utils/typescript/class_declaration.mjs +0 -33
  149. package/schematics/utils/typescript/compiler_host.mjs +0 -66
  150. package/schematics/utils/typescript/decorators.mjs +0 -20
  151. package/schematics/utils/typescript/find_base_classes.mjs +0 -30
  152. package/schematics/utils/typescript/functions.mjs +0 -28
  153. package/schematics/utils/typescript/imports.mjs +0 -91
  154. package/schematics/utils/typescript/nodes.mjs +0 -57
  155. package/schematics/utils/typescript/parse_tsconfig.mjs +0 -26
  156. package/schematics/utils/typescript/property_name.mjs +0 -23
  157. package/schematics/utils/typescript/symbol.mjs +0 -72
  158. package/schematics/utils/utils.externs.js +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v12.1.0-next.5
2
+ * @license Angular v12.1.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -358,10 +358,16 @@
358
358
  r[k] = a[j];
359
359
  return r;
360
360
  }
361
- function __spreadArray(to, from) {
362
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
363
- to[j] = from[i];
364
- return to;
361
+ function __spreadArray(to, from, pack) {
362
+ if (pack || arguments.length === 2)
363
+ for (var i = 0, l = from.length, ar; i < l; i++) {
364
+ if (ar || !(i in from)) {
365
+ if (!ar)
366
+ ar = Array.prototype.slice.call(from, 0, i);
367
+ ar[i] = from[i];
368
+ }
369
+ }
370
+ return to.concat(ar || from);
365
371
  }
366
372
  function __await(v) {
367
373
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -1236,22 +1242,22 @@
1236
1242
  * @codeGenApi
1237
1243
  */
1238
1244
  function ɵɵdefineNgModule(def) {
1239
- var res = {
1240
- type: def.type,
1241
- bootstrap: def.bootstrap || EMPTY_ARRAY,
1242
- declarations: def.declarations || EMPTY_ARRAY,
1243
- imports: def.imports || EMPTY_ARRAY,
1244
- exports: def.exports || EMPTY_ARRAY,
1245
- transitiveCompileScopes: null,
1246
- schemas: def.schemas || null,
1247
- id: def.id || null,
1248
- };
1249
- if (def.id != null) {
1250
- noSideEffects(function () {
1245
+ return noSideEffects(function () {
1246
+ var res = {
1247
+ type: def.type,
1248
+ bootstrap: def.bootstrap || EMPTY_ARRAY,
1249
+ declarations: def.declarations || EMPTY_ARRAY,
1250
+ imports: def.imports || EMPTY_ARRAY,
1251
+ exports: def.exports || EMPTY_ARRAY,
1252
+ transitiveCompileScopes: null,
1253
+ schemas: def.schemas || null,
1254
+ id: def.id || null,
1255
+ };
1256
+ if (def.id != null) {
1251
1257
  autoRegisterModuleById[def.id] = def.type;
1252
- });
1253
- }
1254
- return res;
1258
+ }
1259
+ return res;
1260
+ });
1255
1261
  }
1256
1262
  /**
1257
1263
  * Adds the module metadata that is necessary to compute the module's transitive scope to an
@@ -6850,11 +6856,7 @@
6850
6856
  };
6851
6857
  /** @internal */
6852
6858
  ErrorHandler.prototype._findContext = function (error) {
6853
- if (error) {
6854
- return getDebugContext(error) ? getDebugContext(error) :
6855
- this._findContext(getOriginalError(error));
6856
- }
6857
- return null;
6859
+ return error ? (getDebugContext(error) || this._findContext(getOriginalError(error))) : null;
6858
6860
  };
6859
6861
  /** @internal */
6860
6862
  ErrorHandler.prototype._findOriginalError = function (error) {
@@ -22038,7 +22040,7 @@
22038
22040
  /**
22039
22041
  * @publicApi
22040
22042
  */
22041
- var VERSION = new Version('12.1.0-next.5');
22043
+ var VERSION = new Version('12.1.2');
22042
22044
 
22043
22045
  /**
22044
22046
  * @license
@@ -28577,11 +28579,11 @@
28577
28579
  * through DI.
28578
28580
  *
28579
28581
  * ```
28580
- * function initializeApp(httpClient: HttpClient): Observable<any> {
28581
- * return httpClient.get("https://someUrl.com/api/user")
28582
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
28583
+ * return () => httpClient.get("https://someUrl.com/api/user")
28582
28584
  * .pipe(
28583
28585
  * tap(user => { ... })
28584
- * )
28586
+ * );
28585
28587
  * }
28586
28588
  *
28587
28589
  * @NgModule({
@@ -28590,7 +28592,7 @@
28590
28592
  * bootstrap: [AppComponent],
28591
28593
  * providers: [{
28592
28594
  * provide: APP_INITIALIZER,
28593
- * useFactory: initializeApp,
28595
+ * useFactory: initializeAppFactory,
28594
28596
  * deps: [HttpClient],
28595
28597
  * multi: true
28596
28598
  * }]
@@ -30280,20 +30282,41 @@
30280
30282
  rxjs.merge(isCurrentlyStable, isStable.pipe(operators.share()));
30281
30283
  }
30282
30284
  /**
30283
- * Bootstrap a new component at the root level of the application.
30285
+ * Bootstrap a component onto the element identified by its selector or, optionally, to a
30286
+ * specified element.
30284
30287
  *
30285
30288
  * @usageNotes
30286
30289
  * ### Bootstrap process
30287
30290
  *
30288
- * When bootstrapping a new root component into an application, Angular mounts the
30289
- * specified application component onto DOM elements identified by the componentType's
30290
- * selector and kicks off automatic change detection to finish initializing the component.
30291
+ * When bootstrapping a component, Angular mounts it onto a target DOM element
30292
+ * and kicks off automatic change detection. The target DOM element can be
30293
+ * provided using the `rootSelectorOrNode` argument.
30291
30294
  *
30292
- * Optionally, a component can be mounted onto a DOM element that does not match the
30293
- * componentType's selector.
30295
+ * If the target DOM element is not provided, Angular tries to find one on a page
30296
+ * using the `selector` of the component that is being bootstrapped
30297
+ * (first matched element is used).
30294
30298
  *
30295
30299
  * ### Example
30296
- * {@example core/ts/platform/platform.ts region='longform'}
30300
+ *
30301
+ * Generally, we define the component to bootstrap in the `bootstrap` array of `NgModule`,
30302
+ * but it requires us to know the component while writing the application code.
30303
+ *
30304
+ * Imagine a situation where we have to wait for an API call to decide about the component to
30305
+ * bootstrap. We can use the `ngDoBootstrap` hook of the `NgModule` and call this method to
30306
+ * dynamically bootstrap a component.
30307
+ *
30308
+ * {@example core/ts/platform/platform.ts region='componentSelector'}
30309
+ *
30310
+ * Optionally, a component can be mounted onto a DOM element that does not match the
30311
+ * selector of the bootstrapped component.
30312
+ *
30313
+ * In the following example, we are providing a CSS selector to match the target element.
30314
+ *
30315
+ * {@example core/ts/platform/platform.ts region='cssSelector'}
30316
+ *
30317
+ * While in this example, we are providing reference to a DOM node.
30318
+ *
30319
+ * {@example core/ts/platform/platform.ts region='domNode'}
30297
30320
  */
30298
30321
  ApplicationRef.prototype.bootstrap = function (componentOrFactory, rootSelectorOrNode) {
30299
30322
  var _this = this;