Skip to content

Commit a253739

Browse files
authored
refactor(core): Remove zone toggles for test and standalone
The migration is complete internally. All that remains is bootstrapModule
1 parent 07b8e95 commit a253739

File tree

10 files changed

+3
-50
lines changed

10 files changed

+3
-50
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"dist/main.js": 94769,
2+
"dist/main.js": 89237,
33
"dist/polyfills.js": 33802
44
}

packages/core/src/application/create_application.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ import {ProfilerEvent} from '../render3/profiler_types';
2121
import {errorHandlerEnvironmentInitializer} from '../error_handler';
2222
import {RuntimeError, RuntimeErrorCode} from '../errors';
2323
import {PlatformRef} from '../platform/platform_ref';
24-
import {internalProvideZoneChangeDetection} from '../change_detection/scheduling/ng_zone_scheduling';
2524
import {validAppIdInitializer} from './application_tokens';
2625

27-
const ZONELESS_BY_DEFAULT = true;
28-
2926
/**
3027
* Internal create application API that implements the core application creation logic and optional
3128
* bootstrap logic.
@@ -68,7 +65,6 @@ export function internalCreateApplication(config: {
6865
// bootstrap level as well as providers passed to the bootstrap call by a user.
6966
const allAppProviders = [
7067
provideZonelessChangeDetectionInternal(),
71-
ZONELESS_BY_DEFAULT ? [] : internalProvideZoneChangeDetection({}),
7268
errorHandlerEnvironmentInitializer,
7369
...(ngDevMode ? [validAppIdInitializer] : []),
7470
...(appProviders || []),

packages/core/src/platform/bootstrap.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +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_CREATE_APPLICATION = false;
3231
const REQUIRE_ONE_CD_PROVIDER_BOOTSTRAP_MODULE = false;
3332

3433
/**
@@ -106,10 +105,7 @@ export function bootstrap<M>(
106105
);
107106
}
108107
if (!envInjector.get(PROVIDED_ZONELESS) && !envInjector.get(PROVIDED_NG_ZONE)) {
109-
if (
110-
(REQUIRE_ONE_CD_PROVIDER_CREATE_APPLICATION && isApplicationBootstrapConfig(config)) ||
111-
(REQUIRE_ONE_CD_PROVIDER_BOOTSTRAP_MODULE && !isApplicationBootstrapConfig(config))
112-
) {
108+
if (REQUIRE_ONE_CD_PROVIDER_BOOTSTRAP_MODULE && !isApplicationBootstrapConfig(config)) {
113109
throw new Error(
114110
'Missing change detection configuration: ' +
115111
'please add either `provideZoneChangeDetection()` or `provideZonelessChangeDetection()` ' +

packages/core/test/bundling/animations-standalone/bundle.golden_symbols.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@
176176
"NgModuleRef",
177177
"NgOnChangesFeatureImpl",
178178
"NgZone",
179-
"NgZoneChangeDetectionScheduler",
180179
"NodeInjector",
181180
"NodeInjectorDestroyRef",
182181
"NodeInjectorFactory",
@@ -270,10 +269,8 @@
270269
"WebAnimationsPlayer",
271270
"WebAnimationsStyleNormalizer",
272271
"XhrFactory",
273-
"ZONELESS_BY_DEFAULT",
274272
"ZONELESS_ENABLED",
275273
"ZoneAwareEffectScheduler",
276-
"ZoneStablePendingTask",
277274
"\\u0275PRE_STYLE",
278275
"\\u0275\\u0275defineComponent",
279276
"\\u0275\\u0275defineInjectable",
@@ -521,7 +518,6 @@
521518
"getNearestLContainer",
522519
"getNextLContainer",
523520
"getNgDirectiveDef",
524-
"getNgZoneOptions",
525521
"getNodeInjectable",
526522
"getNullInjector",
527523
"getOrBorrowReactiveLViewConsumer",
@@ -588,7 +584,6 @@
588584
"instructionState",
589585
"internalCreateApplication",
590586
"internalImportProvidersFrom",
591-
"internalProvideZoneChangeDetection",
592587
"interpolateParams",
593588
"invalidCssUnitValue",
594589
"invalidDefinition",

packages/core/test/bundling/defer/bundle.golden_symbols.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@
181181
"NgModuleRef",
182182
"NgOnChangesFeatureImpl",
183183
"NgZone",
184-
"NgZoneChangeDetectionScheduler",
185184
"NodeInjector",
186185
"NodeInjectorDestroyRef",
187186
"NodeInjectorFactory",
@@ -244,10 +243,8 @@
244243
"VIEW_REFS",
245244
"ViewEncapsulation",
246245
"ViewRef",
247-
"ZONELESS_BY_DEFAULT",
248246
"ZONELESS_ENABLED",
249247
"ZoneAwareEffectScheduler",
250-
"ZoneStablePendingTask",
251248
"\\u0275\\u0275advance",
252249
"\\u0275\\u0275defer",
253250
"\\u0275\\u0275deferWhen",
@@ -471,7 +468,6 @@
471468
"getNearestLContainer",
472469
"getNextLContainer",
473470
"getNgDirectiveDef",
474-
"getNgZoneOptions",
475471
"getNodeInjectable",
476472
"getNullInjector",
477473
"getOrBorrowReactiveLViewConsumer",
@@ -540,7 +536,6 @@
540536
"instructionState",
541537
"internalCreateApplication",
542538
"internalImportProvidersFrom",
543-
"internalProvideZoneChangeDetection",
544539
"invokeAllTriggerCleanupFns",
545540
"invokeDirectivesHostBindings",
546541
"invokeHostBindingsInCreationMode",

packages/core/test/bundling/hydration/bundle.golden_symbols.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@
158158
"NgModuleRef",
159159
"NgOnChangesFeatureImpl",
160160
"NgZone",
161-
"NgZoneChangeDetectionScheduler",
162161
"NodeInjector",
163162
"NodeInjectorDestroyRef",
164163
"NodeInjectorFactory",
@@ -234,10 +233,8 @@
234233
"ViewEncapsulation",
235234
"ViewRef",
236235
"XhrFactory",
237-
"ZONELESS_BY_DEFAULT",
238236
"ZONELESS_ENABLED",
239237
"ZoneAwareEffectScheduler",
240-
"ZoneStablePendingTask",
241238
"\\u0275\\u0275defineComponent",
242239
"\\u0275\\u0275defineInjectable",
243240
"\\u0275\\u0275directiveInject",
@@ -486,7 +483,6 @@
486483
"getNextLContainer",
487484
"getNgContainerSize",
488485
"getNgDirectiveDef",
489-
"getNgZoneOptions",
490486
"getNoOffsetIndex",
491487
"getNodeInjectable",
492488
"getNullInjector",
@@ -557,7 +553,6 @@
557553
"instructionState",
558554
"internalCreateApplication",
559555
"internalImportProvidersFrom",
560-
"internalProvideZoneChangeDetection",
561556
"invokeDirectivesHostBindings",
562557
"invokeHostBindingsInCreationMode",
563558
"isAngularZoneProperty",

packages/core/test/bundling/router/bundle.golden_symbols.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
"NgModuleRef2",
191191
"NgOnChangesFeatureImpl",
192192
"NgZone",
193-
"NgZoneChangeDetectionScheduler",
194193
"NoLeftoversInUrl",
195194
"NoMatch",
196195
"NodeInjector",
@@ -318,10 +317,8 @@
318317
"ViewRef",
319318
"XSS_SECURITY_URL",
320319
"XhrFactory",
321-
"ZONELESS_BY_DEFAULT",
322320
"ZONELESS_ENABLED",
323321
"ZoneAwareEffectScheduler",
324-
"ZoneStablePendingTask",
325322
"\\u0275EmptyOutletComponent",
326323
"\\u0275\\u0275NgOnChangesFeature",
327324
"\\u0275\\u0275attribute",
@@ -681,7 +678,6 @@
681678
"getNextLContainer",
682679
"getNgDirectiveDef",
683680
"getNgModuleDef",
684-
"getNgZoneOptions",
685681
"getNodeInjectable",
686682
"getNullInjector",
687683
"getOrBorrowReactiveLViewConsumer",
@@ -778,7 +774,6 @@
778774
"instructionState",
779775
"internalCreateApplication",
780776
"internalImportProvidersFrom",
781-
"internalProvideZoneChangeDetection",
782777
"interpolation1",
783778
"invokeDirectivesHostBindings",
784779
"invokeHostBindingsInCreationMode",

packages/core/test/bundling/standalone_bootstrap/bundle.golden_symbols.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129
"NgModuleRef",
130130
"NgOnChangesFeatureImpl",
131131
"NgZone",
132-
"NgZoneChangeDetectionScheduler",
133132
"NodeInjector",
134133
"NodeInjectorDestroyRef",
135134
"NodeInjectorFactory",
@@ -193,10 +192,8 @@
193192
"ViewEncapsulation",
194193
"ViewRef",
195194
"XhrFactory",
196-
"ZONELESS_BY_DEFAULT",
197195
"ZONELESS_ENABLED",
198196
"ZoneAwareEffectScheduler",
199-
"ZoneStablePendingTask",
200197
"\\u0275\\u0275defineComponent",
201198
"\\u0275\\u0275defineInjectable",
202199
"\\u0275\\u0275directiveInject",
@@ -389,7 +386,6 @@
389386
"getNearestLContainer",
390387
"getNextLContainer",
391388
"getNgDirectiveDef",
392-
"getNgZoneOptions",
393389
"getNodeInjectable",
394390
"getNullInjector",
395391
"getOrBorrowReactiveLViewConsumer",
@@ -447,7 +443,6 @@
447443
"instructionState",
448444
"internalCreateApplication",
449445
"internalImportProvidersFrom",
450-
"internalProvideZoneChangeDetection",
451446
"invokeDirectivesHostBindings",
452447
"invokeHostBindingsInCreationMode",
453448
"isAngularZoneProperty",

packages/core/testing/src/test_bed_compiler.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import {
4242
ɵgetInjectableDef as getInjectableDef,
4343
ɵInternalEnvironmentProviders as InternalEnvironmentProviders,
4444
ɵprovideZonelessChangeDetectionInternal as provideZonelessChangeDetectionInternal,
45-
ɵinternalProvideZoneChangeDetection as internalProvideZoneChangeDetection,
4645
ɵisComponentDefPendingResolution,
4746
ɵisEnvironmentProviders as isEnvironmentProviders,
4847
ɵNG_COMP_DEF as NG_COMP_DEF,
@@ -92,8 +91,6 @@ enum TestingModuleOverride {
9291
OVERRIDE_TEMPLATE,
9392
}
9493

95-
const ZONELESS_BY_DEFAULT = true;
96-
9794
function isTestingModuleOverride(value: unknown): value is TestingModuleOverride {
9895
return (
9996
value === TestingModuleOverride.DECLARATION || value === TestingModuleOverride.OVERRIDE_TEMPLATE
@@ -938,7 +935,6 @@ export class TestBedCompiler {
938935
providers: [
939936
...this.rootProviderOverrides,
940937
provideZonelessChangeDetectionInternal(),
941-
ZONELESS_BY_DEFAULT ? [] : internalProvideZoneChangeDetection({}),
942938
TestBedApplicationErrorHandler,
943939
{
944940
provide: ENVIRONMENT_INITIALIZER,

packages/platform-browser/testing/src/browser.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88
import {ɵprovideFakePlatformNavigation} from '@angular/common/testing';
9-
import {
10-
APP_ID,
11-
createPlatformFactory,
12-
NgModule,
13-
StaticProvider,
14-
ɵprovideZonelessChangeDetectionInternal as provideZonelessChangeDetectionInternal,
15-
ɵinternalProvideZoneChangeDetection as internalProvideZoneChangeDetection,
16-
PlatformRef,
17-
} from '@angular/core';
9+
import {APP_ID, createPlatformFactory, NgModule, StaticProvider, PlatformRef} from '@angular/core';
1810
import {TestComponentRenderer} from '@angular/core/testing';
1911
import {BrowserModule, platformBrowser} from '../../index';
2012
import {DOMTestComponentRenderer} from './dom_test_component_renderer';
2113

22-
const ZONELESS_BY_DEFAULT = true;
23-
2414
/**
2515
* Platform for testing
2616
*

0 commit comments

Comments
 (0)