@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
  });
@@ -1650,8 +1650,13 @@ function findInsertionIndex(id) {
1650
1650
  let end = queue.length;
1651
1651
  while (start < end) {
1652
1652
  const middle = start + end >>> 1;
1653
- const middleJobId = getId(queue[middle]);
1654
- middleJobId < id ? start = middle + 1 : end = middle;
1653
+ const middleJob = queue[middle];
1654
+ const middleJobId = getId(middleJob);
1655
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1656
+ start = middle + 1;
1657
+ } else {
1658
+ end = middle;
1659
+ }
1655
1660
  }
1656
1661
  return start;
1657
1662
  }
@@ -3242,14 +3247,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3242
3247
  parentComponent: parentComponent2,
3243
3248
  container: container2
3244
3249
  } = suspense;
3250
+ let delayEnter = false;
3245
3251
  if (suspense.isHydrating) {
3246
3252
  suspense.isHydrating = false;
3247
3253
  } else if (!resume) {
3248
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3254
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3249
3255
  if (delayEnter) {
3250
3256
  activeBranch.transition.afterLeave = () => {
3251
3257
  if (pendingId === suspense.pendingId) {
3252
3258
  move(pendingBranch, container2, anchor2, 0);
3259
+ queuePostFlushCb(effects);
3253
3260
  }
3254
3261
  };
3255
3262
  }
@@ -3275,7 +3282,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3275
3282
  }
3276
3283
  parent = parent.parent;
3277
3284
  }
3278
- if (!hasUnresolvedAncestor) {
3285
+ if (!hasUnresolvedAncestor && !delayEnter) {
3279
3286
  queuePostFlushCb(effects);
3280
3287
  }
3281
3288
  suspense.effects = [];
@@ -6230,7 +6237,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6230
6237
  return vm;
6231
6238
  }
6232
6239
  }
6233
- Vue.version = `2.6.14-compat:${"3.3.6"}`;
6240
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
6234
6241
  Vue.config = singletonApp.config;
