Skip to content

Commit

Permalink
refactor(core): Remove hybrid mode flag
Browse files Browse the repository at this point in the history
this flag is not used anymore so it's being removed
  • Loading branch information
atscott committed May 7, 2024
1 parent 67bb310 commit 5e705f8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 7 additions & 1 deletion packages/core/src/application/create_application.ts
Expand Up @@ -26,6 +26,8 @@ import {NgZone} from '../zone/ng_zone';

import {ApplicationInitStatus} from './application_init';
import {_callAndReportToErrorHandler, ApplicationRef} from './application_ref';
import {ChangeDetectionScheduler} from '../change_detection/scheduling/zoneless_scheduling';
import {ChangeDetectionSchedulerImpl} from '../change_detection/scheduling/zoneless_scheduling_impl';

/**
* Internal create application API that implements the core application creation logic and optional
Expand Down Expand Up @@ -55,7 +57,11 @@ export function internalCreateApplication(config: {

// Create root application injector based on a set of providers configured at the platform
// bootstrap level as well as providers passed to the bootstrap call by a user.
const allAppProviders = [provideZoneChangeDetection(), ...(appProviders || [])];
const allAppProviders = [
provideZoneChangeDetection(),
{provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl},
...(appProviders || []),
];
const adapter = new EnvironmentNgModuleRefAdapter({
providers: allAppProviders,
parent: platformInjector as EnvironmentInjector,
Expand Down
10 changes: 0 additions & 10 deletions packages/core/src/change_detection/scheduling/flags.ts

This file was deleted.

Expand Up @@ -25,7 +25,6 @@ import {performanceMarkFeature} from '../../util/performance';
import {NgZone} from '../../zone';
import {InternalNgZoneOptions} from '../../zone/ng_zone';

import {alwaysProvideZonelessScheduler} from './flags';
import {ChangeDetectionScheduler, ZONELESS_SCHEDULER_DISABLED} from './zoneless_scheduling';
import {ChangeDetectionSchedulerImpl} from './zoneless_scheduling_impl';

Expand Down Expand Up @@ -113,11 +112,6 @@ export function internalProvideZoneChangeDetection({
// Always disable scheduler whenever explicitly disabled, even if another place called
// `provideZoneChangeDetection` without the 'ignore' option.
ignoreChangesOutsideZone === true ? {provide: ZONELESS_SCHEDULER_DISABLED, useValue: true} : [],
// TODO(atscott): This should move to the same places that zone change detection is provided by
// default instead of being in the zone scheduling providers.
alwaysProvideZonelessScheduler || ignoreChangesOutsideZone === false
? {provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl}
: [],
];
}

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/core_private_export.ts
Expand Up @@ -21,6 +21,7 @@ export {
defaultIterableDiffers as ɵdefaultIterableDiffers,
defaultKeyValueDiffers as ɵdefaultKeyValueDiffers,
} from './change_detection/change_detection';
export {ChangeDetectionSchedulerImpl as ɵChangeDetectionSchedulerImpl} from './change_detection/scheduling/zoneless_scheduling_impl';
export {
ChangeDetectionScheduler as ɵChangeDetectionScheduler,
NotificationSource as ɵNotificationSource,
Expand Down
8 changes: 7 additions & 1 deletion packages/core/testing/src/test_bed_compiler.ts
Expand Up @@ -9,6 +9,8 @@
import {ResourceLoader} from '@angular/compiler';
import {
ApplicationInitStatus,
ɵChangeDetectionScheduler as ChangeDetectionScheduler,
ɵChangeDetectionSchedulerImpl as ChangeDetectionSchedulerImpl,
Compiler,
COMPILER_OPTIONS,
Component,
Expand Down Expand Up @@ -927,7 +929,11 @@ export class TestBedCompiler {
private compileTestModule(): void {
class RootScopeModule {}
compileNgModuleDefs(RootScopeModule as NgModuleType<any>, {
providers: [...this.rootProviderOverrides, provideZoneChangeDetection()],
providers: [
...this.rootProviderOverrides,
provideZoneChangeDetection(),
{provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl},
],
});

const providers = [
Expand Down
3 changes: 3 additions & 0 deletions packages/platform-browser/testing/src/browser.ts
Expand Up @@ -15,6 +15,8 @@ import {
platformCore,
provideZoneChangeDetection,
StaticProvider,
ɵChangeDetectionScheduler as ChangeDetectionScheduler,
ɵChangeDetectionSchedulerImpl as ChangeDetectionSchedulerImpl,
} from '@angular/core';
import {BrowserModule, ɵBrowserDomAdapter as BrowserDomAdapter} from '@angular/platform-browser';

Expand Down Expand Up @@ -47,6 +49,7 @@ export const platformBrowserTesting = createPlatformFactory(
providers: [
{provide: APP_ID, useValue: 'a'},
provideZoneChangeDetection(),
{provide: ChangeDetectionScheduler, useExisting: ChangeDetectionSchedulerImpl},
{provide: PlatformLocation, useClass: MockPlatformLocation},
],
})
Expand Down

0 comments on commit 5e705f8

Please sign in to comment.