Skip to content

Commit 51ebe9a

Browse files
atscottkirjs
authored andcommitted
refactor(core): Remove toggles used for zoneless by default migration
this migration is complete both internally and externally
1 parent ca6ab6c commit 51ebe9a

2 files changed

Lines changed: 1 addition & 30 deletions

File tree

packages/core/src/platform/bootstrap.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import {stringify} from '../util/stringify';
2828
import {isPromise} from '../util/lang';
2929
import {PendingTasksInternal} from '../pending_tasks_internal';
3030

31-
const REQUIRE_ONE_CD_PROVIDER_BOOTSTRAP_MODULE = false;
32-
3331
/**
3432
* InjectionToken to control root component bootstrap behavior.
3533
*
@@ -104,15 +102,6 @@ export function bootstrap<M>(
104102
),
105103
);
106104
}
107-
if (!envInjector.get(PROVIDED_ZONELESS) && !envInjector.get(PROVIDED_NG_ZONE)) {
108-
if (REQUIRE_ONE_CD_PROVIDER_BOOTSTRAP_MODULE && !isApplicationBootstrapConfig(config)) {
109-
throw new Error(
110-
'Missing change detection configuration: ' +
111-
'please add either `provideZoneChangeDetection()` or `provideZonelessChangeDetection()` ' +
112-
"to the list of root providers in your application's bootstrap code.",
113-
);
114-
}
115-
}
116105
}
117106

118107
let onErrorSubscription: Subscription;

packages/core/src/platform/platform_ref.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {compileNgModuleFactory} from '../application/application_ngmodule_factor
1010
import {BootstrapOptions, optionsReducer} from '../application/application_ref';
1111
import {validAppIdInitializer} from '../application/application_tokens';
1212
import {provideZonelessChangeDetectionInternal} from '../change_detection/scheduling/zoneless_scheduling_impl';
13-
import {EnvironmentProviders, Injectable, Injector, Provider, StaticProvider} from '../di';
13+
import {EnvironmentProviders, Injectable, Injector, Provider} from '../di';
1414
import {errorHandlerEnvironmentInitializer} from '../error_handler';
1515
import {RuntimeError, RuntimeErrorCode} from '../errors';
1616
import {Type} from '../interface/type';
@@ -19,11 +19,6 @@ import {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';
1919
import {createNgModuleRefWithProviders} from '../render3/ng_module_ref';
2020
import {bootstrap, setModuleBootstrapImpl} from './bootstrap';
2121
import {PLATFORM_DESTROY_LISTENERS} from './platform_destroy_listeners';
22-
import {
23-
getNgZoneOptions,
24-
internalProvideZoneChangeDetection,
25-
} from '../change_detection/scheduling/ng_zone_scheduling';
26-
import {getNgZone} from '../zone/ng_zone';
2722

2823
/**
2924
* The Angular platform is the entry point for Angular on a web page.
@@ -53,21 +48,8 @@ export class PlatformRef {
5348
moduleFactory: NgModuleFactory<M>,
5449
options?: BootstrapOptions & {applicationProviders?: Array<Provider | EnvironmentProviders>},
5550
): Promise<NgModuleRef<M>> {
56-
const defaultZoneCdProviders = [];
57-
const ZONELESS_BY_DEFAULT = true;
58-
if (!ZONELESS_BY_DEFAULT) {
59-
const ngZoneFactory = () =>
60-
getNgZone(options?.ngZone, {
61-
...getNgZoneOptions({
62-
eventCoalescing: options?.ngZoneEventCoalescing,
63-
runCoalescing: options?.ngZoneRunCoalescing,
64-
}),
65-
});
66-
defaultZoneCdProviders.push(internalProvideZoneChangeDetection({ngZoneFactory}));
67-
}
6851
const allAppProviders = [
6952
provideZonelessChangeDetectionInternal(),
70-
...defaultZoneCdProviders,
7153
...(options?.applicationProviders ?? []),
7254
errorHandlerEnvironmentInitializer,
7355
...(ngDevMode ? [validAppIdInitializer] : []),

0 commit comments

Comments
 (0)