@lwc/engine-core 6.6.5 → 6.6.6

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/index.cjs.js CHANGED
@@ -3336,6 +3336,9 @@ function rehydrateHotTemplate(tpl) {
3336
3336
  }
3337
3337
  function rehydrateHotStyle(style) {
3338
3338
  const activeVMs = activeStyles.get(style);
3339
+ if (!activeVMs.size) {
3340
+ return true;
3341
+ }
3339
3342
  unrenderStylesheet(style);
3340
3343
  for (const vm of activeVMs) {
3341
3344
  // if a style definition is swapped, we must reset
@@ -5205,7 +5208,16 @@ function s(slotName, data, children, slotset) {
5205
5208
  // to the vnode because the current way the diffing algo works, it will replace the original reference
5206
5209
  // to the host element with a new one. This means the new element will be mounted and immediately unmounted.
5207
5210
  // Creating a copy of the vnode to preserve a reference to the previous host element.
5208
- clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5211
+ if (shared.isUndefined(vnode.elm)) {
5212
+ // vnode.elm is undefined during initial render.
5213
+ // We don't need to clone at this point because it doesn't need to be unmounted.
5214
+ vnode.slotAssignment = data.slotAssignment;
5215
+ }
5216
+ else {
5217
+ // Clone when the vnode.elm is defined to ensure we don't lose reference to the previous element.
5218
+ // This is specifically for slot forwarding.
5219
+ clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5220
+ }
5209
5221
  }
5210
5222
  // If the slot content is standard type, the content is static, no additional
5211
5223
  // processing needed on the vnode
@@ -7965,5 +7977,5 @@ exports.swapTemplate = swapTemplate;
7965
7977
  exports.track = track;
7966
7978
  exports.unwrap = unwrap;
7967
7979
  exports.wire = wire;
7968
- /** version: 6.6.5 */
7980
+ /** version: 6.6.6 */
7969
7981
  //# sourceMappingURL=index.cjs.js.map