vue 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 (exports) {
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 (exports) {
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
  }
@@ -2820,14 +2825,16 @@ var Vue = (function (exports) {
2820
2825
  parentComponent: parentComponent2,
2821
2826
  container: container2
2822
2827
  } = suspense;
2828
+ let delayEnter = false;
2823
2829
  if (suspense.isHydrating) {
2824
2830
  suspense.isHydrating = false;
2825
2831
  } else if (!resume) {
2826
- const delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2832
+ delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
2827
2833
  if (delayEnter) {
2828
2834
  activeBranch.transition.afterLeave = () => {
2829
2835
  if (pendingId === suspense.pendingId) {
2830
2836
  move(pendingBranch, container2, anchor2, 0);
2837
+ queuePostFlushCb(effects);
2831
2838
  }
2832
2839
  };
2833
2840
  }
@@ -2853,7 +2860,7 @@ var Vue = (function (exports) {
2853
2860
  }
2854
2861
  parent = parent.parent;
2855
2862
  }
2856
- if (!hasUnresolvedAncestor) {
2863
+ if (!hasUnresolvedAncestor && !delayEnter) {
2857
2864
  queuePostFlushCb(effects);
2858
2865
  }
2859
2866
  suspense.effects = [];
@@ -5155,7 +5162,7 @@ If this is a native custom element, make sure to exclude it from component resol
5155
5162
  }
5156
5163
  });
5157
5164
  }
5158
- const installedPlugins = /* @__PURE__ */ new Set();
5165
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
5159
5166
  let isMounted = false;
5160
5167
  const app = context.app = {
5161
5168
  _uid: uid$1++,
@@ -5819,7 +5826,7 @@ If you want to remount the same app, move your app creation logic into a factory
5819
5826
  }
5820
5827
  if (needDeletionCheck) {
5821
5828
  for (const key in slots) {
5822
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
5829
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
5823
5830
  delete slots[key];
5824
5831
  }
5825
5832
  }
@@ -5995,7 +6002,14 @@ If you want to remount the same app, move your app creation logic into a factory
5995
6002
  break;
5996
6003
  case Comment:
5997
6004
  if (domType !== 8 /* COMMENT */ || isFragmentStart) {
5998
- nextNode = onMismatch();
6005
+ if (node.tagName.toLowerCase() === "template") {
6006
+ const content = vnode.el.content.firstChild;
6007
+ replaceNode(content, node, parentComponent);
6008
+ vnode.el = node = content;
6009
+ nextNode = nextSibling(node);
6010
+ } else {
6011
+ nextNode = onMismatch();
6012
+ }
5999
6013
  } else {
6000
6014
  nextNode = nextSibling(node);
6001
6015
  }
@@ -6037,7 +6051,7 @@ If you want to remount the same app, move your app creation logic into a factory
6037
6051
  break;
6038
6052
  default:
6039
6053
  if (shapeFlag & 1) {
6040
- if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
6054
+ if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
6041
6055
  nextNode = onMismatch();
6042
6056
  } else {
6043
6057
  nextNode = hydrateElement(
@@ -6052,6 +6066,13 @@ If you want to remount the same app, move your app creation logic into a factory
6052
6066
  } else if (shapeFlag & 6) {
6053
6067
  vnode.slotScopeIds = slotScopeIds;
6054
6068
  const container = parentNode(node);
6069
+ if (isFragmentStart) {
6070
+ nextNode = locateClosingAnchor(node);
6071
+ } else if (isComment(node) && node.data === "teleport start") {
6072
+ nextNode = locateClosingAnchor(node, node.data, "teleport end");
6073
+ } else {
6074
+ nextNode = nextSibling(node);
6075
+ }
6055
6076
  mountComponent(
6056
6077
  vnode,
6057
6078
  container,
@@ -6061,10 +6082,6 @@ If you want to remount the same app, move your app creation logic into a factory
6061
6082
  isSVGContainer(container),
6062
6083
  optimized
6063
6084
  );
6064
- nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
6065
- if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
6066
- nextNode = nextSibling(nextNode);
6067
- }
6068
6085
  if (isAsyncWrapper(vnode)) {
6069
6086
  let subTree;
6070
6087
  if (isFragmentStart) {
@@ -6114,7 +6131,7 @@ If you want to remount the same app, move your app creation logic into a factory
6114
6131
  };
6115
6132
  const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
6116
6133
  optimized = optimized || !!vnode.dynamicChildren;
6117
- const { type, props, patchFlag, shapeFlag, dirs } = vnode;
6134
+ const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
6118
6135
  const forcePatchValue = type === "input" && dirs || type === "option";
6119
6136
  {
6120
6137
  if (dirs) {
@@ -6151,12 +6168,23 @@ If you want to remount the same app, move your app creation logic into a factory
6151
6168
  if (vnodeHooks = props && props.onVnodeBeforeMount) {
6152
6169
  invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6153
6170
  }
6171
+ let needCallTransitionHooks = false;
6172
+ if (isTemplateNode(el)) {
6173
+ needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
6174
+ const content = el.content.firstChild;
6175
+ if (needCallTransitionHooks) {
6176
+ transition.beforeEnter(content);
6177
+ }
6178
+ replaceNode(content, el, parentComponent);
6179
+ vnode.el = el = content;
6180
+ }
6154
6181
  if (dirs) {
6155
6182
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6156
6183
  }
6157
- if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
6184
+ if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
6158
6185
  queueEffectWithSuspense(() => {
6159
6186
  vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
6187
+ needCallTransitionHooks && transition.enter(el);
6160
6188
  dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
6161
6189
  }, parentSuspense);
6162
6190
  }
@@ -6274,7 +6302,7 @@ If you want to remount the same app, move your app creation logic into a factory
6274
6302
  );
6275
6303
  vnode.el = null;
6276
6304
  if (isFragment) {
6277
- const end = locateClosingAsyncAnchor(node);
6305
+ const end = locateClosingAnchor(node);
6278
6306
  while (true) {
6279
6307
  const next2 = nextSibling(node);
6280
6308
  if (next2 && next2 !== end) {
@@ -6299,14 +6327,14 @@ If you want to remount the same app, move your app creation logic into a factory
6299
6327
  );
6300
6328
  return next;
6301
6329
  };
6302
- const locateClosingAsyncAnchor = (node) => {
6330
+ const locateClosingAnchor = (node, open = "[", close = "]") => {
6303
6331
  let match = 0;
6304
6332
  while (node) {
6305
6333
  node = nextSibling(node);
6306
6334
  if (node && isComment(node)) {
6307
- if (node.data === "[")
6335
+ if (node.data === open)
6308
6336
  match++;
6309
- if (node.data === "]") {
6337
+ if (node.data === close) {
6310
6338
  if (match === 0) {
6311
6339
  return nextSibling(node);
6312
6340
  } else {
@@ -6317,6 +6345,23 @@ If you want to remount the same app, move your app creation logic into a factory
6317
6345
  }
6318
6346
  return node;
6319
6347
  };
6348
+ const replaceNode = (newNode, oldNode, parentComponent) => {
6349
+ const parentNode2 = oldNode.parentNode;
6350
+ if (parentNode2) {
6351
+ parentNode2.replaceChild(newNode, oldNode);
6352
+ }
6353
+ let parent = parentComponent;
6354
+ while (parent) {
6355
+ if (parent.vnode.el === oldNode) {
6356
+ parent.vnode.el = newNode;
6357
+ parent.subTree.el = newNode;
6358
+ }
6359
+ parent = parent.parent;
6360
+ }
6361
+ };
6362
+ const isTemplateNode = (node) => {
6363
+ return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
6364
+ };
6320
6365
  return [hydrate, hydrateNode];
6321
6366
  }
6322
6367
 
@@ -6644,7 +6689,7 @@ If you want to remount the same app, move your app creation logic into a factory
6644
6689
  if (dirs) {
6645
6690
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
6646
6691
  }
6647
- const needCallTransitionHooks = (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
6692
+ const needCallTransitionHooks = needTransition(parentSuspense, transition);
6648
6693
  if (needCallTransitionHooks) {
6649
6694
  transition.beforeEnter(el);
6650
6695
  }
@@ -7536,8 +7581,8 @@ If you want to remount the same app, move your app creation logic into a factory
7536
7581
  moveStaticNode(vnode, container, anchor);
7537
7582
  return;
7538
7583
  }
7539
- const needTransition = moveType !== 2 && shapeFlag & 1 && transition;
7540
- if (needTransition) {
7584
+ const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
7585
+ if (needTransition2) {
7541
7586
  if (moveType === 0) {
7542
7587
  transition.beforeEnter(el);
7543
7588
  hostInsert(el, container, anchor);
@@ -7757,6 +7802,9 @@ If you want to remount the same app, move your app creation logic into a factory
7757
7802
  function toggleRecurse({ effect, update }, allowed) {
7758
7803
  effect.allowRecurse = update.allowRecurse = allowed;
7759
7804
  }
7805
+ function needTransition(parentSuspense, transition) {
7806
+ return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
7807
+ }
7760
7808
  function traverseStaticChildren(n1, n2, shallow = false) {
7761
7809
  const ch1 = n1.children;
7762
7810
  const ch2 = n2.children;
@@ -7982,19 +8030,18 @@ If you want to remount the same app, move your app creation logic into a factory
7982
8030
  if (target) {
7983
8031
  hostRemove(targetAnchor);
7984
8032
  }
7985
- if (doRemove || !isTeleportDisabled(props)) {
7986
- hostRemove(anchor);
7987
- if (shapeFlag & 16) {
7988
- for (let i = 0; i < children.length; i++) {
7989
- const child = children[i];
7990
- unmount(
7991
- child,
7992
- parentComponent,
7993
- parentSuspense,
7994
- true,
7995
- !!child.dynamicChildren
7996
- );
7997
- }
8033
+ doRemove && hostRemove(anchor);
8034
+ if (shapeFlag & 16) {
8035
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
8036
+ for (let i = 0; i < children.length; i++) {
8037
+ const child = children[i];
8038
+ unmount(
8039
+ child,
8040
+ parentComponent,
8041
+ parentSuspense,
8042
+ shouldRemove,
8043
+ !!child.dynamicChildren
8044
+ );
7998
8045
  }
7999
8046
  }
8000
8047
  },
@@ -8078,7 +8125,7 @@ If you want to remount the same app, move your app creation logic into a factory
8078
8125
  const ctx = vnode.ctx;
8079
8126
  if (ctx && ctx.ut) {
8080
8127
  let node = vnode.children[0].el;
8081
- while (node !== vnode.targetAnchor) {
8128
+ while (node && node !== vnode.targetAnchor) {
8082
8129
  if (node.nodeType === 1)
8083
8130
  node.setAttribute("data-v-owner", ctx.uid);
8084
8131
  node = node.nextSibling;
@@ -9087,7 +9134,7 @@ Component that was made reactive: `,
9087
9134
  return true;
9088
9135
  }
9089
9136
 
9090
- const version = "3.3.5";
9137
+ const version = "3.3.7";
9091
9138
  const ssrUtils = null;
9092
9139
  const resolveFilter = null;
9093
9140
  const compatUtils = null;
@@ -11901,9 +11948,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
11901
11948
  context.transformHoist(children, context, node);
11902
11949
  }
11903
11950
  if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
11904
- node.codegenNode.children = context.hoist(
11951
+ const hoisted = context.hoist(
11905
11952
  createArrayExpression(node.codegenNode.children)
11906
11953
  );
11954
+ if (context.hmr) {
11955
+ hoisted.content = `[...${hoisted.content}]`;
11956
+ }
11957
+ node.codegenNode.children = hoisted;
11907
11958
  }
11908
11959
  }
11909
11960
  function getConstantType(node, context) {
@@ -12076,6 +12127,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12076
12127
  filename = "",
12077
12128
  prefixIdentifiers = false,
12078
12129
  hoistStatic: hoistStatic2 = false,
12130
+ hmr = false,
12079
12131
  cacheHandlers = false,
12080
12132
  nodeTransforms = [],
12081
12133
  directiveTransforms = {},
@@ -12101,6 +12153,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12101
12153
  selfName: nameMatch && capitalize(camelize(nameMatch[1])),
12102
12154
  prefixIdentifiers,
12103
12155
  hoistStatic: hoistStatic2,
12156
+ hmr,
12104
12157
  cacheHandlers,
12105
12158
  nodeTransforms,
12106
12159
  directiveTransforms,
@@ -12126,7 +12179,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
12126
12179
  directives: /* @__PURE__ */ new Set(),
12127
12180
  hoists: [],
12128
12181
  imports: [],
12129
- constantCache: /* @__PURE__ */ new Map(),
12182
+ constantCache: /* @__PURE__ */ new WeakMap(),
12130
12183
  temps: 0,
12131
12184
  cached: 0,
12132
12185
  identifiers: /* @__PURE__ */ Object.create(null),
@@ -13470,7 +13523,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13470
13523
  }
13471
13524
  }
13472
13525
  };
13473
- const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
13526
+ const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
13474
13527
  props,
13475
13528
  children,
13476
13529
  false,
@@ -13492,7 +13545,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13492
13545
  slotsProperties.push(
13493
13546
  createObjectProperty(
13494
13547
  arg || createSimpleExpression("default", true),
13495
- buildSlotFn(exp, children, loc)
13548
+ buildSlotFn(exp, void 0, children, loc)
13496
13549
  )
13497
13550
  );
13498
13551
  }
@@ -13529,10 +13582,15 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13529
13582
  } else {
13530
13583
  hasDynamicSlots = true;
13531
13584
  }
13532
- const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);
13585
+ const vFor = findDir(slotElement, "for");
13586
+ const slotFunction = buildSlotFn(
13587
+ slotProps,
13588
+ vFor == null ? void 0 : vFor.exp,
13589
+ slotChildren,
13590
+ slotLoc
13591
+ );
13533
13592
  let vIf;
13534
13593
  let vElse;
13535
- let vFor;
13536
13594
  if (vIf = findDir(slotElement, "if")) {
13537
13595
  hasDynamicSlots = true;
13538
13596
  dynamicSlots.push(
@@ -13577,7 +13635,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13577
13635
  createCompilerError(30, vElse.loc)
13578
13636
  );
13579
13637
  }
13580
- } else if (vFor = findDir(slotElement, "for")) {
13638
+ } else if (vFor) {
13581
13639
  hasDynamicSlots = true;
13582
13640
  const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
13583
13641
  if (parseResult) {
@@ -13618,7 +13676,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13618
13676
  }
13619
13677
  if (!onComponentSlot) {
13620
13678
  const buildDefaultSlotProperty = (props, children2) => {
13621
- const fn = buildSlotFn(props, children2, loc);
13679
+ const fn = buildSlotFn(props, void 0, children2, loc);
13622
13680
  return createObjectProperty(`default`, fn);
13623
13681
  };
13624
13682
  if (!hasTemplateSlots) {