lwc 2.37.1 → 2.37.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/dist/engine-dom/esm/es2017/engine-dom.js +77 -17
- package/dist/engine-dom/iife/es2017/engine-dom.js +77 -17
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +23 -10
- package/dist/engine-dom/iife/es5/engine-dom.js +80 -17
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +23 -10
- package/dist/engine-dom/umd/es2017/engine-dom.js +77 -17
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +23 -10
- package/dist/engine-dom/umd/es5/engine-dom.js +80 -17
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +23 -10
- package/dist/engine-server/commonjs/es2017/engine-server.js +8 -8
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +8 -8
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -322,6 +322,24 @@ function htmlAttributeToProperty(attrName) {
|
|
|
322
322
|
return propertyName;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
/*
|
|
326
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
327
|
+
* All rights reserved.
|
|
328
|
+
* SPDX-License-Identifier: MIT
|
|
329
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
|
+
*/
|
|
331
|
+
const ESCAPED_CHARS = {
|
|
332
|
+
'"': '"',
|
|
333
|
+
"'": ''',
|
|
334
|
+
'<': '<',
|
|
335
|
+
'>': '>',
|
|
336
|
+
'&': '&',
|
|
337
|
+
};
|
|
338
|
+
function htmlEscape(str, attrMode = false) {
|
|
339
|
+
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
340
|
+
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
|
341
|
+
}
|
|
342
|
+
|
|
325
343
|
/*
|
|
326
344
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
327
345
|
* All rights reserved.
|
|
@@ -329,9 +347,9 @@ function htmlAttributeToProperty(attrName) {
|
|
|
329
347
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
330
348
|
*/
|
|
331
349
|
// Increment whenever the LWC template compiler changes
|
|
332
|
-
const LWC_VERSION = "2.37.
|
|
350
|
+
const LWC_VERSION = "2.37.3";
|
|
333
351
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
334
|
-
/** version: 2.37.
|
|
352
|
+
/** version: 2.37.3 */
|
|
335
353
|
|
|
336
354
|
/**
|
|
337
355
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -410,7 +428,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
410
428
|
setFeatureFlag(name, value);
|
|
411
429
|
}
|
|
412
430
|
}
|
|
413
|
-
/** version: 2.37.
|
|
431
|
+
/** version: 2.37.3 */
|
|
414
432
|
|
|
415
433
|
/**
|
|
416
434
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -474,7 +492,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
474
492
|
}
|
|
475
493
|
}
|
|
476
494
|
}
|
|
477
|
-
/** version: 2.37.
|
|
495
|
+
/** version: 2.37.3 */
|
|
478
496
|
|
|
479
497
|
/*
|
|
480
498
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2993,7 +3011,7 @@ function checkVersionMismatch(func, type) {
|
|
|
2993
3011
|
// stylesheets and templates do not have user-meaningful names, but components do
|
|
2994
3012
|
const friendlyName = type === 'component' ? `${type} ${func.name}` : type;
|
|
2995
3013
|
logError(`LWC WARNING: current engine is v${LWC_VERSION}, but ${friendlyName} was compiled with v${version}.\nPlease update your compiled code or LWC engine so that the versions match.\nNo further warnings will appear.`);
|
|
2996
|
-
report(
|
|
3014
|
+
report("CompilerRuntimeVersionMismatch" /* ReportingEventId.CompilerRuntimeVersionMismatch */, {
|
|
2997
3015
|
compilerVersion: version,
|
|
2998
3016
|
runtimeVersion: LWC_VERSION,
|
|
2999
3017
|
});
|
|
@@ -6347,7 +6365,7 @@ function reportViolation$1(source, target, attrName) {
|
|
|
6347
6365
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
6348
6366
|
return;
|
|
6349
6367
|
}
|
|
6350
|
-
report(
|
|
6368
|
+
report("CrossRootAriaInSyntheticShadow" /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
6351
6369
|
tagName: vm.tagName,
|
|
6352
6370
|
attributeName: attrName,
|
|
6353
6371
|
});
|
|
@@ -6527,7 +6545,7 @@ function checkAndReportViolation(elm, prop, isSetter, setValue) {
|
|
|
6527
6545
|
// https://github.com/salesforce/lwc/issues/3284
|
|
6528
6546
|
setValueType = isNull(setValue) ? 'null' : typeof setValue;
|
|
6529
6547
|
}
|
|
6530
|
-
report(
|
|
6548
|
+
report("NonStandardAriaReflection" /* ReportingEventId.NonStandardAriaReflection */, {
|
|
6531
6549
|
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
6532
6550
|
propertyName: prop,
|
|
6533
6551
|
isSetter,
|
|
@@ -6694,15 +6712,44 @@ function hydrateNode(node, vnode, renderer) {
|
|
|
6694
6712
|
return renderer.nextSibling(hydratedNode);
|
|
6695
6713
|
}
|
|
6696
6714
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
6715
|
+
const PARENT_NODE_PROP = 'parentNode';
|
|
6716
|
+
const TAG_NAME_PROP = 'tagName';
|
|
6717
|
+
function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
6718
|
+
const { getProperty } = renderer;
|
|
6719
|
+
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6720
|
+
if (nodeValue === vnode.text) {
|
|
6721
|
+
return true;
|
|
6722
|
+
}
|
|
6723
|
+
// Special case for empty text nodes – these are serialized differently on the server
|
|
6724
|
+
// See https://github.com/salesforce/lwc/pull/2656
|
|
6725
|
+
if (nodeValue === '\u200D' && vnode.text === '') {
|
|
6726
|
+
return true;
|
|
6727
|
+
}
|
|
6728
|
+
// Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
|
|
6729
|
+
// but not when generated by the engine client-side.
|
|
6730
|
+
const parentNode = getProperty(node, PARENT_NODE_PROP);
|
|
6731
|
+
// Should never be null, but just to be safe, we check.
|
|
6732
|
+
/* istanbul ignore else */
|
|
6733
|
+
if (!isNull(parentNode)) {
|
|
6734
|
+
const tagName = getProperty(parentNode, TAG_NAME_PROP);
|
|
6735
|
+
// If the tagName is STYLE, then the following condition should always be true.
|
|
6736
|
+
// The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
|
|
6737
|
+
// for component authors to render different `<style>` text content on the client and server.
|
|
6738
|
+
// But just to be safe, we check.
|
|
6739
|
+
/* istanbul ignore next */
|
|
6740
|
+
if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
|
|
6741
|
+
return true;
|
|
6742
|
+
}
|
|
6743
|
+
}
|
|
6744
|
+
return false;
|
|
6745
|
+
}
|
|
6697
6746
|
function hydrateText(node, vnode, renderer) {
|
|
6698
6747
|
var _a;
|
|
6699
6748
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6700
6749
|
return handleMismatch(node, vnode, renderer);
|
|
6701
6750
|
}
|
|
6702
6751
|
if (process.env.NODE_ENV !== 'production') {
|
|
6703
|
-
|
|
6704
|
-
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6705
|
-
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
6752
|
+
if (!textNodeContentsAreEqual(node, vnode, renderer)) {
|
|
6706
6753
|
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
6707
6754
|
}
|
|
6708
6755
|
}
|
|
@@ -6882,6 +6929,19 @@ function isMatchingElement(vnode, elm, renderer) {
|
|
|
6882
6929
|
const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
|
|
6883
6930
|
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6884
6931
|
}
|
|
6932
|
+
function attributeValuesAreEqual(vnodeValue, value) {
|
|
6933
|
+
const vnodeValueAsString = String(vnodeValue);
|
|
6934
|
+
if (vnodeValueAsString === value) {
|
|
6935
|
+
return true;
|
|
6936
|
+
}
|
|
6937
|
+
// If the expected value is null, this means that the attribute does not exist. In that case,
|
|
6938
|
+
// we accept any nullish value (undefined or null).
|
|
6939
|
+
if (isNull(value) && (isUndefined$1(vnodeValue) || isNull(vnodeValue))) {
|
|
6940
|
+
return true;
|
|
6941
|
+
}
|
|
6942
|
+
// In all other cases, the two values are not considered equal
|
|
6943
|
+
return false;
|
|
6944
|
+
}
|
|
6885
6945
|
function validateAttrs(vnode, elm, renderer) {
|
|
6886
6946
|
const { data: { attrs = {} }, } = vnode;
|
|
6887
6947
|
let nodesAreCompatible = true;
|
|
@@ -6891,10 +6951,10 @@ function validateAttrs(vnode, elm, renderer) {
|
|
|
6891
6951
|
const { owner } = vnode;
|
|
6892
6952
|
const { getAttribute } = renderer;
|
|
6893
6953
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
6894
|
-
if (
|
|
6954
|
+
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
6895
6955
|
if (process.env.NODE_ENV !== 'production') {
|
|
6896
6956
|
const { getProperty } = renderer;
|
|
6897
|
-
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, owner);
|
|
6957
|
+
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found ${isNull(elmAttrValue) ? 'null' : `"${elmAttrValue}"`}`, owner);
|
|
6898
6958
|
}
|
|
6899
6959
|
nodesAreCompatible = false;
|
|
6900
6960
|
}
|
|
@@ -7113,10 +7173,10 @@ function reportViolation(type, eventId, prop) {
|
|
|
7113
7173
|
report(eventId, { propertyName: prop });
|
|
7114
7174
|
}
|
|
7115
7175
|
function reportTemplateViolation(prop) {
|
|
7116
|
-
reportViolation('template',
|
|
7176
|
+
reportViolation('template', "TemplateMutation" /* ReportingEventId.TemplateMutation */, prop);
|
|
7117
7177
|
}
|
|
7118
7178
|
function reportStylesheetViolation(prop) {
|
|
7119
|
-
reportViolation('stylesheet',
|
|
7179
|
+
reportViolation('stylesheet', "StylesheetMutation" /* ReportingEventId.StylesheetMutation */, prop);
|
|
7120
7180
|
}
|
|
7121
7181
|
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
7122
7182
|
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
@@ -7288,7 +7348,7 @@ function getComponentConstructor(elm) {
|
|
|
7288
7348
|
}
|
|
7289
7349
|
return ctor;
|
|
7290
7350
|
}
|
|
7291
|
-
/* version: 2.37.
|
|
7351
|
+
/* version: 2.37.3 */
|
|
7292
7352
|
|
|
7293
7353
|
/*
|
|
7294
7354
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7716,7 +7776,7 @@ function rendererFactory(baseRenderer) {
|
|
|
7716
7776
|
function isNull(obj) {
|
|
7717
7777
|
return obj === null;
|
|
7718
7778
|
}
|
|
7719
|
-
/** version: 2.37.
|
|
7779
|
+
/** version: 2.37.3 */
|
|
7720
7780
|
|
|
7721
7781
|
/*
|
|
7722
7782
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8269,6 +8329,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8269
8329
|
});
|
|
8270
8330
|
freeze(LightningElement);
|
|
8271
8331
|
seal(LightningElement.prototype);
|
|
8272
|
-
/* version: 2.37.
|
|
8332
|
+
/* version: 2.37.3 */
|
|
8273
8333
|
|
|
8274
8334
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, rendererFactory, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
@@ -325,6 +325,24 @@ var LWC = (function (exports) {
|
|
|
325
325
|
return propertyName;
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
/*
|
|
329
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
330
|
+
* All rights reserved.
|
|
331
|
+
* SPDX-License-Identifier: MIT
|
|
332
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
333
|
+
*/
|
|
334
|
+
const ESCAPED_CHARS = {
|
|
335
|
+
'"': '"',
|
|
336
|
+
"'": ''',
|
|
337
|
+
'<': '<',
|
|
338
|
+
'>': '>',
|
|
339
|
+
'&': '&',
|
|
340
|
+
};
|
|
341
|
+
function htmlEscape(str, attrMode = false) {
|
|
342
|
+
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
343
|
+
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
|
344
|
+
}
|
|
345
|
+
|
|
328
346
|
/*
|
|
329
347
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
330
348
|
* All rights reserved.
|
|
@@ -332,9 +350,9 @@ var LWC = (function (exports) {
|
|
|
332
350
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
333
351
|
*/
|
|
334
352
|
// Increment whenever the LWC template compiler changes
|
|
335
|
-
const LWC_VERSION = "2.37.
|
|
353
|
+
const LWC_VERSION = "2.37.3";
|
|
336
354
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
337
|
-
/** version: 2.37.
|
|
355
|
+
/** version: 2.37.3 */
|
|
338
356
|
|
|
339
357
|
/**
|
|
340
358
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -413,7 +431,7 @@ var LWC = (function (exports) {
|
|
|
413
431
|
setFeatureFlag(name, value);
|
|
414
432
|
}
|
|
415
433
|
}
|
|
416
|
-
/** version: 2.37.
|
|
434
|
+
/** version: 2.37.3 */
|
|
417
435
|
|
|
418
436
|
/**
|
|
419
437
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -477,7 +495,7 @@ var LWC = (function (exports) {
|
|
|
477
495
|
}
|
|
478
496
|
}
|
|
479
497
|
}
|
|
480
|
-
/** version: 2.37.
|
|
498
|
+
/** version: 2.37.3 */
|
|
481
499
|
|
|
482
500
|
/*
|
|
483
501
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2996,7 +3014,7 @@ var LWC = (function (exports) {
|
|
|
2996
3014
|
// stylesheets and templates do not have user-meaningful names, but components do
|
|
2997
3015
|
const friendlyName = type === 'component' ? `${type} ${func.name}` : type;
|
|
2998
3016
|
logError(`LWC WARNING: current engine is v${LWC_VERSION}, but ${friendlyName} was compiled with v${version}.\nPlease update your compiled code or LWC engine so that the versions match.\nNo further warnings will appear.`);
|
|
2999
|
-
report(
|
|
3017
|
+
report("CompilerRuntimeVersionMismatch" /* ReportingEventId.CompilerRuntimeVersionMismatch */, {
|
|
3000
3018
|
compilerVersion: version,
|
|
3001
3019
|
runtimeVersion: LWC_VERSION,
|
|
3002
3020
|
});
|
|
@@ -6350,7 +6368,7 @@ var LWC = (function (exports) {
|
|
|
6350
6368
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
6351
6369
|
return;
|
|
6352
6370
|
}
|
|
6353
|
-
report(
|
|
6371
|
+
report("CrossRootAriaInSyntheticShadow" /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
6354
6372
|
tagName: vm.tagName,
|
|
6355
6373
|
attributeName: attrName,
|
|
6356
6374
|
});
|
|
@@ -6530,7 +6548,7 @@ var LWC = (function (exports) {
|
|
|
6530
6548
|
// https://github.com/salesforce/lwc/issues/3284
|
|
6531
6549
|
setValueType = isNull(setValue) ? 'null' : typeof setValue;
|
|
6532
6550
|
}
|
|
6533
|
-
report(
|
|
6551
|
+
report("NonStandardAriaReflection" /* ReportingEventId.NonStandardAriaReflection */, {
|
|
6534
6552
|
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
6535
6553
|
propertyName: prop,
|
|
6536
6554
|
isSetter,
|
|
@@ -6697,15 +6715,44 @@ var LWC = (function (exports) {
|
|
|
6697
6715
|
return renderer.nextSibling(hydratedNode);
|
|
6698
6716
|
}
|
|
6699
6717
|
const NODE_VALUE_PROP = 'nodeValue';
|
|
6718
|
+
const PARENT_NODE_PROP = 'parentNode';
|
|
6719
|
+
const TAG_NAME_PROP = 'tagName';
|
|
6720
|
+
function textNodeContentsAreEqual(node, vnode, renderer) {
|
|
6721
|
+
const { getProperty } = renderer;
|
|
6722
|
+
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6723
|
+
if (nodeValue === vnode.text) {
|
|
6724
|
+
return true;
|
|
6725
|
+
}
|
|
6726
|
+
// Special case for empty text nodes – these are serialized differently on the server
|
|
6727
|
+
// See https://github.com/salesforce/lwc/pull/2656
|
|
6728
|
+
if (nodeValue === '\u200D' && vnode.text === '') {
|
|
6729
|
+
return true;
|
|
6730
|
+
}
|
|
6731
|
+
// Special case for text nodes inside `<style>` tags – these are escaped when rendered server-size,
|
|
6732
|
+
// but not when generated by the engine client-side.
|
|
6733
|
+
const parentNode = getProperty(node, PARENT_NODE_PROP);
|
|
6734
|
+
// Should never be null, but just to be safe, we check.
|
|
6735
|
+
/* istanbul ignore else */
|
|
6736
|
+
if (!isNull(parentNode)) {
|
|
6737
|
+
const tagName = getProperty(parentNode, TAG_NAME_PROP);
|
|
6738
|
+
// If the tagName is STYLE, then the following condition should always be true.
|
|
6739
|
+
// The LWC compiler blocks using `<style>`s inside of templates, so it should be impossible
|
|
6740
|
+
// for component authors to render different `<style>` text content on the client and server.
|
|
6741
|
+
// But just to be safe, we check.
|
|
6742
|
+
/* istanbul ignore next */
|
|
6743
|
+
if (tagName === 'STYLE' && htmlEscape(vnode.text) === nodeValue) {
|
|
6744
|
+
return true;
|
|
6745
|
+
}
|
|
6746
|
+
}
|
|
6747
|
+
return false;
|
|
6748
|
+
}
|
|
6700
6749
|
function hydrateText(node, vnode, renderer) {
|
|
6701
6750
|
var _a;
|
|
6702
6751
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6703
6752
|
return handleMismatch(node, vnode, renderer);
|
|
6704
6753
|
}
|
|
6705
6754
|
if (process.env.NODE_ENV !== 'production') {
|
|
6706
|
-
|
|
6707
|
-
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6708
|
-
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
6755
|
+
if (!textNodeContentsAreEqual(node, vnode, renderer)) {
|
|
6709
6756
|
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
6710
6757
|
}
|
|
6711
6758
|
}
|
|
@@ -6885,6 +6932,19 @@ var LWC = (function (exports) {
|
|
|
6885
6932
|
const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
|
|
6886
6933
|
return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
6887
6934
|
}
|
|
6935
|
+
function attributeValuesAreEqual(vnodeValue, value) {
|
|
6936
|
+
const vnodeValueAsString = String(vnodeValue);
|
|
6937
|
+
if (vnodeValueAsString === value) {
|
|
6938
|
+
return true;
|
|
6939
|
+
}
|
|
6940
|
+
// If the expected value is null, this means that the attribute does not exist. In that case,
|
|
6941
|
+
// we accept any nullish value (undefined or null).
|
|
6942
|
+
if (isNull(value) && (isUndefined$1(vnodeValue) || isNull(vnodeValue))) {
|
|
6943
|
+
return true;
|
|
6944
|
+
}
|
|
6945
|
+
// In all other cases, the two values are not considered equal
|
|
6946
|
+
return false;
|
|
6947
|
+
}
|
|
6888
6948
|
function validateAttrs(vnode, elm, renderer) {
|
|
6889
6949
|
const { data: { attrs = {} }, } = vnode;
|
|
6890
6950
|
let nodesAreCompatible = true;
|
|
@@ -6894,10 +6954,10 @@ var LWC = (function (exports) {
|
|
|
6894
6954
|
const { owner } = vnode;
|
|
6895
6955
|
const { getAttribute } = renderer;
|
|
6896
6956
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
6897
|
-
if (
|
|
6957
|
+
if (!attributeValuesAreEqual(attrValue, elmAttrValue)) {
|
|
6898
6958
|
if (process.env.NODE_ENV !== 'production') {
|
|
6899
6959
|
const { getProperty } = renderer;
|
|
6900
|
-
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, owner);
|
|
6960
|
+
logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found ${isNull(elmAttrValue) ? 'null' : `"${elmAttrValue}"`}`, owner);
|
|
6901
6961
|
}
|
|
6902
6962
|
nodesAreCompatible = false;
|
|
6903
6963
|
}
|
|
@@ -7116,10 +7176,10 @@ var LWC = (function (exports) {
|
|
|
7116
7176
|
report(eventId, { propertyName: prop });
|
|
7117
7177
|
}
|
|
7118
7178
|
function reportTemplateViolation(prop) {
|
|
7119
|
-
reportViolation('template',
|
|
7179
|
+
reportViolation('template', "TemplateMutation" /* ReportingEventId.TemplateMutation */, prop);
|
|
7120
7180
|
}
|
|
7121
7181
|
function reportStylesheetViolation(prop) {
|
|
7122
|
-
reportViolation('stylesheet',
|
|
7182
|
+
reportViolation('stylesheet', "StylesheetMutation" /* ReportingEventId.StylesheetMutation */, prop);
|
|
7123
7183
|
}
|
|
7124
7184
|
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
7125
7185
|
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
@@ -7291,7 +7351,7 @@ var LWC = (function (exports) {
|
|
|
7291
7351
|
}
|
|
7292
7352
|
return ctor;
|
|
7293
7353
|
}
|
|
7294
|
-
/* version: 2.37.
|
|
7354
|
+
/* version: 2.37.3 */
|
|
7295
7355
|
|
|
7296
7356
|
/*
|
|
7297
7357
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7719,7 +7779,7 @@ var LWC = (function (exports) {
|
|
|
7719
7779
|
function isNull(obj) {
|
|
7720
7780
|
return obj === null;
|
|
7721
7781
|
}
|
|
7722
|
-
/** version: 2.37.
|
|
7782
|
+
/** version: 2.37.3 */
|
|
7723
7783
|
|
|
7724
7784
|
/*
|
|
7725
7785
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8272,7 +8332,7 @@ var LWC = (function (exports) {
|
|
|
8272
8332
|
});
|
|
8273
8333
|
freeze(LightningElement);
|
|
8274
8334
|
seal(LightningElement.prototype);
|
|
8275
|
-
/* version: 2.37.
|
|
8335
|
+
/* version: 2.37.3 */
|
|
8276
8336
|
|
|
8277
8337
|
exports.LightningElement = LightningElement;
|
|
8278
8338
|
exports.__unstable__ProfilerControl = profilerControl;
|