vue 3.4.29 → 3.4.30

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.29
2
+ * vue v3.4.30
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.4.29
2
+ * vue v3.4.30
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.4.29
2
+ * vue v3.4.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -506,8 +506,10 @@ class ReactiveEffect {
506
506
  for (let i = 0; i < this._depsLength; i++) {
507
507
  const dep = this.deps[i];
508
508
  if (dep.computed) {
509
- if (dep.computed.effect._dirtyLevel === 2)
509
+ if (dep.computed.effect._dirtyLevel === 2) {
510
+ resetTracking();
510
511
  return true;
512
+ }
511
513
  triggerComputed(dep.computed);
512
514
  if (this._dirtyLevel >= 5) {
513
515
  break;
@@ -643,13 +645,13 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
643
645
  var _a;
644
646
  pauseScheduling();
645
647
  for (const effect2 of dep.keys()) {
648
+ let tracking;
646
649
  if (!dep.computed && effect2.computed) {
647
- if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
650
+ if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
648
651
  effect2._dirtyLevel = 2;
649
652
  continue;
650
653
  }
651
654
  }
652
- let tracking;
653
655
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
654
656
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
655
657
  if (effect2.computed && effect2._dirtyLevel === 2) {
@@ -1366,8 +1368,11 @@ class ComputedRefImpl {
1366
1368
  }
1367
1369
  get value() {
1368
1370
  const self = toRaw(this);
1371
+ const lastDirtyLevel = self.effect._dirtyLevel;
1369
1372
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1370
- triggerRefValue(self, 5);
1373
+ if (lastDirtyLevel !== 3) {
1374
+ triggerRefValue(self, 5);
1375
+ }
1371
1376
  }
1372
1377
  trackRefValue(self);
1373
1378
  if (self.effect._dirtyLevel >= 2) {
@@ -2815,7 +2820,6 @@ const SuspenseImpl = {
2815
2820
  }
2816
2821
  },
2817
2822
  hydrate: hydrateSuspense,
2818
- create: createSuspenseBoundary,
2819
2823
  normalize: normalizeSuspenseChildren
2820
2824
  };
2821
2825
  const Suspense = SuspenseImpl ;
@@ -5373,18 +5377,8 @@ function createHydrationFunctions(rendererInternals) {
5373
5377
  let domType = node.nodeType;
5374
5378
  vnode.el = node;
5375
5379
  {
5376
- if (!("__vnode" in node)) {
5377
- Object.defineProperty(node, "__vnode", {
5378
- value: vnode,
5379
- enumerable: false
5380
- });
5381
- }
5382
- if (!("__vueParentComponent" in node)) {
5383
- Object.defineProperty(node, "__vueParentComponent", {
5384
- value: parentComponent,
5385
- enumerable: false
5386
- });
5387
- }
5380
+ def(node, "__vnode", vnode, true);
5381
+ def(node, "__vueParentComponent", parentComponent, true);
5388
5382
  }
5389
5383
  if (patchFlag === -2) {
5390
5384
  optimized = false;
@@ -5607,7 +5601,9 @@ Server rendered element contains more child nodes than client vdom.`
5607
5601
  if (props) {
5608
5602
  {
5609
5603
  for (const key in props) {
5610
- if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5604
+ if (// #11189 skip if this node has directives that have created hooks
5605
+ // as it could have mutated the DOM in any possible way
5606
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5611
5607
  logMismatchError();
5612
5608
  }
5613
5609
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5782,7 +5778,6 @@ Server rendered element contains fewer child nodes than client vdom.`
5782
5778
  return [hydrate, hydrateNode];
5783
5779
  }
5784
5780
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5785
- var _a;
5786
5781
  let mismatchType;
5787
5782
  let mismatchKey;
5788
5783
  let actual;
@@ -5805,13 +5800,8 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
5805
5800
  }
5806
5801
  }
5807
5802
  }
5808
- const root = instance == null ? void 0 : instance.subTree;
5809
- if (vnode === root || // eslint-disable-next-line no-restricted-syntax
5810
- (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
5811
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
5812
- for (const key2 in cssVars) {
5813
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
5814
- }
5803
+ if (instance) {
5804
+ resolveCssVars(instance, vnode, expectedMap);
5815
5805
  }
5816
5806
  if (!isMapEqual(actualMap, expectedMap)) {
5817
5807
  mismatchType = mismatchKey = "style";
@@ -5871,8 +5861,8 @@ function toStyleMap(str) {
5871
5861
  const styleMap = /* @__PURE__ */ new Map();
5872
5862
  for (const item of str.split(";")) {
5873
5863
  let [key, value] = item.split(":");
5874
- key = key == null ? void 0 : key.trim();
5875
- value = value == null ? void 0 : value.trim();
5864
+ key = key.trim();
5865
+ value = value && value.trim();
5876
5866
  if (key && value) {
5877
5867
  styleMap.set(key, value);
5878
5868
  }
@@ -5890,6 +5880,18 @@ function isMapEqual(a, b) {
5890
5880
  }
5891
5881
  return true;
5892
5882
  }
5883
+ function resolveCssVars(instance, vnode, expectedMap) {
5884
+ const root = instance.subTree;
5885
+ if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5886
+ const cssVars = instance.getCssVars();
5887
+ for (const key in cssVars) {
5888
+ expectedMap.set(`--${key}`, String(cssVars[key]));
5889
+ }
5890
+ }
5891
+ if (vnode === root && instance.parent) {
5892
+ resolveCssVars(instance.parent, instance.vnode, expectedMap);
5893
+ }
5894
+ }
5893
5895
 
5894
5896
  let supported;
5895
5897
  let perf;
@@ -6207,14 +6209,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6207
6209
  }
6208
6210
  }
6209
6211
  {
6210
- Object.defineProperty(el, "__vnode", {
6211
- value: vnode,
6212
- enumerable: false
6213
- });
6214
- Object.defineProperty(el, "__vueParentComponent", {
6215
- value: parentComponent,
6216
- enumerable: false
6217
- });
6212
+ def(el, "__vnode", vnode, true);
6213
+ def(el, "__vueParentComponent", parentComponent, true);
6218
6214
  }
6219
6215
  if (dirs) {
6220
6216
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
@@ -6276,6 +6272,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6276
6272
  };
6277
6273
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6278
6274
  const el = n2.el = n1.el;
6275
+ {
6276
+ el.__vnode = n2;
6277
+ }
6279
6278
  let { patchFlag, dynamicChildren, dirs } = n2;
6280
6279
  patchFlag |= n1.patchFlag & 16;
6281
6280
  const oldProps = n1.props || EMPTY_OBJ;
@@ -7170,6 +7169,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7170
7169
  dirs,
7171
7170
  memoIndex
7172
7171
  } = vnode;
7172
+ if (patchFlag === -2) {
7173
+ optimized = false;
7174
+ }
7173
7175
  if (ref != null) {
7174
7176
  setRef(ref, null, parentSuspense, vnode, true);
7175
7177
  }
@@ -7201,7 +7203,6 @@ function baseCreateRenderer(options, createHydrationFns) {
7201
7203
  vnode,
7202
7204
  parentComponent,
7203
7205
  parentSuspense,
7204
- optimized,
7205
7206
  internals,
7206
7207
  doRemove
7207
7208
  );
@@ -8477,7 +8478,7 @@ const TeleportImpl = {
8477
8478
  }
8478
8479
  updateCssVars(n2);
8479
8480
  },
8480
- remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8481
+ remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8481
8482
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8482
8483
  if (target) {
8483
8484
  hostRemove(targetAnchor);
@@ -9649,7 +9650,7 @@ function isMemoSame(cached, memo) {
9649
9650
  return true;
9650
9651
  }
9651
9652
 
9652
- const version = "3.4.29";
9653
+ const version = "3.4.30";
9653
9654
  const warn = warn$1 ;
9654
9655
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9655
9656
  const devtools = devtools$1 ;
@@ -10229,7 +10230,10 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
10229
10230
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
10230
10231
  el.removeAttribute(key);
10231
10232
  } else {
10232
- el.setAttribute(key, isBoolean ? "" : String(value));
10233
+ el.setAttribute(
10234
+ key,
10235
+ isBoolean ? "" : isSymbol(value) ? String(value) : value
10236
+ );
10233
10237
  }
10234
10238
  }
10235
10239
  }
@@ -10390,7 +10394,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, paren
10390
10394
  parentSuspense,
10391
10395
  unmountChildren
10392
10396
  );
10393
- if (key === "value" || key === "checked" || key === "selected") {
10397
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
10394
10398
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
10395
10399
  }
10396
10400
  } else {
@@ -15147,9 +15151,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
15147
15151
  break;
15148
15152
  }
15149
15153
  }
15150
- if (prev && isTemplateNode(prev) && findDir(prev, "if")) {
15151
- children.splice(i, 1);
15152
- i--;
15154
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
15153
15155
  let conditional = dynamicSlots[dynamicSlots.length - 1];
15154
15156
  while (conditional.alternate.type === 19) {
15155
15157
  conditional = conditional.alternate;