@vue/runtime-dom 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.29
2
+ * @vue/runtime-dom v3.4.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -442,8 +442,10 @@ var VueRuntimeDOM = (function (exports) {
442
442
  for (let i = 0; i < this._depsLength; i++) {
443
443
  const dep = this.deps[i];
444
444
  if (dep.computed) {
445
- if (dep.computed.effect._dirtyLevel === 2)
445
+ if (dep.computed.effect._dirtyLevel === 2) {
446
+ resetTracking();
446
447
  return true;
448
+ }
447
449
  triggerComputed(dep.computed);
448
450
  if (this._dirtyLevel >= 5) {
449
451
  break;
@@ -579,13 +581,13 @@ var VueRuntimeDOM = (function (exports) {
579
581
  var _a;
580
582
  pauseScheduling();
581
583
  for (const effect2 of dep.keys()) {
584
+ let tracking;
582
585
  if (!dep.computed && effect2.computed) {
583
- if (dep.get(effect2) === effect2._trackId && effect2._runnings > 0) {
586
+ if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
584
587
  effect2._dirtyLevel = 2;
585
588
  continue;
586
589
  }
587
590
  }
588
- let tracking;
589
591
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
590
592
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
591
593
  if (effect2.computed && effect2._dirtyLevel === 2) {
@@ -1302,8 +1304,11 @@ var VueRuntimeDOM = (function (exports) {
1302
1304
  }
1303
1305
  get value() {
1304
1306
  const self = toRaw(this);
1307
+ const lastDirtyLevel = self.effect._dirtyLevel;
1305
1308
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1306
- triggerRefValue(self, 5);
1309
+ if (lastDirtyLevel !== 3) {
1310
+ triggerRefValue(self, 5);
1311
+ }
1307
1312
  }
1308
1313
  trackRefValue(self);
1309
1314
  if (self.effect._dirtyLevel >= 2) {
@@ -2751,7 +2756,6 @@ If this is a native custom element, make sure to exclude it from component resol
2751
2756
  }
2752
2757
  },
2753
2758
  hydrate: hydrateSuspense,
2754
- create: createSuspenseBoundary,
2755
2759
  normalize: normalizeSuspenseChildren
2756
2760
  };
2757
2761
  const Suspense = SuspenseImpl ;
@@ -5309,18 +5313,8 @@ If you want to remount the same app, move your app creation logic into a factory
5309
5313
  let domType = node.nodeType;
5310
5314
  vnode.el = node;
5311
5315
  {
5312
- if (!("__vnode" in node)) {
5313
- Object.defineProperty(node, "__vnode", {
5314
- value: vnode,
5315
- enumerable: false
5316
- });
5317
- }
5318
- if (!("__vueParentComponent" in node)) {
5319
- Object.defineProperty(node, "__vueParentComponent", {
5320
- value: parentComponent,
5321
- enumerable: false
5322
- });
5323
- }
5316
+ def(node, "__vnode", vnode, true);
5317
+ def(node, "__vueParentComponent", parentComponent, true);
5324
5318
  }
5325
5319
  if (patchFlag === -2) {
5326
5320
  optimized = false;
@@ -5543,7 +5537,9 @@ Server rendered element contains more child nodes than client vdom.`
5543
5537
  if (props) {
5544
5538
  {
5545
5539
  for (const key in props) {
5546
- if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5540
+ if (// #11189 skip if this node has directives that have created hooks
5541
+ // as it could have mutated the DOM in any possible way
5542
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
5547
5543
  logMismatchError();
5548
5544
  }
5549
5545
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5718,7 +5714,6 @@ Server rendered element contains fewer child nodes than client vdom.`
5718
5714
  return [hydrate, hydrateNode];
5719
5715
  }
5720
5716
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5721
- var _a;
5722
5717
  let mismatchType;
5723
5718
  let mismatchKey;
5724
5719
  let actual;
@@ -5741,13 +5736,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5741
5736
  }
5742
5737
  }
5743
5738
  }
5744
- const root = instance == null ? void 0 : instance.subTree;
5745
- if (vnode === root || // eslint-disable-next-line no-restricted-syntax
5746
- (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
5747
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
5748
- for (const key2 in cssVars) {
5749
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
5750
- }
5739
+ if (instance) {
5740
+ resolveCssVars(instance, vnode, expectedMap);
5751
5741
  }
5752
5742
  if (!isMapEqual(actualMap, expectedMap)) {
5753
5743
  mismatchType = mismatchKey = "style";
@@ -5807,8 +5797,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5807
5797
  const styleMap = /* @__PURE__ */ new Map();
5808
5798
  for (const item of str.split(";")) {
5809
5799
  let [key, value] = item.split(":");
5810
- key = key == null ? void 0 : key.trim();
5811
- value = value == null ? void 0 : value.trim();
5800
+ key = key.trim();
5801
+ value = value && value.trim();
5812
5802
  if (key && value) {
5813
5803
  styleMap.set(key, value);
5814
5804
  }
@@ -5826,6 +5816,18 @@ Server rendered element contains fewer child nodes than client vdom.`
5826
5816
  }
5827
5817
  return true;
5828
5818
  }
5819
+ function resolveCssVars(instance, vnode, expectedMap) {
5820
+ const root = instance.subTree;
5821
+ if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
5822
+ const cssVars = instance.getCssVars();
5823
+ for (const key in cssVars) {
5824
+ expectedMap.set(`--${key}`, String(cssVars[key]));
5825
+ }
5826
+ }
5827
+ if (vnode === root && instance.parent) {
5828
+ resolveCssVars(instance.parent, instance.vnode, expectedMap);
5829
+ }
5830
+ }
5829
5831
 
5830
5832
  let supported;
5831
5833
  let perf;
@@ -6143,14 +6145,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6143
6145
  }
6144
6146
  }
6145
6147
  {
6146
- Object.defineProperty(el, "__vnode", {
6147
- value: vnode,
6148
- enumerable: false
6149
- });
6150
- Object.defineProperty(el, "__vueParentComponent", {
6151
- value: parentComponent,
6152
- enumerable: false
6153
- });
6148
+ def(el, "__vnode", vnode, true);
6149
+ def(el, "__vueParentComponent", parentComponent, true);
6154
6150
  }
6155
6151
  if (dirs) {
6156
6152
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
@@ -6212,6 +6208,9 @@ Server rendered element contains fewer child nodes than client vdom.`
6212
6208
  };
6213
6209
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6214
6210
  const el = n2.el = n1.el;
6211
+ {
6212
+ el.__vnode = n2;
6213
+ }
6215
6214
  let { patchFlag, dynamicChildren, dirs } = n2;
6216
6215
  patchFlag |= n1.patchFlag & 16;
6217
6216
  const oldProps = n1.props || EMPTY_OBJ;
@@ -7106,6 +7105,9 @@ Server rendered element contains fewer child nodes than client vdom.`
7106
7105
  dirs,
7107
7106
  memoIndex
7108
7107
  } = vnode;
7108
+ if (patchFlag === -2) {
7109
+ optimized = false;
7110
+ }
7109
7111
  if (ref != null) {
7110
7112
  setRef(ref, null, parentSuspense, vnode, true);
7111
7113
  }
@@ -7137,7 +7139,6 @@ Server rendered element contains fewer child nodes than client vdom.`
7137
7139
  vnode,
7138
7140
  parentComponent,
7139
7141
  parentSuspense,
7140
- optimized,
7141
7142
  internals,
7142
7143
  doRemove
7143
7144
  );
@@ -8407,7 +8408,7 @@ Server rendered element contains fewer child nodes than client vdom.`
8407
8408
  }
8408
8409
  updateCssVars(n2);
8409
8410
  },
8410
- remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8411
+ remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8411
8412
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8412
8413
  if (target) {
8413
8414
  hostRemove(targetAnchor);
@@ -9579,7 +9580,7 @@ Component that was made reactive: `,
9579
9580
  return true;
9580
9581
  }
9581
9582
 
9582
- const version = "3.4.29";
9583
+ const version = "3.4.30";
9583
9584
  const warn = warn$1 ;
9584
9585
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9585
9586
  const devtools = devtools$1 ;
@@ -10159,7 +10160,10 @@ Component that was made reactive: `,
10159
10160
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
10160
10161
  el.removeAttribute(key);
10161
10162
  } else {
10162
- el.setAttribute(key, isBoolean ? "" : String(value));
10163
+ el.setAttribute(
10164
+ key,
10165
+ isBoolean ? "" : isSymbol(value) ? String(value) : value
10166
+ );
10163
10167
  }
10164
10168
  }
10165
10169
  }
@@ -10320,7 +10324,7 @@ Expected function or array of functions, received type ${typeof value}.`
10320
10324
  parentSuspense,
10321
10325
  unmountChildren
10322
10326
  );
10323
- if (key === "value" || key === "checked" || key === "selected") {
10327
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
10324
10328
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
10325
10329
  }
10326
10330
  } else {