@angular/core 18.0.0-next.4 → 18.0.0-next.5

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 (40) hide show
  1. package/esm2022/src/application/application_ref.mjs +4 -2
  2. package/esm2022/src/change_detection/scheduling/flags.mjs +10 -0
  3. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +18 -33
  4. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
  5. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +64 -7
  6. package/esm2022/src/core.mjs +2 -1
  7. package/esm2022/src/core_private_export.mjs +1 -3
  8. package/esm2022/src/debug/debug_node.mjs +1 -1
  9. package/esm2022/src/metadata/directives.mjs +1 -62
  10. package/esm2022/src/platform/platform_ref.mjs +3 -3
  11. package/esm2022/src/render3/component_ref.mjs +1 -1
  12. package/esm2022/src/render3/instructions/control_flow.mjs +6 -6
  13. package/esm2022/src/testability/testability.mjs +2 -30
  14. package/esm2022/src/util/callback_scheduler.mjs +3 -3
  15. package/esm2022/src/version.mjs +1 -1
  16. package/esm2022/testing/src/component_fixture.mjs +7 -12
  17. package/esm2022/testing/src/logger.mjs +3 -3
  18. package/esm2022/testing/src/test_bed_common.mjs +1 -6
  19. package/esm2022/testing/src/testing.mjs +1 -2
  20. package/event-dispatch-contract.min.js +1 -0
  21. package/fesm2022/core.mjs +99 -142
  22. package/fesm2022/core.mjs.map +1 -1
  23. package/fesm2022/primitives/signals.mjs +1 -1
  24. package/fesm2022/rxjs-interop.mjs +1 -1
  25. package/fesm2022/testing.mjs +34 -44
  26. package/fesm2022/testing.mjs.map +1 -1
  27. package/index.d.ts +127 -105
  28. package/package.json +4 -1
  29. package/primitives/signals/index.d.ts +1 -1
  30. package/rxjs-interop/index.d.ts +1 -1
  31. package/schematics/migrations/block-template-entities/bundle.js +27 -72
  32. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  33. package/schematics/migrations/invalid-two-way-bindings/bundle.js +32 -77
  34. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +3 -3
  35. package/schematics/ng-generate/control-flow-migration/bundle.js +27 -73
  36. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  37. package/schematics/ng-generate/standalone-migration/bundle.js +54 -87
  38. package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
  39. package/testing/index.d.ts +1 -7
  40. package/esm2022/testing/src/private_export.mjs +0 -9
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.4
2
+ * @license Angular v18.0.0-next.5
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.4
2
+ * @license Angular v18.0.0-next.5
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,46 +1,15 @@
1
1
  /**
2
- * @license Angular v18.0.0-next.4
2
+ * @license Angular v18.0.0-next.5
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ɵDeferBlockBehavior, InjectionToken, ɵDeferBlockState, ɵtriggerResourceLoading, ɵrenderDeferBlockState, ɵCONTAINER_HEADER_OFFSET, ɵgetDeferBlocks, inject as inject$1, ɵNoopNgZone, NgZone, ɵEffectScheduler, ApplicationRef, ɵPendingTasks, getDebugNode, RendererFactory2, ɵdetectChangesInViewIfRequired, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetAsyncClassMetadataFn, ɵgenerateStandaloneInDeclarationsError, ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ɵdepsTracker, ɵgetInjectableDef, resolveForwardRef, ɵNG_COMP_DEF, ɵisComponentDefPendingResolution, ɵresolveComponentResources, ɵ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, ɵclearResolutionOfComponentResourcesQueue, ɵrestoreComponentResolutionQueue, provideZoneChangeDetection, Compiler, ɵDEFER_BLOCK_CONFIG, COMPILER_OPTIONS, Injector, ɵisEnvironmentProviders, ɵNgModuleFactory, ModuleWithComponentFactories, ɵconvertToBitFlags, InjectFlags, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, runInInjectionContext, EnvironmentInjector, ɵZONELESS_ENABLED, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
7
+ import { ɵDeferBlockState, ɵtriggerResourceLoading, ɵrenderDeferBlockState, ɵCONTAINER_HEADER_OFFSET, ɵgetDeferBlocks, ɵDeferBlockBehavior, InjectionToken, inject as inject$1, ɵNoopNgZone, NgZone, ɵEffectScheduler, ApplicationRef, ɵPendingTasks, getDebugNode, RendererFactory2, ɵdetectChangesInViewIfRequired, ɵstringify, ɵReflectionCapabilities, Directive, Component, Pipe, NgModule, ɵgetAsyncClassMetadataFn, ɵgenerateStandaloneInDeclarationsError, ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ɵdepsTracker, ɵgetInjectableDef, resolveForwardRef, ɵNG_COMP_DEF, ɵisComponentDefPendingResolution, ɵresolveComponentResources, ɵ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, ɵclearResolutionOfComponentResourcesQueue, ɵrestoreComponentResolutionQueue, provideZoneChangeDetection, Compiler, ɵDEFER_BLOCK_CONFIG, COMPILER_OPTIONS, Injector, ɵisEnvironmentProviders, ɵNgModuleFactory, ModuleWithComponentFactories, ɵconvertToBitFlags, InjectFlags, ɵsetAllowDuplicateNgModuleIdsForTest, ɵresetCompiledComponents, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, runInInjectionContext, EnvironmentInjector, ɵZONELESS_ENABLED, ɵflushModuleScopingQueueAsMuchAsPossible } from '@angular/core';
8
8
  export { ɵDeferBlockBehavior as DeferBlockBehavior, ɵDeferBlockState as DeferBlockState } from '@angular/core';
9
9
  import { Subscription } from 'rxjs';
10
10
  import { first } from 'rxjs/operators';
11
11
  import { ResourceLoader } from '@angular/compiler';
12
12
 
13
- /** Whether test modules should be torn down by default. */
14
- const TEARDOWN_TESTING_MODULE_ON_DESTROY_DEFAULT = true;
15
- /** Whether unknown elements in templates should throw by default. */
16
- const THROW_ON_UNKNOWN_ELEMENTS_DEFAULT = false;
17
- /** Whether unknown properties in templates should throw by default. */
18
- const THROW_ON_UNKNOWN_PROPERTIES_DEFAULT = false;
19
- /** Whether defer blocks should use manual triggering or play through normally. */
20
- const DEFER_BLOCK_DEFAULT_BEHAVIOR = ɵDeferBlockBehavior.Playthrough;
21
- /**
22
- * An abstract class for inserting the root test component element in a platform independent way.
23
- *
24
- * @publicApi
25
- */
26
- class TestComponentRenderer {
27
- insertRootElement(rootElementId) { }
28
- removeAllRootElements() { }
29
- }
30
- /**
31
- * @publicApi
32
- */
33
- const ComponentFixtureAutoDetect = new InjectionToken('ComponentFixtureAutoDetect');
34
- /**
35
- * TODO(atscott): Make public API once we have decided if we want this error and how we want devs to
36
- * disable it.
37
- */
38
- const AllowDetectChangesAndAcknowledgeItCanHideApplicationBugs = new InjectionToken('AllowDetectChangesAndAcknowledgeItCanHideApplicationBugs');
39
- /**
40
- * @publicApi
41
- */
42
- const ComponentFixtureNoNgZone = new InjectionToken('ComponentFixtureNoNgZone');
43
-
44
13
  /**
45
14
  * Wraps a test function in an asynchronous test zone. The test will automatically
46
15
  * complete when all asynchronous calls within this zone are done. Can be used
@@ -163,6 +132,32 @@ function getDeferBlockStateNameFromEnum(state) {
163
132
  }
164
133
  }
165
134
 
135
+ /** Whether test modules should be torn down by default. */
136
+ const TEARDOWN_TESTING_MODULE_ON_DESTROY_DEFAULT = true;
137
+ /** Whether unknown elements in templates should throw by default. */
138
+ const THROW_ON_UNKNOWN_ELEMENTS_DEFAULT = false;
139
+ /** Whether unknown properties in templates should throw by default. */
140
+ const THROW_ON_UNKNOWN_PROPERTIES_DEFAULT = false;
141
+ /** Whether defer blocks should use manual triggering or play through normally. */
142
+ const DEFER_BLOCK_DEFAULT_BEHAVIOR = ɵDeferBlockBehavior.Playthrough;
143
+ /**
144
+ * An abstract class for inserting the root test component element in a platform independent way.
145
+ *
146
+ * @publicApi
147
+ */
148
+ class TestComponentRenderer {
149
+ insertRootElement(rootElementId) { }
150
+ removeAllRootElements() { }
151
+ }
152
+ /**
153
+ * @publicApi
154
+ */
155
+ const ComponentFixtureAutoDetect = new InjectionToken('ComponentFixtureAutoDetect');
156
+ /**
157
+ * @publicApi
158
+ */
159
+ const ComponentFixtureNoNgZone = new InjectionToken('ComponentFixtureNoNgZone');
160
+
166
161
  /**
167
162
  * Fixture for debugging and testing a component.
168
163
  *
@@ -272,19 +267,11 @@ class ComponentFixture {
272
267
  * `ApplicationRef.isStable`, and `autoDetectChanges` cannot be disabled.
273
268
  */
