@angular/core 20.0.0-rc.1 → 20.0.0-rc.2
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.
- package/{api.d-BcbEQ58q.d.ts → api.d-B0vztftH.d.ts} +15 -15
- package/{chrome_dev_tools_performance.d-CARNn07P.d.ts → chrome_dev_tools_performance.d-DvzAxqBc.d.ts} +5 -1
- package/{discovery.d-MmZhhuxb.d.ts → discovery.d-Cf_r2Ojk.d.ts} +6 -13
- package/event_dispatcher.d-BReQpZfC.d.ts +1 -1
- package/fesm2022/attribute-BWp59EjE.mjs +1 -1
- package/fesm2022/attribute-BWp59EjE.mjs.map +1 -1
- package/fesm2022/core.mjs +15 -9
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/{debug_node-BTSSF0Vj.mjs → debug_node-Nc-zr65s.mjs} +12163 -12293
- package/fesm2022/debug_node-Nc-zr65s.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/{resource-DdxAP6ca.mjs → resource-DOwetGLU.mjs} +64 -14
- package/fesm2022/resource-DOwetGLU.mjs.map +1 -0
- package/fesm2022/{root_effect_scheduler-CX0Q-uCT.mjs → root_effect_scheduler-BgGHQ80j.mjs} +26 -16
- package/fesm2022/root_effect_scheduler-BgGHQ80j.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +27 -12
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal-ePSl6jXn.mjs +1 -1
- package/fesm2022/signal-ePSl6jXn.mjs.map +1 -1
- package/fesm2022/testing.mjs +43 -26
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-2ouAFbCz.mjs +1 -1
- package/fesm2022/untracked-2ouAFbCz.mjs.map +1 -1
- package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
- package/fesm2022/weak_ref-BaIq-pgY.mjs.map +1 -1
- package/graph.d-BcIOep_B.d.ts +1 -1
- package/index.d.ts +204 -313
- package/package.json +3 -3
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +3 -3
- package/schematics/bundles/{apply_import_manager-BdH8vaIZ.js → apply_import_manager-BqwxKJiu.cjs} +3 -3
- package/schematics/bundles/{change_tracker-C_neAOvN.js → change_tracker-B1qegJFu.cjs} +3 -3
- package/schematics/bundles/{checker-DqG0JVTu.js → checker-DmucNdBi.cjs} +55 -45
- package/schematics/bundles/{cleanup-unused-imports.js → cleanup-unused-imports.cjs} +26 -55
- package/schematics/bundles/{compiler-CWuG67kz.js → compiler-DPq1iS19.cjs} +92 -86
- package/schematics/bundles/{compiler_host-CAfDJO3W.js → compiler_host-CAfDJO3W.cjs} +1 -1
- package/schematics/bundles/{control-flow-migration.js → control-flow-migration.cjs} +4 -4
- package/schematics/bundles/{document-core.js → document-core.cjs} +8 -8
- package/schematics/bundles/{imports-CIX-JgAN.js → imports-CIX-JgAN.cjs} +1 -1
- package/schematics/bundles/{index-CGYcUmPq.js → index-1H-qYSW6.cjs} +80 -34
- package/schematics/bundles/{index-DWcLBEg_.js → index-CFmTQ_wx.cjs} +29 -20
- package/schematics/bundles/{inject-flags.js → inject-flags.cjs} +8 -8
- package/schematics/bundles/{inject-migration.js → inject-migration.cjs} +9 -9
- package/schematics/bundles/{leading_space-D9nQ8UQC.js → leading_space-D9nQ8UQC.cjs} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-DAudyiEk.js → migrate_ts_type_references-B2aJNuIK.cjs} +7 -7
- package/schematics/bundles/{ng_decorators-DznZ5jMl.js → ng_decorators-B5HCqr20.cjs} +2 -2
- package/schematics/bundles/{nodes-B16H9JUd.js → nodes-B16H9JUd.cjs} +1 -1
- package/schematics/bundles/{output-migration.js → output-migration.cjs} +8 -8
- package/schematics/bundles/{project_paths-B3YG5aUz.js → project_paths-DmvzlTQL.cjs} +71 -42
- package/schematics/bundles/{project_tsconfig_paths-CDVxT6Ov.js → project_tsconfig_paths-CDVxT6Ov.cjs} +1 -1
- package/schematics/bundles/{property_name-BBwFuqMe.js → property_name-BBwFuqMe.cjs} +1 -1
- package/schematics/bundles/{route-lazy-loading.js → route-lazy-loading.cjs} +7 -7
- package/schematics/bundles/{self-closing-tags-migration.js → self-closing-tags-migration.cjs} +12 -26
- package/schematics/bundles/{signal-input-migration.js → signal-input-migration.cjs} +20 -16
- package/schematics/bundles/{signal-queries-migration.js → signal-queries-migration.cjs} +10 -10
- package/schematics/bundles/{signals.js → signals.cjs} +13 -13
- package/schematics/bundles/{standalone-migration.js → standalone-migration.cjs} +11 -11
- package/schematics/bundles/{symbol-VPWguRxr.js → symbol-VPWguRxr.cjs} +1 -1
- package/schematics/bundles/{test-bed-get.js → test-bed-get.cjs} +8 -8
- package/schematics/collection.json +9 -9
- package/schematics/migrations.json +4 -4
- package/signal.d-D6VJ67xi.d.ts +1 -1
- package/testing/index.d.ts +18 -4
- package/weak_ref.d-eGOEP9S1.d.ts +1 -1
- package/fesm2022/debug_node-BTSSF0Vj.mjs.map +0 -1
- package/fesm2022/resource-DdxAP6ca.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler-CX0Q-uCT.mjs.map +0 -1
- package/schematics/package.json +0 -3
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-rc.
|
|
2
|
+
* @license Angular v20.0.0-rc.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Subscription } from 'rxjs';
|
|
8
|
-
import { inject as inject$1, EnvironmentInjector, ErrorHandler, CONTAINER_HEADER_OFFSET, InjectionToken, PendingTasksInternal, ZONELESS_ENABLED, ChangeDetectionScheduler, EffectScheduler, stringify, getInjectableDef, resolveForwardRef, NG_COMP_DEF, NG_DIR_DEF, NG_PIPE_DEF, NG_INJ_DEF, NG_MOD_DEF, ENVIRONMENT_INITIALIZER, INTERNAL_APPLICATION_ERROR_HANDLER, Injector, isEnvironmentProviders, runInInjectionContext } from './root_effect_scheduler-
|
|
8
|
+
import { inject as inject$1, EnvironmentInjector, ErrorHandler, CONTAINER_HEADER_OFFSET, InjectionToken, PendingTasksInternal, ZONELESS_ENABLED, ChangeDetectionScheduler, EffectScheduler, stringify, getInjectableDef, resolveForwardRef, NG_COMP_DEF, NG_DIR_DEF, NG_PIPE_DEF, NG_INJ_DEF, NG_MOD_DEF, ENVIRONMENT_INITIALIZER, INTERNAL_APPLICATION_ERROR_HANDLER, Injector, isEnvironmentProviders, runInInjectionContext } from './root_effect_scheduler-BgGHQ80j.mjs';
|
|
9
9
|
import * as i0 from '@angular/core';
|
|
10
|
-
import { NgZone, Injectable, DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NoopNgZone, ApplicationRef, getDebugNode, RendererFactory2, Pipe, Directive, Component, NgModule, ReflectionCapabilities, depsTracker, isComponentDefPendingResolution, getAsyncClassMetadataFn, resolveComponentResources, NgModuleRef, ApplicationInitStatus, LOCALE_ID, DEFAULT_LOCALE_ID, setLocaleId, ComponentFactory, compileComponent, compileDirective, compilePipe, patchComponentDefWithScope, compileNgModuleDefs, clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, internalProvideZoneChangeDetection, ChangeDetectionSchedulerImpl, Compiler, DEFER_BLOCK_CONFIG, COMPILER_OPTIONS, transitiveScopesFor, generateStandaloneInDeclarationsError, NgModuleFactory, ModuleWithComponentFactories, resetCompiledComponents, ɵsetUnknownElementStrictMode as _setUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode as _setUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode as _getUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode as _getUnknownPropertyStrictMode, flushModuleScopingQueueAsMuchAsPossible, setAllowDuplicateNgModuleIdsForTest } from './debug_node-
|
|
10
|
+
import { NgZone, Injectable, DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NoopNgZone, ApplicationRef, getDebugNode, RendererFactory2, Pipe, Directive, Component, NgModule, ReflectionCapabilities, depsTracker, isComponentDefPendingResolution, getAsyncClassMetadataFn, resolveComponentResources, NgModuleRef, ApplicationInitStatus, LOCALE_ID, DEFAULT_LOCALE_ID, setLocaleId, ComponentFactory, compileComponent, compileDirective, compilePipe, patchComponentDefWithScope, compileNgModuleDefs, clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, internalProvideZoneChangeDetection, ChangeDetectionSchedulerImpl, Compiler, DEFER_BLOCK_CONFIG, COMPILER_OPTIONS, transitiveScopesFor, generateStandaloneInDeclarationsError, NgModuleFactory, ModuleWithComponentFactories, resetCompiledComponents, ɵsetUnknownElementStrictMode as _setUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode as _setUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode as _getUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode as _getUnknownPropertyStrictMode, flushModuleScopingQueueAsMuchAsPossible, setAllowDuplicateNgModuleIdsForTest } from './debug_node-Nc-zr65s.mjs';
|
|
11
11
|
import { ResourceLoader } from '@angular/compiler';
|
|
12
12
|
import './primitives/di.mjs';
|
|
13
13
|
import './signal-ePSl6jXn.mjs';
|
|
@@ -253,13 +253,15 @@ class ComponentFixture {
|
|
|
253
253
|
this.componentInstance = componentRef.instance;
|
|
254
254
|
this.nativeElement = this.elementRef.nativeElement;
|
|
255
255
|
this.componentRef = componentRef;
|
|
256
|
+
this._testAppRef.allTestViews.add(this.componentRef.hostView);
|
|
256
257
|
if (this.autoDetect) {
|
|
257
|
-
this._testAppRef.
|
|
258
|
+
this._testAppRef.autoDetectTestViews.add(this.componentRef.hostView);
|
|
258
259
|
this.scheduler?.notify(8 /* ɵNotificationSource.ViewAttached */);
|
|
259
260
|
this.scheduler?.notify(0 /* ɵNotificationSource.MarkAncestorsForTraversal */);
|
|
260
261
|
}
|
|
261
262
|
this.componentRef.hostView.onDestroy(() => {
|
|
262
|
-
this._testAppRef.
|
|
263
|
+
this._testAppRef.allTestViews.delete(this.componentRef.hostView);
|
|
264
|
+
this._testAppRef.autoDetectTestViews.delete(this.componentRef.hostView);
|
|
263
265
|
});
|
|
264
266
|
// Create subscriptions outside the NgZone so that the callbacks run outside
|
|
265
267
|
// of NgZone.
|
|
@@ -293,13 +295,11 @@ class ComponentFixture {
|
|
|
293
295
|
}
|
|
294
296
|
if (this.zonelessEnabled) {
|
|
295
297
|
try {
|
|
296
|
-
this._testAppRef.
|
|
298
|
+
this._testAppRef.includeAllTestViews = true;
|
|
297
299
|
this._appRef.tick();
|
|
298
300
|
}
|
|
299
301
|
finally {
|
|
300
|
-
|
|
301
|
-
this._testAppRef.externalTestViews.delete(this.componentRef.hostView);
|
|
302
|
-
}
|
|
302
|
+
this._testAppRef.includeAllTestViews = false;
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
else {
|
|
@@ -323,24 +323,18 @@ class ComponentFixture {
|
|
|
323
323
|
checkNoChanges() {
|
|
324
324
|
this.changeDetectorRef.checkNoChanges();
|
|
325
325
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Set whether the fixture should autodetect changes.
|
|
328
|
-
*
|
|
329
|
-
* Also runs detectChanges once so that any existing change is detected.
|
|
330
|
-
*
|
|
331
|
-
* @param autoDetect Whether to autodetect changes. By default, `true`.
|
|
332
|
-
*/
|
|
333
326
|
autoDetectChanges(autoDetect = true) {
|
|
327
|
+
if (!autoDetect && this.zonelessEnabled) {
|
|
328
|
+
throw new Error('Cannot set autoDetect to false with zoneless change detection.');
|
|
329
|
+
}
|
|
334
330
|
if (this._noZoneOptionIsSet && !this.zonelessEnabled) {
|
|
335
331
|
throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set.');
|
|
336
332
|
}
|
|
337
|
-
if (autoDetect
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
this._testAppRef.externalTestViews.delete(this.componentRef.hostView);
|
|
343
|
-
}
|
|
333
|
+
if (autoDetect) {
|
|
334
|
+
this._testAppRef.autoDetectTestViews.add(this.componentRef.hostView);
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
this._testAppRef.autoDetectTestViews.delete(this.componentRef.hostView);
|
|
344
338
|
}
|
|
345
339
|
this.autoDetect = autoDetect;
|
|
346
340
|
this.detectChanges();
|
|
@@ -404,7 +398,8 @@ class ComponentFixture {
|
|
|
404
398
|
*/
|
|
405
399
|
destroy() {
|
|
406
400
|
this.subscriptions.unsubscribe();
|
|
407
|
-
this._testAppRef.
|
|
401
|
+
this._testAppRef.autoDetectTestViews.delete(this.componentRef.hostView);
|
|
402
|
+
this._testAppRef.allTestViews.delete(this.componentRef.hostView);
|
|
408
403
|
if (!this._isDestroyed) {
|
|
409
404
|
this.componentRef.destroy();
|
|
410
405
|
this._isDestroyed = true;
|
|
@@ -429,7 +424,7 @@ function resetFakeAsyncZone() {
|
|
|
429
424
|
throw new Error(fakeAsyncTestModuleNotLoadedErrorMessage);
|
|
430
425
|
}
|
|
431
426
|
function resetFakeAsyncZoneIfExists() {
|
|
432
|
-
if (fakeAsyncTestModule) {
|
|
427
|
+
if (fakeAsyncTestModule && Zone['ProxyZoneSpec']?.isLoaded()) {
|
|
433
428
|
fakeAsyncTestModule.resetFakeAsyncZone();
|
|
434
429
|
}
|
|
435
430
|
}
|
|
@@ -1864,6 +1859,9 @@ class TestBedImpl {
|
|
|
1864
1859
|
static get ngModule() {
|
|
1865
1860
|
return TestBedImpl.INSTANCE.ngModule;
|
|
1866
1861
|
}
|
|
1862
|
+
static flushEffects() {
|
|
1863
|
+
return TestBedImpl.INSTANCE.tick();
|
|
1864
|
+
}
|
|
1867
1865
|
static tick() {
|
|
1868
1866
|
return TestBedImpl.INSTANCE.tick();
|
|
1869
1867
|
}
|
|
@@ -2188,13 +2186,32 @@ class TestBedImpl {
|
|
|
2188
2186
|
testRenderer.removeAllRootElements?.();
|
|
2189
2187
|
}
|
|
2190
2188
|
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Execute any pending effects by executing any pending work required to synchronize model to the UI.
|
|
2191
|
+
*
|
|
2192
|
+
* @deprecated use `TestBed.tick()` instead
|
|
2193
|
+
*/
|
|
2194
|
+
flushEffects() {
|
|
2195
|
+
this.tick();
|
|
2196
|
+
}
|
|
2191
2197
|
/**
|
|
2192
2198
|
* Execute any pending work required to synchronize model to the UI.
|
|
2193
2199
|
*
|
|
2194
2200
|
* @publicApi
|
|
2195
2201
|
*/
|
|
2196
2202
|
tick() {
|
|
2197
|
-
this.inject(ApplicationRef)
|
|
2203
|
+
const appRef = this.inject(ApplicationRef);
|
|
2204
|
+
try {
|
|
2205
|
+
// TODO(atscott): ApplicationRef.tick should set includeAllTestViews to true itself rather than doing this here and in ComponentFixture
|
|
2206
|
+
// The behavior should be that TestBed.tick, ComponentFixture.detectChanges, and ApplicationRef.tick all result in the test fixtures
|
|
2207
|
+
// getting synchronized, regardless of whether they are autoDetect: true.
|
|
2208
|
+
// Automatic scheduling (zone or zoneless) will call _tick which will _not_ include fixtures with autoDetect: false
|
|
2209
|
+
appRef.includeAllTestViews = true;
|
|
2210
|
+
appRef.tick();
|
|
2211
|
+
}
|
|
2212
|
+
finally {
|
|
2213
|
+
appRef.includeAllTestViews = false;
|
|
2214
|
+
}
|
|
2198
2215
|
}
|
|
2199
2216
|
}
|
|
2200
2217
|
/**
|