@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.
@@ -540,7 +540,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
540
540
  } else if (key === "length" && isArray(target)) {
541
541
  const newLength = Number(newValue);
542
542
  depsMap.forEach((dep, key2) => {
543
- if (key2 === "length" || key2 >= newLength) {
543
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
544
544
  deps.push(dep);
545
545
  }
546
546
  });
@@ -1636,8 +1636,13 @@ function findInsertionIndex(id) {
1636
1636
  let end = queue.length;
1637
1637
  while (start < end) {
1638
1638
  const middle = start + end >>> 1;
1639
- const middleJobId = getId(queue[middle]);
1640
- middleJobId < id ? start = middle + 1 : end = middle;
1639
+ const middleJob = queue[middle];
1640
+ const middleJobId = getId(middleJob);
1641
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1642
+ start = middle + 1;
1643
+ } else {
1644
+ end = middle;
1645
+ }
1641
1646
  }
1642
1647
  return start;
1643
1648
  }
@@ -3225,14 +3230,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3225
3230
  parentComponent: parentComponent2,
3226
3231
  container: container2
3227
3232
  } = suspense;
3233
+ let delayEnter = false;
3228
3234
  if (suspense.isHydrating) {
3229
3235
  suspense.isHydrating = false;
3230
3236
  } else if (!resume) {
3231
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3237
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3232
3238
  if (delayEnter) {
3233
3239
  activeBranch.transition.afterLeave = () => {
3234
3240
  if (pendingId === suspense.pendingId) {
3235
3241
  move(pendingBranch, container2, anchor2, 0);
3242
+ queuePostFlushCb(effects);
3236
3243
  }
3237
3244
  };
3238
3245
  }
@@ -3258,7 +3265,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3258
3265
  }
3259
3266
  parent = parent.parent;
3260
3267
  }
3261
- if (!hasUnresolvedAncestor) {
3268
+ if (!hasUnresolvedAncestor && !delayEnter) {
3262
3269
  queuePostFlushCb(effects);
3263
3270
  }
3264
3271
  suspense.effects = [];
@@ -6182,7 +6189,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6182
6189
  return vm;
6183
6190
  }
6184
6191
  }
6185
- Vue.version = `2.6.14-compat:${"3.3.6"}`;
6192
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
6186
6193
  Vue.config = singletonApp.config;
