lwc 2.5.7 → 2.5.8
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 +490 -68
- package/dist/engine-dom/iife/es2017/engine-dom.js +490 -67
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +306 -60
- package/dist/engine-dom/iife/es5/engine-dom.js +566 -129
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +363 -113
- package/dist/engine-dom/umd/es2017/engine-dom.js +490 -67
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +306 -60
- package/dist/engine-dom/umd/es5/engine-dom.js +566 -129
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +363 -113
- package/dist/engine-server/commonjs/es2017/engine-server.js +361 -11
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +361 -11
- 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_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- 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_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- 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_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_debug.js +2 -2
- package/package.json +8 -8
|
@@ -335,7 +335,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
335
335
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
336
336
|
return attributeName;
|
|
337
337
|
}
|
|
338
|
-
/** version: 2.5.
|
|
338
|
+
/** version: 2.5.8 */
|
|
339
339
|
|
|
340
340
|
/*
|
|
341
341
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -456,7 +456,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
456
456
|
setFeatureFlag(name, value);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
/** version: 2.5.
|
|
459
|
+
/** version: 2.5.8 */
|
|
460
460
|
|
|
461
461
|
/* proxy-compat-disable */
|
|
462
462
|
|
|
@@ -508,6 +508,28 @@ function guid() {
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
|
|
511
|
+
} // Borrowed from Vue template compiler.
|
|
512
|
+
// https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
const DECLARATION_DELIMITER = /;(?![^(]*\))/g;
|
|
516
|
+
const PROPERTY_DELIMITER = /:(.+)/;
|
|
517
|
+
|
|
518
|
+
function parseStyleText(cssText) {
|
|
519
|
+
const styleMap = {};
|
|
520
|
+
const declarations = cssText.split(DECLARATION_DELIMITER);
|
|
521
|
+
|
|
522
|
+
for (const declaration of declarations) {
|
|
523
|
+
if (declaration) {
|
|
524
|
+
const [prop, value] = declaration.split(PROPERTY_DELIMITER);
|
|
525
|
+
|
|
526
|
+
if (prop !== undefined && value !== undefined) {
|
|
527
|
+
styleMap[prop.trim()] = value.trim();
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
return styleMap;
|
|
511
533
|
}
|
|
512
534
|
/*
|
|
513
535
|
* Copyright (c) 2019, salesforce.com, inc.
|
|
@@ -689,8 +711,8 @@ function getErrorComponentStack(vm) {
|
|
|
689
711
|
*/
|
|
690
712
|
|
|
691
713
|
|
|
692
|
-
function
|
|
693
|
-
let msg = `[LWC
|
|
714
|
+
function log(method, message, vm) {
|
|
715
|
+
let msg = `[LWC ${method}]: ${message}`;
|
|
694
716
|
|
|
695
717
|
if (!isUndefined$1(vm)) {
|
|
696
718
|
msg = `${msg}\n${getComponentStack(vm)}`;
|
|
@@ -698,7 +720,7 @@ function logError(message, vm) {
|
|
|
698
720
|
|
|
699
721
|
if (process.env.NODE_ENV === 'test') {
|
|
700
722
|
/* eslint-disable-next-line no-console */
|
|
701
|
-
console
|
|
723
|
+
console[method](msg);
|
|
702
724
|
return;
|
|
703
725
|
}
|
|
704
726
|
|
|
@@ -706,9 +728,17 @@ function logError(message, vm) {
|
|
|
706
728
|
throw new Error(msg);
|
|
707
729
|
} catch (e) {
|
|
708
730
|
/* eslint-disable-next-line no-console */
|
|
709
|
-
console
|
|
731
|
+
console[method](e);
|
|
710
732
|
}
|
|
711
733
|
}
|
|
734
|
+
|
|
735
|
+
function logError(message, vm) {
|
|
736
|
+
log('error', message, vm);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function logWarn(message, vm) {
|
|
740
|
+
log('warn', message, vm);
|
|
741
|
+
}
|
|
712
742
|
/*
|
|
713
743
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
714
744
|
* All rights reserved.
|
|
@@ -4448,6 +4478,17 @@ function createElmHook(vnode) {
|
|
|
4448
4478
|
modComputedStyle.create(vnode);
|
|
4449
4479
|
}
|
|
4450
4480
|
|
|
4481
|
+
function hydrateElmHook(vnode) {
|
|
4482
|
+
modEvents.create(vnode); // Attrs are already on the element.
|
|
4483
|
+
// modAttrs.create(vnode);
|
|
4484
|
+
|
|
4485
|
+
modProps.create(vnode); // Already set.
|
|
4486
|
+
// modStaticClassName.create(vnode);
|
|
4487
|
+
// modStaticStyle.create(vnode);
|
|
4488
|
+
// modComputedClassName.create(vnode);
|
|
4489
|
+
// modComputedStyle.create(vnode);
|
|
4490
|
+
}
|
|
4491
|
+
|
|
4451
4492
|
function fallbackElmHook(elm, vnode) {
|
|
4452
4493
|
const {
|
|
4453
4494
|
owner
|
|
@@ -4619,6 +4660,179 @@ function createChildrenHook(vnode) {
|
|
|
4619
4660
|
}
|
|
4620
4661
|
}
|
|
4621
4662
|
|
|
4663
|
+
function isElementNode(node) {
|
|
4664
|
+
// eslint-disable-next-line lwc-internal/no-global-node
|
|
4665
|
+
return node.nodeType === Node.ELEMENT_NODE;
|
|
4666
|
+
}
|
|
4667
|
+
|
|
4668
|
+
function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
|
|
4669
|
+
const {
|
|
4670
|
+
data: {
|
|
4671
|
+
attrs = {}
|
|
4672
|
+
},
|
|
4673
|
+
owner: {
|
|
4674
|
+
renderer
|
|
4675
|
+
}
|
|
4676
|
+
} = vnode;
|
|
4677
|
+
let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
|
|
4678
|
+
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
4679
|
+
|
|
4680
|
+
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
4681
|
+
const elmAttrValue = renderer.getAttribute(elm, attrName);
|
|
4682
|
+
|
|
4683
|
+
if (attrValue !== elmAttrValue) {
|
|
4684
|
+
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
|
|
4685
|
+
nodesAreCompatible = false;
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
|
|
4689
|
+
return nodesAreCompatible;
|
|
4690
|
+
}
|
|
4691
|
+
|
|
4692
|
+
function vnodesAndElementHaveCompatibleClass(vnode, elm) {
|
|
4693
|
+
const {
|
|
4694
|
+
data: {
|
|
4695
|
+
className,
|
|
4696
|
+
classMap
|
|
4697
|
+
},
|
|
4698
|
+
owner: {
|
|
4699
|
+
renderer
|
|
4700
|
+
}
|
|
4701
|
+
} = vnode;
|
|
4702
|
+
let nodesAreCompatible = true;
|
|
4703
|
+
let vnodeClassName;
|
|
4704
|
+
|
|
4705
|
+
if (!isUndefined$1(className) && className !== elm.className) {
|
|
4706
|
+
// className is used when class is bound to an expr.
|
|
4707
|
+
nodesAreCompatible = false;
|
|
4708
|
+
vnodeClassName = className;
|
|
4709
|
+
} else if (!isUndefined$1(classMap)) {
|
|
4710
|
+
// classMap is used when class is set to static value.
|
|
4711
|
+
const classList = renderer.getClassList(elm);
|
|
4712
|
+
let computedClassName = ''; // all classes from the vnode should be in the element.classList
|
|
4713
|
+
|
|
4714
|
+
for (const name in classMap) {
|
|
4715
|
+
computedClassName += ' ' + name;
|
|
4716
|
+
|
|
4717
|
+
if (!classList.contains(name)) {
|
|
4718
|
+
nodesAreCompatible = false;
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
|
|
4722
|
+
vnodeClassName = computedClassName.trim();
|
|
4723
|
+
|
|
4724
|
+
if (classList.length > keys(classMap).length) {
|
|
4725
|
+
nodesAreCompatible = false;
|
|
4726
|
+
}
|
|
4727
|
+
}
|
|
4728
|
+
|
|
4729
|
+
if (!nodesAreCompatible) {
|
|
4730
|
+
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${elm.className}"`, vnode.owner);
|
|
4731
|
+
}
|
|
4732
|
+
|
|
4733
|
+
return nodesAreCompatible;
|
|
4734
|
+
}
|
|
4735
|
+
|
|
4736
|
+
function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
|
|
4737
|
+
const {
|
|
4738
|
+
data: {
|
|
4739
|
+
style,
|
|
4740
|
+
styleDecls
|
|
4741
|
+
},
|
|
4742
|
+
owner: {
|
|
4743
|
+
renderer
|
|
4744
|
+
}
|
|
4745
|
+
} = vnode;
|
|
4746
|
+
const elmStyle = renderer.getAttribute(elm, 'style') || '';
|
|
4747
|
+
let vnodeStyle;
|
|
4748
|
+
let nodesAreCompatible = true;
|
|
4749
|
+
|
|
4750
|
+
if (!isUndefined$1(style) && style !== elmStyle) {
|
|
4751
|
+
nodesAreCompatible = false;
|
|
4752
|
+
vnodeStyle = style;
|
|
4753
|
+
} else if (!isUndefined$1(styleDecls)) {
|
|
4754
|
+
const parsedVnodeStyle = parseStyleText(elmStyle);
|
|
4755
|
+
const expectedStyle = []; // styleMap is used when style is set to static value.
|
|
4756
|
+
|
|
4757
|
+
for (let i = 0, n = styleDecls.length; i < n; i++) {
|
|
4758
|
+
const [prop, value, important] = styleDecls[i];
|
|
4759
|
+
expectedStyle.push(`${prop}: ${value + (important ? ' important!' : '')}`);
|
|
4760
|
+
const parsedPropValue = parsedVnodeStyle[prop];
|
|
4761
|
+
|
|
4762
|
+
if (isUndefined$1(parsedPropValue)) {
|
|
4763
|
+
nodesAreCompatible = false;
|
|
4764
|
+
} else if (!parsedPropValue.startsWith(value)) {
|
|
4765
|
+
nodesAreCompatible = false;
|
|
4766
|
+
} else if (important && !parsedPropValue.endsWith('!important')) {
|
|
4767
|
+
nodesAreCompatible = false;
|
|
4768
|
+
}
|
|
4769
|
+
}
|
|
4770
|
+
|
|
4771
|
+
if (keys(parsedVnodeStyle).length > styleDecls.length) {
|
|
4772
|
+
nodesAreCompatible = false;
|
|
4773
|
+
}
|
|
4774
|
+
|
|
4775
|
+
vnodeStyle = ArrayJoin.call(expectedStyle, ';');
|
|
4776
|
+
}
|
|
4777
|
+
|
|
4778
|
+
if (!nodesAreCompatible) {
|
|
4779
|
+
// style is used when class is bound to an expr.
|
|
4780
|
+
logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
|
|
4781
|
+
}
|
|
4782
|
+
|
|
4783
|
+
return nodesAreCompatible;
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
function throwHydrationError() {
|
|
4787
|
+
assert.fail('Server rendered elements do not match client side generated elements');
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4790
|
+
function hydrateChildrenHook(elmChildren, children, vm) {
|
|
4791
|
+
var _a, _b;
|
|
4792
|
+
|
|
4793
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4794
|
+
const filteredVNodes = ArrayFilter.call(children, vnode => !!vnode);
|
|
4795
|
+
|
|
4796
|
+
if (elmChildren.length !== filteredVNodes.length) {
|
|
4797
|
+
logError(`Hydration mismatch: incorrect number of rendered nodes, expected ${filteredVNodes.length} but found ${elmChildren.length}.`, vm);
|
|
4798
|
+
throwHydrationError();
|
|
4799
|
+
}
|
|
4800
|
+
}
|
|
4801
|
+
|
|
4802
|
+
let elmCurrentChildIdx = 0;
|
|
4803
|
+
|
|
4804
|
+
for (let j = 0, n = children.length; j < n; j++) {
|
|
4805
|
+
const ch = children[j];
|
|
4806
|
+
|
|
4807
|
+
if (ch != null) {
|
|
4808
|
+
const childNode = elmChildren[elmCurrentChildIdx];
|
|
4809
|
+
|
|
4810
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4811
|
+
// VComments and VTexts validation is handled in their hooks
|
|
4812
|
+
if (isElementNode(childNode)) {
|
|
4813
|
+
if (((_a = ch.sel) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== childNode.tagName.toLowerCase()) {
|
|
4814
|
+
logError(`Hydration mismatch: expecting element with tag "${(_b = ch.sel) === null || _b === void 0 ? void 0 : _b.toLowerCase()}" but found "${childNode.tagName.toLowerCase()}".`, vm);
|
|
4815
|
+
throwHydrationError();
|
|
4816
|
+
} // Note: props are not yet set
|
|
4817
|
+
|
|
4818
|
+
|
|
4819
|
+
const hasIncompatibleAttrs = vnodesAndElementHaveCompatibleAttrs(ch, childNode);
|
|
4820
|
+
const hasIncompatibleClass = vnodesAndElementHaveCompatibleClass(ch, childNode);
|
|
4821
|
+
const hasIncompatibleStyle = vnodesAndElementHaveCompatibleStyle(ch, childNode);
|
|
4822
|
+
const isVNodeAndElementCompatible = hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
|
|
4823
|
+
|
|
4824
|
+
if (!isVNodeAndElementCompatible) {
|
|
4825
|
+
throwHydrationError();
|
|
4826
|
+
}
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
|
|
4830
|
+
ch.hook.hydrate(ch, childNode);
|
|
4831
|
+
elmCurrentChildIdx++;
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4834
|
+
}
|
|
4835
|
+
|
|
4622
4836
|
function updateCustomElmHook(oldVnode, vnode) {
|
|
4623
4837
|
// Attrs need to be applied to element before props
|
|
4624
4838
|
// IE11 will wipe out value on radio inputs if value
|
|
@@ -4720,7 +4934,26 @@ const TextHook = {
|
|
|
4720
4934
|
update: updateNodeHook,
|
|
4721
4935
|
insert: insertNodeHook,
|
|
4722
4936
|
move: insertNodeHook,
|
|
4723
|
-
remove: removeNodeHook
|
|
4937
|
+
remove: removeNodeHook,
|
|
4938
|
+
hydrate: (vNode, node) => {
|
|
4939
|
+
var _a;
|
|
4940
|
+
|
|
4941
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4942
|
+
// eslint-disable-next-line lwc-internal/no-global-node
|
|
4943
|
+
if (node.nodeType !== Node.TEXT_NODE) {
|
|
4944
|
+
logError('Hydration mismatch: incorrect node type received', vNode.owner);
|
|
4945
|
+
assert.fail('Hydration mismatch: incorrect node type received.');
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
if (node.nodeValue !== vNode.text) {
|
|
4949
|
+
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vNode.owner);
|
|
4950
|
+
}
|
|
4951
|
+
} // always set the text value to the one from the vnode.
|
|
4952
|
+
|
|
4953
|
+
|
|
4954
|
+
node.nodeValue = (_a = vNode.text) !== null && _a !== void 0 ? _a : null;
|
|
4955
|
+
vNode.elm = node;
|
|
4956
|
+
}
|
|
4724
4957
|
};
|
|
4725
4958
|
const CommentHook = {
|
|
4726
4959
|
create: vnode => {
|
|
@@ -4738,7 +4971,26 @@ const CommentHook = {
|
|
|
4738
4971
|
update: updateNodeHook,
|
|
4739
4972
|
insert: insertNodeHook,
|
|
4740
4973
|
move: insertNodeHook,
|
|
4741
|
-
remove: removeNodeHook
|
|
4974
|
+
remove: removeNodeHook,
|
|
4975
|
+
hydrate: (vNode, node) => {
|
|
4976
|
+
var _a;
|
|
4977
|
+
|
|
4978
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4979
|
+
// eslint-disable-next-line lwc-internal/no-global-node
|
|
4980
|
+
if (node.nodeType !== Node.COMMENT_NODE) {
|
|
4981
|
+
logError('Hydration mismatch: incorrect node type received', vNode.owner);
|
|
4982
|
+
assert.fail('Hydration mismatch: incorrect node type received.');
|
|
4983
|
+
}
|
|
4984
|
+
|
|
4985
|
+
if (node.nodeValue !== vNode.text) {
|
|
4986
|
+
logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vNode.owner);
|
|
4987
|
+
}
|
|
4988
|
+
} // always set the text value to the one from the vnode.
|
|
4989
|
+
|
|
4990
|
+
|
|
4991
|
+
node.nodeValue = (_a = vNode.text) !== null && _a !== void 0 ? _a : null;
|
|
4992
|
+
vNode.elm = node;
|
|
4993
|
+
}
|
|
4742
4994
|
}; // insert is called after update, which is used somewhere else (via a module)
|
|
4743
4995
|
// to mark the vm as inserted, that means we cannot use update as the main channel
|
|
4744
4996
|
// to rehydrate when dirty, because sometimes the element is not inserted just yet,
|
|
@@ -4778,6 +5030,38 @@ const ElementHook = {
|
|
|
4778
5030
|
remove: (vnode, parentNode) => {
|
|
4779
5031
|
removeNodeHook(vnode, parentNode);
|
|
4780
5032
|
removeElmHook(vnode);
|
|
5033
|
+
},
|
|
5034
|
+
hydrate: (vnode, node) => {
|
|
5035
|
+
const elm = node;
|
|
5036
|
+
vnode.elm = elm;
|
|
5037
|
+
const {
|
|
5038
|
+
context
|
|
5039
|
+
} = vnode.data;
|
|
5040
|
+
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
|
|
5041
|
+
/* manual */
|
|
5042
|
+
);
|
|
5043
|
+
|
|
5044
|
+
if (isDomManual) {
|
|
5045
|
+
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
5046
|
+
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
5047
|
+
const {
|
|
5048
|
+
props
|
|
5049
|
+
} = vnode.data;
|
|
5050
|
+
|
|
5051
|
+
if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
|
|
5052
|
+
if (elm.innerHTML === props.innerHTML) {
|
|
5053
|
+
delete props.innerHTML;
|
|
5054
|
+
} else {
|
|
5055
|
+
logWarn(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
|
|
5056
|
+
}
|
|
5057
|
+
}
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
hydrateElmHook(vnode);
|
|
5061
|
+
|
|
5062
|
+
if (!isDomManual) {
|
|
5063
|
+
hydrateChildrenHook(vnode.elm.childNodes, vnode.children, vnode.owner);
|
|
5064
|
+
}
|
|
4781
5065
|
}
|
|
4782
5066
|
};
|
|
4783
5067
|
const CustomElementHook = {
|
|
@@ -4869,6 +5153,44 @@ const CustomElementHook = {
|
|
|
4869
5153
|
// will take care of disconnecting any child VM attached to its shadow as well.
|
|
4870
5154
|
removeVM(vm);
|
|
4871
5155
|
}
|
|
5156
|
+
},
|
|
5157
|
+
hydrate: (vnode, elm) => {
|
|
5158
|
+
// the element is created, but the vm is not
|
|
5159
|
+
const {
|
|
5160
|
+
sel,
|
|
5161
|
+
mode,
|
|
5162
|
+
ctor,
|
|
5163
|
+
owner
|
|
5164
|
+
} = vnode;
|
|
5165
|
+
const def = getComponentInternalDef(ctor);
|
|
5166
|
+
createVM(elm, def, {
|
|
5167
|
+
mode,
|
|
5168
|
+
owner,
|
|
5169
|
+
tagName: sel,
|
|
5170
|
+
renderer: owner.renderer
|
|
5171
|
+
});
|
|
5172
|
+
vnode.elm = elm;
|
|
5173
|
+
const vm = getAssociatedVM(elm);
|
|
5174
|
+
allocateChildrenHook(vnode, vm);
|
|
5175
|
+
hydrateElmHook(vnode); // Insert hook section:
|
|
5176
|
+
|
|
5177
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5178
|
+
assert.isTrue(vm.state === 0
|
|
5179
|
+
/* created */
|
|
5180
|
+
, `${vm} cannot be recycled.`);
|
|
5181
|
+
}
|
|
5182
|
+
|
|
5183
|
+
runConnectedCallback(vm);
|
|
5184
|
+
|
|
5185
|
+
if (vm.renderMode !== 0
|
|
5186
|
+
/* Light */
|
|
5187
|
+
) {
|
|
5188
|
+
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
5189
|
+
// Note: for Light DOM, this is handled while hydrating the VM
|
|
5190
|
+
hydrateChildrenHook(vnode.elm.childNodes, vnode.children, vm);
|
|
5191
|
+
}
|
|
5192
|
+
|
|
5193
|
+
hydrateVM(vm);
|
|
4872
5194
|
}
|
|
4873
5195
|
};
|
|
4874
5196
|
|
|
@@ -5557,7 +5879,10 @@ function createStylesheet(vm, stylesheets) {
|
|
|
5557
5879
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5558
5880
|
renderer.insertGlobalStylesheet(stylesheets[i]);
|
|
5559
5881
|
}
|
|
5560
|
-
} else if (renderer.ssr) {
|
|
5882
|
+
} else if (renderer.ssr || renderer.isHydrating) {
|
|
5883
|
+
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
5884
|
+
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
5885
|
+
// the first time the VM renders.
|
|
5561
5886
|
// native shadow or light DOM, SSR
|
|
5562
5887
|
const combinedStylesheetContent = ArrayJoin.call(stylesheets, '\n');
|
|
5563
5888
|
return createInlineStyleVNode(combinedStylesheetContent);
|
|
@@ -6137,6 +6462,10 @@ function disconnectRootElement(elm) {
|
|
|
6137
6462
|
|
|
6138
6463
|
function appendVM(vm) {
|
|
6139
6464
|
rehydrate(vm);
|
|
6465
|
+
}
|
|
6466
|
+
|
|
6467
|
+
function hydrateVM(vm) {
|
|
6468
|
+
hydrate(vm);
|
|
6140
6469
|
} // just in case the component comes back, with this we guarantee re-rendering it
|
|
6141
6470
|
// while preventing any attempt to rehydration until after reinsertion.
|
|
6142
6471
|
|
|
@@ -6370,6 +6699,22 @@ function rehydrate(vm) {
|
|
|
6370
6699
|
}
|
|
6371
6700
|
}
|
|
6372
6701
|
|
|
6702
|
+
function hydrate(vm) {
|
|
6703
|
+
if (isTrue(vm.isDirty)) {
|
|
6704
|
+
// manually diffing/patching here.
|
|
6705
|
+
// This routine is:
|
|
6706
|
+
// patchShadowRoot(vm, children);
|
|
6707
|
+
// -> addVnodes.
|
|
6708
|
+
const children = renderComponent$1(vm);
|
|
6709
|
+
vm.children = children;
|
|
6710
|
+
const vmChildren = vm.renderMode === 0
|
|
6711
|
+
/* Light */
|
|
6712
|
+
? vm.elm.childNodes : vm.elm.shadowRoot.childNodes;
|
|
6713
|
+
hydrateChildrenHook(vmChildren, children, vm);
|
|
6714
|
+
runRenderedCallback(vm);
|
|
6715
|
+
}
|
|
6716
|
+
}
|
|
6717
|
+
|
|
6373
6718
|
function patchShadowRoot(vm, newCh) {
|
|
6374
6719
|
const {
|
|
6375
6720
|
children: oldCh
|
|
@@ -7183,7 +7528,7 @@ function setHooks(hooks) {
|
|
|
7183
7528
|
hooksAreSet = true;
|
|
7184
7529
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7185
7530
|
}
|
|
7186
|
-
/* version: 2.5.
|
|
7531
|
+
/* version: 2.5.8 */
|
|
7187
7532
|
|
|
7188
7533
|
/*
|
|
7189
7534
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -7275,6 +7620,11 @@ class HTMLElement$1 {
|
|
|
7275
7620
|
|
|
7276
7621
|
const renderer = {
|
|
7277
7622
|
ssr: true,
|
|
7623
|
+
|
|
7624
|
+
get isHydrating() {
|
|
7625
|
+
return false;
|
|
7626
|
+
},
|
|
7627
|
+
|
|
7278
7628
|
isNativeShadowDefined: false,
|
|
7279
7629
|
isSyntheticShadowDefined: false,
|
|
7280
7630
|
|
|
@@ -7674,6 +8024,6 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
7674
8024
|
|
|
7675
8025
|
freeze(LightningElement);
|
|
7676
8026
|
seal(LightningElement.prototype);
|
|
7677
|
-
/* version: 2.5.
|
|
8027
|
+
/* version: 2.5.8 */
|
|
7678
8028
|
|
|
7679
8029
|
export { LightningElement, api$1 as api, createContextProvider, getComponentDef, isComponentConstructor, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
|
|
@@ -194,7 +194,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
|
194
194
|
// we can't use typeof since it will fail when transpiling.
|
|
195
195
|
|
|
196
196
|
const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
|
|
197
|
-
/** version: 2.5.
|
|
197
|
+
/** version: 2.5.8 */
|
|
198
198
|
|
|
199
199
|
/*
|
|
200
200
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -533,7 +533,7 @@ if (!_globalThis.lwcRuntimeFlags) {
|
|
|
533
533
|
}
|
|
534
534
|
|
|
535
535
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
536
|
-
/** version: 2.5.
|
|
536
|
+
/** version: 2.5.8 */
|
|
537
537
|
|
|
538
538
|
/*
|
|
539
539
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5829,4 +5829,4 @@ defineProperty(Element.prototype, '$domManual$', {
|
|
|
5829
5829
|
|
|
5830
5830
|
configurable: true
|
|
5831
5831
|
});
|
|
5832
|
-
/** version: 2.5.
|
|
5832
|
+
/** version: 2.5.8 */
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
// we can't use typeof since it will fail when transpiling.
|
|
198
198
|
|
|
199
199
|
const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
|
|
200
|
-
/** version: 2.5.
|
|
200
|
+
/** version: 2.5.8 */
|
|
201
201
|
|
|
202
202
|
/*
|
|
203
203
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
539
|
-
/** version: 2.5.
|
|
539
|
+
/** version: 2.5.8 */
|
|
540
540
|
|
|
541
541
|
/*
|
|
542
542
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5832,6 +5832,6 @@
|
|
|
5832
5832
|
|
|
5833
5833
|
configurable: true
|
|
5834
5834
|
});
|
|
5835
|
-
/** version: 2.5.
|
|
5835
|
+
/** version: 2.5.8 */
|
|
5836
5836
|
|
|
5837
5837
|
})();
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
const KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
126
126
|
const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
127
127
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
128
|
-
/** version: 2.5.
|
|
128
|
+
/** version: 2.5.8 */
|
|
129
129
|
|
|
130
130
|
/*
|
|
131
131
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
}
|
|
465
465
|
|
|
466
466
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
467
|
-
/** version: 2.5.
|
|
467
|
+
/** version: 2.5.8 */
|
|
468
468
|
|
|
469
469
|
/*
|
|
470
470
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5640,6 +5640,6 @@
|
|
|
5640
5640
|
|
|
5641
5641
|
configurable: true
|
|
5642
5642
|
});
|
|
5643
|
-
/** version: 2.5.
|
|
5643
|
+
/** version: 2.5.8 */
|
|
5644
5644
|
|
|
5645
5645
|
})();
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
var hasNativeSymbolSupport = /*@__PURE__*/function () {
|
|
194
194
|
return Symbol('x').toString() === 'Symbol(x)';
|
|
195
195
|
}();
|
|
196
|
-
/** version: 2.5.
|
|
196
|
+
/** version: 2.5.8 */
|
|
197
197
|
|
|
198
198
|
/*
|
|
199
199
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -526,7 +526,7 @@
|
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
529
|
-
/** version: 2.5.
|
|
529
|
+
/** version: 2.5.8 */
|
|
530
530
|
|
|
531
531
|
/*
|
|
532
532
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5631,6 +5631,6 @@
|
|
|
5631
5631
|
},
|
|
5632
5632
|
configurable: true
|
|
5633
5633
|
});
|
|
5634
|
-
/** version: 2.5.
|
|
5634
|
+
/** version: 2.5.8 */
|
|
5635
5635
|
|
|
5636
5636
|
})();
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
var KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
118
118
|
var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
119
119
|
var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
120
|
-
/** version: 2.5.
|
|
120
|
+
/** version: 2.5.8 */
|
|
121
121
|
|
|
122
122
|
/*
|
|
123
123
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -448,7 +448,7 @@
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
451
|
-
/** version: 2.5.
|
|
451
|
+
/** version: 2.5.8 */
|
|
452
452
|
|
|
453
453
|
/*
|
|
454
454
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5435,6 +5435,6 @@
|
|
|
5435
5435
|
},
|
|
5436
5436
|
configurable: true
|
|
5437
5437
|
});
|
|
5438
|
-
/** version: 2.5.
|
|
5438
|
+
/** version: 2.5.8 */
|
|
5439
5439
|
|
|
5440
5440
|
})();
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
// we can't use typeof since it will fail when transpiling.
|
|
200
200
|
|
|
201
201
|
const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
|
|
202
|
-
/** version: 2.5.
|
|
202
|
+
/** version: 2.5.8 */
|
|
203
203
|
|
|
204
204
|
/*
|
|
205
205
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -538,7 +538,7 @@
|
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
541
|
-
/** version: 2.5.
|
|
541
|
+
/** version: 2.5.8 */
|
|
542
542
|
|
|
543
543
|
/*
|
|
544
544
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5834,6 +5834,6 @@
|
|
|
5834
5834
|
|
|
5835
5835
|
configurable: true
|
|
5836
5836
|
});
|
|
5837
|
-
/** version: 2.5.
|
|
5837
|
+
/** version: 2.5.8 */
|
|
5838
5838
|
|
|
5839
5839
|
}));
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
const KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
128
128
|
const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
129
129
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
130
|
-
/** version: 2.5.
|
|
130
|
+
/** version: 2.5.8 */
|
|
131
131
|
|
|
132
132
|
/*
|
|
133
133
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -466,7 +466,7 @@
|
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
469
|
-
/** version: 2.5.
|
|
469
|
+
/** version: 2.5.8 */
|
|
470
470
|
|
|
471
471
|
/*
|
|
472
472
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5642,6 +5642,6 @@
|
|
|
5642
5642
|
|
|
5643
5643
|
configurable: true
|
|
5644
5644
|
});
|
|
5645
|
-
/** version: 2.5.
|
|
5645
|
+
/** version: 2.5.8 */
|
|
5646
5646
|
|
|
5647
5647
|
}));
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
var hasNativeSymbolSupport = /*@__PURE__*/function () {
|
|
196
196
|
return Symbol('x').toString() === 'Symbol(x)';
|
|
197
197
|
}();
|
|
198
|
-
/** version: 2.5.
|
|
198
|
+
/** version: 2.5.8 */
|
|
199
199
|
|
|
200
200
|
/*
|
|
201
201
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
531
|
-
/** version: 2.5.
|
|
531
|
+
/** version: 2.5.8 */
|
|
532
532
|
|
|
533
533
|
/*
|
|
534
534
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5633,6 +5633,6 @@
|
|
|
5633
5633
|
},
|
|
5634
5634
|
configurable: true
|
|
5635
5635
|
});
|
|
5636
|
-
/** version: 2.5.
|
|
5636
|
+
/** version: 2.5.8 */
|
|
5637
5637
|
|
|
5638
5638
|
}));
|