lwc 2.45.0 → 2.45.1

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.
Files changed (64) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +102 -75
  2. package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
  3. package/dist/engine-dom/iife/es2017/engine-dom.js +102 -75
  4. package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
  5. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  6. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +16 -10
  7. package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
  8. package/dist/engine-dom/iife/es5/engine-dom.js +99 -73
  9. package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
  10. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  11. package/dist/engine-dom/iife/es5/engine-dom_debug.js +17 -10
  12. package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
  13. package/dist/engine-dom/umd/es2017/engine-dom.js +102 -75
  14. package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
  15. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  16. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +16 -10
  17. package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
  18. package/dist/engine-dom/umd/es5/engine-dom.js +99 -73
  19. package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
  20. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  21. package/dist/engine-dom/umd/es5/engine-dom_debug.js +17 -10
  22. package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
  23. package/dist/engine-server/commonjs/es2017/engine-server.js +101 -74
  24. package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
  25. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  26. package/dist/engine-server/esm/es2017/engine-server.js +101 -74
  27. package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
  28. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  29. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
  30. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
  34. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  37. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
  38. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
  40. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  41. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
  42. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  43. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
  44. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  45. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
  46. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  47. package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
  48. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  49. package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
  50. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  51. package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
  52. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  53. package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
  54. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  55. package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
  56. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  57. package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
  58. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  59. package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
  60. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  61. package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
  62. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  63. package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
  64. package/package.json +7 -7
@@ -445,9 +445,9 @@ function htmlEscape(str, attrMode = false) {
445
445
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
446
446
  */
447
447
  // Increment whenever the LWC template compiler changes
448
- const LWC_VERSION = "2.45.0";
448
+ const LWC_VERSION = "2.45.1";
449
449
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
450
- /** version: 2.45.0 */
450
+ /** version: 2.45.1 */
451
451
 
452
452
  /**
453
453
  * Copyright (C) 2018 salesforce.com, inc.
@@ -525,7 +525,7 @@ function setFeatureFlagForTest(name, value) {
525
525
  setFeatureFlag(name, value);
526
526
  }
527
527
  }
528
- /** version: 2.45.0 */
528
+ /** version: 2.45.1 */
529
529
 
530
530
  /*
531
531
  * Copyright (c) 2020, salesforce.com, inc.
@@ -621,7 +621,7 @@ function applyAriaReflection(prototype = Element.prototype) {
621
621
  }
622
622
  }
623
623
  }
624
- /** version: 2.45.0 */
624
+ /** version: 2.45.1 */
625
625
 
626
626
  /* proxy-compat-disable */
627
627
 
@@ -934,8 +934,9 @@ function patchElementWithRestrictions(elm, options) {
934
934
  get() {
935
935
  return originalOuterHTMLDescriptor.get.call(this);
936
936
  },
937
- set(_value) {
938
- throw new TypeError(`Invalid attempt to set outerHTML on Element.`);
937
+ set(value) {
938
+ logError(`Invalid attempt to set outerHTML on Element.`);
939
+ return originalOuterHTMLDescriptor.set.call(this, value);
939
940
  },
940
941
  }),
941
942
  };
@@ -1020,16 +1021,18 @@ function getShadowRootRestrictionsDescriptors(sr) {
1020
1021
  get() {
1021
1022
  return originalInnerHTMLDescriptor.get.call(this);
1022
1023
  },
1023
- set(_value) {
1024
- throw new TypeError(`Invalid attempt to set innerHTML on ShadowRoot.`);
1024
+ set(value) {
1025
+ logError(`Invalid attempt to set innerHTML on ShadowRoot.`);
1026
+ return originalInnerHTMLDescriptor.set.call(this, value);
1025
1027
  },
1026
1028
  }),
