@angular/core 20.2.0-next.1 → 20.2.0-next.3
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.d.ts +2 -2
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +2 -1
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/core.mjs +30 -33
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +585 -8
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/resource.mjs +19 -7
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +16 -2
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/signal.mjs +154 -118
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +33 -8
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked.mjs +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/graph.d.d.ts +20 -33
- package/index.d.ts +160 -3
- package/package.json +2 -2
- 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 +1 -1
- package/schematics/bundles/{apply_import_manager-ceekZYTK.cjs → apply_import_manager-C9H5B66Q.cjs} +3 -3
- package/schematics/bundles/{checker-BVY3FNBy.cjs → checker-DBomdQHo.cjs} +720 -195
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-DRAgYPzr.cjs → compiler_host-DTywrGR6.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +3 -3
- package/schematics/bundles/document-core.cjs +5 -5
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-B7rvD9dh.cjs → index-DWQ8GMRM.cjs} +71 -38
- package/schematics/bundles/{index-DkKydW5H.cjs → index-DvIl8s8s.cjs} +4 -4
- package/schematics/bundles/inject-flags.cjs +5 -5
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-BRFh6uWT.cjs → migrate_ts_type_references-BFb3oiAk.cjs} +5 -5
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{project_paths-zgvnBQD8.cjs → project_paths-Cuim0I7i.cjs} +3 -3
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +1 -1
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
- package/schematics/bundles/signal-input-migration.cjs +7 -7
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +4 -4
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -4
- package/signal.d.d.ts +1 -1
- package/testing/index.d.ts +17 -2
- package/weak_ref.d.d.ts +1 -1
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.2.0-next.
|
|
2
|
+
* @license Angular v20.2.0-next.3
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { NgZone, Injectable, DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NoopNgZone, ApplicationRef, getDebugNode, RendererFactory2, Directive, Component, Pipe, NgModule, ReflectionCapabilities, depsTracker, isComponentDefPendingResolution, resolveComponentResources, NgModuleRef, ApplicationInitStatus, LOCALE_ID, DEFAULT_LOCALE_ID, setLocaleId, ComponentFactory, getAsyncClassMetadataFn, compileComponent, compileDirective, compilePipe, patchComponentDefWithScope, compileNgModuleDefs, clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, internalProvideZoneChangeDetection, ChangeDetectionSchedulerImpl, COMPILER_OPTIONS, generateStandaloneInDeclarationsError, transitiveScopesFor, Compiler, DEFER_BLOCK_CONFIG, NgModuleFactory, ModuleWithComponentFactories, resetCompiledComponents, ɵsetUnknownElementStrictMode as _setUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode as _setUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode as _getUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode as _getUnknownPropertyStrictMode, flushModuleScopingQueueAsMuchAsPossible, setAllowDuplicateNgModuleIdsForTest } from './debug_node.mjs';
|
|
8
|
+
import { NgZone, Injectable, DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, NoopNgZone, ApplicationRef, getDebugNode, RendererFactory2, Directive, Component, Pipe, NgModule, ReflectionCapabilities, depsTracker, isComponentDefPendingResolution, resolveComponentResources, NgModuleRef, ApplicationInitStatus, LOCALE_ID, DEFAULT_LOCALE_ID, setLocaleId, ComponentFactory, getAsyncClassMetadataFn, compileComponent, compileDirective, compilePipe, patchComponentDefWithScope, compileNgModuleDefs, clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, internalProvideZoneChangeDetection, ChangeDetectionSchedulerImpl, COMPILER_OPTIONS, generateStandaloneInDeclarationsError, transitiveScopesFor, Compiler, DEFER_BLOCK_CONFIG, ANIMATIONS_DISABLED, NgModuleFactory, ModuleWithComponentFactories, resetCompiledComponents, ɵsetUnknownElementStrictMode as _setUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode as _setUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode as _getUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode as _getUnknownPropertyStrictMode, inferTagNameFromDefinition, flushModuleScopingQueueAsMuchAsPossible, setAllowDuplicateNgModuleIdsForTest } from './debug_node.mjs';
|
|
9
9
|
import { Subscription } from 'rxjs';
|
|
10
|
-
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, Injector, isEnvironmentProviders, INTERNAL_APPLICATION_ERROR_HANDLER, runInInjectionContext } from './root_effect_scheduler.mjs';
|
|
10
|
+
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, Injector, isEnvironmentProviders, INTERNAL_APPLICATION_ERROR_HANDLER, runInInjectionContext, getComponentDef as getComponentDef$1 } from './root_effect_scheduler.mjs';
|
|
11
11
|
import { ResourceLoader } from '@angular/compiler';
|
|
12
12
|
import './signal.mjs';
|
|
13
13
|
import '@angular/core/primitives/signals';
|
|
@@ -174,13 +174,15 @@ const THROW_ON_UNKNOWN_ELEMENTS_DEFAULT = false;
|
|
|
174
174
|
const THROW_ON_UNKNOWN_PROPERTIES_DEFAULT = false;
|
|
175
175
|
/** Whether defer blocks should use manual triggering or play through normally. */
|
|
176
176
|
const DEFER_BLOCK_DEFAULT_BEHAVIOR = DeferBlockBehavior.Playthrough;
|
|
177
|
+
/** Whether animations are enabled or disabled. */
|
|
178
|
+
const ANIMATIONS_ENABLED_DEFAULT = false;
|
|
177
179
|
/**
|
|
178
180
|
* An abstract class for inserting the root test component element in a platform independent way.
|
|
179
181
|
*
|
|
180
182
|
* @publicApi
|
|
181
183
|
*/
|
|
182
184
|
class TestComponentRenderer {
|
|
183
|
-
insertRootElement(rootElementId) { }
|
|
185
|
+
insertRootElement(rootElementId, tagName) { }
|
|
184
186
|
removeAllRootElements() { }
|
|
185
187
|
}
|
|
186
188
|
/**
|
|
@@ -827,6 +829,7 @@ class TestBedCompiler {
|
|
|
827
829
|
scopesWithOverriddenProviders = new Set();
|
|
828
830
|
testModuleType;
|
|
829
831
|
testModuleRef = null;
|
|
832
|
+
animationsEnabled = ANIMATIONS_ENABLED_DEFAULT;
|
|
830
833
|
deferBlockBehavior = DEFER_BLOCK_DEFAULT_BEHAVIOR;
|
|
831
834
|
rethrowApplicationTickErrors = RETHROW_APPLICATION_ERRORS_DEFAULT;
|
|
832
835
|
constructor(platform, additionalModuleTypes) {
|
|
@@ -860,6 +863,7 @@ class TestBedCompiler {
|
|
|
860
863
|
this.schemas.push(...moduleDef.schemas);
|
|
861
864
|
}
|
|
862
865
|
this.deferBlockBehavior = moduleDef.deferBlockBehavior ?? DEFER_BLOCK_DEFAULT_BEHAVIOR;
|
|
866
|
+
this.animationsEnabled = moduleDef.animationsEnabled ?? ANIMATIONS_ENABLED_DEFAULT;
|
|
863
867
|
this.rethrowApplicationTickErrors =
|
|
864
868
|
moduleDef.rethrowApplicationErrors ?? RETHROW_APPLICATION_ERRORS_DEFAULT;
|
|
865
869
|
}
|
|
@@ -1477,6 +1481,10 @@ class TestBedCompiler {
|
|
|
1477
1481
|
const providers = [
|
|
1478
1482
|
{ provide: Compiler, useFactory: () => new R3TestCompiler(this) },
|
|
1479
1483
|
{ provide: DEFER_BLOCK_CONFIG, useValue: { behavior: this.deferBlockBehavior } },
|
|
1484
|
+
{
|
|
1485
|
+
provide: ANIMATIONS_DISABLED,
|
|
1486
|
+
useValue: !this.animationsEnabled,
|
|
1487
|
+
},
|
|
1480
1488
|
{
|
|
1481
1489
|
provide: INTERNAL_APPLICATION_ERROR_HANDLER,
|
|
1482
1490
|
useFactory: () => {
|
|
@@ -1732,6 +1740,10 @@ class TestBedImpl {
|
|
|
1732
1740
|
* or set to play through.
|
|
1733
1741
|
*/
|
|
1734
1742
|
_instanceDeferBlockBehavior = DEFER_BLOCK_DEFAULT_BEHAVIOR;
|
|
1743
|
+
/**
|
|
1744
|
+
* Animations behavior option that specifies whether animations are enabled or disabled.
|
|
1745
|
+
*/
|
|
1746
|
+
_instanceAnimationsEnabled = ANIMATIONS_ENABLED_DEFAULT;
|
|
1735
1747
|
/**
|
|
1736
1748
|
* "Error on unknown elements" option that has been configured at the `TestBed` instance level.
|
|
1737
1749
|
* This option takes precedence over the environment-level one.
|
|
@@ -1752,6 +1764,10 @@ class TestBedImpl {
|
|
|
1752
1764
|
* allowing to restore it in the reset testing module logic.
|
|
1753
1765
|
*/
|
|
1754
1766
|
_previousErrorOnUnknownPropertiesOption;
|
|
1767
|
+
/**
|
|
1768
|
+
* Stores the value for `inferTagName` from the testing module.
|
|
1769
|
+
*/
|
|
1770
|
+
_instanceInferTagName;
|
|
1755
1771
|
/**
|
|
1756
1772
|
* Initialize the environment for testing with a compiler factory, a PlatformRef, and an
|
|
1757
1773
|
* angular module. These are common to every test in the suite.
|
|
@@ -1937,7 +1953,9 @@ class TestBedImpl {
|
|
|
1937
1953
|
this._instanceTeardownOptions = undefined;
|
|
1938
1954
|
this._instanceErrorOnUnknownElementsOption = undefined;
|
|
1939
1955
|
this._instanceErrorOnUnknownPropertiesOption = undefined;
|
|
1956
|
+
this._instanceInferTagName = undefined;
|
|
1940
1957
|
this._instanceDeferBlockBehavior = DEFER_BLOCK_DEFAULT_BEHAVIOR;
|
|
1958
|
+
this._instanceAnimationsEnabled = ANIMATIONS_ENABLED_DEFAULT;
|
|
1941
1959
|
}
|
|
1942
1960
|
}
|
|
1943
1961
|
return this;
|
|
@@ -1963,7 +1981,9 @@ class TestBedImpl {
|
|
|
1963
1981
|
this._instanceTeardownOptions = moduleDef.teardown;
|
|
1964
1982
|
this._instanceErrorOnUnknownElementsOption = moduleDef.errorOnUnknownElements;
|
|
1965
1983
|
this._instanceErrorOnUnknownPropertiesOption = moduleDef.errorOnUnknownProperties;
|
|
1984
|
+
this._instanceInferTagName = moduleDef.inferTagName;
|
|
1966
1985
|
this._instanceDeferBlockBehavior = moduleDef.deferBlockBehavior ?? DEFER_BLOCK_DEFAULT_BEHAVIOR;
|
|
1986
|
+
this._instanceAnimationsEnabled = moduleDef.animationsEnabled ?? ANIMATIONS_ENABLED_DEFAULT;
|
|
1967
1987
|
// Store the current value of the strict mode option,
|
|
1968
1988
|
// so we can restore it later
|
|
1969
1989
|
this._previousErrorOnUnknownElementsOption = _getUnknownElementStrictMode();
|
|
@@ -2030,17 +2050,19 @@ class TestBedImpl {
|
|
|
2030
2050
|
return this.overrideComponent(component, { set: { template, templateUrl: null } });
|
|
2031
2051
|
}
|
|
2032
2052
|
createComponent(type, options) {
|
|
2033
|
-
const testComponentRenderer = this.inject(TestComponentRenderer);
|
|
2034
|
-
const rootElId = `root${_nextRootElementId++}`;
|
|
2035
|
-
testComponentRenderer.insertRootElement(rootElId);
|
|
2036
2053
|
if (getAsyncClassMetadataFn(type)) {
|
|
2037
2054
|
throw new Error(`Component '${type.name}' has unresolved metadata. ` +
|
|
2038
2055
|
`Please call \`await TestBed.compileComponents()\` before running this test.`);
|
|
2039
2056
|
}
|
|
2040
|
-
|
|
2057
|
+
// Note: injecting the renderer before accessing the definition appears to be load-bearing.
|
|
2058
|
+
const testComponentRenderer = this.inject(TestComponentRenderer);
|
|
2059
|
+
const shouldInferTagName = options?.inferTagName ?? this._instanceInferTagName ?? false;
|
|
2060
|
+
const componentDef = getComponentDef$1(type);
|
|
2061
|
+
const rootElId = `root${_nextRootElementId++}`;
|
|
2041
2062
|
if (!componentDef) {
|
|
2042
2063
|
throw new Error(`It looks like '${stringify(type)}' has not been compiled.`);
|
|
2043
2064
|
}
|
|
2065
|
+
testComponentRenderer.insertRootElement(rootElId, shouldInferTagName ? inferTagNameFromDefinition(componentDef) : undefined);
|
|
2044
2066
|
const componentFactory = new ComponentFactory(componentDef);
|
|
2045
2067
|
const initComponent = () => {
|
|
2046
2068
|
const componentRef = componentFactory.create(Injector.NULL, [], `#${rootElId}`, this.testModuleRef, undefined, options?.bindings);
|
|
@@ -2150,6 +2172,9 @@ class TestBedImpl {
|
|
|
2150
2172
|
getDeferBlockBehavior() {
|
|
2151
2173
|
return this._instanceDeferBlockBehavior;
|
|
2152
2174
|
}
|
|
2175
|
+
getAnimationsEnabled() {
|
|
2176
|
+
return this._instanceAnimationsEnabled;
|
|
2177
|
+
}
|
|
2153
2178
|
tearDownTestingModule() {
|
|
2154
2179
|
// If the module ref has already been destroyed, we won't be able to get a test renderer.
|
|
2155
2180
|
if (this._testModuleRef === null) {
|