@vue/compat 3.3.5 → 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.
@@ -608,7 +608,7 @@ var Vue = (function () {
608
608
  } else if (key === "length" && isArray(target)) {
609
609
  const newLength = Number(newValue);
610
610
  depsMap.forEach((dep, key2) => {
611
- if (key2 === "length" || key2 >= newLength) {
611
+ if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
612
612
  deps.push(dep);
613
613
  }
614
614
  });
@@ -1704,8 +1704,13 @@ var Vue = (function () {
1704
1704
  let end = queue.length;
1705
1705
  while (start < end) {
1706
1706
  const middle = start + end >>> 1;
1707
- const middleJobId = getId(queue[middle]);
1708
- middleJobId < id ? start = middle + 1 : end = middle;
1707
+ const middleJob = queue[middle];
1708
+ const middleJobId = getId(middleJob);
1709
+ if (middleJobId < id || middleJobId === id && middleJob.pre) {
1710
+ start = middle + 1;
1711
+ } else {
1712
+ end = middle;
1713
+ }
1709
1714
  }
1710
1715
  return start;
1711
1716
  }
@@ -3293,14 +3298,16 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3293
3298
  parentComponent: parentComponent2,
3294
3299
  container: container2
3295
3300
  } = suspense;
3301
+ let delayEnter = false;
3296
3302
  if (suspense.isHydrating) {
3297
3303
  suspense.isHydrating = false;
3298
3304
  } else if (!resume) {
3299
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3305
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
3300
3306
  if (delayEnter) {
3301
3307
  activeBranch.transition.afterLeave = () => {
3302
3308
  if (pendingId === suspense.pendingId) {
3303
3309
  move(pendingBranch, container2, anchor2, 0);
3310
+ queuePostFlushCb(effects);
3304
3311
  }
3305
3312
  };
3306
3313
  }
@@ -3326,7 +3333,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3326
3333
  }
3327
3334
  parent = parent.parent;
3328
3335
  }
3329
- if (!hasUnresolvedAncestor) {
3336
+ if (!hasUnresolvedAncestor && !delayEnter) {
3330
3337
  queuePostFlushCb(effects);
3331
3338
  }
3332
3339
  suspense.effects = [];
@@ -4954,7 +4961,7 @@ If this is a native custom element, make sure to exclude it from component resol
4954
4961
  }
4955
4962
  }
4956
4963
 
4957
- const normalizedFunctionalComponentMap = /* @__PURE__ */ new Map();
4964
+ const normalizedFunctionalComponentMap = /* @__PURE__ */ new WeakMap();
4958
4965
  const legacySlotProxyHandlers = {
4959
4966
  get(target, key) {
4960
4967
  const slot = target[key];
@@ -6250,7 +6257,7 @@ If this is a native custom element, make sure to exclude it from component resol
6250
6257
  return vm;
6251
6258
  }
6252
6259
  }
6253
- Vue.version = `2.6.14-compat:${"3.3.5"}`;
6260
+ Vue.version = `2.6.14-compat:${"3.3.7"}`;
6254
6261
  Vue.config = singletonApp.config;
6255
6262
  Vue.use = (p, ...options) => {
6256
6263
  if (p && isFunction(p.install)) {
@@ -6663,7 +6670,7 @@ If this is a native custom element, make sure to exclude it from component resol
6663
6670
  }
6664
6671
  });
6665
6672
  }
6666
- const installedPlugins = /* @__PURE__ */ new Set();
6673
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
6667
6674
  let isMounted = false;
6668
6675
  const app = context.app = {
6669
6676
  _uid: uid$1++,
@@ -7404,7 +7411,7 @@ If you want to remount the same app, move your app creation logic into a factory
7404
7411
  }
7405
7412
  if (needDeletionCheck) {
7406
7413
  for (const key in slots) {
7407
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
7414
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
7408
7415
  delete slots[key];
7409
7416
  }
7410
7417
  }
@@ -7580,7 +7587,14 @@ If you want to remount the same app, move your app creation logic into a factory
7580
7587
  break;
7581
7588
  case Comment:
7582
7589
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
7583
- nextNode = onMismatch();
7590
+ if (node.tagName.toLowerCase() === "template") {
7591
+ const content = vnode.el.content.firstChild;
7592
+ replaceNode(content, node, parentComponent);
7593
+ vnode.el = node = content;
7594
+ nextNode = nextSibling(node);
7595
+ } else {
7596
+ nextNode = onMismatch();
7597
+ }
7584
7598
  } else {
7585
7599
  nextNode = nextSibling(node);
7586
7600
  }
@@ -7622,7 +7636,7 @@ If you want to remount the same app, move your app creation logic into a factory
7622
7636
  break;
7623
7637
  default:
7624
7638
  if (shapeFlag & 1) {
7625
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
7639
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
7626
7640
  nextNode = onMismatch();
7627
7641
  } else {
7628
7642
  nextNode = hydrateElement(
@@ -7637,6 +7651,13 @@ If you want to remount the same app, move your app creation logic into a factory
7637
7651
  } else if (shapeFlag & 6) {
7638
7652
  vnode.slotScopeIds = slotScopeIds;
7639
7653
  const container = parentNode(node);
7654
+ if (isFragmentStart) {
7655
+ nextNode = locateClosingAnchor(node);
7656
+ } else if (isComment(node) && node.data === "teleport start") {
7657
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
7658
+ } else {
7659
+ nextNode = nextSibling(node);
7660
+ }
7640
7661
  mountComponent(
7641
7662
  vnode,
7642
7663
  container,
@@ -7646,10 +7667,6 @@ If you want to remount the same app, move your app creation logic into a factory
7646
7667
  isSVGContainer(container),
7647
7668
  optimized
7648
7669
  );
7649
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
7650
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
7651
- nextNode = nextSibling(nextNode);
7652
- }
7653
7670
  if (isAsyncWrapper(vnode)) {
7654
7671
  let subTree;
7655
7672
  if (isFragmentStart) {
@@ -7699,7 +7716,7 @@ If you want to remount the same app, move your app creation logic into a factory
7699
7716
  };
7700
7717
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
7701
7718
  optimized = optimized || !!vnode.dynamicChildren;
7702
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
7719
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
7703
7720
  const forcePatchValue = type === "input" && dirs || type === "option";
7704
7721
  {
7705
7722
  if (dirs) {
@@ -7736,12 +7753,23 @@ If you want to remount the same app, move your app creation logic into a factory
7736
7753
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
7737
7754
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7738
7755
  }
7756
+ let needCallTransitionHooks = false;
7757
+ if (isTemplateNode(el)) {
7758
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
7759
+ const content = el.content.firstChild;
7760
+ if (needCallTransitionHooks) {
7761
+ transition.beforeEnter(content);
7762
+ }
7763
+ replaceNode(content, el, parentComponent);
7764
+ vnode.el = el = content;
7765
+ }
7739
7766
  if (dirs) {
7740
7767
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
7741
7768
  }
7742
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
7769
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
7743
7770
  queueEffectWithSuspense(() => {
7744
7771
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
7772
+ needCallTransitionHooks && transition.enter(el);
7745
7773
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7746
7774
  }, parentSuspense);
7747
7775
  }
@@ -7859,7 +7887,7 @@ If you want to remount the same app, move your app creation logic into a factory
7859
7887
  );
7860
7888
  vnode.el = null;
7861
7889
  if (isFragment) {
7862
- const end = locateClosingAsyncAnchor(node);
7890
+ const end = locateClosingAnchor(node);
7863
7891
  while (true) {
7864
7892
  const next2 = nextSibling(node);
7865
7893
  if (next2 && next2 !== end) {
@@ -7884,14 +7912,14 @@ If you want to remount the same app, move your app creation logic into a factory
7884
7912
  );
7885
7913
  return next;
7886
7914
  };
7887
- const locateClosingAsyncAnchor = (node) => {
7915
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
7888
7916
  let match = 0;
7889
7917
  while (node) {
7890
7918
  node = nextSibling(node);
7891
7919
  if (node && isComment(node)) {
7892
- if (node.data === "[")
7920
+ if (node.data === open)
7893
7921
  match++;
7894
- if (node.data === "]") {
7922
+ if (node.data === close) {
7895
7923
  if (match === 0) {
7896
7924
  return nextSibling(node);
7897
7925
  } else {
@@ -7902,6 +7930,23 @@ If you want to remount the same app, move your app creation logic into a factory
7902
7930
  }
7903
7931
  return node;
7904
7932
  };
7933
+ const replaceNode = (newNode, oldNode, parentComponent) => {
7934
+ const parentNode2 = oldNode.parentNode;
7935
+ if (parentNode2) {
7936
+ parentNode2.replaceChild(newNode, oldNode);
7937
+ }
7938
+ let parent = parentComponent;
7939
+ while (parent) {
7940
+ if (parent.vnode.el === oldNode) {
7941
+ parent.vnode.el = newNode;
7942
+ parent.subTree.el = newNode;
7943
+ }
7944
+ parent = parent.parent;
7945
+ }
7946
+ };
7947
+ const isTemplateNode = (node) => {
7948
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
7949
+ };
7905
7950
  return [hydrate, hydrateNode];
7906
7951
  }
7907
7952
 
@@ -8229,7 +8274,7 @@ If you want to remount the same app, move your app creation logic into a factory
8229
8274
  if (dirs) {
8230
8275
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
8231
8276
  }
8232
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
8277
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
8233
8278
  if (needCallTransitionHooks) {
8234
8279
  transition.beforeEnter(el);
8235
8280
  }
@@ -9146,8 +9191,8 @@ If you want to remount the same app, move your app creation logic into a factory
9146
9191
  moveStaticNode(vnode, container, anchor);
9147
9192
  return;
9148
9193
  }
9149
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
9150
- if (needTransition) {
9194
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
9195
+ if (needTransition2) {
9151
9196
  if (moveType === 0) {
9152
9197
  transition.beforeEnter(el);
9153
9198
  hostInsert(el, container, anchor);
@@ -9376,6 +9421,9 @@ If you want to remount the same app, move your app creation logic into a factory
9376
9421
  function toggleRecurse({ effect, update }, allowed) {
9377
9422
  effect.allowRecurse = update.allowRecurse = allowed;
9378
9423
  }
9424
+ function needTransition(parentSuspense, transition) {
9425
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
9426
+ }
9379
9427
  function traverseStaticChildren(n1, n2, shallow = false) {
9380
9428
  const ch1 = n1.children;
9381
9429
  const ch2 = n2.children;
@@ -9601,19 +9649,18 @@ If you want to remount the same app, move your app creation logic into a factory
9601
9649
  if (target) {
9602
9650
  hostRemove(targetAnchor);
9603
9651
  }
9604
- if (doRemove || !isTeleportDisabled(props)) {
9605
- hostRemove(anchor);
9606
- if (shapeFlag & 16) {
9607
- for (let i = 0; i < children.length; i++) {
9608
- const child = children[i];
9609
- unmount(
9610
- child,
9611
- parentComponent,
9612
- parentSuspense,
9613
- true,
9614
- !!child.dynamicChildren
9615
- );
9616
- }
9652
+ doRemove && hostRemove(anchor);
9653
+ if (shapeFlag & 16) {
9654
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
9655
+ for (let i = 0; i < children.length; i++) {
9656
+ const child = children[i];
9657
+ unmount(
9658
+ child,
9659
+ parentComponent,
9660
+ parentSuspense,
9661
+ shouldRemove,
9662
+ !!child.dynamicChildren
9663
+ );
9617
9664
  }
9618
9665
  }
9619
9666
  },
@@ -9697,7 +9744,7 @@ If you want to remount the same app, move your app creation logic into a factory
9697
9744
  const ctx = vnode.ctx;
9698
9745
  if (ctx && ctx.ut) {
9699
9746
  let node = vnode.children[0].el;
9700
- while (node !== vnode.targetAnchor) {
9747
+ while (node && node !== vnode.targetAnchor) {
9701
9748
  if (node.nodeType === 1)
9702
9749
  node.setAttribute("data-v-owner", ctx.uid);
9703
9750
  node = node.nextSibling;
@@ -9706,7 +9753,7 @@ If you want to remount the same app, move your app creation logic into a factory
9706
9753
  }
9707
9754
  }
9708
9755
 
9709
- const normalizedAsyncComponentMap = /* @__PURE__ */ new Map();
9756
+ const normalizedAsyncComponentMap = /* @__PURE__ */ new WeakMap();
9710
9757
  function convertLegacyAsyncComponent(comp) {
9711
9758
  if (normalizedAsyncComponentMap.has(comp)) {
9712
9759
  return normalizedAsyncComponentMap.get(comp);
@@ -10779,7 +10826,7 @@ Component that was made reactive: `,
10779
10826
  return true;
10780
10827
  }
10781
10828
 
10782
- const version = "3.3.5";
10829
+ const version = "3.3.7";
10783
10830
  const ssrUtils = null;
10784
10831
  const resolveFilter = resolveFilter$1 ;
10785
10832
  const _compatUtils = {
@@ -14069,9 +14116,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14069
14116
  context.transformHoist(children, context, node);
14070
14117
  }
14071
14118
  if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14072
- node.codegenNode.children = context.hoist(
14119
+ const hoisted = context.hoist(
14073
14120
  createArrayExpression(node.codegenNode.children)
14074
14121
  );
14122
+ if (context.hmr) {
14123
+ hoisted.content = `[...${hoisted.content}]`;
14124
+ }
14125
+ node.codegenNode.children = hoisted;
14075
14126
  }
14076
14127
  }
14077
14128
  function getConstantType(node, context) {
@@ -14244,6 +14295,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14244
14295
  filename = "",
14245
14296
  prefixIdentifiers = false,
14246
14297
  hoistStatic: hoistStatic2 = false,
14298
+ hmr = false,
14247
14299
  cacheHandlers = false,
14248
14300
  nodeTransforms = [],
14249
14301
  directiveTransforms = {},
@@ -14269,6 +14321,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14269
14321
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
14270
14322
  prefixIdentifiers,
14271
14323
  hoistStatic: hoistStatic2,
14324
+ hmr,
14272
14325
  cacheHandlers,
14273
14326
  nodeTransforms,
14274
14327
  directiveTransforms,
@@ -14294,7 +14347,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14294
14347
  directives: /* @__PURE__ */ new Set(),
14295
14348
  hoists: [],
14296
14349
  imports: [],
14297
- constantCache: /* @__PURE__ */ new Map(),
14350
+ constantCache: /* @__PURE__ */ new WeakMap(),
14298
14351
  temps: 0,
14299
14352
  cached: 0,
14300
14353
  identifiers: /* @__PURE__ */ Object.create(null),
@@ -15652,7 +15705,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15652
15705
  }
15653
15706
  }
15654
15707
  };
15655
- const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
15708
+ const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
15656
15709
  props,
15657
15710
  children,
15658
15711
  false,
@@ -15674,7 +15727,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15674
15727
  slotsProperties.push(
15675
15728
  createObjectProperty(
15676
15729
  arg || createSimpleExpression("default", true),
15677
- buildSlotFn(exp, children, loc)
15730
+ buildSlotFn(exp, void 0, children, loc)
15678
15731
  )
15679
15732
  );
15680
15733
  }
@@ -15711,10 +15764,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15711
15764
  } else {
15712
15765
  hasDynamicSlots = true;
15713
15766
  }
15714
- const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
15767
+ const vFor = findDir(slotElement, "for");
15768
+ const slotFunction = buildSlotFn(
15769
+ slotProps,
15770
+ vFor == null ? void 0 : vFor.exp,
15771
+ slotChildren,
15772
+ slotLoc
15773
+ );
15715
15774
  let vIf;
15716
15775
  let vElse;
15717
- let vFor;
15718
15776
  if (vIf = findDir(slotElement, "if")) {
15719
15777
  hasDynamicSlots = true;
15720
15778
  dynamicSlots.push(
@@ -15759,7 +15817,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15759
15817
  createCompilerError(30, vElse.loc)
15760
15818
  );
15761
15819
  }
15762
- } else if (vFor = findDir(slotElement, "for")) {
15820
+ } else if (vFor) {
15763
15821
  hasDynamicSlots = true;
15764
15822
  const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
15765
15823
  if (parseResult) {
@@ -15800,7 +15858,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15800
15858
  }
15801
15859
  if (!onComponentSlot) {
15802
15860
  const buildDefaultSlotProperty = (props, children2) => {
15803
- const fn = buildSlotFn(props, children2, loc);
15861
+ const fn = buildSlotFn(props, void 0, children2, loc);
15804
15862
  if (context.compatConfig) {
15805
15863
  fn.isNonScopedSlot = true;
15806
15864
  }