@lwc/engine-core 8.7.0 → 8.9.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/dist/framework/main.d.ts +1 -1
- package/dist/framework/wiring/index.d.ts +1 -1
- package/dist/index.cjs.js +183 -85
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +184 -86
- package/dist/index.js.map +1 -1
- package/dist/libs/reflection/attr-reflection.d.ts +2 -0
- package/dist/libs/reflection/index.d.ts +2 -0
- package/package.json +4 -4
- /package/dist/libs/{aria-reflection → reflection}/aria-reflection.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2024 Salesforce, Inc.
|
|
3
3
|
*/
|
|
4
|
-
import { noop,
|
|
4
|
+
import { noop, isNull, ArrayPush as ArrayPush$1, StringToLowerCase, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, seal, create, isAPIFeatureEnabled, isFunction as isFunction$1, keys, toString as toString$1, isString, ArrayFilter, isObject, isArray as isArray$1, getOwnPropertyNames as getOwnPropertyNames$1, getOwnPropertySymbols as getOwnPropertySymbols$1, ArrayIndexOf, ArrayPop, isFalse, isTrustedSignal, hasOwnProperty as hasOwnProperty$1, entries, AriaPropNameToAttrNameMap, getPropertyDescriptor, AriaAttrNameToPropNameMap, forEach, defineProperties, assign, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, KEY__SYNTHETIC_MODE, freeze, assert, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyDescriptors, htmlPropertyToAttribute, ArraySlice, isTrue, KEY__SCOPED_CSS, KEY__NATIVE_ONLY_CSS, ArrayMap, ArraySplice, flattenStylesheets, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, StringSlice, KEY__SHADOW_RESOLVER, ArraySome, SVG_NAMESPACE, KEY__SHADOW_STATIC, StringTrim, sanitizeHtmlContent, StringReplace, isNumber, ArraySort, ArrayFrom, StringCharAt, htmlEscape, LOWEST_API_VERSION, ArrayUnshift, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, KEY__SHADOW_TOKEN, ID_REFERENCING_ATTRIBUTES_SET, StringSplit, arrayEvery, parseStyleText, ArrayCopyWithin, ArrayFill, ArrayReverse, ArrayShift } from '@lwc/shared';
|
|
5
5
|
export { setHooks, setTrustedSignalSet } from '@lwc/shared';
|
|
6
6
|
export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
|
|
7
7
|
|
|
@@ -682,6 +682,129 @@ for (const [propName, attrName] of entries(AriaPropNameToAttrNameMap)) {
|
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
+
/*
|
|
686
|
+
* Copyright (c) 2024, Salesforce, Inc.
|
|
687
|
+
* All rights reserved.
|
|
688
|
+
* SPDX-License-Identifier: MIT
|
|
689
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
690
|
+
*/
|
|
691
|
+
/**
|
|
692
|
+
* Descriptor for IDL attribute reflections that merely reflect the string, e.g. `title`.
|
|
693
|
+
*/
|
|
694
|
+
const stringDescriptor = (attrName) => ({
|
|
695
|
+
configurable: true,
|
|
696
|
+
enumerable: true,
|
|
697
|
+
get() {
|
|
698
|
+
return this.getAttribute(attrName);
|
|
699
|
+
},
|
|
700
|
+
set(newValue) {
|
|
701
|
+
const currentValue = this.getAttribute(attrName);
|
|
702
|
+
const normalizedValue = String(newValue);
|
|
703
|
+
if (normalizedValue !== currentValue) {
|
|
704
|
+
this.setAttribute(attrName, normalizedValue);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
});
|
|
708
|
+
/** Descriptor for a boolean that checks for `attr="true"` or `attr="false"`, e.g. `spellcheck` and `draggable`. */
|
|
709
|
+
const explicitBooleanDescriptor = (attrName, defaultValue) => ({
|
|
710
|
+
configurable: true,
|
|
711
|
+
enumerable: true,
|
|
712
|
+
get() {
|
|
713
|
+
const value = this.getAttribute(attrName);
|
|
714
|
+
if (value === null)
|
|
715
|
+
return defaultValue;
|
|
716
|
+
// spellcheck=false => false, everything else => true
|
|
717
|
+
// draggable=true => true, everything else => false
|
|
718
|
+
return value.toLowerCase() === String(defaultValue) ? defaultValue : !defaultValue;
|
|
719
|
+
},
|
|
720
|
+
set(newValue) {
|
|
721
|
+
const currentValue = this.getAttribute(attrName);
|
|
722
|
+
const normalizedValue = String(Boolean(newValue));
|
|
723
|
+
if (normalizedValue !== currentValue) {
|
|
724
|
+
this.setAttribute(attrName, normalizedValue);
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
});
|
|
728
|
+
/**
|
|
729
|
+
* Descriptor for a "true" boolean attribute that checks solely for presence, e.g. `hidden`.
|
|
730
|
+
*/
|
|
731
|
+
const booleanAttributeDescriptor = (attrName) => ({
|
|
732
|
+
configurable: true,
|
|
733
|
+
enumerable: true,
|
|
734
|
+
get() {
|
|
735
|
+
return this.hasAttribute(attrName);
|
|
736
|
+
},
|
|
737
|
+
set(newValue) {
|
|
738
|
+
const hasAttribute = this.hasAttribute(attrName);
|
|
739
|
+
if (newValue) {
|
|
740
|
+
if (!hasAttribute) {
|
|
741
|
+
this.setAttribute(attrName, '');
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
if (hasAttribute) {
|
|
746
|
+
this.removeAttribute(attrName);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
/**
|
|
752
|
+
* Descriptor for ARIA reflections, e.g. `ariaLabel` and `role`.
|
|
753
|
+
*/
|
|
754
|
+
const ariaDescriptor = (attrName) => ({
|
|
755
|
+
configurable: true,
|
|
756
|
+
enumerable: true,
|
|
757
|
+
get() {
|
|
758
|
+
return this.getAttribute(attrName);
|
|
759
|
+
},
|
|
760
|
+
set(newValue) {
|
|
761
|
+
const currentValue = this.getAttribute(attrName);
|
|
762
|
+
if (newValue !== currentValue) {
|
|
763
|
+
// TODO [#3284]: According to the spec, IDL nullable type values
|
|
764
|
+
// (null and undefined) should remove the attribute; however, we
|
|
765
|
+
// only do so in the case of null for historical reasons.
|
|
766
|
+
if (isNull(newValue)) {
|
|
767
|
+
this.removeAttribute(attrName);
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
this.setAttribute(attrName, toString$1(newValue));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
});
|
|
775
|
+
const tabIndexDescriptor = () => ({
|
|
776
|
+
configurable: true,
|
|
777
|
+
enumerable: true,
|
|
778
|
+
get() {
|
|
779
|
+
const str = this.getAttribute('tabindex');
|
|
780
|
+
const num = Number(str);
|
|
781
|
+
return isFinite(num) ? Math.trunc(num) : -1;
|
|
782
|
+
},
|
|
783
|
+
set(newValue) {
|
|
784
|
+
const currentValue = this.getAttribute('tabindex');
|
|
785
|
+
const num = Number(newValue);
|
|
786
|
+
const normalizedValue = isFinite(num) ? String(Math.trunc(num)) : '0';
|
|
787
|
+
if (normalizedValue !== currentValue) {
|
|
788
|
+
this.setAttribute('tabindex', toString$1(newValue));
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
});
|
|
792
|
+
const descriptors = {
|
|
793
|
+
accessKey: stringDescriptor('accesskey'),
|
|
794
|
+
dir: stringDescriptor('dir'),
|
|
795
|
+
draggable: explicitBooleanDescriptor('draggable', true),
|
|
796
|
+
hidden: booleanAttributeDescriptor('hidden'),
|
|
797
|
+
id: stringDescriptor('id'),
|
|
798
|
+
lang: stringDescriptor('lang'),
|
|
799
|
+
spellcheck: explicitBooleanDescriptor('spellcheck', false),
|
|
800
|
+
tabIndex: tabIndexDescriptor(),
|
|
801
|
+
title: stringDescriptor('title'),
|
|
802
|
+
};
|
|
803
|
+
// Add descriptors for ARIA attributes
|
|
804
|
+
for (const [attrName, propName] of entries(AriaAttrNameToPropNameMap)) {
|
|
805
|
+
descriptors[propName] = ariaDescriptor(attrName);
|
|
806
|
+
}
|
|
807
|
+
|
|
685
808
|
/*
|
|
686
809
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
687
810
|
* All rights reserved.
|
|
@@ -2085,7 +2208,7 @@ if (process.env.IS_BROWSER) {
|
|
|
2085
2208
|
else {
|
|
2086
2209
|
// On the server, we cannot use createBridgeToElementDescriptor because getAttribute/setAttribute are
|
|
2087
2210
|
// not supported on HTMLElement. So apply the polyfill directly on top of LightningElement
|
|
2088
|
-
defineProperties(LightningElement.prototype,
|
|
2211
|
+
defineProperties(LightningElement.prototype, descriptors);
|
|
2089
2212
|
}
|
|
2090
2213
|
defineProperties(LightningElement.prototype, lightningBasedDescriptors);
|
|
2091
2214
|
defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
@@ -3160,7 +3283,13 @@ function updateStylesheetToken(vm, template, legacy) {
|
|
|
3160
3283
|
// Set the new styling token on the host element
|
|
3161
3284
|
if (!isUndefined$1(newToken)) {
|
|
3162
3285
|
if (hasScopedStyles) {
|
|
3163
|
-
|
|
3286
|
+
const hostScopeTokenClass = makeHostToken(newToken);
|
|
3287
|
+
getClassList(elm).add(hostScopeTokenClass);
|
|
3288
|
+
if (!process.env.IS_BROWSER) {
|
|
3289
|
+
// This is only used in SSR to communicate to hydration that
|
|
3290
|
+
// this class should be treated specially for purposes of hydration mismatches.
|
|
3291
|
+
setAttribute(elm, 'data-lwc-host-scope-token', hostScopeTokenClass);
|
|
3292
|
+
}
|
|
3164
3293
|
newHasTokenInClass = true;
|
|
3165
3294
|
}
|
|
3166
3295
|
if (isSyntheticShadow) {
|
|
@@ -3297,21 +3426,6 @@ function getScopeTokenClass(owner, legacy) {
|
|
|
3297
3426
|
(legacy ? cmpTemplate?.legacyStylesheetToken : cmpTemplate?.stylesheetToken)) ||
|
|
3298
3427
|
null);
|
|
3299
3428
|
}
|
|
3300
|
-
/**
|
|
3301
|
-
* This function returns the host style token for a custom element if it
|
|
3302
|
-
* exists. Otherwise it returns null.
|
|
3303
|
-
*
|
|
3304
|
-
* A host style token is applied to the component if scoped styles are used.
|
|
3305
|
-
* @param vnode
|
|
3306
|
-
*/
|
|
3307
|
-
function getStylesheetTokenHost(vnode) {
|
|
3308
|
-
const { template } = getComponentInternalDef(vnode.ctor);
|
|
3309
|
-
const { vm } = vnode;
|
|
3310
|
-
const { stylesheetToken } = template;
|
|
3311
|
-
return !isUndefined$1(stylesheetToken) && computeHasScopedStyles(template, vm)
|
|
3312
|
-
? makeHostToken(stylesheetToken)
|
|
3313
|
-
: null;
|
|
3314
|
-
}
|
|
3315
3429
|
function getNearestNativeShadowComponent(vm) {
|
|
3316
3430
|
const owner = getNearestShadowComponent(vm);
|
|
3317
3431
|
if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
@@ -3849,7 +3963,6 @@ function getComponentHtmlPrototype(Ctor) {
|
|
|
3849
3963
|
return def.bridge;
|
|
3850
3964
|
}
|
|
3851
3965
|
const lightingElementDef = {
|
|
3852
|
-
ctor: LightningElement,
|
|
3853
3966
|
name: LightningElement.name,
|
|
3854
3967
|
props: lightningBasedDescriptors,
|
|
3855
3968
|
propsConfig: EmptyObject,
|
|
@@ -5759,7 +5872,7 @@ function dc(Ctor, data, children = EmptyArray) {
|
|
|
5759
5872
|
return null;
|
|
5760
5873
|
}
|
|
5761
5874
|
if (!isComponentConstructor(Ctor)) {
|
|
5762
|
-
throw new Error(`Invalid constructor ${toString$1(Ctor)} is not a LightningElement constructor.`);
|
|
5875
|
+
throw new Error(`Invalid constructor: "${toString$1(Ctor)}" is not a LightningElement constructor.`);
|
|
5763
5876
|
}
|
|
5764
5877
|
// Look up the dynamic component's name at runtime once the constructor is available.
|
|
5765
5878
|
// This information is only known at runtime and is stored as part of registerComponent.
|
|
@@ -7595,7 +7708,7 @@ function hydrateRoot(vm) {
|
|
|
7595
7708
|
runConnectedCallback(vm);
|
|
7596
7709
|
hydrateVM(vm);
|
|
7597
7710
|
if (hasMismatch && process.env.NODE_ENV !== 'production') {
|
|
7598
|
-
|
|
7711
|
+
logWarn('Hydration completed with errors.', vm);
|
|
7599
7712
|
}
|
|
7600
7713
|
}
|
|
7601
7714
|
function hydrateVM(vm) {
|
|
@@ -7850,7 +7963,7 @@ expectAddlSiblings) {
|
|
|
7850
7963
|
if (process.env.NODE_ENV !== 'production') {
|
|
7851
7964
|
if (!hasWarned) {
|
|
7852
7965
|
hasWarned = true;
|
|
7853
|
-
|
|
7966
|
+
logWarn(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
|
|
7854
7967
|
}
|
|
7855
7968
|
}
|
|
7856
7969
|
mount(childVnode, parentNode, renderer, nextNode);
|
|
@@ -7872,7 +7985,7 @@ expectAddlSiblings) {
|
|
|
7872
7985
|
hasMismatch = true;
|
|
7873
7986
|
if (process.env.NODE_ENV !== 'production') {
|
|
7874
7987
|
if (!hasWarned) {
|
|
7875
|
-
|
|
7988
|
+
logWarn(`Hydration mismatch: incorrect number of rendered nodes. Server rendered more nodes than the client.`, owner);
|
|
7876
7989
|
}
|
|
7877
7990
|
}
|
|
7878
7991
|
// nextSibling is mostly harmless, and since we don't have
|
|
@@ -7905,7 +8018,7 @@ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
|
7905
8018
|
const { getProperty } = renderer;
|
|
7906
8019
|
if (getProperty(node, 'nodeType') !== nodeType) {
|
|
7907
8020
|
if (process.env.NODE_ENV !== 'production') {
|
|
7908
|
-
|
|
8021
|
+
logWarn('Hydration mismatch: incorrect node type received', vnode.owner);
|
|
7909
8022
|
}
|
|
7910
8023
|
return false;
|
|
7911
8024
|
}
|
|
@@ -7915,7 +8028,7 @@ function isMatchingElement(vnode, elm, renderer, shouldValidateAttr = () => true
|
|
|
7915
8028
|
const { getProperty } = renderer;
|
|
7916
8029
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
7917
8030
|
if (process.env.NODE_ENV !== 'production') {
|
|
7918
|
-
|
|
8031
|
+
logWarn(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty(elm, 'tagName').toLowerCase()}".`, vnode.owner);
|
|
7919
8032
|
}
|
|
7920
8033
|
return false;
|
|
7921
8034
|
}
|
|
@@ -7956,7 +8069,7 @@ function validateAttrs(vnode, elm, data, renderer, shouldValidateAttr) {
|
|
|
7956
8069
|
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
7957
8070
|
if (process.env.NODE_ENV !== 'production') {
|
|
7958
8071
|
const { getProperty } = renderer;
|
|
7959
|
-
|
|
8072
|
+
logWarn(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found ${isNull(elmAttrValue) ? 'null' : `"${elmAttrValue}"`}`, vnode.owner);
|
|
7960
8073
|
}
|
|
7961
8074
|
nodesAreCompatible = false;
|
|
7962
8075
|
}
|
|
@@ -7967,78 +8080,63 @@ function validateClassAttr(vnode, elm, data, renderer) {
|
|
|
7967
8080
|
const { owner } = vnode;
|
|
7968
8081
|
// classMap is never available on VStaticPartData so it can default to undefined
|
|
7969
8082
|
// casting to prevent TS error.
|
|
7970
|
-
|
|
7971
|
-
const { getProperty
|
|
8083
|
+
const { className, classMap } = data;
|
|
8084
|
+
const { getProperty } = renderer;
|
|
8085
|
+
// ---------- Step 1: get the classes from the element and the vnode
|
|
8086
|
+
// Use a Set because we don't care to validate mismatches for 1) different ordering in SSR vs CSR, or 2)
|
|
8087
|
+
// duplicated class names. These don't have an effect on rendered styles.
|
|
8088
|
+
const elmClasses = new Set(ArrayFrom(elm.classList));
|
|
8089
|
+
let vnodeClasses;
|
|
8090
|
+
if (!isUndefined$1(className)) {
|
|
8091
|
+
// ignore empty spaces entirely, filter them out using `filter(..., Boolean)`
|
|
8092
|
+
vnodeClasses = new Set(ArrayFilter.call(StringSplit.call(className, /\s+/), Boolean));
|
|
8093
|
+
}
|
|
8094
|
+
else if (!isUndefined$1(classMap)) {
|
|
8095
|
+
vnodeClasses = new Set(keys(classMap));
|
|
8096
|
+
}
|
|
8097
|
+
else {
|
|
8098
|
+
vnodeClasses = new Set();
|
|
8099
|
+
}
|
|
8100
|
+
// ---------- Step 2: handle the scope tokens
|
|
7972
8101
|
// we don't care about legacy for hydration. it's a new use case
|
|
7973
|
-
const
|
|
7974
|
-
const stylesheetTokenHost = isVCustomElement(vnode) ? getStylesheetTokenHost(vnode) : null;
|
|
8102
|
+
const scopeToken = getScopeTokenClass(owner, /* legacy */ false);
|
|
7975
8103
|
// Classnames for scoped CSS are added directly to the DOM during rendering,
|
|
7976
8104
|
// or to the VDOM on the server in the case of SSR. As such, these classnames
|
|
7977
8105
|
// are never present in VDOM nodes in the browser.
|
|
7978
8106
|
//
|
|
7979
8107
|
// Consequently, hydration mismatches will occur if scoped CSS token classnames
|
|
7980
8108
|
// are rendered during SSR. This needs to be accounted for when validating.
|
|
7981
|
-
if (!isNull(
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
...(!isNull(scopedToken) ? { [scopedToken]: true } : {}),
|
|
7992
|
-
...(!isNull(stylesheetTokenHost) ? { [stylesheetTokenHost]: true } : {}),
|
|
7993
|
-
};
|
|
7994
|
-
}
|
|
7995
|
-
else {
|
|
7996
|
-
// The order of the className should be scopedToken stylesheetTokenHost
|
|
7997
|
-
const classTokens = [scopedToken, stylesheetTokenHost];
|
|
7998
|
-
const classNames = ArrayFilter.call(classTokens, (token) => !isNull(token));
|
|
7999
|
-
if (classNames.length) {
|
|
8000
|
-
className = ArrayJoin.call(classNames, ' ');
|
|
8001
|
-
}
|
|
8002
|
-
}
|
|
8109
|
+
if (!isNull(scopeToken)) {
|
|
8110
|
+
vnodeClasses.add(scopeToken);
|
|
8111
|
+
}
|
|
8112
|
+
// This tells us which `*-host` scope token was rendered to the element's class.
|
|
8113
|
+
// For now we just ignore any mismatches involving this class.
|
|
8114
|
+
// TODO [#4866]: correctly validate the host scope token class
|
|
8115
|
+
const elmHostScopeToken = renderer.getAttribute(elm, 'data-lwc-host-scope-token');
|
|
8116
|
+
if (!isNull(elmHostScopeToken)) {
|
|
8117
|
+
elmClasses.delete(elmHostScopeToken);
|
|
8118
|
+
vnodeClasses.delete(elmHostScopeToken);
|
|
8003
8119
|
}
|
|
8120
|
+
// ---------- Step 3: check for compatibility
|
|
8004
8121
|
let nodesAreCompatible = true;
|
|
8005
|
-
|
|
8006
|
-
const elmClassName = getAttribute(elm, 'class');
|
|
8007
|
-
if (!isUndefined$1(className) &&
|
|
8008
|
-
String(className) !== elmClassName &&
|
|
8009
|
-
// No mismatch if SSR `class` attribute is missing and CSR `class` is the empty string
|
|
8010
|
-
!(className === '' && isNull(elmClassName))) {
|
|
8011
|
-
// className is used when class is bound to an expr.
|
|
8122
|
+
if (vnodeClasses.size !== elmClasses.size) {
|
|
8012
8123
|
nodesAreCompatible = false;
|
|
8013
|
-
// stringify for pretty-printing
|
|
8014
|
-
readableVnodeClassname = JSON.stringify(className);
|
|
8015
8124
|
}
|
|
8016
|
-
else
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
let computedClassName = '';
|
|
8020
|
-
// all classes from the vnode should be in the element.classList
|
|
8021
|
-
for (const name in classMap) {
|
|
8022
|
-
computedClassName += ' ' + name;
|
|
8023
|
-
if (!classList.contains(name)) {
|
|
8125
|
+
else {
|
|
8126
|
+
for (const vnodeClass of vnodeClasses) {
|
|
8127
|
+
if (!elmClasses.has(vnodeClass)) {
|
|
8024
8128
|
nodesAreCompatible = false;
|
|
8025
8129
|
}
|
|
8026
8130
|
}
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8131
|
+
for (const elmClass of elmClasses) {
|
|
8132
|
+
if (!vnodeClasses.has(elmClass)) {
|
|
8133
|
+
nodesAreCompatible = false;
|
|
8134
|
+
}
|
|
8031
8135
|
}
|
|
8032
8136
|
}
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
readableVnodeClassname = '""';
|
|
8037
|
-
}
|
|
8038
|
-
if (!nodesAreCompatible) {
|
|
8039
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
8040
|
-
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected ${readableVnodeClassname} but found ${JSON.stringify(elmClassName)}`, vnode.owner);
|
|
8041
|
-
}
|
|
8137
|
+
if (process.env.NODE_ENV !== 'production' && !nodesAreCompatible) {
|
|
8138
|
+
const prettyPrint = (set) => JSON.stringify(ArrayJoin.call(ArraySort.call(ArrayFrom(set)), ' '));
|
|
8139
|
+
logWarn(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected ${prettyPrint(vnodeClasses)} but found ${prettyPrint(elmClasses)}`, vnode.owner);
|
|
8042
8140
|
}
|
|
8043
8141
|
return nodesAreCompatible;
|
|
8044
8142
|
}
|
|
@@ -8079,7 +8177,7 @@ function validateStyleAttr(vnode, elm, data, renderer) {
|
|
|
8079
8177
|
if (!nodesAreCompatible) {
|
|
8080
8178
|
if (process.env.NODE_ENV !== 'production') {
|
|
8081
8179
|
const { getProperty } = renderer;
|
|
8082
|
-
|
|
8180
|
+
logWarn(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
|
|
8083
8181
|
}
|
|
8084
8182
|
}
|
|
8085
8183
|
return nodesAreCompatible;
|
|
@@ -8105,7 +8203,7 @@ function areCompatibleStaticNodes(client, ssr, vnode, renderer) {
|
|
|
8105
8203
|
let isCompatibleElements = true;
|
|
8106
8204
|
if (getProperty(client, 'tagName') !== getProperty(ssr, 'tagName')) {
|
|
8107
8205
|
if (process.env.NODE_ENV !== 'production') {
|
|
8108
|
-
|
|
8206
|
+
logWarn(`Hydration mismatch: expecting element with tag "${getProperty(client, 'tagName').toLowerCase()}" but found "${getProperty(ssr, 'tagName').toLowerCase()}".`, owner);
|
|
8109
8207
|
}
|
|
8110
8208
|
return false;
|
|
8111
8209
|
}
|
|
@@ -8118,7 +8216,7 @@ function areCompatibleStaticNodes(client, ssr, vnode, renderer) {
|
|
|
8118
8216
|
// partId === 0 will always refer to the root element, this is guaranteed by the compiler.
|
|
8119
8217
|
if (parts?.[0].partId !== 0) {
|
|
8120
8218
|
if (process.env.NODE_ENV !== 'production') {
|
|
8121
|
-
|
|
8219
|
+
logWarn(`Mismatch hydrating element <${getProperty(client, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${getAttribute(client, attrName)}" but found "${getAttribute(ssr, attrName)}"`, owner);
|
|
8122
8220
|
}
|
|
8123
8221
|
isCompatibleElements = false;
|
|
8124
8222
|
}
|
|
@@ -8429,5 +8527,5 @@ function readonly(obj) {
|
|
|
8429
8527
|
}
|
|
8430
8528
|
|
|
8431
8529
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
8432
|
-
/** version: 8.
|
|
8530
|
+
/** version: 8.9.0 */
|
|
8433
8531
|
//# sourceMappingURL=index.js.map
|