@angular/core 14.0.0-next.0 → 14.0.0-next.11

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 (101) hide show
  1. package/core.d.ts +202 -132
  2. package/esm2020/src/application_init.mjs +4 -3
  3. package/esm2020/src/application_module.mjs +5 -104
  4. package/esm2020/src/application_ref.mjs +6 -24
  5. package/esm2020/src/application_tokens.mjs +14 -2
  6. package/esm2020/src/change_detection/change_detection.mjs +2 -3
  7. package/esm2020/src/compiler/compiler_facade_interface.mjs +1 -1
  8. package/esm2020/src/core.mjs +2 -2
  9. package/esm2020/src/core_private_export.mjs +2 -1
  10. package/esm2020/src/core_render3_private_export.mjs +4 -3
  11. package/esm2020/src/debug/debug_node.mjs +137 -53
  12. package/esm2020/src/di/injector_compatibility.mjs +2 -2
  13. package/esm2020/src/di/r3_injector.mjs +5 -15
  14. package/esm2020/src/di/reflective_injector.mjs +1 -1
  15. package/esm2020/src/di/reflective_provider.mjs +4 -4
  16. package/esm2020/src/errors.mjs +22 -5
  17. package/esm2020/src/i18n/tokens.mjs +39 -3
  18. package/esm2020/src/linker/compiler.mjs +4 -3
  19. package/esm2020/src/linker/ng_module_factory_loader.mjs +2 -2
  20. package/esm2020/src/linker/ng_module_registration.mjs +55 -0
  21. package/esm2020/src/linker/template_ref.mjs +3 -3
  22. package/esm2020/src/linker/view_container_ref.mjs +35 -8
  23. package/esm2020/src/metadata/directives.mjs +14 -5
  24. package/esm2020/src/reflection/platform_reflection_capabilities.mjs +1 -1
  25. package/esm2020/src/reflection/reflection_capabilities.mjs +1 -37
  26. package/esm2020/src/render3/component.mjs +3 -3
  27. package/esm2020/src/render3/component_ref.mjs +22 -26
  28. package/esm2020/src/render3/context_discovery.mjs +34 -30
  29. package/esm2020/src/render3/definition.mjs +3 -1
  30. package/esm2020/src/render3/di.mjs +177 -97
  31. package/esm2020/src/render3/hooks.mjs +3 -3
  32. package/esm2020/src/render3/i18n/i18n_parse.mjs +3 -3
  33. package/esm2020/src/render3/index.mjs +2 -2
  34. package/esm2020/src/render3/instructions/element.mjs +28 -7
  35. package/esm2020/src/render3/instructions/element_container.mjs +7 -1
  36. package/esm2020/src/render3/instructions/lview_debug.mjs +7 -4
  37. package/esm2020/src/render3/instructions/shared.mjs +26 -12
  38. package/esm2020/src/render3/interfaces/context.mjs +35 -2
  39. package/esm2020/src/render3/interfaces/definition.mjs +1 -1
  40. package/esm2020/src/render3/interfaces/injector.mjs +1 -1
  41. package/esm2020/src/render3/interfaces/lview_tracking.mjs +33 -0
  42. package/esm2020/src/render3/interfaces/renderer_dom.mjs +1 -1
  43. package/esm2020/src/render3/interfaces/view.mjs +4 -2
  44. package/esm2020/src/render3/jit/directive.mjs +5 -2
  45. package/esm2020/src/render3/jit/environment.mjs +4 -1
  46. package/esm2020/src/render3/jit/module.mjs +7 -1
  47. package/esm2020/src/render3/jit/module_patch.mjs +11 -0
  48. package/esm2020/src/render3/jit/pipe.mjs +5 -2
  49. package/esm2020/src/render3/ng_module_ref.mjs +1 -29
  50. package/esm2020/src/render3/node_manipulation.mjs +12 -3
  51. package/esm2020/src/render3/state.mjs +16 -2
  52. package/esm2020/src/render3/styling/styling_parser.mjs +2 -2
  53. package/esm2020/src/render3/util/discovery_utils.mjs +33 -22
  54. package/esm2020/src/util/coercion.mjs +12 -0
  55. package/esm2020/src/version.mjs +1 -1
  56. package/esm2020/testing/src/fake_async.mjs +3 -2
  57. package/esm2020/testing/src/logger.mjs +3 -3
  58. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  59. package/esm2020/testing/src/r3_test_bed.mjs +13 -2
  60. package/fesm2015/core.mjs +798 -604
  61. package/fesm2015/core.mjs.map +1 -1
  62. package/fesm2015/testing.mjs +15 -3
  63. package/fesm2015/testing.mjs.map +1 -1
  64. package/fesm2020/core.mjs +798 -597
  65. package/fesm2020/core.mjs.map +1 -1
  66. package/fesm2020/testing.mjs +15 -3
  67. package/fesm2020/testing.mjs.map +1 -1
  68. package/package.json +2 -2
  69. package/schematics/migrations/entry-components/util.js +2 -2
  70. package/schematics/migrations/{router-link-empty-expression → path-match-type}/index.d.ts +2 -2
  71. package/schematics/migrations/path-match-type/index.js +95 -0
  72. package/schematics/migrations/path-match-type/transform.d.ts +19 -0
  73. package/schematics/migrations/path-match-type/transform.js +48 -0
  74. package/schematics/migrations/path-match-type/update_recorder.d.ts +18 -0
  75. package/schematics/migrations/path-match-type/update_recorder.js +20 -0
  76. package/schematics/migrations/path-match-type/util.d.ts +11 -0
  77. package/schematics/migrations/path-match-type/util.js +106 -0
  78. package/schematics/migrations/typed-forms/index.d.ts +1 -5
  79. package/schematics/migrations/typed-forms/index.js +12 -34
  80. package/schematics/migrations/typed-forms/util.d.ts +8 -10
  81. package/schematics/migrations/typed-forms/util.js +99 -52
  82. package/schematics/migrations.json +11 -16
  83. package/schematics/utils/import_manager.js +11 -22
  84. package/schematics/utils/typescript/imports.js +5 -9
  85. package/schematics/utils/typescript/parse_tsconfig.js +6 -2
  86. package/schematics/utils/typescript/symbol.js +4 -3
  87. package/testing/testing.d.ts +3 -2
  88. package/esm2020/src/di/util.mjs +0 -51
  89. package/esm2020/src/linker/ng_module_factory_registration.mjs +0 -59
  90. package/esm2020/src/reflection/reflection.mjs +0 -16
  91. package/esm2020/src/reflection/reflector.mjs +0 -56
  92. package/esm2020/src/reflection/types.mjs +0 -9
  93. package/schematics/migrations/router-link-empty-expression/analyze_template.d.ts +0 -11
  94. package/schematics/migrations/router-link-empty-expression/analyze_template.js +0 -34
  95. package/schematics/migrations/router-link-empty-expression/angular/html_routerlink_empty_expr_visitor.d.ts +0 -20
  96. package/schematics/migrations/router-link-empty-expression/angular/html_routerlink_empty_expr_visitor.js +0 -47
  97. package/schematics/migrations/router-link-empty-expression/index.js +0 -170
  98. package/schematics/migrations/testbed-teardown/index.d.ts +0 -11
  99. package/schematics/migrations/testbed-teardown/index.js +0 -92
  100. package/schematics/migrations/testbed-teardown/util.d.ts +0 -35
  101. package/schematics/migrations/testbed-teardown/util.js +0 -188
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.0
2
+ * @license Angular v14.0.0-next.11
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { getDebugNode, RendererFactory2, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ModuleWithComponentFactories, InjectionToken, Injector, InjectFlags, ɵresetCompiledComponents, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
7
+ import { getDebugNode, RendererFactory2, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetInjectableDef, resolveForwardRef, ɵNG_COMP_DEF, ɵRender3NgModuleRef, ApplicationInitStatus, LOCALE_ID, ɵDEFAULT_LOCALE_ID, ɵsetLocaleId, ɵRender3ComponentFactory, ɵcompileComponent, ɵNG_DIR_DEF, ɵcompileDirective, ɵNG_PIPE_DEF, ɵcompilePipe, ɵNG_MOD_DEF, ɵtransitiveScopesFor, ɵpatchComponentDefWithScope, ɵNG_INJ_DEF, ɵcompileNgModuleDefs, NgZone, Compiler, COMPILER_OPTIONS, ɵNgModuleFactory, ModuleWithComponentFactories, InjectionToken, Injector, InjectFlags, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
8
8
  import { __awaiter } from 'tslib';
9
9
  import { ResourceLoader } from '@angular/compiler';
10
10
 
@@ -374,7 +374,8 @@ function tick(millis = 0, tickOptions = {
374
374
  throw new Error(fakeAsyncTestModuleNotLoadedErrorMessage);
375
375
  }
376
376
  /**
377
- * Simulates the asynchronous passage of time for the timers in the `fakeAsync` zone by
377
+ * Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
378
+ * the `fakeAsync` zone by
378
379
  * draining the macrotask queue until it is empty.
379
380
  *
380
381
  * @param maxTurns The maximum number of times the scheduler attempts to clear its queue before
@@ -1649,6 +1650,11 @@ class TestBedRender3 {
1649
1650
  this.platform = platform;
1650
1651
  this.ngModule = ngModule;
1651
1652
  this._compiler = new R3TestBedCompiler(this.platform, this.ngModule);
1653
+ // TestBed does not have an API which can reliably detect the start of a test, and thus could be
1654
+ // used to track the state of the NgModule registry and reset it correctly. Instead, when we
1655
+ // know we're in a testing scenario, we disable the check for duplicate NgModule registration
1656
+ // completely.
1657
+ ɵsetAllowDuplicateNgModuleIdsForTest(true);
1652
1658
  }
1653
1659
  /**
1654
1660
  * Reset the providers for the test injector.
@@ -1661,6 +1667,7 @@ class TestBedRender3 {
1661
1667
  this.platform = null;
1662
1668
  this.ngModule = null;
1663
1669
  TestBedRender3._environmentTeardownOptions = undefined;
1670
+ ɵsetAllowDuplicateNgModuleIdsForTest(false);
1664
1671
  }
1665
1672
  resetTestingModule() {
1666
1673
  this.checkGlobalCompilationFinished();
@@ -1697,6 +1704,11 @@ class TestBedRender3 {
1697
1704
  }
1698
1705
  configureTestingModule(moduleDef) {
1699
1706
  this.assertNotInstantiated('R3TestBed.configureTestingModule', 'configure the test module');
1707
+ // Trigger module scoping queue flush before executing other TestBed operations in a test.
1708
+ // This is needed for the first test invocation to ensure that globally declared modules have
1709
+ // their components scoped properly. See the `checkGlobalCompilationFinished` function
1710
+ // description for additional info.
1711
+ this.checkGlobalCompilationFinished();
1700
1712
  // Always re-assign the teardown options, even if they're undefined.
1701
1713
  // This ensures that we don't carry the options between tests.
1702
1714
  this._instanceTeardownOptions = moduleDef.teardown;