274
269
  class ScheduledComponentFixture extends ComponentFixture {
275
- constructor() {
276
- super(...arguments);
277
- this.disableDetectChangesError = inject$1(AllowDetectChangesAndAcknowledgeItCanHideApplicationBugs, { optional: true }) ?? false;
278
- }
279
270
  initialize() {
280
271
  this._appRef.attachView(this.componentRef.hostView);
281
272
  }
282
273
  detectChanges(checkNoChanges = true) {
283
- if (!this.disableDetectChangesError) {
284
- throw new Error('Do not use `detectChanges` directly when using zoneless change detection.' +
285
- ' Instead, wait for the next render or `fixture.whenStable`.');
286
- }
287
- else if (!checkNoChanges) {
274
+ if (!checkNoChanges) {
288
275
  throw new Error('Cannot disable `checkNoChanges` in this configuration. ' +
289
276
  'Use `fixture.componentRef.hostView.changeDetectorRef.detectChanges()` instead.');
290
277
  }
@@ -293,7 +280,10 @@ class ScheduledComponentFixture extends ComponentFixture {
293
280
  this._effectRunner.flush();
294
281
  }
295
282
  autoDetectChanges(autoDetect) {
296
- throw new Error('Cannot call autoDetectChanges when using change detection scheduling.');
283
+ if (!autoDetect) {
284
+ throw new Error('Cannot disable autoDetect when using the zoneless scheduler.');
285
+ }
286
+ this.detectChanges();
297
287
  }
298
288
  }
299
289
  /**
@@ -2248,5 +2238,5 @@ const __core_private_testing_placeholder__ = '';
2248
2238
  * Generated bundle index. Do not edit.
2249
2239
  */
2250
2240
 
2251
- export { ComponentFixture, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, DeferBlockFixture, InjectSetupWrapper, TestBed, TestComponentRenderer, __core_private_testing_placeholder__, async, discardPeriodicTasks, fakeAsync, flush, flushMicrotasks, getTestBed, inject, resetFakeAsyncZone, tick, waitForAsync, withModule, AllowDetectChangesAndAcknowledgeItCanHideApplicationBugs as ɵAllowDetectChangesAndAcknowledgeItCanHideApplicationBugs, MetadataOverrider as ɵMetadataOverrider };
2241
+ export { ComponentFixture, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, DeferBlockFixture, InjectSetupWrapper, TestBed, TestComponentRenderer, __core_private_testing_placeholder__, async, discardPeriodicTasks, fakeAsync, flush, flushMicrotasks, getTestBed, inject, resetFakeAsyncZone, tick, waitForAsync, withModule, MetadataOverrider as ɵMetadataOverrider };
2252
2242
  //# sourceMappingURL=testing.mjs.map