@angular/core 14.2.0-next.0 → 14.2.0-next.1
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/esm2020/src/application_ref.mjs +2 -2
- package/esm2020/src/core_render3_private_export.mjs +4 -4
- package/esm2020/src/di/interface/defs.mjs +4 -1
- package/esm2020/src/render3/component_ref.mjs +4 -31
- package/esm2020/src/render3/definition.mjs +5 -5
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +3 -19
- package/esm2020/src/render3/instructions/shared.mjs +10 -50
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/jit/module.mjs +2 -6
- package/esm2020/src/render3/util/change_detection_utils.mjs +7 -3
- package/esm2020/src/render3/util/misc_utils.mjs +1 -7
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +23 -108
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +20 -106
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +23 -108
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +20 -106
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +3 -97
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/esm2020/src/render3/interfaces/player.mjs +0 -9
package/fesm2015/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.2.0-next.
|
|
2
|
+
* @license Angular v14.2.0-next.1
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -835,6 +835,9 @@ function ɵɵdefineInjector(options) {
|
|
|
835
835
|
function getInjectableDef(type) {
|
|
836
836
|
return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);
|
|
837
837
|
}
|
|
838
|
+
function isInjectable(type) {
|
|
839
|
+
return getInjectableDef(type) !== null;
|
|
840
|
+
}
|
|
838
841
|
/**
|
|
839
842
|
* Return definition only if it is defined directly on `type` and is not inherited from a base
|
|
840
843
|
* class of `type`.
|
|
@@ -2605,7 +2608,6 @@ function extractDirectiveDef(type) {
|
|
|
2605
2608
|
function nonNull(value) {
|
|
2606
2609
|
return value !== null;
|
|
2607
2610
|
}
|
|
2608
|
-
const autoRegisterModuleById = {};
|
|
2609
2611
|
/**
|
|
2610
2612
|
* @codeGenApi
|
|
2611
2613
|
*/
|
|
@@ -2621,9 +2623,6 @@ function ɵɵdefineNgModule(def) {
|
|
|
2621
2623
|
schemas: def.schemas || null,
|
|
2622
2624
|
id: def.id || null,
|
|
2623
2625
|
};
|
|
2624
|
-
if (def.id != null) {
|
|
2625
|
-
autoRegisterModuleById[def.id] = def.type;
|
|
2626
|
-
}
|
|
2627
2626
|
return res;
|
|
2628
2627
|
});
|
|
2629
2628
|
}
|
|
@@ -2777,6 +2776,10 @@ function getDirectiveDef(type) {
|
|
|
2777
2776
|
function getPipeDef$1(type) {
|
|
2778
2777
|
return type[NG_PIPE_DEF] || null;
|
|
2779
2778
|
}
|
|
2779
|
+
function isStandalone(type) {
|
|
2780
|
+
const def = getComponentDef$1(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
2781
|
+
return def !== null ? def.standalone : false;
|
|
2782
|
+
}
|
|
2780
2783
|
function getNgModuleDef(type, throwNotFound) {
|
|
2781
2784
|
const ngModuleDef = type[NG_MOD_DEF] || null;
|
|
2782
2785
|
if (!ngModuleDef && throwNotFound === true) {
|
|
@@ -5502,11 +5505,6 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
5502
5505
|
* Use of this source code is governed by an MIT-style license that can be
|
|
5503
5506
|
* found in the LICENSE file at https://angular.io/license
|
|
5504
5507
|
*/
|
|
5505
|
-
const defaultScheduler = (() => (typeof requestAnimationFrame !== 'undefined' &&
|
|
5506
|
-
requestAnimationFrame || // browser only
|
|
5507
|
-
setTimeout // everything else
|
|
5508
|
-
)
|
|
5509
|
-
.bind(_global$1))();
|
|
5510
5508
|
/**
|
|
5511
5509
|
*
|
|
5512
5510
|
* @codeGenApi
|
|
@@ -7649,7 +7647,7 @@ class Version {
|
|
|
7649
7647
|
/**
|
|
7650
7648
|
* @publicApi
|
|
7651
7649
|
*/
|
|
7652
|
-
const VERSION = new Version('14.2.0-next.
|
|
7650
|
+
const VERSION = new Version('14.2.0-next.1');
|
|
7653
7651
|
|
|
7654
7652
|
/**
|
|
7655
7653
|
* @license
|
|
@@ -12047,11 +12045,6 @@ class LContainerDebug {
|
|
|
12047
12045
|
* Use of this source code is governed by an MIT-style license that can be
|
|
12048
12046
|
* found in the LICENSE file at https://angular.io/license
|
|
12049
12047
|
*/
|
|
12050
|
-
/**
|
|
12051
|
-
* A permanent marker promise which signifies that the current CD tree is
|
|
12052
|
-
* clean.
|
|
12053
|
-
*/
|
|
12054
|
-
const _CLEAN_PROMISE = (() => Promise.resolve(null))();
|
|
12055
12048
|
/**
|
|
12056
12049
|
* Invoke `HostBindingsFunction`s for view.
|
|
12057
12050
|
*
|
|
@@ -13432,13 +13425,15 @@ function refreshContainsDirtyView(lView) {
|
|
|
13432
13425
|
for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
|
|
13433
13426
|
for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
|
|
13434
13427
|
const embeddedLView = lContainer[i];
|
|
13435
|
-
if (embeddedLView
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13428
|
+
if (viewAttachedToChangeDetector(embeddedLView)) {
|
|
13429
|
+
if (embeddedLView[FLAGS] & 512 /* LViewFlags.RefreshTransplantedView */) {
|
|
13430
|
+
const embeddedTView = embeddedLView[TVIEW];
|
|
13431
|
+
ngDevMode && assertDefined(embeddedTView, 'TView must be allocated');
|
|
13432
|
+
refreshView(embeddedTView, embeddedLView, embeddedTView.template, embeddedLView[CONTEXT]);
|
|
13433
|
+
}
|
|
13434
|
+
else if (embeddedLView[TRANSPLANTED_VIEWS_TO_REFRESH] > 0) {
|
|
13435
|
+
refreshContainsDirtyView(embeddedLView);
|
|
13436
|
+
}
|
|
13442
13437
|
}
|
|
13443
13438
|
}
|
|
13444
13439
|
}
|
|
@@ -13547,42 +13542,6 @@ function markViewDirty(lView) {
|
|
|
13547
13542
|
}
|
|
13548
13543
|
return null;
|
|
13549
13544
|
}
|
|
13550
|
-
/**
|
|
13551
|
-
* Used to schedule change detection on the whole application.
|
|
13552
|
-
*
|
|
13553
|
-
* Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.
|
|
13554
|
-
* It is usually called indirectly by calling `markDirty` when the view needs to be
|
|
13555
|
-
* re-rendered.
|
|
13556
|
-
*
|
|
13557
|
-
* Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple
|
|
13558
|
-
* `scheduleTick` requests. The scheduling function can be overridden in
|
|
13559
|
-
* `renderComponent`'s `scheduler` option.
|
|
13560
|
-
*/
|
|
13561
|
-
function scheduleTick(rootContext, flags) {
|
|
13562
|
-
const nothingScheduled = rootContext.flags === 0 /* RootContextFlags.Empty */;
|
|
13563
|
-
if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {
|
|
13564
|
-
// https://github.com/angular/angular/issues/39296
|
|
13565
|
-
// should only attach the flags when really scheduling a tick
|
|
13566
|
-
rootContext.flags |= flags;
|
|
13567
|
-
let res;
|
|
13568
|
-
rootContext.clean = new Promise((r) => res = r);
|
|
13569
|
-
rootContext.scheduler(() => {
|
|
13570
|
-
if (rootContext.flags & 1 /* RootContextFlags.DetectChanges */) {
|
|
13571
|
-
rootContext.flags &= ~1 /* RootContextFlags.DetectChanges */;
|
|
13572
|
-
tickRootContext(rootContext);
|
|
13573
|
-
}
|
|
13574
|
-
if (rootContext.flags & 2 /* RootContextFlags.FlushPlayers */) {
|
|
13575
|
-
rootContext.flags &= ~2 /* RootContextFlags.FlushPlayers */;
|
|
13576
|
-
const playerHandler = rootContext.playerHandler;
|
|
13577
|
-
if (playerHandler) {
|
|
13578
|
-
playerHandler.flushPlayers();
|
|
13579
|
-
}
|
|
13580
|
-
}
|
|
13581
|
-
rootContext.clean = _CLEAN_PROMISE;
|
|
13582
|
-
res(null);
|
|
13583
|
-
});
|
|
13584
|
-
}
|
|
13585
|
-
}
|
|
13586
13545
|
function tickRootContext(rootContext) {
|
|
13587
13546
|
for (let i = 0; i < rootContext.components.length; i++) {
|
|
13588
13547
|
const rootComponent = rootContext.components[i];
|
|
@@ -13691,7 +13650,6 @@ function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex,
|
|
|
13691
13650
|
}
|
|
13692
13651
|
}
|
|
13693
13652
|
}
|
|
13694
|
-
const CLEAN_PROMISE = _CLEAN_PROMISE;
|
|
13695
13653
|
function getOrCreateLViewCleanup(view) {
|
|
13696
13654
|
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
|
|
13697
13655
|
return view[CLEANUP] || (view[CLEANUP] = ngDevMode ? new LCleanup() : []);
|
|
@@ -14450,14 +14408,8 @@ function createRootComponent(componentView, componentDef, rootLView, rootContext
|
|
|
14450
14408
|
}
|
|
14451
14409
|
return component;
|
|
14452
14410
|
}
|
|
14453
|
-
function createRootContext(
|
|
14454
|
-
return {
|
|
14455
|
-
components: [],
|
|
14456
|
-
scheduler: scheduler || defaultScheduler,
|
|
14457
|
-
clean: CLEAN_PROMISE,
|
|
14458
|
-
playerHandler: playerHandler || null,
|
|
14459
|
-
flags: 0 /* RootContextFlags.Empty */
|
|
14460
|
-
};
|
|
14411
|
+
function createRootContext() {
|
|
14412
|
+
return { components: [] };
|
|
14461
14413
|
}
|
|
14462
14414
|
/**
|
|
14463
14415
|
* Used to enable lifecycle hooks on the root component.
|
|
@@ -14477,25 +14429,6 @@ function LifecycleHooksFeature() {
|
|
|
14477
14429
|
ngDevMode && assertDefined(tNode, 'TNode is required');
|
|
14478
14430
|
registerPostOrderHooks(getLView()[TVIEW], tNode);
|
|
14479
14431
|
}
|
|
14480
|
-
/**
|
|
14481
|
-
* Wait on component until it is rendered.
|
|
14482
|
-
*
|
|
14483
|
-
* This function returns a `Promise` which is resolved when the component's
|
|
14484
|
-
* change detection is executed. This is determined by finding the scheduler
|
|
14485
|
-
* associated with the `component`'s render tree and waiting until the scheduler
|
|
14486
|
-
* flushes. If nothing is scheduled, the function returns a resolved promise.
|
|
14487
|
-
*
|
|
14488
|
-
* Example:
|
|
14489
|
-
* ```
|
|
14490
|
-
* await whenRendered(myComponent);
|
|
14491
|
-
* ```
|
|
14492
|
-
*
|
|
14493
|
-
* @param component Component to wait upon
|
|
14494
|
-
* @returns Promise which resolves when the component is rendered.
|
|
14495
|
-
*/
|
|
14496
|
-
function whenRendered(component) {
|
|
14497
|
-
return getRootContext(component).clean;
|
|
14498
|
-
}
|
|
14499
14432
|
|
|
14500
14433
|
/**
|
|
14501
14434
|
* @license
|
|
@@ -15480,21 +15413,6 @@ function detectChanges(component) {
|
|
|
15480
15413
|
const view = getComponentViewByInstance(component);
|
|
15481
15414
|
detectChangesInternal(view[TVIEW], view, component);
|
|
15482
15415
|
}
|
|
15483
|
-
/**
|
|
15484
|
-
* Marks the component as dirty (needing change detection). Marking a component dirty will
|
|
15485
|
-
* schedule a change detection on it at some point in the future.
|
|
15486
|
-
*
|
|
15487
|
-
* Marking an already dirty component as dirty won't do anything. Only one outstanding change
|
|
15488
|
-
* detection can be scheduled per component tree.
|
|
15489
|
-
*
|
|
15490
|
-
* @param component Component to mark as dirty.
|
|
15491
|
-
*/
|
|
15492
|
-
function markDirty(component) {
|
|
15493
|
-
ngDevMode && assertDefined(component, 'component');
|
|
15494
|
-
const rootView = markViewDirty(getComponentViewByInstance(component));
|
|
15495
|
-
ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
|
|
15496
|
-
scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
|
|
15497
|
-
}
|
|
15498
15416
|
|
|
15499
15417
|
/**
|
|
15500
15418
|
* @license
|
|
@@ -24657,10 +24575,6 @@ function compileNgModuleDefs(moduleType, ngModule, allowDuplicateDeclarationsInR
|
|
|
24657
24575
|
configurable: !!ngDevMode,
|
|
24658
24576
|
});
|
|
24659
24577
|
}
|
|
24660
|
-
function isStandalone(type) {
|
|
24661
|
-
const def = getComponentDef$1(type) || getDirectiveDef(type) || getPipeDef$1(type);
|
|
24662
|
-
return def !== null ? def.standalone : false;
|
|
24663
|
-
}
|
|
24664
24578
|
function generateStandaloneInDeclarationsError(type, location) {
|
|
24665
24579
|
const prefix = `Unexpected "${stringifyForError(type)}" found in the "declarations" array of the`;
|
|
24666
24580
|
const suffix = `"${stringifyForError(type)}" is marked as standalone and can't be declared ` +
|