lwc 2.45.0 → 2.45.2
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 +158 -83
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +158 -83
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +75 -18
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +162 -79
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +83 -16
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +158 -83
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +75 -18
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +162 -79
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +83 -16
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +102 -75
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +102 -75
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -67,7 +67,7 @@ var assert = /*#__PURE__*/Object.freeze({
|
|
|
67
67
|
*/
|
|
68
68
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
69
69
|
const { isArray: isArray$1 } = Array;
|
|
70
|
-
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
70
|
+
const { concat: ArrayConcat$1, copyWithin: ArrayCopyWithin, every: ArrayEvery, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, findIndex: ArrayFindIndex, includes: ArrayIncludes, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
71
71
|
const { fromCharCode: StringFromCharCode } = String;
|
|
72
72
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
73
73
|
function isUndefined$1(obj) {
|
|
@@ -466,9 +466,9 @@ function htmlEscape(str, attrMode = false) {
|
|
|
466
466
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
467
467
|
*/
|
|
468
468
|
// Increment whenever the LWC template compiler changes
|
|
469
|
-
const LWC_VERSION = "2.45.
|
|
469
|
+
const LWC_VERSION = "2.45.2";
|
|
470
470
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
471
|
-
/** version: 2.45.
|
|
471
|
+
/** version: 2.45.2 */
|
|
472
472
|
|
|
473
473
|
/**
|
|
474
474
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -546,7 +546,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
546
546
|
setFeatureFlag(name, value);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
|
-
/** version: 2.45.
|
|
549
|
+
/** version: 2.45.2 */
|
|
550
550
|
|
|
551
551
|
/*
|
|
552
552
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -642,7 +642,7 @@ function applyAriaReflection(prototype = Element.prototype) {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
/** version: 2.45.
|
|
645
|
+
/** version: 2.45.2 */
|
|
646
646
|
|
|
647
647
|
/* proxy-compat-disable */
|
|
648
648
|
|
|
@@ -955,8 +955,9 @@ function patchElementWithRestrictions(elm, options) {
|
|
|
955
955
|
get() {
|
|
956
956
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
957
957
|
},
|
|
958
|
-
set(
|
|
959
|
-
|
|
958
|
+
set(value) {
|
|
959
|
+
logError(`Invalid attempt to set outerHTML on Element.`);
|
|
960
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
960
961
|
},
|
|
961
962
|
}),
|
|
962
963
|
};
|
|
@@ -1041,16 +1042,18 @@ function getShadowRootRestrictionsDescriptors(sr) {
|
|
|
1041
1042
|
get() {
|
|
1042
1043
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1043
1044
|
},
|
|
1044
|
-
set(
|
|
1045
|
-
|
|
1045
|
+
set(value) {
|
|
1046
|
+
logError(`Invalid attempt to set innerHTML on ShadowRoot.`);
|
|
1047
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1046
1048
|
},
|
|
1047
1049
|
}),
|
|
1048
1050
|
textContent: generateAccessorDescriptor({
|
|
1049
1051
|
get() {
|
|
1050
1052
|
return originalTextContentDescriptor.get.call(this);
|
|
1051
1053
|
},
|
|
1052
|
-
set(
|
|
1053
|
-
|
|
1054
|
+
set(value) {
|
|
1055
|
+
logError(`Invalid attempt to set textContent on ShadowRoot.`);
|
|
1056
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1054
1057
|
},
|
|
1055
1058
|
}),
|
|
1056
1059
|
addEventListener: generateDataDescriptor({
|
|
@@ -1079,24 +1082,27 @@ function getCustomElementRestrictionsDescriptors(elm) {
|
|
|
1079
1082
|
get() {
|
|
1080
1083
|
return originalInnerHTMLDescriptor.get.call(this);
|
|
1081
1084
|
},
|
|
1082
|
-
set(
|
|
1083
|
-
|
|
1085
|
+
set(value) {
|
|
1086
|
+
logError(`Invalid attempt to set innerHTML on HTMLElement.`);
|
|
1087
|
+
return originalInnerHTMLDescriptor.set.call(this, value);
|
|
1084
1088
|
},
|
|
1085
1089
|
}),
|
|
1086
1090
|
outerHTML: generateAccessorDescriptor({
|
|
1087
1091
|
get() {
|
|
1088
1092
|
return originalOuterHTMLDescriptor.get.call(this);
|
|
1089
1093
|
},
|
|
1090
|
-
set(
|
|
1091
|
-
|
|
1094
|
+
set(value) {
|
|
1095
|
+
logError(`Invalid attempt to set outerHTML on HTMLElement.`);
|
|
1096
|
+
return originalOuterHTMLDescriptor.set.call(this, value);
|
|
1092
1097
|
},
|
|
1093
1098
|
}),
|
|
1094
1099
|
textContent: generateAccessorDescriptor({
|
|
1095
1100
|
get() {
|
|
1096
1101
|
return originalTextContentDescriptor.get.call(this);
|
|
1097
1102
|
},
|
|
1098
|
-
set(
|
|
1099
|
-
|
|
1103
|
+
set(value) {
|
|
1104
|
+
logError(`Invalid attempt to set textContent on HTMLElement.`);
|
|
1105
|
+
return originalTextContentDescriptor.set.call(this, value);
|
|
1100
1106
|
},
|
|
1101
1107
|
}),
|
|
1102
1108
|
addEventListener: generateDataDescriptor({
|
|
@@ -1112,20 +1118,6 @@ function getCustomElementRestrictionsDescriptors(elm) {
|
|
|
1112
1118
|
}),
|
|
1113
1119
|
};
|
|
1114
1120
|
}
|
|
1115
|
-
function getComponentRestrictionsDescriptors() {
|
|
1116
|
-
assertNotProd(); // this method should never leak to prod
|
|
1117
|
-
return {
|
|
1118
|
-
tagName: generateAccessorDescriptor({
|
|
1119
|
-
get() {
|
|
1120
|
-
throw new Error(`Usage of property \`tagName\` is disallowed because the component itself does` +
|
|
1121
|
-
` not know which tagName will be used to create the element, therefore writing` +
|
|
1122
|
-
` code that check for that value is error prone.`);
|
|
1123
|
-
},
|
|
1124
|
-
configurable: true,
|
|
1125
|
-
enumerable: false, // no enumerable properties on component
|
|
1126
|
-
}),
|
|
1127
|
-
};
|
|
1128
|
-
}
|
|
1129
1121
|
function getLightningElementPrototypeRestrictionsDescriptors(proto) {
|
|
1130
1122
|
assertNotProd(); // this method should never leak to prod
|
|
1131
1123
|
const originalDispatchEvent = proto.dispatchEvent;
|
|
@@ -1158,9 +1150,6 @@ function patchCustomElementWithRestrictions(elm) {
|
|
|
1158
1150
|
const elmProto = getPrototypeOf$1(elm);
|
|
1159
1151
|
setPrototypeOf(elm, create(elmProto, restrictionsDescriptors));
|
|
1160
1152
|
}
|
|
1161
|
-
function patchComponentWithRestrictions(cmp) {
|
|
1162
|
-
defineProperties(cmp, getComponentRestrictionsDescriptors());
|
|
1163
|
-
}
|
|
1164
1153
|
function patchLightningElementPrototypeWithRestrictions(proto) {
|
|
1165
1154
|
defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
|
|
1166
1155
|
}
|
|
@@ -1763,16 +1752,10 @@ function getReactiveProxy(value) {
|
|
|
1763
1752
|
function createBridgeToElementDescriptor(propName, descriptor) {
|
|
1764
1753
|
const { get, set, enumerable, configurable } = descriptor;
|
|
1765
1754
|
if (!isFunction$1(get)) {
|
|
1766
|
-
|
|
1767
|
-
assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard getter.`);
|
|
1768
|
-
}
|
|
1769
|
-
throw new TypeError();
|
|
1755
|
+
throw new TypeError(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard getter.`);
|
|
1770
1756
|
}
|
|
1771
1757
|
if (!isFunction$1(set)) {
|
|
1772
|
-
|
|
1773
|
-
assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard setter.`);
|
|
1774
|
-
}
|
|
1775
|
-
throw new TypeError();
|
|
1758
|
+
throw new TypeError(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard setter.`);
|
|
1776
1759
|
}
|
|
1777
1760
|
return {
|
|
1778
1761
|
enumerable,
|
|
@@ -1791,10 +1774,18 @@ function createBridgeToElementDescriptor(propName, descriptor) {
|
|
|
1791
1774
|
const vm = getAssociatedVM(this);
|
|
1792
1775
|
if (process.env.NODE_ENV !== 'production') {
|
|
1793
1776
|
const vmBeingRendered = getVMBeingRendered();
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1777
|
+
if (isInvokingRender) {
|
|
1778
|
+
logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm}.${propName}`);
|
|
1779
|
+
}
|
|
1780
|
+
if (isUpdatingTemplate) {
|
|
1781
|
+
logError(`When updating the template of ${vmBeingRendered}, one of the accessors used by the template has side effects on the state of ${vm}.${propName}`);
|
|
1782
|
+
}
|
|
1783
|
+
if (isBeingConstructed(vm)) {
|
|
1784
|
+
logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
1785
|
+
}
|
|
1786
|
+
if (isObject(newValue) && !isNull(newValue)) {
|
|
1787
|
+
logError(`Invalid value "${newValue}" for "${propName}" of ${vm}. Value cannot be an object, must be a primitive value.`);
|
|
1788
|
+
}
|
|
1798
1789
|
}
|
|
1799
1790
|
updateComponentValue(vm, propName, newValue);
|
|
1800
1791
|
return set.call(vm.elm, newValue);
|
|
@@ -1846,7 +1837,6 @@ const LightningElement = function () {
|
|
|
1846
1837
|
// Adding extra guard rails in DEV mode.
|
|
1847
1838
|
if (process.env.NODE_ENV !== 'production') {
|
|
1848
1839
|
patchCustomElementWithRestrictions(elm);
|
|
1849
|
-
patchComponentWithRestrictions(component);
|
|
1850
1840
|
}
|
|
1851
1841
|
return this;
|
|
1852
1842
|
};
|
|
@@ -1882,9 +1872,15 @@ LightningElement.prototype = {
|
|
|
1882
1872
|
const { elm, renderer: { addEventListener }, } = vm;
|
|
1883
1873
|
if (process.env.NODE_ENV !== 'production') {
|
|
1884
1874
|
const vmBeingRendered = getVMBeingRendered();
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1875
|
+
if (isInvokingRender) {
|
|
1876
|
+
logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm} by adding an event listener for "${type}".`);
|
|
1877
|
+
}
|
|
1878
|
+
if (isUpdatingTemplate) {
|
|
1879
|
+
logError(`Updating the template of ${vmBeingRendered} has side effects on the state of ${vm} by adding an event listener for "${type}".`);
|
|
1880
|
+
}
|
|
1881
|
+
if (!isFunction$1(listener)) {
|
|
1882
|
+
logError(`Invalid second argument for this.addEventListener() in ${vm} for event "${type}". Expected an EventListener but received ${listener}.`);
|
|
1883
|
+
}
|
|
1888
1884
|
}
|
|
1889
1885
|
const wrappedListener = getWrappedComponentsListener(vm, listener);
|
|
1890
1886
|
addEventListener(elm, type, wrappedListener, options);
|
|
@@ -1934,7 +1930,9 @@ LightningElement.prototype = {
|
|
|
1934
1930
|
const vm = getAssociatedVM(this);
|
|
1935
1931
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1936
1932
|
if (process.env.NODE_ENV !== 'production') {
|
|
1937
|
-
|
|
1933
|
+
if (isBeingConstructed(vm)) {
|
|
1934
|
+
logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
1935
|
+
}
|
|
1938
1936
|
}
|
|
1939
1937
|
unlockAttribute(elm, name);
|
|
1940
1938
|
setAttribute(elm, name, value);
|
|
@@ -1944,7 +1942,9 @@ LightningElement.prototype = {
|
|
|
1944
1942
|
const vm = getAssociatedVM(this);
|
|
1945
1943
|
const { elm, renderer: { setAttribute }, } = vm;
|
|
1946
1944
|
if (process.env.NODE_ENV !== 'production') {
|
|
1947
|
-
|
|
1945
|
+
if (isBeingConstructed(vm)) {
|
|
1946
|
+
logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
|
|
1947
|
+
}
|
|
1948
1948
|
}
|
|
1949
1949
|
unlockAttribute(elm, name);
|
|
1950
1950
|
setAttribute(elm, name, value, namespace);
|
|
@@ -1967,9 +1967,9 @@ LightningElement.prototype = {
|
|
|
1967
1967
|
const vm = getAssociatedVM(this);
|
|
1968
1968
|
const { elm, renderer: { getClassList }, } = vm;
|
|
1969
1969
|
if (process.env.NODE_ENV !== 'production') {
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1970
|
+
if (isBeingConstructed(vm)) {
|
|
1971
|
+
logError(`Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
|
|
1972
|
+
}
|
|
1973
1973
|
}
|
|
1974
1974
|
return getClassList(elm);
|
|
1975
1975
|
},
|
|
@@ -2460,8 +2460,12 @@ function createPublicPropertyDescriptor(key) {
|
|
|
2460
2460
|
const vm = getAssociatedVM(this);
|
|
2461
2461
|
if (process.env.NODE_ENV !== 'production') {
|
|
2462
2462
|
const vmBeingRendered = getVMBeingRendered();
|
|
2463
|
-
|
|
2464
|
-
|
|
2463
|
+
if (isInvokingRender) {
|
|
2464
|
+
logError(`render() method has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
|
|
2465
|
+
}
|
|
2466
|
+
if (isUpdatingTemplate) {
|
|
2467
|
+
logError(`Updating the template has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
|
|
2468
|
+
}
|
|
2465
2469
|
}
|
|
2466
2470
|
vm.cmpProps[key] = newValue;
|
|
2467
2471
|
},
|
|
@@ -2484,14 +2488,18 @@ function createPublicAccessorDescriptor(key, descriptor) {
|
|
|
2484
2488
|
const vm = getAssociatedVM(this);
|
|
2485
2489
|
if (process.env.NODE_ENV !== 'production') {
|
|
2486
2490
|
const vmBeingRendered = getVMBeingRendered();
|
|
2487
|
-
|
|
2488
|
-
|
|
2491
|
+
if (isInvokingRender) {
|
|
2492
|
+
logError(`render() method has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
|
|
2493
|
+
}
|
|
2494
|
+
if (isUpdatingTemplate) {
|
|
2495
|
+
logError(`Updating the template has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
|
|
2496
|
+
}
|
|
2489
2497
|
}
|
|
2490
2498
|
if (set) {
|
|
2491
2499
|
set.call(this, newValue);
|
|
2492
2500
|
}
|
|
2493
2501
|
else if (process.env.NODE_ENV !== 'production') {
|
|
2494
|
-
|
|
2502
|
+
logError(`Invalid attempt to set a new value for property "${toString$1(key)}" that does not has a setter decorated with @api.`, vm);
|
|
2495
2503
|
}
|
|
2496
2504
|
},
|
|
2497
2505
|
enumerable,
|
|
@@ -2524,8 +2532,12 @@ function internalTrackDecorator(key) {
|
|
|
2524
2532
|
const vm = getAssociatedVM(this);
|
|
2525
2533
|
if (process.env.NODE_ENV !== 'production') {
|
|
2526
2534
|
const vmBeingRendered = getVMBeingRendered();
|
|
2527
|
-
|
|
2528
|
-
|
|
2535
|
+
if (isInvokingRender) {
|
|
2536
|
+
logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
|
|
2537
|
+
}
|
|
2538
|
+
if (isUpdatingTemplate) {
|
|
2539
|
+
logError(`Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
|
|
2540
|
+
}
|
|
2529
2541
|
}
|
|
2530
2542
|
const reactiveOrAnyValue = getReactiveProxy(newValue);
|
|
2531
2543
|
updateComponentValue(vm, key, reactiveOrAnyValue);
|
|
@@ -3199,13 +3211,20 @@ function createComponentDef(Ctor) {
|
|
|
3199
3211
|
const ctorName = Ctor.name;
|
|
3200
3212
|
// Removing the following assert until https://bugs.webkit.org/show_bug.cgi?id=190140 is fixed.
|
|
3201
3213
|
// assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3214
|
+
if (!Ctor.constructor) {
|
|
3215
|
+
// This error seems impossible to hit, due to an earlier check in `isComponentConstructor()`.
|
|
3216
|
+
// But we keep it here just in case.
|
|
3217
|
+
logError(`Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
3218
|
+
}
|
|
3219
|
+
if (!isUndefined$1(ctorShadowSupportMode) &&
|
|
3220
|
+
ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ &&
|
|
3221
|
+
ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */) {
|
|
3222
|
+
logError(`Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3206
3223
|
}
|
|
3207
|
-
if (!isUndefined$1(ctorRenderMode)
|
|
3208
|
-
|
|
3224
|
+
if (!isUndefined$1(ctorRenderMode) &&
|
|
3225
|
+
ctorRenderMode !== 'light' &&
|
|
3226
|
+
ctorRenderMode !== 'shadow') {
|
|
3227
|
+
logError(`Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
|
|
3209
3228
|
}
|
|
3210
3229
|
}
|
|
3211
3230
|
const decoratorsMeta = getDecoratorsMeta(Ctor);
|
|
@@ -4933,7 +4952,7 @@ function k(compilerKey, obj) {
|
|
|
4933
4952
|
return compilerKey + ':' + obj;
|
|
4934
4953
|
case 'object':
|
|
4935
4954
|
if (process.env.NODE_ENV !== 'production') {
|
|
4936
|
-
|
|
4955
|
+
logError(`Invalid key value "${obj}" in ${getVMBeingRendered()}. Key must be a string or number.`);
|
|
4937
4956
|
}
|
|
4938
4957
|
}
|
|
4939
4958
|
}
|
|
@@ -5189,13 +5208,19 @@ function validateSlots(vm) {
|
|
|
5189
5208
|
}
|
|
5190
5209
|
}
|
|
5191
5210
|
function validateLightDomTemplate(template, vm) {
|
|
5192
|
-
|
|
5211
|
+
assertNotProd(); // should never leak to prod mode
|
|
5212
|
+
if (template === defaultEmptyTemplate) {
|
|
5193
5213
|
return;
|
|
5214
|
+
}
|
|
5194
5215
|
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
5195
|
-
|
|
5216
|
+
if (template.renderMode !== 'light') {
|
|
5217
|
+
logError(`Light DOM components can't render shadow DOM templates. Add an 'lwc:render-mode="light"' directive to the root template tag of ${getComponentTag(vm)}.`);
|
|
5218
|
+
}
|
|
5196
5219
|
}
|
|
5197
5220
|
else {
|
|
5198
|
-
|
|
5221
|
+
if (!isUndefined$1(template.renderMode)) {
|
|
5222
|
+
logError(`Shadow DOM components template can't render light DOM templates. Either remove the 'lwc:render-mode' directive from ${getComponentTag(vm)} or set it to 'lwc:render-mode="shadow"`);
|
|
5223
|
+
}
|
|
5199
5224
|
}
|
|
5200
5225
|
}
|
|
5201
5226
|
function buildParseFragmentFn(createFragmentFn) {
|
|
@@ -5323,7 +5348,9 @@ function evaluateTemplate(vm, html) {
|
|
|
5323
5348
|
logOperationEnd(1 /* OperationId.Render */, vm);
|
|
5324
5349
|
});
|
|
5325
5350
|
if (process.env.NODE_ENV !== 'production') {
|
|
5326
|
-
|
|
5351
|
+
if (!isArray$1(vnodes)) {
|
|
5352
|
+
logError(`Compiler should produce html functions that always return an array.`);
|
|
5353
|
+
}
|
|
5327
5354
|
}
|
|
5328
5355
|
return vnodes;
|
|
5329
5356
|
}
|
|
@@ -6240,7 +6267,7 @@ function readonly(obj) {
|
|
|
6240
6267
|
}
|
|
6241
6268
|
return getReadOnlyProxy(obj);
|
|
6242
6269
|
}
|
|
6243
|
-
/* version: 2.45.
|
|
6270
|
+
/* version: 2.45.2 */
|
|
6244
6271
|
|
|
6245
6272
|
/*
|
|
6246
6273
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6821,7 +6848,7 @@ seal(LightningElement.prototype);
|
|
|
6821
6848
|
function createElement() {
|
|
6822
6849
|
throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
|
|
6823
6850
|
}
|
|
6824
|
-
/* version: 2.45.
|
|
6851
|
+
/* version: 2.45.2 */
|
|
6825
6852
|
|
|
6826
6853
|
exports.LightningElement = LightningElement;
|
|
6827
6854
|
exports.api = api$1;
|