@lwc/engine-core 6.6.4 → 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.js CHANGED
@@ -3332,6 +3332,9 @@ function rehydrateHotTemplate(tpl) {
3332
3332
  }
3333
3333
  function rehydrateHotStyle(style) {
3334
3334
  const activeVMs = activeStyles.get(style);
3335
+ if (!activeVMs.size) {
3336
+ return true;
3337
+ }
3335
3338
  unrenderStylesheet(style);
3336
3339
  for (const vm of activeVMs) {
3337
3340
  // if a style definition is swapped, we must reset
@@ -5055,7 +5058,7 @@ function ssf(slotName, factory) {
5055
5058
  factory,
5056
5059
  owner: getVMBeingRendered(),
5057
5060
  elm: undefined,
5058
- sel: undefined,
5061
+ sel: '__scoped_slot_fragment__',
5059
5062
  key: undefined,
5060
5063
  slotName,
5061
5064
  };
@@ -5066,7 +5069,7 @@ function st(fragmentFactory, key, parts) {
5066
5069
  const fragment = fragmentFactory(parts);
5067
5070
  const vnode = {
5068
5071
  type: 4 /* VNodeType.Static */,
5069
- sel: undefined,
5072
+ sel: '__static__',
5070
5073
  key,
5071
5074
  elm: undefined,
5072
5075
  fragment,
@@ -5084,7 +5087,7 @@ function fr(key, children, stable) {
5084
5087
  const trailing = useCommentNodes ? co('') : t('');
5085
5088
  return {
5086
5089
  type: 5 /* VNodeType.Fragment */,
5087
- sel: undefined,
5090
+ sel: '__fragment__',
5088
5091
  key,
5089
5092
  elm: undefined,
5090
5093
  children: [leading, ...children, trailing],
@@ -5201,7 +5204,16 @@ function s(slotName, data, children, slotset) {
5201
5204
  // to the vnode because the current way the diffing algo works, it will replace the original reference
5202
5205
  // to the host element with a new one. This means the new element will be mounted and immediately unmounted.
5203
5206
  // Creating a copy of the vnode to preserve a reference to the previous host element.
5204
- clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5207
+ if (isUndefined$1(vnode.elm)) {
5208
+ // vnode.elm is undefined during initial render.
5209
+ // We don't need to clone at this point because it doesn't need to be unmounted.
5210
+ vnode.slotAssignment = data.slotAssignment;
5211
+ }
5212
+ else {
5213
+ // Clone when the vnode.elm is defined to ensure we don't lose reference to the previous element.
5214
+ // This is specifically for slot forwarding.
5215
+ clonedVNode = { ...vnode, slotAssignment: data.slotAssignment };
5216
+ }
5205
5217
  }
5206
5218
  // If the slot content is standard type, the content is static, no additional
5207
5219
  // processing needed on the vnode
@@ -5369,10 +5381,10 @@ function f(items) {
5369
5381
  }
5370
5382
  // [t]ext node
5371
5383
  function t(text) {
5372
- let sel, key, elm;
5384
+ let key, elm;
5373
5385
  return {
5374
5386
  type: 0 /* VNodeType.Text */,
5375
- sel,
5387
+ sel: '__text__',
5376
5388
  text,
5377
5389
  elm,
5378
5390
  key,
@@ -5381,13 +5393,13 @@ function t(text) {
5381
5393
  }
5382
5394
  // [co]mment node
5383
5395
  function co(text) {
5384
- let sel, elm;
5396
+ let elm, key;
5385
5397
  return {
5386
5398
  type: 1 /* VNodeType.Comment */,
5387
- sel,
5399
+ sel: '__comment__',
5388
5400
  text,
5389
5401
  elm,
5390
- key: 'c',
5402
+ key,
5391
5403
  owner: getVMBeingRendered(),
5392
5404
  };
5393
5405
  }
@@ -7918,5 +7930,5 @@ function readonly(obj) {
7918
7930
  }
7919
7931
 
7920
7932
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, setHooks, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
7921
- /** version: 6.6.4 */
7933
+ /** version: 6.6.6 */
7922
7934
  //# sourceMappingURL=index.js.map