@angular/core 20.0.0-next.8 → 20.0.0-rc.0
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-KjtSQajV.d.ts → api.d-CRxC7NlU.d.ts} +28 -43
- package/{chrome_dev_tools_performance.d-qv7drdAl.d.ts → chrome_dev_tools_performance.d-B0FzTuRf.d.ts} +7 -1
- package/{discovery.d-vJaEafe4.d.ts → discovery.d-CBxzK1ay.d.ts} +30 -6
- package/event_dispatcher.d-DlbccpYq.d.ts +1 -1
- package/fesm2022/attribute-BWp59EjE.mjs +1 -1
- package/fesm2022/core.mjs +80 -166
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/{debug_node-DEfPCixm.mjs → debug_node-3mmnD06K.mjs} +138 -54
- package/fesm2022/debug_node-3mmnD06K.mjs.map +1 -0
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +2 -2
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +7 -5
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/{resource-DhKtse7l.mjs → resource-nrAenwIA.mjs} +31 -76
- package/fesm2022/resource-nrAenwIA.mjs.map +1 -0
- package/fesm2022/{root_effect_scheduler-BZMWiScf.mjs → root_effect_scheduler-B_EWGyLU.mjs} +20 -12
- package/fesm2022/root_effect_scheduler-B_EWGyLU.mjs.map +1 -0
- package/fesm2022/rxjs-interop.mjs +16 -11
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/{signal-B6pMq7KS.mjs → signal-ePSl6jXn.mjs} +14 -4
- package/fesm2022/{signal-B6pMq7KS.mjs.map → signal-ePSl6jXn.mjs.map} +1 -1
- package/fesm2022/testing.mjs +61 -63
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/{untracked-Bz5WMeU1.mjs → untracked-2ouAFbCz.mjs} +4 -4
- package/fesm2022/untracked-2ouAFbCz.mjs.map +1 -0
- package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
- package/graph.d-BcIOep_B.d.ts +1 -1
- package/index.d.ts +154 -136
- 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 +3 -3
- package/rxjs-interop/index.d.ts +11 -11
- package/schematics/bundles/{apply_import_manager-CaG-_cEq.js → apply_import_manager-Coc7Hewu.js} +3 -3
- package/schematics/bundles/{change_tracker-ISzWfEHN.js → change_tracker-CDJPOAni.js} +3 -3
- package/schematics/bundles/{checker-DV96LHWz.js → checker-BAl7CJ0l.js} +386 -122
- package/schematics/bundles/cleanup-unused-imports.js +6 -6
- package/schematics/bundles/{compiler-BEZ6sUQS.js → compiler-BSv6JWRF.js} +58 -65
- package/schematics/bundles/compiler_host-CAfDJO3W.js +1 -1
- package/schematics/bundles/control-flow-migration.js +2 -2
- package/schematics/bundles/document-core.js +6 -6
- package/schematics/bundles/imports-CIX-JgAN.js +1 -1
- package/schematics/bundles/{index-6wv04ZFQ.js → index-CnKffIJ6.js} +6 -5
- package/schematics/bundles/{index-B1R5GL-k.js → index-CxuDmkeg.js} +421 -317
- package/schematics/bundles/inject-flags.js +6 -6
- package/schematics/bundles/inject-migration.js +4 -4
- package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
- package/schematics/bundles/{migrate_ts_type_references-Dh9TZgTr.js → migrate_ts_type_references-DE1AlxIs.js} +6 -6
- package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
- package/schematics/bundles/nodes-B16H9JUd.js +1 -1
- package/schematics/bundles/output-migration.js +7 -7
- package/schematics/bundles/{project_paths-B-Nevd-p.js → project_paths-Bl-H7Vlb.js} +4 -4
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
- package/schematics/bundles/route-lazy-loading.js +4 -4
- package/schematics/bundles/self-closing-tags-migration.js +5 -5
- package/schematics/bundles/signal-input-migration.js +8 -8
- package/schematics/bundles/signal-queries-migration.js +8 -8
- package/schematics/bundles/signals.js +8 -8
- package/schematics/bundles/standalone-migration.js +5 -5
- package/schematics/bundles/symbol-VPWguRxr.js +1 -1
- package/schematics/bundles/test-bed-get.js +5 -5
- package/{signal.d-E0e5nW1p.d.ts → signal.d-D6VJ67xi.d.ts} +8 -2
- package/testing/index.d.ts +12 -24
- package/weak_ref.d-eGOEP9S1.d.ts +1 -1
- package/fesm2022/debug_node-DEfPCixm.mjs.map +0 -1
- package/fesm2022/resource-DhKtse7l.mjs.map +0 -1
- package/fesm2022/root_effect_scheduler-BZMWiScf.mjs.map +0 -1
- package/fesm2022/untracked-Bz5WMeU1.mjs.map +0 -1
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-
|
|
2
|
+
* @license Angular v20.0.0-rc.0
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { CONTAINER_HEADER_OFFSET, InjectionToken, inject as inject$1, EnvironmentInjector, ErrorHandler, 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-B_EWGyLU.mjs';
|
|
7
8
|
import { Subscription } from 'rxjs';
|
|
8
|
-
import { DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NgZone, Injectable, 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-
|
|
9
|
-
import { CONTAINER_HEADER_OFFSET, InjectionToken, inject as inject$1, EnvironmentInjector, ErrorHandler, 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-BZMWiScf.mjs';
|
|
9
|
+
import { DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NgZone, Injectable, 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-3mmnD06K.mjs';
|
|
10
10
|
import * as i0 from '@angular/core';
|
|
11
11
|
import { ResourceLoader } from '@angular/compiler';
|
|
12
|
-
import './
|
|
12
|
+
import './primitives/di.mjs';
|
|
13
|
+
import './signal-ePSl6jXn.mjs';
|
|
14
|
+
import '@angular/core/primitives/di';
|
|
13
15
|
import '@angular/core/primitives/signals';
|
|
14
16
|
import 'rxjs/operators';
|
|
15
17
|
import './attribute-BWp59EjE.mjs';
|
|
16
|
-
import './primitives/di.mjs';
|
|
17
|
-
import '@angular/core/primitives/di';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Wraps a test function in an asynchronous test zone. The test will automatically
|
|
@@ -1872,9 +1872,6 @@ class TestBedImpl {
|
|
|
1872
1872
|
static get ngModule() {
|
|
1873
1873
|
return TestBedImpl.INSTANCE.ngModule;
|
|
1874
1874
|
}
|
|
1875
|
-
static flushEffects() {
|
|
1876
|
-
return TestBedImpl.INSTANCE.flushEffects();
|
|
1877
|
-
}
|
|
1878
1875
|
static tick() {
|
|
1879
1876
|
return TestBedImpl.INSTANCE.tick();
|
|
1880
1877
|
}
|
|
@@ -2199,14 +2196,6 @@ class TestBedImpl {
|
|
|
2199
2196
|
testRenderer.removeAllRootElements?.();
|
|
2200
2197
|
}
|
|
2201
2198
|
}
|
|
2202
|
-
/**
|
|
2203
|
-
* Execute any pending effects.
|
|
2204
|
-
*
|
|
2205
|
-
* @deprecated use `TestBed.tick()` instead
|
|
2206
|
-
*/
|
|
2207
|
-
flushEffects() {
|
|
2208
|
-
this.inject(EffectScheduler).flush();
|
|
2209
|
-
}
|
|
2210
2199
|
/**
|
|
2211
2200
|
* Execute any pending work required to synchronize model to the UI.
|
|
2212
2201
|
*
|
|
@@ -2292,48 +2281,12 @@ function withModule(moduleDef, fn) {
|
|
|
2292
2281
|
return new InjectSetupWrapper(() => moduleDef);
|
|
2293
2282
|
}
|
|
2294
2283
|
|
|
2295
|
-
/**
|
|
2296
|
-
* Public Test Library for unit testing Angular applications. Assumes that you are running
|
|
2297
|
-
* with Jasmine, Mocha, or a similar framework which exports a beforeEach function and
|
|
2298
|
-
* allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
|
|
2299
|
-
*/
|
|
2300
|
-
// Reset the test providers and the fake async zone before each test.
|
|
2301
|
-
// We keep a guard because somehow this file can make it into a bundle and be executed
|
|
2302
|
-
// beforeEach is only defined when executing the tests
|
|
2303
|
-
globalThis.beforeEach?.(getCleanupHook(false));
|
|
2304
|
-
// We provide both a `beforeEach` and `afterEach`, because the updated behavior for
|
|
2305
|
-
// tearing down the module is supposed to run after the test so that we can associate
|
|
2306
|
-
// teardown errors with the correct test.
|
|
2307
|
-
// We keep a guard because somehow this file can make it into a bundle and be executed
|
|
2308
|
-
// afterEach is only defined when executing the tests
|
|
2309
|
-
globalThis.afterEach?.(getCleanupHook(true));
|
|
2310
|
-
function getCleanupHook(expectedTeardownValue) {
|
|
2311
|
-
return () => {
|
|
2312
|
-
const testBed = TestBedImpl.INSTANCE;
|
|
2313
|
-
if (testBed.shouldTearDownTestingModule() === expectedTeardownValue) {
|
|
2314
|
-
testBed.resetTestingModule();
|
|
2315
|
-
resetFakeAsyncZoneIfExists();
|
|
2316
|
-
}
|
|
2317
|
-
};
|
|
2318
|
-
}
|
|
2319
|
-
/**
|
|
2320
|
-
* This API should be removed. But doing so seems to break `google3` and so it requires a bit of
|
|
2321
|
-
* investigation.
|
|
2322
|
-
*
|
|
2323
|
-
* A work around is to mark it as `@codeGenApi` for now and investigate later.
|
|
2324
|
-
*
|
|
2325
|
-
* @codeGenApi
|
|
2326
|
-
*/
|
|
2327
|
-
// TODO(iminar): Remove this code in a safe way.
|
|
2328
|
-
const __core_private_testing_placeholder__ = '';
|
|
2329
|
-
|
|
2330
2284
|
/**
|
|
2331
2285
|
* Fake implementation of user agent history and navigation behavior. This is a
|
|
2332
2286
|
* high-fidelity implementation of browser behavior that attempts to emulate
|
|
2333
2287
|
* things like traversal delay.
|
|
2334
2288
|
*/
|
|
2335
2289
|
class FakeNavigation {
|
|
2336
|
-
window;
|
|
2337
2290
|
/**
|
|
2338
2291
|
* The fake implementation of an entries array. Only same-document entries
|
|
2339
2292
|
* allowed.
|
|
@@ -2391,9 +2344,30 @@ class FakeNavigation {
|
|
|
2391
2344
|
get canGoForward() {
|
|
2392
2345
|
return this.currentEntryIndex < this.entriesArr.length - 1;
|
|
2393
2346
|
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2347
|
+
createEventTarget;
|
|
2348
|
+
_window;
|
|
2349
|
+
get window() {
|
|
2350
|
+
return this._window;
|
|
2351
|
+
}
|
|
2352
|
+
constructor(doc, startURL) {
|
|
2353
|
+
this.createEventTarget = () => {
|
|
2354
|
+
try {
|
|
2355
|
+
// `document.createElement` because NodeJS `EventTarget` is
|
|
2356
|
+
// incompatible with Domino's `Event`. That is, attempting to
|
|
2357
|
+
// dispatch an event created by Domino's patched `Event` will
|
|
2358
|
+
// throw an error since it is not an instance of a real Node
|
|
2359
|
+
// `Event`.
|
|
2360
|
+
return doc.createElement('div');
|
|
2361
|
+
}
|
|
2362
|
+
catch {
|
|
2363
|
+
// Fallback to a basic EventTarget if `document.createElement`
|
|
2364
|
+
// fails. This can happen with tests that pass in a value for document
|
|
2365
|
+
// that is stubbed.
|
|
2366
|
+
return new EventTarget();
|
|
2367
|
+
}
|
|
2368
|
+
};
|
|
2369
|
+
this._window = document.defaultView ?? this.createEventTarget();
|
|
2370
|
+
this.eventTarget = this.createEventTarget();
|
|
2397
2371
|
// First entry.
|
|
2398
2372
|
this.setInitialEntryForTesting(startURL);
|
|
2399
2373
|
}
|
|
@@ -2405,7 +2379,7 @@ class FakeNavigation {
|
|
|
2405
2379
|
throw new Error('setInitialEntryForTesting can only be called before any ' + 'navigation has occurred');
|
|
2406
2380
|
}
|
|
2407
2381
|
const currentInitialEntry = this.entriesArr[0];
|
|
2408
|
-
this.entriesArr[0] = new FakeNavigationHistoryEntry(this.
|
|
2382
|
+
this.entriesArr[0] = new FakeNavigationHistoryEntry(this.eventTarget, new URL(url).toString(), {
|
|
2409
2383
|
index: 0,
|
|
2410
2384
|
key: currentInitialEntry?.key ?? String(this.nextKey++),
|
|
2411
2385
|
id: currentInitialEntry?.id ?? String(this.nextId++),
|
|
@@ -2672,8 +2646,7 @@ class FakeNavigation {
|
|
|
2672
2646
|
/** Cleans up resources. */
|
|
2673
2647
|
dispose() {
|
|
2674
2648
|
// Recreate eventTarget to release current listeners.
|
|
2675
|
-
|
|
2676
|
-
this.eventTarget = this.window.document.createElement('div');
|
|
2649
|
+
this.eventTarget = this.createEventTarget();
|
|
2677
2650
|
this.disposed = true;
|
|
2678
2651
|
}
|
|
2679
2652
|
/** Returns whether this fake is disposed. */
|
|
@@ -2732,10 +2705,10 @@ class FakeNavigation {
|
|
|
2732
2705
|
const popStateEvent = createPopStateEvent({
|
|
2733
2706
|
state: navigateEvent.destination.getHistoryState(),
|
|
2734
2707
|
});
|
|
2735
|
-
this.
|
|
2708
|
+
this._window.dispatchEvent(popStateEvent);
|
|
2736
2709
|
if (navigateEvent.hashChange) {
|
|
2737
2710
|
const hashchangeEvent = createHashChangeEvent(oldUrl, this.currentEntry.url);
|
|
2738
|
-
this.
|
|
2711
|
+
this._window.dispatchEvent(hashchangeEvent);
|
|
2739
2712
|
}
|
|
2740
2713
|
}
|
|
2741
2714
|
/**
|
|
@@ -2762,7 +2735,7 @@ class FakeNavigation {
|
|
|
2762
2735
|
if (navigationType === 'push' || navigationType === 'replace') {
|
|
2763
2736
|
const index = this.currentEntryIndex;
|
|
2764
2737
|
const key = navigationType === 'push' ? String(this.nextKey++) : this.currentEntry.key;
|
|
2765
|
-
const newNHE = new FakeNavigationHistoryEntry(this.
|
|
2738
|
+
const newNHE = new FakeNavigationHistoryEntry(this.eventTarget, destination.url, {
|
|
2766
2739
|
id: String(this.nextId++),
|
|
2767
2740
|
key,
|
|
2768
2741
|
index,
|
|
@@ -3230,5 +3203,30 @@ class InternalNavigationResult {
|
|
|
3230
3203
|
}
|
|
3231
3204
|
}
|
|
3232
3205
|
|
|
3233
|
-
|
|
3206
|
+
/**
|
|
3207
|
+
* Public Test Library for unit testing Angular applications. Assumes that you are running
|
|
3208
|
+
* with Jasmine, Mocha, or a similar framework which exports a beforeEach function and
|
|
3209
|
+
* allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
|
|
3210
|
+
*/
|
|
3211
|
+
// Reset the test providers and the fake async zone before each test.
|
|
3212
|
+
// We keep a guard because somehow this file can make it into a bundle and be executed
|
|
3213
|
+
// beforeEach is only defined when executing the tests
|
|
3214
|
+
globalThis.beforeEach?.(getCleanupHook(false));
|
|
3215
|
+
// We provide both a `beforeEach` and `afterEach`, because the updated behavior for
|
|
3216
|
+
// tearing down the module is supposed to run after the test so that we can associate
|
|
3217
|
+
// teardown errors with the correct test.
|
|
3218
|
+
// We keep a guard because somehow this file can make it into a bundle and be executed
|
|
3219
|
+
// afterEach is only defined when executing the tests
|
|
3220
|
+
globalThis.afterEach?.(getCleanupHook(true));
|
|
3221
|
+
function getCleanupHook(expectedTeardownValue) {
|
|
3222
|
+
return () => {
|
|
3223
|
+
const testBed = TestBedImpl.INSTANCE;
|
|
3224
|
+
if (testBed.shouldTearDownTestingModule() === expectedTeardownValue) {
|
|
3225
|
+
testBed.resetTestingModule();
|
|
3226
|
+
resetFakeAsyncZoneIfExists();
|
|
3227
|
+
}
|
|
3228
|
+
};
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
export { ComponentFixture, ComponentFixtureAutoDetect, ComponentFixtureNoNgZone, DeferBlockBehavior, DeferBlockFixture, DeferBlockState, InjectSetupWrapper, TestBed, TestComponentRenderer, discardPeriodicTasks, fakeAsync, flush, flushMicrotasks, getTestBed, inject, resetFakeAsyncZone, tick, waitForAsync, withModule, FakeNavigation as ɵFakeNavigation, MetadataOverrider as ɵMetadataOverrider, getCleanupHook as ɵgetCleanupHook };
|
|
3234
3232
|
//# sourceMappingURL=testing.mjs.map
|