6235
6242
  Vue.use = (p, ...options) => {
6236
6243
  if (p && isFunction(p.install)) {
@@ -7563,7 +7570,14 @@ function createHydrationFunctions(rendererInternals) {
7563
7570
  break;
7564
7571
  case Comment:
7565
7572
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7566
- nextNode = onMismatch();
7573
+ if (node.tagName.toLowerCase() === "template") {
7574
+ const content = vnode.el.content.firstChild;
7575
+ replaceNode(content, node, parentComponent);
7576
+ vnode.el = node = content;
7577
+ nextNode = nextSibling(node);
7578
+ } else {
7579
+ nextNode = onMismatch();
7580
+ }
7567
7581
  } else {
7568
7582
  nextNode = nextSibling(node);
7569
7583
  }
@@ -7605,7 +7619,7 @@ function createHydrationFunctions(rendererInternals) {
7605
7619
  break;
7606
7620
  default:
7607
7621
  if (shapeFlag & 1) {
7608
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
7622
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
7609
7623
  nextNode = onMismatch();
7610
7624
  } else {
7611
7625
  nextNode = hydrateElement(
@@ -7620,6 +7634,13 @@ function createHydrationFunctions(rendererInternals) {
7620
7634
  } else if (shapeFlag & 6) {
7621
7635
  vnode.slotScopeIds = slotScopeIds;
7622
7636
  const container = parentNode(node);
7637
+ if (isFragmentStart) {
7638
+ nextNode = locateClosingAnchor(node);
7639
+ } else if (isComment(node) && node.data === "teleport start") {
7640
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
7641
+ } else {
7642
+ nextNode = nextSibling(node);
7643
+ }
7623
7644
  mountComponent(
7624
7645
  vnode,
7625
7646
  container,
@@ -7629,10 +7650,6 @@ function createHydrationFunctions(rendererInternals) {
7629
7650
  isSVGContainer(container),
7630
7651
  optimized
7631
7652
  );
7632
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
7633
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
7634
- nextNode = nextSibling(nextNode);
7635
- }
7636
7653
  if (isAsyncWrapper(vnode)) {
7637
7654
  let subTree;
7638
7655
  if (isFragmentStart) {
@@ -7682,7 +7699,7 @@ function createHydrationFunctions(rendererInternals) {
7682
7699
  };
7683
7700
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7684
7701
  optimized = optimized || !!vnode.dynamicChildren;
7685
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
7702
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7686
7703
  const forcePatchValue = type === "input" && dirs || type === "option";
7687
7704
  if (!!(process.env.NODE_ENV !== "production") || forcePatchValue || patchFlag !== -1) {
7688
7705
  if (dirs) {
@@ -7719,12 +7736,23 @@ function createHydrationFunctions(rendererInternals) {
7719
7736
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
7720
7737
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7721
7738
  }
7739
+ let needCallTransitionHooks = false;
7740
+ if (isTemplateNode(el)) {
7741
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
7742
+ const content = el.content.firstChild;
7743
+ if (needCallTransitionHooks) {
7744
+ transition.beforeEnter(content);
7745
+ }
7746
+ replaceNode(content, el, parentComponent);
7747
+ vnode.el = el = content;
7748
+ }
7722
7749
  if (dirs) {
7723
7750
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7724
7751
  }
7725
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
7752
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7726
7753
  queueEffectWithSuspense(() => {
7727
7754
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7755
+ needCallTransitionHooks && transition.enter(el);
7728
7756
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7729
7757
  }, parentSuspense);
7730
7758
  }
@@ -7842,7 +7870,7 @@ function createHydrationFunctions(rendererInternals) {
7842
7870
  );
7843
7871
  vnode.el = null;
7844
7872
  if (isFragment) {
7845
- const end = locateClosingAsyncAnchor(node);
7873
+ const end = locateClosingAnchor(node);
7846
7874
  while (true) {
7847
7875
  const next2 = nextSibling(node);
7848
7876
  if (next2 && next2 !== end) {
@@ -7867,14 +7895,14 @@ function createHydrationFunctions(rendererInternals) {
7867
7895
  );
7868
7896
  return next;
7869
7897
  };
7870
- const locateClosingAsyncAnchor = (node) => {
7898
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
7871
7899
  let match = 0;
7872
7900
  while (node) {
7873
7901
  node = nextSibling(node);
7874
7902
  if (node && isComment(node)) {
7875
- if (node.data === "[")
7903
+ if (node.data === open)
7876
7904
  match++;
7877
- if (node.data === "]") {
7905
+ if (node.data === close) {
7878
7906
  if (match === 0) {
7879
7907
  return nextSibling(node);
7880
7908
  } else {
@@ -7885,6 +7913,23 @@ function createHydrationFunctions(rendererInternals) {
7885
7913
  }
7886
7914
  return node;
7887
7915
  };
7916
+ const replaceNode = (newNode, oldNode, parentComponent) => {
7917
+ const parentNode2 = oldNode.parentNode;
7918
+ if (parentNode2) {
7919
+ parentNode2.replaceChild(newNode, oldNode);
7920
+ }
7921
+ let parent = parentComponent;
7922
+ while (parent) {
7923
+ if (parent.vnode.el === oldNode) {
7924
+ parent.vnode.el = newNode;
7925
+ parent.subTree.el = newNode;
7926
+ }
7927
+ parent = parent.parent;
7928
+ }
7929
+ };
7930
+ const isTemplateNode = (node) => {
7931
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
7932
+ };
7888
7933
  return [hydrate, hydrateNode];
7889
7934
  }
7890
7935
 
@@ -8235,7 +8280,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8235
8280
  if (dirs) {
8236
8281
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8237
8282
  }
8238
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8283
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
8239
8284
  if (needCallTransitionHooks) {
8240
8285
  transition.beforeEnter(el);
8241
8286
  }
@@ -9163,8 +9208,8 @@ function baseCreateRenderer(options, createHydrationFns) {
9163
9208
  moveStaticNode(vnode, container, anchor);
9164
9209
  return;
9165
9210
  }
9166
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
9167
- if (needTransition) {
9211
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
9212
+ if (needTransition2) {
9168
9213
  if (moveType === 0) {
9169
9214
  transition.beforeEnter(el);
9170
9215
  hostInsert(el, container, anchor);
@@ -9393,6 +9438,9 @@ function baseCreateRenderer(options, createHydrationFns) {
9393
9438
  function toggleRecurse({ effect, update }, allowed) {
9394
9439
  effect.allowRecurse = update.allowRecurse = allowed;
9395
9440
  }
9441
+ function needTransition(parentSuspense, transition) {
9442
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9443
+ }
9396
9444
  function traverseStaticChildren(n1, n2, shallow = false) {
9397
9445
  const ch1 = n1.children;
9398
9446
  const ch2 = n2.children;
@@ -10829,7 +10877,7 @@ function isMemoSame(cached, memo) {
10829
10877
  return true;
10830
10878
  }
10831
10879
 
10832
- const version = "3.3.6";
10880
+ const version = "3.3.7";
10833
10881
  const _ssrUtils = {
10834
10882
  createComponentInstance,
10835
10883
  setupComponent,
@@ -543,7 +543,7 @@ var Vue = (function () {
543
543
  } else if (key === "length" && isArray(target)) {
544
544
  const newLength = Number(newValue);
545
545
  depsMap.forEach((dep, key2) => {
546
- if (key2 === "length" || key2 >= newLength) {
546
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
547
547
  deps.push(dep);
548
548
  }
549
549
  });
@@ -1639,8 +1639,13 @@ var Vue = (function () {
1639
1639
  let end = queue.length;
1640
1640
  while (start < end) {
1641
1641
  const middle = start + end >>> 1;
1642
- const middleJobId = getId(queue[middle]);
1643
- middleJobId < id ? start = middle + 1 : end = middle;
1642
+ const middleJob = queue[middle];
1643
+ const middleJobId = getId(middleJob);
1644
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1645
+ start = middle + 1;
1646
+ } else {
1647
+ end = middle;
1648
+ }
1644
1649
  }
1645
1650
  return start;
1646
1651
  }
@@ -3228,14 +3233,16 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3228
3233
  parentComponent: parentComponent2,
3229
3234
  container: container2
3230
3235
  } = suspense;
3236
+ let delayEnter = false;
3231
3237
  if (suspense.isHydrating) {
3232
3238
  suspense.isHydrating = false;
3233
3239
  } else if (!resume) {
3234
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3240
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3235
3241
  if (delayEnter) {
3236
3242
  activeBranch.transition.afterLeave = () => {
3237
3243
  if (pendingId === suspense.pendingId) {
3238
3244
  move(pendingBranch, container2, anchor2, 0);
3245
+ queuePostFlushCb(effects);
3239
3246
  }
3240
3247
  };
3241
3248
  }
@@ -3261,7 +3268,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3261
3268
  }
3262
3269
  parent = parent.parent;
3263
3270
  }
3264
- if (!hasUnresolvedAncestor) {
3271
+ if (!hasUnresolvedAncestor && !delayEnter) {
3265
3272
  queuePostFlushCb(effects);
3266
3273
  }
3267
3274
  suspense.effects = [];
@@ -6185,7 +6192,7 @@ If this is a native custom element, make sure to exclude it from component resol
6185
6192
  return vm;
6186
6193
  }
6187
6194
  }
6188
- Vue.version = `2.6.14-compat:${"3.3.6"}`;
6195
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
6189
6196
  Vue.config = singletonApp.config;
6190
6197
  Vue.use = (p, ...options) => {
6191
6198
  if (p && isFunction(p.install)) {
@@ -7515,7 +7522,14 @@ If you want to remount the same app, move your app creation logic into a factory
7515
7522
  break;
7516
7523
  case Comment:
7517
7524
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7518
- nextNode = onMismatch();
7525
+ if (node.tagName.toLowerCase() === "template") {
7526
+ const content = vnode.el.content.firstChild;
7527
+ replaceNode(content, node, parentComponent);
7528
+ vnode.el = node = content;
7529
+ nextNode = nextSibling(node);
7530
+ } else {
7531
+ nextNode = onMismatch();
7532
+ }
7519
7533
  } else {
7520
7534
  nextNode = nextSibling(node);
7521
7535
  }
@@ -7557,7 +7571,7 @@ If you want to remount the same app, move your app creation logic into a factory
7557
7571
  break;
7558
7572
  default:
7559
7573
  if (shapeFlag & 1) {
7560
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
7574
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
7561
7575
  nextNode = onMismatch();
7562
7576
  } else {
7563
7577
  nextNode = hydrateElement(
@@ -7572,6 +7586,13 @@ If you want to remount the same app, move your app creation logic into a factory
7572
7586
  } else if (shapeFlag & 6) {
7573
7587
  vnode.slotScopeIds = slotScopeIds;
7574
7588
  const container = parentNode(node);
7589
+ if (isFragmentStart) {
7590
+ nextNode = locateClosingAnchor(node);
7591
+ } else if (isComment(node) && node.data === "teleport start") {
7592
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
7593
+ } else {
7594
+ nextNode = nextSibling(node);
7595
+ }
7575
7596
  mountComponent(
7576
7597
  vnode,
7577
7598
  container,
@@ -7581,10 +7602,6 @@ If you want to remount the same app, move your app creation logic into a factory
7581
7602
  isSVGContainer(container),
7582
7603
  optimized
7583
7604
  );
7584
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
7585
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
7586
- nextNode = nextSibling(nextNode);
7587
- }
7588
7605
  if (isAsyncWrapper(vnode)) {
7589
7606
  let subTree;
7590
7607
  if (isFragmentStart) {
@@ -7634,7 +7651,7 @@ If you want to remount the same app, move your app creation logic into a factory
7634
7651
  };
7635
7652
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7636
7653
  optimized = optimized || !!vnode.dynamicChildren;
7637
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
7654
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7638
7655
  const forcePatchValue = type === "input" && dirs || type === "option";
7639
7656
  {
7640
7657
  if (dirs) {
@@ -7671,12 +7688,23 @@ If you want to remount the same app, move your app creation logic into a factory
7671
7688
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
7672
7689
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7673
7690
  }
7691
+ let needCallTransitionHooks = false;
7692
+ if (isTemplateNode(el)) {
7693
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
7694
+ const content = el.content.firstChild;
7695
+ if (needCallTransitionHooks) {
7696
+ transition.beforeEnter(content);
7697
+ }
7698
+ replaceNode(content, el, parentComponent);
7699
+ vnode.el = el = content;
7700
+ }
7674
7701
  if (dirs) {
7675
7702
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7676
7703
  }
7677
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
7704
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7678
7705
  queueEffectWithSuspense(() => {
7679
7706
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7707
+ needCallTransitionHooks && transition.enter(el);
7680
7708
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7681
7709
  }, parentSuspense);
7682
7710
  }
@@ -7794,7 +7822,7 @@ If you want to remount the same app, move your app creation logic into a factory
7794
7822
  );
7795
7823
  vnode.el = null;
7796
7824
  if (isFragment) {
7797
- const end = locateClosingAsyncAnchor(node);
7825
+ const end = locateClosingAnchor(node);
7798
7826
  while (true) {
7799
7827
  const next2 = nextSibling(node);
7800
7828
  if (next2 && next2 !== end) {
@@ -7819,14 +7847,14 @@ If you want to remount the same app, move your app creation logic into a factory
7819
7847
  );
7820
7848
  return next;
7821
7849
  };
7822
- const locateClosingAsyncAnchor = (node) => {
7850
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
7823
7851
  let match = 0;
7824
7852
  while (node) {
7825
7853
  node = nextSibling(node);
7826
7854
  if (node && isComment(node)) {
7827
- if (node.data === "[")
7855
+ if (node.data === open)
7828
7856
  match++;
7829
- if (node.data === "]") {
7857
+ if (node.data === close) {
7830
7858
  if (match === 0) {
7831
7859
  return nextSibling(node);
7832
7860
  } else {
@@ -7837,6 +7865,23 @@ If you want to remount the same app, move your app creation logic into a factory
7837
7865
  }
7838
7866
  return node;
7839
7867
  };
7868
+ const replaceNode = (newNode, oldNode, parentComponent) => {
7869
+ const parentNode2 = oldNode.parentNode;
7870
+ if (parentNode2) {
7871
+ parentNode2.replaceChild(newNode, oldNode);
7872
+ }
7873
+ let parent = parentComponent;
7874
+ while (parent) {
7875
+ if (parent.vnode.el === oldNode) {
7876
+ parent.vnode.el = newNode;
7877
+ parent.subTree.el = newNode;
7878
+ }
7879
+ parent = parent.parent;
7880
+ }
7881
+ };
7882
+ const isTemplateNode = (node) => {
7883
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
7884
+ };
7840
7885
  return [hydrate, hydrateNode];
7841
7886
  }
7842
7887
 
@@ -8164,7 +8209,7 @@ If you want to remount the same app, move your app creation logic into a factory
8164
8209
  if (dirs) {
8165
8210
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8166
8211
  }
8167
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8212
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
8168
8213
  if (needCallTransitionHooks) {
8169
8214
  transition.beforeEnter(el);
8170
8215
  }
@@ -9081,8 +9126,8 @@ If you want to remount the same app, move your app creation logic into a factory
9081
9126
  moveStaticNode(vnode, container, anchor);
9082
9127
  return;
9083
9128
  }
9084
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
9085
- if (needTransition) {
9129
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
9130
+ if (needTransition2) {
9086
9131
  if (moveType === 0) {
9087
9132
  transition.beforeEnter(el);
9088
9133
  hostInsert(el, container, anchor);
@@ -9311,6 +9356,9 @@ If you want to remount the same app, move your app creation logic into a factory
9311
9356
  function toggleRecurse({ effect, update }, allowed) {
9312
9357
  effect.allowRecurse = update.allowRecurse = allowed;
9313
9358
  }
9359
+ function needTransition(parentSuspense, transition) {
9360
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9361
+ }
9314
9362
  function traverseStaticChildren(n1, n2, shallow = false) {
9315
9363
  const ch1 = n1.children;
9316
9364
  const ch2 = n2.children;
@@ -10713,7 +10761,7 @@ Component that was made reactive: `,
10713
10761
  return true;
10714
10762
  }
10715
10763
 
10716
- const version = "3.3.6";
10764
+ const version = "3.3.7";
10717
10765
  const ssrUtils = null;
10718
10766
  const resolveFilter = resolveFilter$1 ;
10719
10767
  const _compatUtils = {