1027
1029
  textContent: generateAccessorDescriptor({
1028
1030
  get() {
1029
1031
  return originalTextContentDescriptor.get.call(this);
1030
1032
  },
1031
- set(_value) {
1032
- throw new TypeError(`Invalid attempt to set textContent on ShadowRoot.`);
1033
+ set(value) {
1034
+ logError(`Invalid attempt to set textContent on ShadowRoot.`);
1035
+ return originalTextContentDescriptor.set.call(this, value);
1033
1036
  },
1034
1037
  }),
1035
1038
  addEventListener: generateDataDescriptor({
@@ -1058,24 +1061,27 @@ function getCustomElementRestrictionsDescriptors(elm) {
1058
1061
  get() {
1059
1062
  return originalInnerHTMLDescriptor.get.call(this);
1060
1063
  },
1061
- set(_value) {
1062
- throw new TypeError(`Invalid attempt to set innerHTML on HTMLElement.`);
1064
+ set(value) {
1065
+ logError(`Invalid attempt to set innerHTML on HTMLElement.`);
1066
+ return originalInnerHTMLDescriptor.set.call(this, value);
1063
1067
  },
1064
1068
  }),
1065
1069
  outerHTML: generateAccessorDescriptor({
1066
1070
  get() {
1067
1071
  return originalOuterHTMLDescriptor.get.call(this);
1068
1072
  },
1069
- set(_value) {
1070
- throw new TypeError(`Invalid attempt to set outerHTML on HTMLElement.`);
1073
+ set(value) {
1074
+ logError(`Invalid attempt to set outerHTML on HTMLElement.`);
1075
+ return originalOuterHTMLDescriptor.set.call(this, value);
1071
1076
  },
1072
1077
  }),
1073
1078
  textContent: generateAccessorDescriptor({
1074
1079
  get() {
1075
1080
  return originalTextContentDescriptor.get.call(this);
1076
1081
  },
1077
- set(_value) {
1078
- throw new TypeError(`Invalid attempt to set textContent on HTMLElement.`);
1082
+ set(value) {
1083
+ logError(`Invalid attempt to set textContent on HTMLElement.`);
1084
+ return originalTextContentDescriptor.set.call(this, value);
1079
1085
  },
1080
1086
  }),
1081
1087
  addEventListener: generateDataDescriptor({
@@ -1091,20 +1097,6 @@ function getCustomElementRestrictionsDescriptors(elm) {
1091
1097
  }),
1092
1098
  };
1093
1099
  }
1094
- function getComponentRestrictionsDescriptors() {
1095
- assertNotProd(); // this method should never leak to prod
1096
- return {
1097
- tagName: generateAccessorDescriptor({
1098
- get() {
1099
- throw new Error(`Usage of property \`tagName\` is disallowed because the component itself does` +
1100
- ` not know which tagName will be used to create the element, therefore writing` +
1101
- ` code that check for that value is error prone.`);
1102
- },
1103
- configurable: true,
1104
- enumerable: false, // no enumerable properties on component
1105
- }),
1106
- };
1107
- }
1108
1100
  function getLightningElementPrototypeRestrictionsDescriptors(proto) {
1109
1101
  assertNotProd(); // this method should never leak to prod
1110
1102
  const originalDispatchEvent = proto.dispatchEvent;
@@ -1137,9 +1129,6 @@ function patchCustomElementWithRestrictions(elm) {
1137
1129
  const elmProto = getPrototypeOf$1(elm);
1138
1130
  setPrototypeOf(elm, create(elmProto, restrictionsDescriptors));
1139
1131
  }
1140
- function patchComponentWithRestrictions(cmp) {
1141
- defineProperties(cmp, getComponentRestrictionsDescriptors());
1142
- }
1143
1132
  function patchLightningElementPrototypeWithRestrictions(proto) {
1144
1133
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1145
1134
  }
@@ -1742,16 +1731,10 @@ function getReactiveProxy(value) {
1742
1731
  function createBridgeToElementDescriptor(propName, descriptor) {
1743
1732
  const { get, set, enumerable, configurable } = descriptor;
1744
1733
  if (!isFunction$1(get)) {
1745
- if (process.env.NODE_ENV !== 'production') {
1746
- assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard getter.`);
1747
- }
1748
- throw new TypeError();
1734
+ throw new TypeError(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard getter.`);
1749
1735
  }
1750
1736
  if (!isFunction$1(set)) {
1751
- if (process.env.NODE_ENV !== 'production') {
1752
- assert.fail(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard setter.`);
1753
- }
1754
- throw new TypeError();
1737
+ throw new TypeError(`Detected invalid public property descriptor for HTMLElement.prototype.${propName} definition. Missing the standard setter.`);
1755
1738
  }
1756
1739
  return {
1757
1740
  enumerable,
@@ -1770,10 +1753,18 @@ function createBridgeToElementDescriptor(propName, descriptor) {
1770
1753
  const vm = getAssociatedVM(this);
1771
1754
  if (process.env.NODE_ENV !== 'production') {
1772
1755
  const vmBeingRendered = getVMBeingRendered();
1773
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${propName}`);
1774
- assert.invariant(!isUpdatingTemplate, `When updating the template of ${vmBeingRendered}, one of the accessors used by the template has side effects on the state of ${vm}.${propName}`);
1775
- assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1776
- assert.invariant(!isObject(newValue) || isNull(newValue), `Invalid value "${newValue}" for "${propName}" of ${vm}. Value cannot be an object, must be a primitive value.`);
1756
+ if (isInvokingRender) {
1757
+ logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm}.${propName}`);
1758
+ }
1759
+ if (isUpdatingTemplate) {
1760
+ logError(`When updating the template of ${vmBeingRendered}, one of the accessors used by the template has side effects on the state of ${vm}.${propName}`);
1761
+ }
1762
+ if (isBeingConstructed(vm)) {
1763
+ logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1764
+ }
1765
+ if (isObject(newValue) && !isNull(newValue)) {
1766
+ logError(`Invalid value "${newValue}" for "${propName}" of ${vm}. Value cannot be an object, must be a primitive value.`);
1767
+ }
1777
1768
  }
1778
1769
  updateComponentValue(vm, propName, newValue);
1779
1770
  return set.call(vm.elm, newValue);
@@ -1825,7 +1816,6 @@ const LightningElement = function () {
1825
1816
  // Adding extra guard rails in DEV mode.
1826
1817
  if (process.env.NODE_ENV !== 'production') {
1827
1818
  patchCustomElementWithRestrictions(elm);
1828
- patchComponentWithRestrictions(component);
1829
1819
  }
1830
1820
  return this;
1831
1821
  };
@@ -1861,9 +1851,15 @@ LightningElement.prototype = {
1861
1851
  const { elm, renderer: { addEventListener }, } = vm;
1862
1852
  if (process.env.NODE_ENV !== 'production') {
1863
1853
  const vmBeingRendered = getVMBeingRendered();
1864
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm} by adding an event listener for "${type}".`);
1865
- assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm} by adding an event listener for "${type}".`);
1866
- assert.invariant(isFunction$1(listener), `Invalid second argument for this.addEventListener() in ${vm} for event "${type}". Expected an EventListener but received ${listener}.`);
1854
+ if (isInvokingRender) {
1855
+ logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm} by adding an event listener for "${type}".`);
1856
+ }
1857
+ if (isUpdatingTemplate) {
1858
+ logError(`Updating the template of ${vmBeingRendered} has side effects on the state of ${vm} by adding an event listener for "${type}".`);
1859
+ }
1860
+ if (!isFunction$1(listener)) {
1861
+ logError(`Invalid second argument for this.addEventListener() in ${vm} for event "${type}". Expected an EventListener but received ${listener}.`);
1862
+ }
1867
1863
  }
1868
1864
  const wrappedListener = getWrappedComponentsListener(vm, listener);
1869
1865
  addEventListener(elm, type, wrappedListener, options);
@@ -1913,7 +1909,9 @@ LightningElement.prototype = {
1913
1909
  const vm = getAssociatedVM(this);
1914
1910
  const { elm, renderer: { setAttribute }, } = vm;
1915
1911
  if (process.env.NODE_ENV !== 'production') {
1916
- assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1912
+ if (isBeingConstructed(vm)) {
1913
+ logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1914
+ }
1917
1915
  }
1918
1916
  unlockAttribute(elm, name);
1919
1917
  setAttribute(elm, name, value);
@@ -1923,7 +1921,9 @@ LightningElement.prototype = {
1923
1921
  const vm = getAssociatedVM(this);
1924
1922
  const { elm, renderer: { setAttribute }, } = vm;
1925
1923
  if (process.env.NODE_ENV !== 'production') {
1926
- assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1924
+ if (isBeingConstructed(vm)) {
1925
+ logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1926
+ }
1927
1927
  }
1928
1928
  unlockAttribute(elm, name);
1929
1929
  setAttribute(elm, name, value, namespace);
@@ -1946,9 +1946,9 @@ LightningElement.prototype = {
1946
1946
  const vm = getAssociatedVM(this);
1947
1947
  const { elm, renderer: { getClassList }, } = vm;
1948
1948
  if (process.env.NODE_ENV !== 'production') {
1949
- // TODO [#1290]: this still fails in dev but works in production, eventually, we should
1950
- // just throw in all modes
1951
- assert.isFalse(isBeingConstructed(vm), `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.`);
1949
+ if (isBeingConstructed(vm)) {
1950
+ 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.`);
1951
+ }
1952
1952
  }
1953
1953
  return getClassList(elm);
1954
1954
  },
@@ -2439,8 +2439,12 @@ function createPublicPropertyDescriptor(key) {
2439
2439
  const vm = getAssociatedVM(this);
2440
2440
  if (process.env.NODE_ENV !== 'production') {
2441
2441
  const vmBeingRendered = getVMBeingRendered();
2442
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2443
- assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2442
+ if (isInvokingRender) {
2443
+ logError(`render() method has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
2444
+ }
2445
+ if (isUpdatingTemplate) {
2446
+ logError(`Updating the template has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
2447
+ }
2444
2448
  }
2445
2449
  vm.cmpProps[key] = newValue;
2446
2450
  },
@@ -2463,14 +2467,18 @@ function createPublicAccessorDescriptor(key, descriptor) {
2463
2467
  const vm = getAssociatedVM(this);
2464
2468
  if (process.env.NODE_ENV !== 'production') {
2465
2469
  const vmBeingRendered = getVMBeingRendered();
2466
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2467
- assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2470
+ if (isInvokingRender) {
2471
+ logError(`render() method has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
2472
+ }
2473
+ if (isUpdatingTemplate) {
2474
+ logError(`Updating the template has side effects on the state of property "${toString$1(key)}"`, isNull(vmBeingRendered) ? vm : vmBeingRendered);
2475
+ }
2468
2476
  }
2469
2477
  if (set) {
2470
2478
  set.call(this, newValue);
2471
2479
  }
2472
2480
  else if (process.env.NODE_ENV !== 'production') {
2473
- assert.fail(`Invalid attempt to set a new value for property ${toString$1(key)} of ${vm} that does not has a setter decorated with @api.`);
2481
+ logError(`Invalid attempt to set a new value for property "${toString$1(key)}" that does not has a setter decorated with @api.`, vm);
2474
2482
  }
2475
2483
  },
2476
2484
  enumerable,
@@ -2503,8 +2511,12 @@ function internalTrackDecorator(key) {
2503
2511
  const vm = getAssociatedVM(this);
2504
2512
  if (process.env.NODE_ENV !== 'production') {
2505
2513
  const vmBeingRendered = getVMBeingRendered();
2506
- assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2507
- assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2514
+ if (isInvokingRender) {
2515
+ logError(`${vmBeingRendered}.render() method has side effects on the state of ${vm}.${toString$1(key)}`);
2516
+ }
2517
+ if (isUpdatingTemplate) {
2518
+ logError(`Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2519
+ }
2508
2520
  }
2509
2521
  const reactiveOrAnyValue = getReactiveProxy(newValue);
2510
2522
  updateComponentValue(vm, key, reactiveOrAnyValue);
@@ -3178,13 +3190,20 @@ function createComponentDef(Ctor) {
3178
3190
  const ctorName = Ctor.name;
3179
3191
  // Removing the following assert until https://bugs.webkit.org/show_bug.cgi?id=190140 is fixed.
3180
3192
  // assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
3181
- assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
3182
- if (!isUndefined$1(ctorShadowSupportMode)) {
3183
- assert.invariant(ctorShadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
3184
- ctorShadowSupportMode === "reset" /* ShadowSupportMode.Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
3193
+ if (!Ctor.constructor) {
3194
+ // This error seems impossible to hit, due to an earlier check in `isComponentConstructor()`.
3195
+ // But we keep it here just in case.
3196
+ logError(`Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
3197
+ }
3198
+ if (!isUndefined$1(ctorShadowSupportMode) &&
3199
+ ctorShadowSupportMode !== "any" /* ShadowSupportMode.Any */ &&
3200
+ ctorShadowSupportMode !== "reset" /* ShadowSupportMode.Default */) {
3201
+ logError(`Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
3185
3202
  }
3186
- if (!isUndefined$1(ctorRenderMode)) {
3187
- assert.invariant(ctorRenderMode === 'light' || ctorRenderMode === 'shadow', `Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
3203
+ if (!isUndefined$1(ctorRenderMode) &&
3204
+ ctorRenderMode !== 'light' &&
3205
+ ctorRenderMode !== 'shadow') {
3206
+ logError(`Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
3188
3207
  }
3189
3208
  }
3190
3209
  const decoratorsMeta = getDecoratorsMeta(Ctor);
@@ -4912,7 +4931,7 @@ function k(compilerKey, obj) {
4912
4931
  return compilerKey + ':' + obj;
4913
4932
  case 'object':
4914
4933
  if (process.env.NODE_ENV !== 'production') {
4915
- assert.fail(`Invalid key value "${obj}" in ${getVMBeingRendered()}. Key must be a string or number.`);
4934
+ logError(`Invalid key value "${obj}" in ${getVMBeingRendered()}. Key must be a string or number.`);
4916
4935
  }
4917
4936
  }
4918
4937
  }
@@ -5168,13 +5187,19 @@ function validateSlots(vm) {
5168
5187
  }
5169
5188
  }
5170
5189
  function validateLightDomTemplate(template, vm) {
5171
- if (template === defaultEmptyTemplate)
5190
+ assertNotProd(); // should never leak to prod mode
5191
+ if (template === defaultEmptyTemplate) {
5172
5192
  return;
5193
+ }
5173
5194
  if (vm.renderMode === 0 /* RenderMode.Light */) {
5174
- assert.isTrue(template.renderMode === 'light', `Light DOM components can't render shadow DOM templates. Add an 'lwc:render-mode="light"' directive to the root template tag of ${getComponentTag(vm)}.`);
5195
+ if (template.renderMode !== 'light') {
5196
+ 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)}.`);
5197
+ }
5175
5198
  }
5176
5199
  else {
5177
- assert.isTrue(isUndefined$1(template.renderMode), `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"`);
5200
+ if (!isUndefined$1(template.renderMode)) {
5201
+ 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"`);
5202
+ }
5178
5203
  }
5179
5204
  }
5180
5205
  function buildParseFragmentFn(createFragmentFn) {
@@ -5302,7 +5327,9 @@ function evaluateTemplate(vm, html) {
5302
5327
  logOperationEnd(1 /* OperationId.Render */, vm);
5303
5328
  });
5304
5329
  if (process.env.NODE_ENV !== 'production') {
5305
- assert.invariant(isArray$1(vnodes), `Compiler should produce html functions that always return an array.`);
5330
+ if (!isArray$1(vnodes)) {
5331
+ logError(`Compiler should produce html functions that always return an array.`);
5332
+ }
5306
5333
  }
5307
5334
  return vnodes;
5308
5335
  }
@@ -6219,7 +6246,7 @@ function readonly(obj) {
6219
6246
  }
6220
6247
  return getReadOnlyProxy(obj);
6221
6248
  }
6222
- /* version: 2.45.0 */
6249
+ /* version: 2.45.1 */
6223
6250
 
6224
6251
  /*
6225
6252
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6800,7 +6827,7 @@ seal(LightningElement.prototype);
6800
6827
  function createElement() {
6801
6828
  throw new Error('createElement is not supported in @lwc/engine-server, only @lwc/engine-dom.');
6802
6829
  }
6803
- /* version: 2.45.0 */
6830
+ /* version: 2.45.1 */
6804
6831
 
6805
6832
  export { LightningElement, api$1 as api, createContextProvider, createElement, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
6806
6833
  //# sourceMappingURL=engine-server.js.map