lwc 2.21.1 → 2.23.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 (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +222 -199
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +222 -199
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +211 -188
  5. package/dist/engine-dom/iife/es5/engine-dom.js +263 -216
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +239 -192
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +222 -199
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +211 -188
  11. package/dist/engine-dom/umd/es5/engine-dom.js +263 -216
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +239 -192
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +116 -403
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +116 -403
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +30 -27
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +30 -27
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +29 -26
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +32 -31
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +31 -30
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +30 -27
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +29 -26
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +32 -31
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +31 -30
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -349,7 +349,11 @@
349
349
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
350
350
  return attributeName;
351
351
  }
352
- /** version: 2.21.1 */
352
+ /** version: 2.23.1 */
353
+
354
+ /**
355
+ * Copyright (C) 2018 salesforce.com, inc.
356
+ */
353
357
 
354
358
  /*
355
359
  * Copyright (c) 2018, salesforce.com, inc.
@@ -359,7 +363,7 @@
359
363
  */
360
364
 
361
365
  function detect(propName) {
362
- return Object.getOwnPropertyDescriptor(Element.prototype, propName) === undefined;
366
+ return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
363
367
  }
364
368
  /*
365
369
  * Copyright (c) 2018, salesforce.com, inc.
@@ -439,6 +443,8 @@
439
443
  patch$1(propName);
440
444
  }
441
445
  }
446
+ /** version: 2.23.1 */
447
+
442
448
  /**
443
449
  * Copyright (C) 2018 salesforce.com, inc.
444
450
  */
@@ -471,7 +477,7 @@
471
477
  });
472
478
  }
473
479
 
474
- var runtimeFlags = _globalThis.lwcRuntimeFlags;
480
+ var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
475
481
  /**
476
482
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
477
483
  * flag. It is meant to be used during the app initialization.
@@ -499,7 +505,7 @@
499
505
 
500
506
  {
501
507
  // Disallow the same flag to be set more than once in production
502
- var runtimeValue = runtimeFlags[name];
508
+ var runtimeValue = lwcRuntimeFlags[name];
503
509
 
504
510
  if (!isUndefined$1(runtimeValue)) {
505
511
  // eslint-disable-next-line no-console
@@ -507,7 +513,7 @@
507
513
  return;
508
514
  }
509
515
 
510
- defineProperty(runtimeFlags, name, {
516
+ defineProperty(lwcRuntimeFlags, name, {
511
517
  value: value
512
518
  });
513
519
  }
@@ -737,20 +743,24 @@
737
743
 
738
744
  return ReactiveObserver;
739
745
  }();
740
- /*
741
- * Copyright (c) 2018, salesforce.com, inc.
742
- * All rights reserved.
743
- * SPDX-License-Identifier: MIT
744
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
745
- */
746
-
747
746
 
748
747
  function componentValueMutated(vm, key) {
749
- valueMutated(vm.component, key);
748
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
749
+ {
750
+ valueMutated(vm.component, key);
751
+ }
750
752
  }
751
753
 
752
754
  function componentValueObserved(vm, key) {
753
- valueObserved(vm.component, key);
755
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
756
+ {
757
+ valueObserved(vm.component, key);
758
+ }
759
+ }
760
+
761
+ function createReactiveObserver(callback) {
762
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
763
+ return new ReactiveObserver(callback);
754
764
  }
755
765
  /*
756
766
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1015,6 +1025,15 @@
1015
1025
  HTMLElementOriginalDescriptors[propName] = descriptor;
1016
1026
  }
1017
1027
  });
1028
+
1029
+ function updateComponentValue(vm, key, newValue) {
1030
+ var cmpFields = vm.cmpFields;
1031
+
1032
+ if (newValue !== cmpFields[key]) {
1033
+ cmpFields[key] = newValue;
1034
+ componentValueMutated(vm, key);
1035
+ }
1036
+ }
1018
1037
  /**
1019
1038
  * Copyright (C) 2017 salesforce.com, inc.
1020
1039
  */
@@ -1675,8 +1694,28 @@
1675
1694
  */
1676
1695
 
1677
1696
  function unwrap(value) {
1697
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1678
1698
  return reactiveMembrane.unwrapProxy(value);
1679
1699
  }
