@vue/compat 3.3.6 → 3.3.7

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/vue.cjs.js CHANGED
@@ -678,7 +678,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
678
678
  } else if (key === "length" && isArray(target)) {
679
679
  const newLength = Number(newValue);
680
680
  depsMap.forEach((dep, key2) => {
681
- if (key2 === "length" || key2 >= newLength) {
681
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
682
682
  deps.push(dep);
683
683
  }
684
684
  });
@@ -1774,8 +1774,13 @@ function findInsertionIndex(id) {
1774
1774
  let end = queue.length;
1775
1775
  while (start < end) {
1776
1776
  const middle = start + end >>> 1;
1777
- const middleJobId = getId(queue[middle]);
1778
- middleJobId < id ? start = middle + 1 : end = middle;
1777
+ const middleJob = queue[middle];
1778
+ const middleJobId = getId(middleJob);
1779
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1780
+ start = middle + 1;
1781
+ } else {
1782
+ end = middle;
1783
+ }
1779
1784
  }
1780
1785
  return start;
1781
1786
  }
@@ -3363,14 +3368,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3363
3368
  parentComponent: parentComponent2,
3364
3369
  container: container2
3365
3370
  } = suspense;
3371
+ let delayEnter = false;
3366
3372
  if (suspense.isHydrating) {
3367
3373
  suspense.isHydrating = false;
3368
3374
  } else if (!resume) {
3369
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3375
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3370
3376
  if (delayEnter) {
3371
3377
  activeBranch.transition.afterLeave = () => {
3372
3378
  if (pendingId === suspense.pendingId) {
3373
3379
  move(pendingBranch, container2, anchor2, 0);
3380
+ queuePostFlushCb(effects);
3374
3381
  }
3375
3382
  };
3376
3383
  }
@@ -3396,7 +3403,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3396
3403
  }
3397
3404
  parent = parent.parent;
3398
3405
  }
3399
- if (!hasUnresolvedAncestor) {
3406
+ if (!hasUnresolvedAncestor && !delayEnter) {
3400
3407
  queuePostFlushCb(effects);
3401
3408
  }
3402
3409
  suspense.effects = [];
@@ -6347,7 +6354,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6347
6354
  return vm;
6348
6355
  }
6349
6356
  }
6350
- Vue.version = `2.6.14-compat:${"3.3.6"}`;
6357
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
6351
6358
  Vue.config = singletonApp.config;
