vue 3.5.1 → 3.5.3

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.1
2
+ * vue v3.5.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.5.1
2
+ * vue v3.5.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -714,7 +714,7 @@ var Vue = (function (exports) {
714
714
  shouldTrack = true;
715
715
  try {
716
716
  prepareDeps(computed);
717
- const value = computed.fn();
717
+ const value = computed.fn(computed._value);
718
718
  if (dep.version === 0 || hasChanged(value, computed._value)) {
719
719
  computed._value = value;
720
720
  dep.version++;
@@ -823,7 +823,7 @@ var Vue = (function (exports) {
823
823
  }
824
824
  }
825
825
  track(debugInfo) {
826
- if (!activeSub || !shouldTrack) {
826
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
827
827
  return;
828
828
  }
829
829
  let link = this.activeLink;
@@ -1836,7 +1836,7 @@ var Vue = (function (exports) {
1836
1836
  return isFunction(source) ? source() : unref(source);
1837
1837
  }
1838
1838
  const shallowUnwrapHandlers = {
1839
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1839
+ get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1840
1840
  set: (target, key, value, receiver) => {
1841
1841
  const oldValue = target[key];
1842
1842
  if (isRef(oldValue) && !isRef(value)) {
@@ -2538,9 +2538,7 @@ var Vue = (function (exports) {
2538
2538
  } else {
2539
2539
  queue.splice(findInsertionIndex(jobId), 0, job);
2540
2540
  }
2541
- if (!(job.flags & 4)) {
2542
- job.flags |= 1;
2543
- }
2541
+ job.flags |= 1;
2544
2542
  queueFlush();
2545
2543
  }
2546
2544
  }
@@ -2556,9 +2554,7 @@ var Vue = (function (exports) {
2556
2554
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2557
2555
  } else if (!(cb.flags & 1)) {
2558
2556
  pendingPostFlushCbs.push(cb);
2559
- if (!(cb.flags & 4)) {
2560
- cb.flags |= 1;
2561
- }
2557
+ cb.flags |= 1;
2562
2558
  }
2563
2559
  } else {
2564
2560
  pendingPostFlushCbs.push(...cb);
@@ -2580,6 +2576,9 @@ var Vue = (function (exports) {
2580
2576
  }
2581
2577
  queue.splice(i, 1);
2582
2578
  i--;
2579
+ if (cb.flags & 4) {
2580
+ cb.flags &= ~1;
2581
+ }
2583
2582
  cb();
2584
2583
  cb.flags &= ~1;
2585
2584
  }
@@ -2604,6 +2603,9 @@ var Vue = (function (exports) {
2604
2603
  if (checkRecursiveUpdates(seen, cb)) {
2605
2604
  continue;
2606
2605
  }
2606
+ if (cb.flags & 4) {
2607
+ cb.flags &= ~1;
2608
+ }
2607
2609
  if (!(cb.flags & 8)) cb();
2608
2610
  cb.flags &= ~1;
2609
2611
  }
@@ -2626,6 +2628,9 @@ var Vue = (function (exports) {
2626
2628
  if (check(job)) {
2627
2629
  continue;
2628
2630
  }
2631
+ if (job.flags & 4) {
2632
+ job.flags &= ~1;
2633
+ }
2629
2634
  callWithErrorHandling(
2630
2635
  job,
2631
2636
  job.i,
@@ -2635,6 +2640,12 @@ var Vue = (function (exports) {
2635
2640
  }
2636
2641
  }
2637
2642
  } finally {
2643
+ for (; flushIndex < queue.length; flushIndex++) {
2644
+ const job = queue[flushIndex];
2645
+ if (job) {
2646
+ job.flags &= ~1;
2647
+ }
2648
+ }
2638
2649
  flushIndex = 0;
2639
2650
  queue.length = 0;
2640
2651
  flushPostFlushCbs(seen);
@@ -3391,6 +3402,7 @@ var Vue = (function (exports) {
3391
3402
  if (!(instance.job.flags & 8)) {
3392
3403
  instance.update();
3393
3404
  }
3405
+ delete leavingHooks.afterLeave;
3394
3406
  };
3395
3407
  return emptyPlaceholder(child);
3396
3408
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3613,6 +3625,7 @@ var Vue = (function (exports) {
3613
3625
  }
3614
3626
  function setTransitionHooks(vnode, hooks) {
3615
3627
  if (vnode.shapeFlag & 6 && vnode.component) {
3628
+ vnode.transition = hooks;
3616
3629
  setTransitionHooks(vnode.component.subTree, hooks);
3617
3630
  } else if (vnode.shapeFlag & 128) {
3618
3631
  vnode.ssContent.transition = hooks.clone(vnode.ssContent);
@@ -3657,7 +3670,7 @@ var Vue = (function (exports) {
3657
3670
  function useId() {
3658
3671
  const i = getCurrentInstance();
3659
3672
  if (i) {
3660
- return (i.appContext.config.idPrefix || "v") + ":" + i.ids[0] + i.ids[1]++;
3673
+ return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3661
3674
  } else {
3662
3675
  warn$1(
3663
3676
  `useId() is called when there is no active component instance to be associated with.`
@@ -3668,6 +3681,34 @@ var Vue = (function (exports) {
3668
3681
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3669
3682
  }
3670
3683
 
3684
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3685
+ function useTemplateRef(key) {
3686
+ const i = getCurrentInstance();
3687
+ const r = shallowRef(null);
3688
+ if (i) {
3689
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3690
+ let desc;
3691
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3692
+ warn$1(`useTemplateRef('${key}') already exists.`);
3693
+ } else {
3694
+ Object.defineProperty(refs, key, {
3695
+ enumerable: true,
3696
+ get: () => r.value,
3697
+ set: (val) => r.value = val
3698
+ });
3699
+ }
3700
+ } else {
3701
+ warn$1(
3702
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3703
+ );
3704
+ }
3705
+ const ret = readonly(r) ;
3706
+ {
3707
+ knownTemplateRefs.add(ret);
3708
+ }
3709
+ return ret;
3710
+ }
3711
+
3671
3712
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3672
3713
  if (isArray(rawRef)) {
3673
3714
  rawRef.forEach(
@@ -3696,7 +3737,13 @@ var Vue = (function (exports) {
3696
3737
  const oldRef = oldRawRef && oldRawRef.r;
3697
3738
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3698
3739
  const setupState = owner.setupState;
3699
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => hasOwn(setupState, key) && !(Object.getOwnPropertyDescriptor(refs, key) || EMPTY_OBJ).get;
3740
+ const rawSetupState = toRaw(setupState);
3741
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3742
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3743
+ return false;
3744
+ }
3745
+ return hasOwn(rawSetupState, key);
3746
+ };
3700
3747
  if (oldRef != null && oldRef !== ref) {
3701
3748
  if (isString(oldRef)) {
3702
3749
  refs[oldRef] = null;
@@ -4747,7 +4794,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4747
4794
  return () => {
4748
4795
  pendingCacheKey = null;
4749
4796
  if (!slots.default) {
4750
- return null;
4797
+ return current = null;
4751
4798
  }
4752
4799
  const children = slots.default();
4753
4800
  const rawVNode = children[0];
@@ -7330,7 +7377,7 @@ If you want to remount the same app, move your app creation logic into a factory
7330
7377
  endMeasure(instance, `hydrate`);
7331
7378
  }
7332
7379
  };
7333
- if (isAsyncWrapperVNode) {
7380
+ if (isAsyncWrapperVNode && type.__asyncHydrate) {
7334
7381
  type.__asyncHydrate(
7335
7382
  el,
7336
7383
  instance,
@@ -8599,7 +8646,7 @@ If you want to remount the same app, move your app creation logic into a factory
8599
8646
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8600
8647
  );
8601
8648
  }
8602
- root.transition = vnode.transition;
8649
+ setTransitionHooks(root, vnode.transition);
8603
8650
  }
8604
8651
  if (setRoot) {
8605
8652
  setRoot(root);
@@ -9093,7 +9140,7 @@ If you want to remount the same app, move your app creation logic into a factory
9093
9140
  };
9094
9141
  }
9095
9142
  if (activeBranch) {
9096
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9143
+ if (parentNode(activeBranch.el) === container2) {
9097
9144
  anchor = next(activeBranch);
9098
9145
  }
9099
9146
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10140,29 +10187,6 @@ Component that was made reactive: `,
10140
10187
  return c;
10141
10188
  };
10142
10189
 
10143
- function useTemplateRef(key) {
10144
- const i = getCurrentInstance();
10145
- const r = shallowRef(null);
10146
- if (i) {
10147
- const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
10148
- let desc;
10149
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
10150
- warn$1(`useTemplateRef('${key}') already exists.`);
10151
- } else {
10152
- Object.defineProperty(refs, key, {
10153
- enumerable: true,
10154
- get: () => r.value,
10155
- set: (val) => r.value = val
10156
- });
10157
- }
10158
- } else {
10159
- warn$1(
10160
- `useTemplateRef() is called when there is no active component instance to be associated with.`
10161
- );
10162
- }
10163
- return readonly(r) ;
10164
- }
10165
-
10166
10190
  function h(type, propsOrChildren, children) {
10167
10191
  const l = arguments.length;
10168
10192
  if (l === 2) {
@@ -10388,7 +10412,7 @@ Component that was made reactive: `,
10388
10412
  return true;
10389
10413
  }
10390
10414
 
10391
- const version = "3.5.1";
10415
+ const version = "3.5.3";
10392
10416
  const warn = warn$1 ;
10393
10417
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10394
10418
  const devtools = devtools$1 ;
@@ -13704,7 +13728,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13704
13728
  rawName: raw,
13705
13729
  exp: void 0,
13706
13730
  arg: void 0,
13707
- modifiers: raw === "." ? ["prop"] : [],
13731
+ modifiers: raw === "." ? [createSimpleExpression("prop")] : [],
13708
13732
  loc: getLoc(start)
13709
13733
  };
13710
13734
  if (name === "pre") {
@@ -13747,7 +13771,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
13747
13771
  setLocEnd(arg.loc, end);
13748
13772
  }
13749
13773
  } else {
13750
- currentProp.modifiers.push(mod);
13774
+ const exp = createSimpleExpression(mod, true, getLoc(start, end));
13775
+ currentProp.modifiers.push(exp);
13751
13776
  }
13752
13777
  },
13753
13778
  onattribdata(start, end) {
@@ -15702,7 +15727,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15702
15727
  } else if (!arg.isStatic) {
15703
15728
  arg.content = `${arg.content} || ""`;
15704
15729
  }
15705
- if (modifiers.includes("camel")) {
15730
+ if (modifiers.some((mod) => mod.content === "camel")) {
15706
15731
  if (arg.type === 4) {
15707
15732
  if (arg.isStatic) {
15708
15733
  arg.content = camelize(arg.content);
@@ -15715,10 +15740,10 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15715
15740
  }
15716
15741
  }
15717
15742
  if (!context.inSSR) {
15718
- if (modifiers.includes("prop")) {
15743
+ if (modifiers.some((mod) => mod.content === "prop")) {
15719
15744
  injectPrefix(arg, ".");
15720
15745
  }
15721
- if (modifiers.includes("attr")) {
15746
+ if (modifiers.some((mod) => mod.content === "attr")) {
15722
15747
  injectPrefix(arg, "^");
15723
15748
  }
15724
15749
  }
@@ -16489,7 +16514,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16489
16514
  }
16490
16515
  continue;
16491
16516
  }
16492
- if (isVBind && modifiers.includes("prop")) {
16517
+ if (isVBind && modifiers.some((mod) => mod.content === "prop")) {
16493
16518
  patchFlag |= 32;
16494
16519
  }
16495
16520
  const directiveTransform = context.directiveTransforms[name];
@@ -17003,7 +17028,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17003
17028
  createObjectProperty(eventName, assignmentExp)
17004
17029
  ];
17005
17030
  if (dir.modifiers.length && node.tagType === 1) {
17006
- const modifiers = dir.modifiers.map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
17031
+ const modifiers = dir.modifiers.map((m) => m.content).map((m) => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`).join(`, `);
17007
17032
  const modifiersKey = arg ? isStaticExp(arg) ? `${arg.content}Modifiers` : createCompoundExpression([arg, ' + "Modifiers"']) : `modelModifiers`;
17008
17033
  props.push(
17009
17034
  createObjectProperty(
@@ -17403,7 +17428,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17403
17428
  const nonKeyModifiers = [];
17404
17429
  const eventOptionModifiers = [];
17405
17430
  for (let i = 0; i < modifiers.length; i++) {
17406
- const modifier = modifiers[i];
17431
+ const modifier = modifiers[i].content;
17407
17432
  if (isEventOptionModifier(modifier)) {
17408
17433
  eventOptionModifiers.push(modifier);
17409
17434
  } else {