1700
+
1701
+ function getReadOnlyProxy(value) {
1702
+ // We must return a frozen wrapper around the value, so that child components cannot mutate properties passed to
1703
+ // them from their parents. This applies to both the client and server.
1704
+ return reactiveMembrane.getReadOnlyProxy(value);
1705
+ }
1706
+
1707
+ function getReactiveProxy(value) {
1708
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1709
+ return reactiveMembrane.getProxy(value);
1710
+ } // Making the component instance a live value when using Locker to support expandos.
1711
+
1712
+
1713
+ function markLockerLiveObject(obj) {
1714
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
1715
+ {
1716
+ obj[lockerLivePropertyKey] = undefined;
1717
+ }
1718
+ }
1680
1719
  /*
1681
1720
  * Copyright (c) 2018, salesforce.com, inc.
1682
1721
  * All rights reserved.
@@ -1725,11 +1764,7 @@
1725
1764
  set: function set(newValue) {
1726
1765
  var vm = getAssociatedVM(this);
1727
1766
 
1728
- if (newValue !== vm.cmpProps[propName]) {
1729
- vm.cmpProps[propName] = newValue;
1730
- componentValueMutated(vm, propName);
1731
- }
1732
-
1767
+ updateComponentValue(vm, propName, newValue);
1733
1768
  return _set.call(vm.elm, newValue);
1734
1769
  }
1735
1770
  };
@@ -1767,10 +1802,9 @@
1767
1802
  vm.callHook = _callHook;
1768
1803
  vm.setHook = _setHook;
1769
1804
  vm.getHook = _getHook;
1770
- } // Making the component instance a live value when using Locker to support expandos.
1771
-
1805
+ }
1772
1806
 
1773
- this[lockerLivePropertyKey] = undefined; // Linking elm, shadow root and component with the VM.
1807
+ markLockerLiveObject(this); // Linking elm, shadow root and component with the VM.
1774
1808
 
1775
1809
  associateVM(component, vm);
1776
1810
  associateVM(elm, vm);
@@ -2018,47 +2052,7 @@
2018
2052
  },
2019
2053
  set: function set(newValue) {
2020
2054
  var vm = getAssociatedVM(this);
2021
-
2022
- if (newValue !== vm.cmpFields[key]) {
2023
- vm.cmpFields[key] = newValue;
2024
- componentValueMutated(vm, key);
2025
- }
2026
- },
2027
- enumerable: true,
2028
- configurable: true
2029
- };
2030
- }
2031
- /*
2032
- * Copyright (c) 2018, salesforce.com, inc.
2033
- * All rights reserved.
2034
- * SPDX-License-Identifier: MIT
2035
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2036
- */
2037
-
2038
-
2039
- function api$1() {
2040
-
2041
- throw new Error();
2042
- }
2043
-
2044
- function createPublicPropertyDescriptor(key) {
2045
- return {
2046
- get: function get() {
2047
- var vm = getAssociatedVM(this);
2048
-
2049
- if (isBeingConstructed(vm)) {
2050
-
2051
- return;
2052
- }
2053
-
2054
- componentValueObserved(vm, key);
2055
- return vm.cmpProps[key];
2056
- },
2057
- set: function set(newValue) {
2058
- var vm = getAssociatedVM(this);
2059
-
2060
- vm.cmpProps[key] = newValue;
2061
- componentValueMutated(vm, key);
2055
+ updateComponentValue(vm, key, newValue);
2062
2056
  },
2063
2057
  enumerable: true,
2064
2058
  configurable: true
@@ -2122,6 +2116,47 @@
2122
2116
  return AccessorReactiveObserver;
2123
2117
  }(ReactiveObserver);
2124
2118
 
2119
+ function createAccessorReactiveObserver(vm, set) {
2120
+ // On the server side, we don't need mutation tracking. Skipping it improves performance.
2121
+ return new AccessorReactiveObserver(vm, set);
2122
+ }
2123
+ /*
2124
+ * Copyright (c) 2018, salesforce.com, inc.
2125
+ * All rights reserved.
2126
+ * SPDX-License-Identifier: MIT
2127
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2128
+ */
2129
+
2130
+
2131
+ function api$1() {
2132
+
2133
+ throw new Error();
2134
+ }
2135
+
2136
+ function createPublicPropertyDescriptor(key) {
2137
+ return {
2138
+ get: function get() {
2139
+ var vm = getAssociatedVM(this);
2140
+
2141
+ if (isBeingConstructed(vm)) {
2142
+
2143
+ return;
2144
+ }
2145
+
2146
+ componentValueObserved(vm, key);
2147
+ return vm.cmpProps[key];
2148
+ },
2149
+ set: function set(newValue) {
2150
+ var vm = getAssociatedVM(this);
2151
+
2152
+ vm.cmpProps[key] = newValue;
2153
+ componentValueMutated(vm, key);
2154
+ },
2155
+ enumerable: true,
2156
+ configurable: true
2157
+ };
2158
+ }
2159
+
2125
2160
  function createPublicAccessorDescriptor(key, descriptor) {
2126
2161
  var _get3 = descriptor.get,
2127
2162
  _set2 = descriptor.set,
@@ -2144,11 +2179,11 @@
2144
2179
  var vm = getAssociatedVM(this);
2145
2180
 
2146
2181
  if (_set2) {
2147
- if (runtimeFlags.ENABLE_REACTIVE_SETTER) {
2182
+ if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
2148
2183
  var ro = vm.oar[key];
2149
2184
 
2150
2185
  if (isUndefined$1(ro)) {
2151
- ro = vm.oar[key] = new AccessorReactiveObserver(vm, _set2);
2186
+ ro = vm.oar[key] = createAccessorReactiveObserver(vm, _set2);
2152
2187
  } // every time we invoke this setter from outside (through this wrapper setter)
2153
2188
  // we should reset the value and then debounce just in case there is a pending
2154
2189
  // invocation the next tick that is not longer relevant since the value is changing
@@ -2178,7 +2213,7 @@
2178
2213
 
2179
2214
  function track(target) {
2180
2215
  if (arguments.length === 1) {
2181
- return reactiveMembrane.getProxy(target);
2216
+ return getReactiveProxy(target);
2182
2217
  }
2183
2218
 
2184
2219
  throw new Error();
@@ -2194,12 +2229,8 @@
2194
2229
  set: function set(newValue) {
2195
2230
  var vm = getAssociatedVM(this);
2196
2231
 
2197
- var reactiveOrAnyValue = reactiveMembrane.getProxy(newValue);
2198
-
2199
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2200
- vm.cmpFields[key] = reactiveOrAnyValue;
2201
- componentValueMutated(vm, key);
2202
- }
2232
+ var reactiveOrAnyValue = getReactiveProxy(newValue);
2233
+ updateComponentValue(vm, key, reactiveOrAnyValue);
2203
2234
  },
2204
2235
  enumerable: true,
2205
2236
  configurable: true
@@ -2240,10 +2271,7 @@
2240
2271
  * system to be backward compatible.
2241
2272
  */
2242
2273
 
2243
- if (value !== vm.cmpFields[key]) {
2244
- vm.cmpFields[key] = value;
2245
- componentValueMutated(vm, key);
2246
- }
2274
+ updateComponentValue(vm, key, value);
2247
2275
  },
2248
2276
  enumerable: true,
2249
2277
  configurable: true
@@ -2502,7 +2530,7 @@
2502
2530
  fn = cachedSetterByKey[key] = function (newValue) {
2503
2531
  var vm = getAssociatedVM(this);
2504
2532
  var setHook = vm.setHook;
2505
- newValue = reactiveMembrane.getReadOnlyProxy(newValue);
2533
+ newValue = getReadOnlyProxy(newValue);
2506
2534
  setHook(vm.component, key, newValue);
2507
2535
  };
2508
2536
  }
@@ -2657,7 +2685,7 @@
2657
2685
 
2658
2686
  function swapTemplate(oldTpl, newTpl) {
2659
2687
 
2660
- if (!runtimeFlags.ENABLE_HMR) {
2688
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2661
2689
  throw new Error('HMR is not enabled');
2662
2690
  }
2663
2691
 
@@ -2666,7 +2694,7 @@
2666
2694
 
2667
2695
  function swapComponent(oldComponent, newComponent) {
2668
2696
 
2669
- if (!runtimeFlags.ENABLE_HMR) {
2697
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2670
2698
  throw new Error('HMR is not enabled');
2671
2699
  }
2672
2700
 
@@ -2675,7 +2703,7 @@
2675
2703
 
2676
2704
  function swapStyle(oldStyle, newStyle) {
2677
2705
 
2678
- if (!runtimeFlags.ENABLE_HMR) {
2706
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2679
2707
  throw new Error('HMR is not enabled');
2680
2708
  }
2681
2709
 
@@ -3109,9 +3137,7 @@
3109
3137
  function createStylesheet(vm, stylesheets) {
3110
3138
  var renderMode = vm.renderMode,
3111
3139
  shadowMode = vm.shadowMode,
3112
- _vm$renderer2 = vm.renderer,
3113
- ssr = _vm$renderer2.ssr,
3114
- insertStylesheet = _vm$renderer2.insertStylesheet;
3140
+ insertStylesheet = vm.renderer.insertStylesheet;
3115
3141
 
3116
3142
  if (renderMode === 1
3117
3143
  /* RenderMode.Shadow */
@@ -3121,7 +3147,7 @@
3121
3147
  for (var _i12 = 0; _i12 < stylesheets.length; _i12++) {
3122
3148
  insertStylesheet(stylesheets[_i12]);
3123
3149
  }
3124
- } else if (ssr || vm.hydrated) {
3150
+ } else if (vm.hydrated) {
3125
3151
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
3126
3152
  // This works in the client, because the stylesheets are created, and cached in the VM
3127
3153
  // the first time the VM renders.
@@ -3502,7 +3528,7 @@
3502
3528
  }
3503
3529
  }
3504
3530
 
3505
- function patch(n1, n2, renderer) {
3531
+ function patch(n1, n2, parent, renderer) {
3506
3532
  var _a, _b;
3507
3533
 
3508
3534
  if (n1 === n2) {
@@ -3539,7 +3565,7 @@
3539
3565
  case 3
3540
3566
  /* VNodeType.CustomElement */
3541
3567
  :
3542
- patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3568
+ patchCustomElement(n1, n2, parent, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3543
3569
  break;
3544
3570
  }
3545
3571
  }
@@ -3704,25 +3730,34 @@
3704
3730
  }
3705
3731
  }
3706
3732
 
3707
- function patchCustomElement(n1, n2, renderer) {
3708
- var elm = n2.elm = n1.elm;
3709
- var vm = n2.vm = n1.vm;
3710
- patchElementPropsAndAttrs$1(n1, n2, renderer);
3733
+ function patchCustomElement(n1, n2, parent, renderer) {
3734
+ if (n1.ctor !== n2.ctor) {
3735
+ // If the constructor, unmount the current component and mount a new one using the new
3736
+ // constructor.
3737
+ var anchor = renderer.nextSibling(n1.elm);
3738
+ unmount(n1, parent, renderer, true);
3739
+ mountCustomElement(n2, parent, anchor, renderer);
3740
+ } else {
3741
+ // Otherwise patch the existing component with new props/attrs/etc.
3742
+ var elm = n2.elm = n1.elm;
3743
+ var vm = n2.vm = n1.vm;
3744
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
3711
3745
 
3712
- if (!isUndefined$1(vm)) {
3713
- // in fallback mode, the allocation will always set children to
3714
- // empty and delegate the real allocation to the slot elements
3715
- allocateChildren(n2, vm);
3716
- } // in fallback mode, the children will be always empty, so, nothing
3717
- // will happen, but in native, it does allocate the light dom
3746
+ if (!isUndefined$1(vm)) {
3747
+ // in fallback mode, the allocation will always set children to
3748
+ // empty and delegate the real allocation to the slot elements
3749
+ allocateChildren(n2, vm);
3750
+ } // in fallback mode, the children will be always empty, so, nothing
3751
+ // will happen, but in native, it does allocate the light dom
3718
3752
 
3719
3753
 
3720
- patchChildren(n1.children, n2.children, elm, renderer);
3754
+ patchChildren(n1.children, n2.children, elm, renderer);
3721
3755
 
3722
- if (!isUndefined$1(vm)) {
3723
- // this will probably update the shadowRoot, but only if the vm is in a dirty state
3724
- // this is important to preserve the top to bottom synchronous rendering phase.
3725
- rerenderVM(vm);
3756
+ if (!isUndefined$1(vm)) {
3757
+ // this will probably update the shadowRoot, but only if the vm is in a dirty state
3758
+ // this is important to preserve the top to bottom synchronous rendering phase.
3759
+ rerenderVM(vm);
3760
+ }
3726
3761
  }
3727
3762
  }
3728
3763
 
@@ -4046,22 +4081,22 @@
4046
4081
  } else if (!isVNode(newEndVnode)) {
4047
4082
  newEndVnode = newCh[--newEndIdx];
4048
4083
  } else if (isSameVnode(oldStartVnode, newStartVnode)) {
4049
- patch(oldStartVnode, newStartVnode, renderer);
4084
+ patch(oldStartVnode, newStartVnode, parent, renderer);
4050
4085
  oldStartVnode = oldCh[++oldStartIdx];
4051
4086
  newStartVnode = newCh[++newStartIdx];
4052
4087
  } else if (isSameVnode(oldEndVnode, newEndVnode)) {
4053
- patch(oldEndVnode, newEndVnode, renderer);
4088
+ patch(oldEndVnode, newEndVnode, parent, renderer);
4054
4089
  oldEndVnode = oldCh[--oldEndIdx];
4055
4090
  newEndVnode = newCh[--newEndIdx];
4056
4091
  } else if (isSameVnode(oldStartVnode, newEndVnode)) {
4057
4092
  // Vnode moved right
4058
- patch(oldStartVnode, newEndVnode, renderer);
4093
+ patch(oldStartVnode, newEndVnode, parent, renderer);
4059
4094
  insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
4060
4095
  oldStartVnode = oldCh[++oldStartIdx];
4061
4096
  newEndVnode = newCh[--newEndIdx];
4062
4097
  } else if (isSameVnode(oldEndVnode, newStartVnode)) {
4063
4098
  // Vnode moved left
4064
- patch(oldEndVnode, newStartVnode, renderer);
4099
+ patch(oldEndVnode, newStartVnode, parent, renderer);
4065
4100
  insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
4066
4101
  oldEndVnode = oldCh[--oldEndIdx];
4067
4102
  newStartVnode = newCh[++newStartIdx];
@@ -4084,7 +4119,7 @@
4084
4119
  // New element
4085
4120
  mount(newStartVnode, parent, renderer, oldStartVnode.elm);
4086
4121
  } else {
4087
- patch(elmToMove, newStartVnode, renderer); // Delete the old child, but copy the array since it is read-only.
4122
+ patch(elmToMove, newStartVnode, parent, renderer); // Delete the old child, but copy the array since it is read-only.
4088
4123
  // The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
4089
4124
  // so we only care about the `oldCh` object inside this function.
4090
4125
  // To avoid cloning over and over again, we check `clonedOldCh`
@@ -4154,7 +4189,7 @@
4154
4189
  if (isVNode(n1)) {
4155
4190
  if (isVNode(n2)) {
4156
4191
  // both vnodes are equivalent, and we just need to patch them
4157
- patch(n1, n2, renderer);
4192
+ patch(n1, n2, parent, renderer);
4158
4193
  anchor = n2.elm;
4159
4194
  } else {
4160
4195
  // removing the old vnode since the new one is null
@@ -4455,19 +4490,11 @@
4455
4490
 
4456
4491
  return url;
4457
4492
  }
4458
- /**
4459
- * Map to store an index value assigned to any dynamic component reference ingested
4460
- * by dc() api. This allows us to generate a unique unique per template per dynamic
4461
- * component reference to avoid diffing algo mismatches.
4462
- */
4463
-
4464
-
4465
- var DynamicImportedComponentMap = new Map();
4466
- var dynamicImportedComponentCounter = 0;
4467
4493
  /**
4468
4494
  * create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
4469
4495
  */
4470
4496
 
4497
+
4471
4498
  function dc(sel, Ctor, data) {
4472
4499
  var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
4473
4500
 
@@ -4480,22 +4507,7 @@
4480
4507
  throw new Error("Invalid LWC Constructor ".concat(toString$1(Ctor), " for custom element <").concat(sel, ">."));
4481
4508
  }
4482
4509
 
4483
- var idx = DynamicImportedComponentMap.get(Ctor);
4484
-
4485
- if (isUndefined$1(idx)) {
4486
- idx = dynamicImportedComponentCounter++;
4487
- DynamicImportedComponentMap.set(Ctor, idx);
4488
- } // the new vnode key is a mix of idx and compiler key, this is required by the diffing algo
4489
- // to identify different constructors as vnodes with different keys to avoid reusing the
4490
- // element used for previous constructors.
4491
- // Shallow clone is necessary here becuase VElementData may be shared across VNodes due to
4492
- // hoisting optimization.
4493
-
4494
-
4495
- var newData = Object.assign(Object.assign({}, data), {
4496
- key: "dc:".concat(idx, ":").concat(data.key)
4497
- });
4498
- return c(sel, Ctor, newData, children);
4510
+ return c(sel, Ctor, data, children);
4499
4511
  }
4500
4512
  /**
4501
4513
  * slow children collection marking mechanism. this API allows the compiler to signal
@@ -4956,7 +4968,7 @@
4956
4968
  }
4957
4969
 
4958
4970
  function getTemplateReactiveObserver(vm) {
4959
- return new ReactiveObserver(function () {
4971
+ return createReactiveObserver(function () {
4960
4972
  var isDirty = vm.isDirty;
4961
4973
 
4962
4974
  if (isFalse(isDirty)) {
@@ -5225,7 +5237,7 @@
5225
5237
  } else if (isNativeShadowDefined) {
5226
5238
  // Not combined with above condition because @lwc/features only supports identifiers in
5227
5239
  // the if-condition.
5228
- if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5240
+ if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5229
5241
  if (def.shadowSupportMode === "any"
5230
5242
  /* ShadowSupportMode.Any */
5231
5243
  ) {
@@ -5335,13 +5347,7 @@
5335
5347
  }
5336
5348
 
5337
5349
  function runRenderedCallback(vm) {
5338
- var renderedCallback = vm.def.renderedCallback,
5339
- ssr = vm.renderer.ssr;
5340
-
5341
- if (isTrue(ssr)) {
5342
- return;
5343
- }
5344
-
5350
+ var renderedCallback = vm.def.renderedCallback;
5345
5351
  var rendered = Services.rendered;
5346
5352
 
5347
5353
  if (rendered) {
@@ -5564,9 +5570,7 @@
5564
5570
  }
5565
5571
 
5566
5572
  function scheduleRehydration(vm) {
5567
- var ssr = vm.renderer.ssr;
5568
-
5569
- if (isTrue(ssr) || isTrue(vm.isScheduled)) {
5573
+ if (isTrue(vm.isScheduled)) {
5570
5574
  return;
5571
5575
  }
5572
5576
 
@@ -5668,13 +5672,8 @@
5668
5672
  }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
5669
5673
 
5670
5674
  function createFieldDataCallback(vm, name) {
5671
- var cmpFields = vm.cmpFields;
5672
5675
  return function (value) {
5673
- if (value !== vm.cmpFields[name]) {
5674
- // storing the value in the underlying storage
5675
- cmpFields[name] = value;
5676
- componentValueMutated(vm, name);
5677
- }
5676
+ updateComponentValue(vm, name, value);
5678
5677
  };
5679
5678
  }
5680
5679
 
@@ -5691,7 +5690,7 @@
5691
5690
  function createConfigWatcher(component, configCallback, callbackWhenConfigIsReady) {
5692
5691
  var hasPendingConfig = false; // creating the reactive observer for reactive params when needed
5693
5692
 
5694
- var ro = new ReactiveObserver(function () {
5693
+ var ro = createReactiveObserver(function () {
5695
5694
  if (hasPendingConfig === false) {
5696
5695
  hasPendingConfig = true; // collect new config in the micro-task
5697
5696
 
@@ -5883,7 +5882,7 @@
5883
5882
  ArrayPush$1.call(wiredConnecting, function () {
5884
5883
  connector.connect();
5885
5884
 
5886
- if (!runtimeFlags.ENABLE_WIRE_SYNC_EMIT) {
5885
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
5887
5886
  if (hasDynamicParams) {
5888
5887
  Promise.resolve().then(computeConfigAndUpdate);
5889
5888
  return;
@@ -5982,7 +5981,7 @@
5982
5981
 
5983
5982
  function readonly(obj) {
5984
5983
 
5985
- return reactiveMembrane.getReadOnlyProxy(obj);
5984
+ return getReadOnlyProxy(obj);
5986
5985
  }
5987
5986
  /*
5988
5987
  * Copyright (c) 2022, salesforce.com, inc.
@@ -6464,7 +6463,7 @@
6464
6463
 
6465
6464
  return ctor;
6466
6465
  }
6467
- /* version: 2.21.1 */
6466
+ /* version: 2.23.1 */
6468
6467
 
6469
6468
  /*
6470
6469
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6623,6 +6622,85 @@
6623
6622
  */
6624
6623
 
6625
6624
 
6625
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
6626
+ var createFragment;
6627
+
6628
+ if (SUPPORTS_TEMPLATE) {
6629
+ // Parse the fragment HTML string into DOM
6630
+ createFragment = function createFragment(html) {
6631
+ var template = document.createElement('template');
6632
+ template.innerHTML = html;
6633
+ return template.content.firstChild;
6634
+ };
6635
+ } else {
6636
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
6637
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
6638
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
6639
+ // With other elements added from:
6640
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
6641
+ // Using the test:
6642
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
6643
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
6644
+ var topLevelWrappingMap = {
6645
+ caption: ['table'],
6646
+ col: ['colgroup', 'table'],
6647
+ colgroup: ['table'],
6648
+ option: ['select'],
6649
+ tbody: ['table'],
6650
+ td: ['tr', 'tbody', 'table'],
6651
+ th: ['tr', 'tbody', 'table'],
6652
+ thead: ['table'],
6653
+ tfoot: ['table'],
6654
+ tr: ['tbody', 'table']
6655
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
6656
+
6657
+ var getTagName = function getTagName(text) {
6658
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
6659
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
6660
+
6661
+
6662
+ createFragment = function createFragment(html) {
6663
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
6664
+
6665
+ if (!isUndefined$1(wrapperTags)) {
6666
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
6667
+ _step5;
6668
+
6669
+ try {
6670
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6671
+ var wrapperTag = _step5.value;
6672
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6673
+ }
6674
+ } catch (err) {
6675
+ _iterator5.e(err);
6676
+ } finally {
6677
+ _iterator5.f();
6678
+ }
6679
+ } // For IE11, the document title must not be undefined, but it can be an empty string
6680
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
6681
+
6682
+
6683
+ var doc = document.implementation.createHTMLDocument('');
6684
+ doc.body.innerHTML = html;
6685
+ var content = doc.body;
6686
+
6687
+ if (!isUndefined$1(wrapperTags)) {
6688
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
6689
+ content = content.firstChild;
6690
+ }
6691
+ }
6692
+
6693
+ return content.firstChild;
6694
+ };
6695
+ }
6696
+ /*
6697
+ * Copyright (c) 2018, salesforce.com, inc.
6698
+ * All rights reserved.
6699
+ * SPDX-License-Identifier: MIT
6700
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6701
+ */
6702
+
6703
+
6626
6704
  var getCustomElement;
6627
6705
  var defineCustomElement;
6628
6706
  var HTMLElementConstructor;
@@ -6704,18 +6782,6 @@
6704
6782
  HTMLElementConstructor.prototype = HTMLElement.prototype;
6705
6783
  }
6706
6784
 
6707
- var hydrating = false;
6708
-
6709
- function setIsHydrating(value) {
6710
- hydrating = value;
6711
- }
6712
-
6713
- var ssr = false;
6714
-
6715
- function isHydrating() {
6716
- return hydrating;
6717
- }
6718
-
6719
6785
  var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
6720
6786
  var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
6721
6787
 
@@ -6723,10 +6789,6 @@
6723
6789
  return node.cloneNode(deep);
6724
6790
  }
6725
6791
 
6726
- function createFragment(html) {
6727
- return document.createRange().createContextualFragment(html).firstChild;
6728
- }
6729
-
6730
6792
  function createElement$1(tagName, namespace) {
6731
6793
  return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6732
6794
  }
@@ -6752,15 +6814,11 @@
6752
6814
  }
6753
6815
 
6754
6816
  function attachShadow(element, options) {
6755
- // `hydrating` will be true in two cases:
6817
+ // `shadowRoot` will be non-null in two cases:
6756
6818
  // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
6757
6819
  // 2. when a webapp author places <c-app> in their static HTML and mounts their
6758
- // root component with customeElement.define('c-app', Ctor)
6759
- //
6760
- // The second case can be treated as a failed hydration with nominal impact
6761
- // to performance. However, because <c-app> won't have a <template shadowroot>
6762
- // declarative child, `element.shadowRoot` is `null`.
6763
- if (hydrating && element.shadowRoot) {
6820
+ // root component with customElement.define('c-app', Ctor)
6821
+ if (!isNull(element.shadowRoot)) {
6764
6822
  return element.shadowRoot;
6765
6823
  }
6766
6824
 
@@ -6872,11 +6930,9 @@
6872
6930
 
6873
6931
  var HTMLElementExported = HTMLElementConstructor;
6874
6932
  var renderer = {
6875
- ssr: ssr,
6876
6933
  isNativeShadowDefined: isNativeShadowDefined,
6877
6934
  isSyntheticShadowDefined: isSyntheticShadowDefined,
6878
6935
  HTMLElementExported: HTMLElementExported,
6879
- isHydrating: isHydrating,
6880
6936
  insert: insert,
6881
6937
  remove: remove,
6882
6938
  cloneNode: cloneNode,
@@ -6945,8 +7001,8 @@
6945
7001
  hydrated: true
6946
7002
  });
6947
7003
 
6948
- for (var _i32 = 0, _Object$entries2 = Object.entries(props); _i32 < _Object$entries2.length; _i32++) {
6949
- var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i32], 2),
7004
+ for (var _i33 = 0, _Object$entries2 = Object.entries(props); _i33 < _Object$entries2.length; _i33++) {
7005
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i33], 2),
6950
7006
  key = _Object$entries2$_i[0],
6951
7007
  value = _Object$entries2$_i[1];
6952
7008
 
@@ -6978,13 +7034,8 @@
6978
7034
  }
6979
7035
 
6980
7036
  try {
6981
- // Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
6982
- // and uses the same algo to create the stylesheets as in SSR.
6983
- setIsHydrating(true);
6984
7037
  var vm = createVMWithProps(element, Ctor, props);
6985
- hydrateRoot(vm); // set it back since now we finished hydration.
6986
-
6987
- setIsHydrating(false);
7038
+ hydrateRoot(vm);
6988
7039
  } catch (e) {
6989
7040
  // Fallback: In case there's an error while hydrating, let's log the error, and replace the element content
6990
7041
  // with the client generated DOM.
@@ -6995,11 +7046,7 @@
6995
7046
  resetShadowRootAndLightDom(element, Ctor); // we need to recreate the vm with the hydration flag on, so it re-uses the existing shadowRoot.
6996
7047
 
6997
7048
  createVMWithProps(element, Ctor, props);
6998
- setIsHydrating(false);
6999
7049
  connectRootElement(element);
7000
- } finally {
7001
- // in case there's an error during recovery
7002
- setIsHydrating(false);
7003
7050
  }
7004
7051
  }
7005
7052
  /*
@@ -7271,7 +7318,7 @@
7271
7318
  });
7272
7319
  freeze(LightningElement);
7273
7320
  seal(LightningElement.prototype);
7274
- /* version: 2.21.1 */
7321
+ /* version: 2.23.1 */
7275
7322
 
7276
7323
  exports.LightningElement = LightningElement;
7277
7324
  exports.__unstable__ProfilerControl = profilerControl;