@angular/core 16.1.0-rc.0 → 16.1.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/esm2022/src/hydration/annotate.mjs +4 -5
- package/esm2022/src/hydration/skip_hydration.mjs +10 -4
- package/esm2022/src/render3/instructions/element.mjs +7 -4
- package/esm2022/src/render3/instructions/shared.mjs +3 -3
- package/esm2022/src/render3/interfaces/renderer_dom.mjs +1 -1
- package/esm2022/src/render3/interfaces/type_checks.mjs +4 -1
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +21 -10
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +20 -8
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +2 -1
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +9 -9
- package/schematics/ng-generate/standalone-migration/bundle.js.map +1 -1
- package/testing/index.d.ts +1 -1
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.1.0
|
|
2
|
+
* @license Angular v16.1.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3339,6 +3339,9 @@ function isRootView(target) {
|
|
|
3339
3339
|
function isProjectionTNode(tNode) {
|
|
3340
3340
|
return (tNode.type & 16 /* TNodeType.Projection */) === 16 /* TNodeType.Projection */;
|
|
3341
3341
|
}
|
|
3342
|
+
function hasI18n(lView) {
|
|
3343
|
+
return (lView[FLAGS] & 32 /* LViewFlags.HasI18n */) === 32 /* LViewFlags.HasI18n */;
|
|
3344
|
+
}
|
|
3342
3345
|
|
|
3343
3346
|
// [Assert functions do not constraint type when they are guarded by a truthy
|
|
3344
3347
|
// expression.](https://github.com/microsoft/TypeScript/issues/37295)
|
|
@@ -6570,9 +6573,9 @@ function matchingSchemas(schemas, tagName) {
|
|
|
6570
6573
|
*/
|
|
6571
6574
|
const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
|
|
6572
6575
|
/**
|
|
6573
|
-
* Helper function to check if a given
|
|
6576
|
+
* Helper function to check if a given TNode has the 'ngSkipHydration' attribute.
|
|
6574
6577
|
*/
|
|
6575
|
-
function
|
|
6578
|
+
function hasSkipHydrationAttrOnTNode(tNode) {
|
|
6576
6579
|
const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = SKIP_HYDRATION_ATTR_NAME.toLowerCase();
|
|
6577
6580
|
const attrs = tNode.mergedAttrs;
|
|
6578
6581
|
if (attrs === null)
|
|
@@ -6590,6 +6593,12 @@ function hasNgSkipHydrationAttr(tNode) {
|
|
|
6590
6593
|
}
|
|
6591
6594
|
return false;
|
|
6592
6595
|
}
|
|
6596
|
+
/**
|
|
6597
|
+
* Helper function to check if a given RElement has the 'ngSkipHydration' attribute.
|
|
6598
|
+
*/
|
|
6599
|
+
function hasSkipHydrationAttrOnRElement(rNode) {
|
|
6600
|
+
return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);
|
|
6601
|
+
}
|
|
6593
6602
|
/**
|
|
6594
6603
|
* Checks whether a TNode has a flag to indicate that it's a part of
|
|
6595
6604
|
* a skip hydration block.
|
|
@@ -6609,7 +6618,7 @@ function hasInSkipHydrationBlockFlag(tNode) {
|
|
|
6609
6618
|
function isInSkipHydrationBlock(tNode) {
|
|
6610
6619
|
let currentTNode = tNode.parent;
|
|
6611
6620
|
while (currentTNode) {
|
|
6612
|
-
if (
|
|
6621
|
+
if (hasSkipHydrationAttrOnTNode(currentTNode)) {
|
|
6613
6622
|
return true;
|
|
6614
6623
|
}
|
|
6615
6624
|
currentTNode = currentTNode.parent;
|
|
@@ -10469,7 +10478,7 @@ class Version {
|
|
|
10469
10478
|
/**
|
|
10470
10479
|
* @publicApi
|
|
10471
10480
|
*/
|
|
10472
|
-
const VERSION = new Version('16.1.0
|
|
10481
|
+
const VERSION = new Version('16.1.0');
|
|
10473
10482
|
|
|
10474
10483
|
// This default value is when checking the hierarchy for a token.
|
|
10475
10484
|
//
|
|
@@ -11490,7 +11499,7 @@ let _applyRootElementTransformImpl = (rootElement) => null;
|
|
|
11490
11499
|
* @param rootElement the app root HTML Element
|
|
11491
11500
|
*/
|
|
11492
11501
|
function applyRootElementTransformImpl(rootElement) {
|
|
11493
|
-
if (rootElement
|
|
11502
|
+
if (hasSkipHydrationAttrOnRElement(rootElement)) {
|
|
11494
11503
|
// Handle a situation when the `ngSkipHydration` attribute is applied
|
|
11495
11504
|
// to the root node of an application. In this case, we should clear
|
|
11496
11505
|
// the contents and render everything from scratch.
|
|
@@ -15726,8 +15735,11 @@ function locateOrCreateElementNodeImpl(tView, lView, tNode, renderer, name, inde
|
|
|
15726
15735
|
setSegmentHead(hydrationInfo, index, native.nextSibling);
|
|
15727
15736
|
}
|
|
15728
15737
|
// Checks if the skip hydration attribute is present during hydration so we know to
|
|
15729
|
-
// skip attempting to hydrate this block.
|
|
15730
|
-
|
|
15738
|
+
// skip attempting to hydrate this block. We check both TNode and RElement for an
|
|
15739
|
+
// attribute: the RElement case is needed for i18n cases, when we add it to host
|
|
15740
|
+
// elements during the annotation phase (after all internal data structures are setup).
|
|
15741
|
+
if (hydrationInfo &&
|
|
15742
|
+
(hasSkipHydrationAttrOnTNode(tNode) || hasSkipHydrationAttrOnRElement(native))) {
|
|
15731
15743
|
if (isComponentHost(tNode)) {
|
|
15732
15744
|
enterSkipHydrationBlock(tNode);
|
|
15733
15745
|
// Since this isn't hydratable, we need to empty the node
|