6187
6194
  Vue.use = (p, ...options) => {
6188
6195
  if (p && isFunction(p.install)) {
@@ -7512,7 +7519,14 @@ function createHydrationFunctions(rendererInternals) {
7512
7519
  break;
7513
7520
  case Comment:
7514
7521
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7515
- nextNode = onMismatch();
7522
+ if (node.tagName.toLowerCase() === "template") {
7523
+ const content = vnode.el.content.firstChild;
7524
+ replaceNode(content, node, parentComponent);
7525
+ vnode.el = node = content;
7526
+ nextNode = nextSibling(node);
7527
+ } else {
7528
+ nextNode = onMismatch();
7529
+ }
7516
7530
  } else {
7517
7531
  nextNode = nextSibling(node);
7518
7532
  }
@@ -7554,7 +7568,7 @@ function createHydrationFunctions(rendererInternals) {
7554
7568
  break;
7555
7569
  default:
7556
7570
  if (shapeFlag & 1) {
7557
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
7571
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
7558
7572
  nextNode = onMismatch();
7559
7573
  } else {
7560
7574
  nextNode = hydrateElement(
@@ -7569,6 +7583,13 @@ function createHydrationFunctions(rendererInternals) {
7569
7583
  } else if (shapeFlag & 6) {
7570
7584
  vnode.slotScopeIds = slotScopeIds;
7571
7585
  const container = parentNode(node);
7586
+ if (isFragmentStart) {
7587
+ nextNode = locateClosingAnchor(node);
7588
+ } else if (isComment(node) && node.data === "teleport start") {
7589
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
7590
+ } else {
7591
+ nextNode = nextSibling(node);
7592
+ }
7572
7593
  mountComponent(
7573
7594
  vnode,
7574
7595
  container,
@@ -7578,10 +7599,6 @@ function createHydrationFunctions(rendererInternals) {
7578
7599
  isSVGContainer(container),
7579
7600
  optimized
7580
7601
  );
7581
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
7582
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
7583
- nextNode = nextSibling(nextNode);
7584
- }
7585
7602
  if (isAsyncWrapper(vnode)) {
7586
7603
  let subTree;
7587
7604
  if (isFragmentStart) {
@@ -7631,7 +7648,7 @@ function createHydrationFunctions(rendererInternals) {
7631
7648
  };
7632
7649
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7633
7650
  optimized = optimized || !!vnode.dynamicChildren;
7634
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
7651
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7635
7652
  const forcePatchValue = type === "input" && dirs || type === "option";
7636
7653
  {
7637
7654
  if (dirs) {
@@ -7668,12 +7685,23 @@ function createHydrationFunctions(rendererInternals) {
7668
7685
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
7669
7686
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7670
7687
  }
7688
+ let needCallTransitionHooks = false;
7689
+ if (isTemplateNode(el)) {
7690
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
7691
+ const content = el.content.firstChild;
7692
+ if (needCallTransitionHooks) {
7693
+ transition.beforeEnter(content);
7694
+ }
7695
+ replaceNode(content, el, parentComponent);
7696
+ vnode.el = el = content;
7697
+ }
7671
7698
  if (dirs) {
7672
7699
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7673
7700
  }
7674
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
7701
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7675
7702
  queueEffectWithSuspense(() => {
7676
7703
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7704
+ needCallTransitionHooks && transition.enter(el);
7677
7705
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7678
7706
  }, parentSuspense);
7679
7707
  }
@@ -7791,7 +7819,7 @@ function createHydrationFunctions(rendererInternals) {
7791
7819
  );
7792
7820
  vnode.el = null;
7793
7821
  if (isFragment) {
7794
- const end = locateClosingAsyncAnchor(node);
7822
+ const end = locateClosingAnchor(node);
7795
7823
  while (true) {
7796
7824
  const next2 = nextSibling(node);
7797
7825
  if (next2 && next2 !== end) {
@@ -7816,14 +7844,14 @@ function createHydrationFunctions(rendererInternals) {
7816
7844
  );
7817
7845
  return next;
7818
7846
  };
7819
- const locateClosingAsyncAnchor = (node) => {
7847
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
7820
7848
  let match = 0;
7821
7849
  while (node) {
7822
7850
  node = nextSibling(node);
7823
7851
  if (node && isComment(node)) {
7824
- if (node.data === "[")
7852
+ if (node.data === open)
7825
7853
  match++;
7826
- if (node.data === "]") {
7854
+ if (node.data === close) {
7827
7855
  if (match === 0) {
7828
7856
  return nextSibling(node);
7829
7857
  } else {
@@ -7834,6 +7862,23 @@ function createHydrationFunctions(rendererInternals) {
7834
7862
  }
7835
7863
  return node;
7836
7864
  };
7865
+ const replaceNode = (newNode, oldNode, parentComponent) => {
7866
+ const parentNode2 = oldNode.parentNode;
7867
+ if (parentNode2) {
7868
+ parentNode2.replaceChild(newNode, oldNode);
7869
+ }
7870
+ let parent = parentComponent;
7871
+ while (parent) {
7872
+ if (parent.vnode.el === oldNode) {
7873
+ parent.vnode.el = newNode;
7874
+ parent.subTree.el = newNode;
7875
+ }
7876
+ parent = parent.parent;
7877
+ }
7878
+ };
7879
+ const isTemplateNode = (node) => {
7880
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
7881
+ };
7837
7882
  return [hydrate, hydrateNode];
7838
7883
  }
7839
7884
 
@@ -8161,7 +8206,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8161
8206
  if (dirs) {
8162
8207
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8163
8208
  }
8164
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8209
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
8165
8210
  if (needCallTransitionHooks) {
8166
8211
  transition.beforeEnter(el);
8167
8212
  }
@@ -9078,8 +9123,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9078
9123
  moveStaticNode(vnode, container, anchor);
9079
9124
  return;
9080
9125
  }
9081
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
9082
- if (needTransition) {
9126
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
9127
+ if (needTransition2) {
9083
9128
  if (moveType === 0) {
9084
9129
  transition.beforeEnter(el);
9085
9130
  hostInsert(el, container, anchor);
@@ -9308,6 +9353,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9308
9353
  function toggleRecurse({ effect, update }, allowed) {
9309
9354
  effect.allowRecurse = update.allowRecurse = allowed;
9310
9355
  }
9356
+ function needTransition(parentSuspense, transition) {
9357
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9358
+ }
9311
9359
  function traverseStaticChildren(n1, n2, shallow = false) {
9312
9360
  const ch1 = n1.children;
9313
9361
  const ch2 = n2.children;
@@ -10716,7 +10764,7 @@ function isMemoSame(cached, memo) {
10716
10764
  return true;
10717
10765
  }
10718
10766
 
10719
- const version = "3.3.6";
10767
+ const version = "3.3.7";
10720
10768
  const ssrUtils = null;
10721
10769
  const resolveFilter = resolveFilter$1 ;
10722
10770
  const _compatUtils = {