6352
6359
  Vue.use = (p, ...options) => {
6353
6360
  if (p && isFunction(p.install)) {
@@ -7677,7 +7684,14 @@ function createHydrationFunctions(rendererInternals) {
7677
7684
  break;
7678
7685
  case Comment:
7679
7686
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7680
- nextNode = onMismatch();
7687
+ if (node.tagName.toLowerCase() === "template") {
7688
+ const content = vnode.el.content.firstChild;
7689
+ replaceNode(content, node, parentComponent);
7690
+ vnode.el = node = content;
7691
+ nextNode = nextSibling(node);
7692
+ } else {
7693
+ nextNode = onMismatch();
7694
+ }
7681
7695
  } else {
7682
7696
  nextNode = nextSibling(node);
7683
7697
  }
@@ -7719,7 +7733,7 @@ function createHydrationFunctions(rendererInternals) {
7719
7733
  break;
7720
7734
  default:
7721
7735
  if (shapeFlag & 1) {
7722
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
7736
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
7723
7737
  nextNode = onMismatch();
7724
7738
  } else {
7725
7739
  nextNode = hydrateElement(
@@ -7734,6 +7748,13 @@ function createHydrationFunctions(rendererInternals) {
7734
7748
  } else if (shapeFlag & 6) {
7735
7749
  vnode.slotScopeIds = slotScopeIds;
7736
7750
  const container = parentNode(node);
7751
+ if (isFragmentStart) {
7752
+ nextNode = locateClosingAnchor(node);
7753
+ } else if (isComment(node) && node.data === "teleport start") {
7754
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
7755
+ } else {
7756
+ nextNode = nextSibling(node);
7757
+ }
7737
7758
  mountComponent(
7738
7759
  vnode,
7739
7760
  container,
@@ -7743,10 +7764,6 @@ function createHydrationFunctions(rendererInternals) {
7743
7764
  isSVGContainer(container),
7744
7765
  optimized
7745
7766
  );
7746
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
7747
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
7748
- nextNode = nextSibling(nextNode);
7749
- }
7750
7767
  if (isAsyncWrapper(vnode)) {
7751
7768
  let subTree;
7752
7769
  if (isFragmentStart) {
@@ -7796,7 +7813,7 @@ function createHydrationFunctions(rendererInternals) {
7796
7813
  };
7797
7814
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7798
7815
  optimized = optimized || !!vnode.dynamicChildren;
7799
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
7816
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7800
7817
  const forcePatchValue = type === "input" && dirs || type === "option";
7801
7818
  {
7802
7819
  if (dirs) {
@@ -7833,12 +7850,23 @@ function createHydrationFunctions(rendererInternals) {
7833
7850
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
7834
7851
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7835
7852
  }
7853
+ let needCallTransitionHooks = false;
7854
+ if (isTemplateNode(el)) {
7855
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
7856
+ const content = el.content.firstChild;
7857
+ if (needCallTransitionHooks) {
7858
+ transition.beforeEnter(content);
7859
+ }
7860
+ replaceNode(content, el, parentComponent);
7861
+ vnode.el = el = content;
7862
+ }
7836
7863
  if (dirs) {
7837
7864
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7838
7865
  }
7839
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
7866
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7840
7867
  queueEffectWithSuspense(() => {
7841
7868
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7869
+ needCallTransitionHooks && transition.enter(el);
7842
7870
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7843
7871
  }, parentSuspense);
7844
7872
  }
@@ -7956,7 +7984,7 @@ function createHydrationFunctions(rendererInternals) {
7956
7984
  );
7957
7985
  vnode.el = null;
7958
7986
  if (isFragment) {
7959
- const end = locateClosingAsyncAnchor(node);
7987
+ const end = locateClosingAnchor(node);
7960
7988
  while (true) {
7961
7989
  const next2 = nextSibling(node);
7962
7990
  if (next2 && next2 !== end) {
@@ -7981,14 +8009,14 @@ function createHydrationFunctions(rendererInternals) {
7981
8009
  );
7982
8010
  return next;
7983
8011
  };
7984
- const locateClosingAsyncAnchor = (node) => {
8012
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
7985
8013
  let match = 0;
7986
8014
  while (node) {
7987
8015
  node = nextSibling(node);
7988
8016
  if (node && isComment(node)) {
7989
- if (node.data === "[")
8017
+ if (node.data === open)
7990
8018
  match++;
7991
- if (node.data === "]") {
8019
+ if (node.data === close) {
7992
8020
  if (match === 0) {
7993
8021
  return nextSibling(node);
7994
8022
  } else {
@@ -7999,6 +8027,23 @@ function createHydrationFunctions(rendererInternals) {
7999
8027
  }
8000
8028
  return node;
8001
8029
  };
8030
+ const replaceNode = (newNode, oldNode, parentComponent) => {
8031
+ const parentNode2 = oldNode.parentNode;
8032
+ if (parentNode2) {
8033
+ parentNode2.replaceChild(newNode, oldNode);
8034
+ }
8035
+ let parent = parentComponent;
8036
+ while (parent) {
8037
+ if (parent.vnode.el === oldNode) {
8038
+ parent.vnode.el = newNode;
8039
+ parent.subTree.el = newNode;
8040
+ }
8041
+ parent = parent.parent;
8042
+ }
8043
+ };
8044
+ const isTemplateNode = (node) => {
8045
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
8046
+ };
8002
8047
  return [hydrate, hydrateNode];
8003
8048
  }
8004
8049
 
@@ -8326,7 +8371,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8326
8371
  if (dirs) {
8327
8372
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8328
8373
  }
8329
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8374
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
8330
8375
  if (needCallTransitionHooks) {
8331
8376
  transition.beforeEnter(el);
8332
8377
  }
@@ -9243,8 +9288,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9243
9288
  moveStaticNode(vnode, container, anchor);
9244
9289
  return;
9245
9290
  }
9246
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
9247
- if (needTransition) {
9291
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
9292
+ if (needTransition2) {
9248
9293
  if (moveType === 0) {
9249
9294
  transition.beforeEnter(el);
9250
9295
  hostInsert(el, container, anchor);
@@ -9473,6 +9518,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9473
9518
  function toggleRecurse({ effect, update }, allowed) {
9474
9519
  effect.allowRecurse = update.allowRecurse = allowed;
9475
9520
  }
9521
+ function needTransition(parentSuspense, transition) {
9522
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9523
+ }
9476
9524
  function traverseStaticChildren(n1, n2, shallow = false) {
9477
9525
  const ch1 = n1.children;
9478
9526
  const ch2 = n2.children;
@@ -10893,7 +10941,7 @@ function isMemoSame(cached, memo) {
10893
10941
  return true;
10894
10942
  }
10895
10943
 
10896
- const version = "3.3.6";
10944
+ const version = "3.3.7";
10897
10945
  const _ssrUtils = {
10898
10946
  createComponentInstance,
10899
10947
  setupComponent,
@@ -14168,9 +14216,13 @@ function walk(node, context, doNotHoistNode = false) {
14168
14216
  context.transformHoist(children, context, node);
14169
14217
  }
14170
14218
  if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14171
- node.codegenNode.children = context.hoist(
14219
+ const hoisted = context.hoist(
14172
14220
  createArrayExpression(node.codegenNode.children)
14173
14221
  );
14222
+ if (context.hmr) {
14223
+ hoisted.content = `[...${hoisted.content}]`;
14224
+ }
14225
+ node.codegenNode.children = hoisted;
14174
14226
  }
14175
14227
  }
14176
14228
  function getConstantType(node, context) {
@@ -14343,6 +14395,7 @@ function createTransformContext(root, {
14343
14395
  filename = "",
14344
14396
  prefixIdentifiers = false,
14345
14397
  hoistStatic: hoistStatic2 = false,
14398
+ hmr = false,
14346
14399
  cacheHandlers = false,
14347
14400
  nodeTransforms = [],
14348
14401
  directiveTransforms = {},
@@ -14368,6 +14421,7 @@ function createTransformContext(root, {
14368
14421
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
14369
14422
  prefixIdentifiers,
14370
14423
  hoistStatic: hoistStatic2,
14424
+ hmr,
14371
14425
  cacheHandlers,
14372
14426
  nodeTransforms,
14373
14427
  directiveTransforms,
@@ -16412,7 +16466,7 @@ const trackVForSlotScopes = (node, context) => {
16412
16466
  }
16413
16467
  }
16414
16468
  };
16415
- const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
16469
+ const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
16416
16470
  props,
16417
16471
  children,
16418
16472
  false,
@@ -16437,7 +16491,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16437
16491
  slotsProperties.push(
16438
16492
  createObjectProperty(
16439
16493
  arg || createSimpleExpression("default", true),
16440
- buildSlotFn(exp, children, loc)
16494
+ buildSlotFn(exp, void 0, children, loc)
16441
16495
  )
16442
16496
  );
16443
16497
  }
@@ -16474,10 +16528,15 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16474
16528
  } else {
16475
16529
  hasDynamicSlots = true;
16476
16530
  }
16477
- const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
16531
+ const vFor = findDir(slotElement, "for");
16532
+ const slotFunction = buildSlotFn(
16533
+ slotProps,
16534
+ vFor == null ? void 0 : vFor.exp,
16535
+ slotChildren,
16536
+ slotLoc
16537
+ );
16478
16538
  let vIf;
16479
16539
  let vElse;
16480
- let vFor;
16481
16540
  if (vIf = findDir(slotElement, "if")) {
16482
16541
  hasDynamicSlots = true;
16483
16542
  dynamicSlots.push(
@@ -16522,7 +16581,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16522
16581
  createCompilerError(30, vElse.loc)
16523
16582
  );
16524
16583
  }
16525
- } else if (vFor = findDir(slotElement, "for")) {
16584
+ } else if (vFor) {
16526
16585
  hasDynamicSlots = true;
16527
16586
  const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
16528
16587
  if (parseResult) {
@@ -16563,7 +16622,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
16563
16622
  }
16564
16623
  if (!onComponentSlot) {
16565
16624
  const buildDefaultSlotProperty = (props, children2) => {
16566
- const fn = buildSlotFn(props, children2, loc);
16625
+ const fn = buildSlotFn(props, void 0, children2, loc);
16567
16626
  if (context.compatConfig) {
16568
16627
  fn.isNonScopedSlot = true;
16569
16628
  }
@@ -594,7 +594,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
594
594
  } else if (key === "length" && isArray(target)) {
595
595
  const newLength = Number(newValue);
596
596
  depsMap.forEach((dep, key2) => {
597
- if (key2 === "length" || key2 >= newLength) {
597
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
598
598
  deps.push(dep);
599
599
  }
600
600
  });
@@ -1481,8 +1481,13 @@ function findInsertionIndex(id) {
1481
1481
  let end = queue.length;
1482
1482
  while (start < end) {
1483
1483
  const middle = start + end >>> 1;
1484
- const middleJobId = getId(queue[middle]);
1485
- middleJobId < id ? start = middle + 1 : end = middle;
1484
+ const middleJob = queue[middle];
1485
+ const middleJobId = getId(middleJob);
1486
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1487
+ start = middle + 1;
1488
+ } else {
1489
+ end = middle;
1490
+ }
1486
1491
  }
1487
1492
  return start;
1488
1493
  }
@@ -2435,14 +2440,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2435
2440
  parentComponent: parentComponent2,
2436
2441
  container: container2
2437
2442
  } = suspense;
2443
+ let delayEnter = false;
2438
2444
  if (suspense.isHydrating) {
2439
2445
  suspense.isHydrating = false;
2440
2446
  } else if (!resume) {
2441
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2447
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2442
2448
  if (delayEnter) {
2443
2449
  activeBranch.transition.afterLeave = () => {
2444
2450
  if (pendingId === suspense.pendingId) {
2445
2451
  move(pendingBranch, container2, anchor2, 0);
2452
+ queuePostFlushCb(effects);
2446
2453
  }
2447
2454
  };
2448
2455
  }
@@ -2468,7 +2475,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
2468
2475
  }
2469
2476
  parent = parent.parent;
2470
2477
  }
2471
- if (!hasUnresolvedAncestor) {
2478
+ if (!hasUnresolvedAncestor && !delayEnter) {
2472
2479
  queuePostFlushCb(effects);
2473
2480
  }
2474
2481
  suspense.effects = [];
@@ -5065,7 +5072,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5065
5072
  return vm;
5066
5073
  }
5067
5074
  }
5068
- Vue.version = `2.6.14-compat:${"3.3.6"}`;
5075
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
5069
5076
  Vue.config = singletonApp.config;
5070
5077
  Vue.use = (p, ...options) => {
5071
5078
  if (p && isFunction(p.install)) {
@@ -6118,7 +6125,14 @@ function createHydrationFunctions(rendererInternals) {
6118
6125
  break;
6119
6126
  case Comment:
6120
6127
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
6121
- nextNode = onMismatch();
6128
+ if (node.tagName.toLowerCase() === "template") {
6129
+ const content = vnode.el.content.firstChild;
6130
+ replaceNode(content, node, parentComponent);
6131
+ vnode.el = node = content;
6132
+ nextNode = nextSibling(node);
6133
+ } else {
6134
+ nextNode = onMismatch();
6135
+ }
6122
6136
  } else {
6123
6137
  nextNode = nextSibling(node);
6124
6138
  }
@@ -6160,7 +6174,7 @@ function createHydrationFunctions(rendererInternals) {
6160
6174
  break;
6161
6175
  default:
6162
6176
  if (shapeFlag & 1) {
6163
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
6177
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
6164
6178
  nextNode = onMismatch();
6165
6179
  } else {
6166
6180
  nextNode = hydrateElement(
@@ -6175,6 +6189,13 @@ function createHydrationFunctions(rendererInternals) {
6175
6189
  } else if (shapeFlag & 6) {
6176
6190
  vnode.slotScopeIds = slotScopeIds;
6177
6191
  const container = parentNode(node);
6192
+ if (isFragmentStart) {
6193
+ nextNode = locateClosingAnchor(node);
6194
+ } else if (isComment(node) && node.data === "teleport start") {
6195
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
6196
+ } else {
6197
+ nextNode = nextSibling(node);
6198
+ }
6178
6199
  mountComponent(
6179
6200
  vnode,
6180
6201
  container,
@@ -6184,10 +6205,6 @@ function createHydrationFunctions(rendererInternals) {
6184
6205
  isSVGContainer(container),
6185
6206
  optimized
6186
6207
  );
6187
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
6188
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
6189
- nextNode = nextSibling(nextNode);
6190
- }
6191
6208
  if (isAsyncWrapper(vnode)) {
6192
6209
  let subTree;
6193
6210
  if (isFragmentStart) {
@@ -6235,7 +6252,7 @@ function createHydrationFunctions(rendererInternals) {
6235
6252
  };
6236
6253
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6237
6254
  optimized = optimized || !!vnode.dynamicChildren;
6238
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
6255
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6239
6256
  const forcePatchValue = type === "input" && dirs || type === "option";
6240
6257
  if (forcePatchValue || patchFlag !== -1) {
6241
6258
  if (dirs) {
@@ -6272,12 +6289,23 @@ function createHydrationFunctions(rendererInternals) {
6272
6289
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
6273
6290
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6274
6291
  }
6292
+ let needCallTransitionHooks = false;
6293
+ if (isTemplateNode(el)) {
6294
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6295
+ const content = el.content.firstChild;
6296
+ if (needCallTransitionHooks) {
6297
+ transition.beforeEnter(content);
6298
+ }
6299
+ replaceNode(content, el, parentComponent);
6300
+ vnode.el = el = content;
6301
+ }
6275
6302
  if (dirs) {
6276
6303
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6277
6304
  }
6278
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
6305
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6279
6306
  queueEffectWithSuspense(() => {
6280
6307
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6308
+ needCallTransitionHooks && transition.enter(el);
6281
6309
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6282
6310
  }, parentSuspense);
6283
6311
  }
@@ -6367,7 +6395,7 @@ function createHydrationFunctions(rendererInternals) {
6367
6395
  hasMismatch = true;
6368
6396
  vnode.el = null;
6369
6397
  if (isFragment) {
6370
- const end = locateClosingAsyncAnchor(node);
6398
+ const end = locateClosingAnchor(node);
6371
6399
  while (true) {
6372
6400
  const next2 = nextSibling(node);
6373
6401
  if (next2 && next2 !== end) {
@@ -6392,14 +6420,14 @@ function createHydrationFunctions(rendererInternals) {
6392
6420
  );
6393
6421
  return next;
6394
6422
  };
6395
- const locateClosingAsyncAnchor = (node) => {
6423
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
6396
6424
  let match = 0;
6397
6425
  while (node) {
6398
6426
  node = nextSibling(node);
6399
6427
  if (node && isComment(node)) {
6400
- if (node.data === "[")
6428
+ if (node.data === open)
6401
6429
  match++;
6402
- if (node.data === "]") {
6430
+ if (node.data === close) {
6403
6431
  if (match === 0) {
6404
6432
  return nextSibling(node);
6405
6433
  } else {
@@ -6410,6 +6438,23 @@ function createHydrationFunctions(rendererInternals) {
6410
6438
  }
6411
6439
  return node;
6412
6440
  };
6441
+ const replaceNode = (newNode, oldNode, parentComponent) => {
6442
+ const parentNode2 = oldNode.parentNode;
6443
+ if (parentNode2) {
6444
+ parentNode2.replaceChild(newNode, oldNode);
6445
+ }
6446
+ let parent = parentComponent;
6447
+ while (parent) {
6448
+ if (parent.vnode.el === oldNode) {
6449
+ parent.vnode.el = newNode;
6450
+ parent.subTree.el = newNode;
6451
+ }
6452
+ parent = parent.parent;
6453
+ }
6454
+ };
6455
+ const isTemplateNode = (node) => {
6456
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
6457
+ };
6413
6458
  return [hydrate, hydrateNode];
6414
6459
  }
6415
6460
 
@@ -6665,7 +6710,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6665
6710
  if (dirs) {
6666
6711
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6667
6712
  }
6668
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6713
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
6669
6714
  if (needCallTransitionHooks) {
6670
6715
  transition.beforeEnter(el);
6671
6716
  }
@@ -7491,8 +7536,8 @@ function baseCreateRenderer(options, createHydrationFns) {
7491
7536
  moveStaticNode(vnode, container, anchor);
7492
7537
  return;
7493
7538
  }
7494
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7495
- if (needTransition) {
7539
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
7540
+ if (needTransition2) {
7496
7541
  if (moveType === 0) {
7497
7542
  transition.beforeEnter(el);
7498
7543
  hostInsert(el, container, anchor);
@@ -7707,6 +7752,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7707
7752
  function toggleRecurse({ effect, update }, allowed) {
7708
7753
  effect.allowRecurse = update.allowRecurse = allowed;
7709
7754
  }
7755
+ function needTransition(parentSuspense, transition) {
7756
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
7757
+ }
7710
7758
  function traverseStaticChildren(n1, n2, shallow = false) {
7711
7759
  const ch1 = n1.children;
7712
7760
  const ch2 = n2.children;
@@ -8752,7 +8800,7 @@ function isMemoSame(cached, memo) {
8752
8800
  return true;
8753
8801
  }
8754
8802
 
8755
- const version = "3.3.6";
8803
+ const version = "3.3.7";
8756
8804
  const _ssrUtils = {
8757
8805
  createComponentInstance,
8758
8806
  setupComponent,
@@ -11811,9 +11859,13 @@ function walk(node, context, doNotHoistNode = false) {
11811
11859
  context.transformHoist(children, context, node);
11812
11860
  }
11813
11861
  if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
11814
- node.codegenNode.children = context.hoist(
11862
+ const hoisted = context.hoist(
11815
11863
  createArrayExpression(node.codegenNode.children)
11816
11864
  );
11865
+ if (context.hmr) {
11866
+ hoisted.content = `[...${hoisted.content}]`;
11867
+ }
11868
+ node.codegenNode.children = hoisted;
11817
11869
  }
11818
11870
  }
11819
11871
  function getConstantType(node, context) {
@@ -11986,6 +12038,7 @@ function createTransformContext(root, {
11986
12038
  filename = "",
11987
12039
  prefixIdentifiers = false,
11988
12040
  hoistStatic: hoistStatic2 = false,
12041
+ hmr = false,
11989
12042
  cacheHandlers = false,
11990
12043
  nodeTransforms = [],
11991
12044
  directiveTransforms = {},
@@ -12011,6 +12064,7 @@ function createTransformContext(root, {
12011
12064
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
12012
12065
  prefixIdentifiers,
12013
12066
  hoistStatic: hoistStatic2,
12067
+ hmr,
12014
12068
  cacheHandlers,
12015
12069
  nodeTransforms,
12016
12070
  directiveTransforms,
@@ -14013,7 +14067,7 @@ const trackVForSlotScopes = (node, context) => {
14013
14067
  }
14014
14068
  }
14015
14069
  };
14016
- const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
14070
+ const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
14017
14071
  props,
14018
14072
  children,
14019
14073
  false,
@@ -14038,7 +14092,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14038
14092
  slotsProperties.push(
14039
14093
  createObjectProperty(
14040
14094
  arg || createSimpleExpression("default", true),
14041
- buildSlotFn(exp, children, loc)
14095
+ buildSlotFn(exp, void 0, children, loc)
14042
14096
  )
14043
14097
  );
14044
14098
  }
@@ -14075,10 +14129,15 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14075
14129
  } else {
14076
14130
  hasDynamicSlots = true;
14077
14131
  }
14078
- const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
14132
+ const vFor = findDir(slotElement, "for");
14133
+ const slotFunction = buildSlotFn(
14134
+ slotProps,
14135
+ vFor == null ? void 0 : vFor.exp,
14136
+ slotChildren,
14137
+ slotLoc
14138
+ );
14079
14139
  let vIf;
14080
14140
  let vElse;
14081
- let vFor;
14082
14141
  if (vIf = findDir(slotElement, "if")) {
14083
14142
  hasDynamicSlots = true;
14084
14143
  dynamicSlots.push(
@@ -14123,7 +14182,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14123
14182
  createCompilerError(30, vElse.loc)
14124
14183
  );
14125
14184
  }
14126
- } else if (vFor = findDir(slotElement, "for")) {
14185
+ } else if (vFor) {
14127
14186
  hasDynamicSlots = true;
14128
14187
  const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
14129
14188
  if (parseResult) {
@@ -14164,7 +14223,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
14164
14223
  }
14165
14224
  if (!onComponentSlot) {
14166
14225
  const buildDefaultSlotProperty = (props, children2) => {
14167
- const fn = buildSlotFn(props, children2, loc);
14226
+ const fn = buildSlotFn(props, void 0, children2, loc);
14168
14227
  if (context.compatConfig) {
14169
14228
  fn.isNonScopedSlot = true;
14170
14229
  }