From c2ada68956ec533442927d20eaa494ecb6d3a8d1 Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Thu, 16 May 2024 10:07:16 +0200 Subject: [PATCH] fix(core): error about provideExperimentalCheckNoChangesForDebug uses wrong name The error about `provideExperimentalCheckNoChangesForDebug` mentions `provideCheckNoChangesForDebug` instead. --- .../scheduling/exhaustive_check_no_changes.ts | 8 ++++---- packages/core/test/acceptance/change_detection_spec.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts b/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts index 71eab7fe0b4c8..f669e951e3640 100644 --- a/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts +++ b/packages/core/src/change_detection/scheduling/exhaustive_check_no_changes.ts @@ -24,9 +24,9 @@ import {ZONELESS_ENABLED} from './zoneless_scheduling'; * * @param options Used to configure when the check will execute. * - `interval` will periodically run exhaustive `checkNoChanges` on application views - * - `useNgZoneOnStable` will us ZoneJS to determine when change detection might have run + * - `useNgZoneOnStable` will use ZoneJS to determine when change detection might have run * in an application using ZoneJS to drive change detection. When the `NgZone.onStable` would - * have emit, all views attached to the `ApplicationRef` are checked for changes. + * have emitted, all views attached to the `ApplicationRef` are checked for changes. * - 'exhaustive' means that all views attached to `ApplicationRef` and all the descendants of those views will be * checked for changes (excluding those subtrees which are detached via `ChangeDetectorRef.detach()`). * This is useful because the check that runs after regular change detection does not work for components using `ChangeDetectionStrategy.OnPush`. @@ -68,7 +68,7 @@ export function provideExperimentalCheckNoChangesForDebug(options: { !(inject(NgZone) instanceof DebugNgZoneForCheckNoChanges) ) { throw new Error( - '`provideCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.', + '`provideExperimentalCheckNoChangesForDebug` with `useNgZoneOnStable` must be after any other provider for `NgZone`.', ); } }, @@ -87,7 +87,7 @@ export class DebugNgZoneForCheckNoChanges extends NgZone { constructor(private readonly checkNoChangesMode: CheckNoChangesMode) { const zonelessEnabled = inject(ZONELESS_ENABLED); - // Use coalsecing to ensure we aren't ever running this check synchronously + // Use coalescing to ensure we aren't ever running this check synchronously super({ shouldCoalesceEventChangeDetection: true, shouldCoalesceRunChangeDetection: zonelessEnabled, diff --git a/packages/core/test/acceptance/change_detection_spec.ts b/packages/core/test/acceptance/change_detection_spec.ts index 64d6730aacd79..9a4cb6256e31c 100644 --- a/packages/core/test/acceptance/change_detection_spec.ts +++ b/packages/core/test/acceptance/change_detection_spec.ts @@ -1309,7 +1309,7 @@ describe('change detection', () => { expect(comp.viewCheckCount).toEqual(1); }); - describe('provideCheckNoChangesForDebug', () => { + describe('provideExperimentalCheckNoChangesForDebug', () => { // Needed because tests in this repo patch rAF to be setTimeout // and coalescing tries to get the native one but fails so // coalescing will run a timeout in the zone and cause an infinite loop.