@vue/runtime-dom 3.4.28 → 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.28
2
+ * @vue/runtime-dom v3.4.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -414,7 +414,7 @@ var VueRuntimeDOM = (function (exports) {
414
414
  /**
415
415
  * @internal
416
416
  */
417
- this._dirtyLevel = 4;
417
+ this._dirtyLevel = 5;
418
418
  /**
419
419
  * @internal
420
420
  */
@@ -434,14 +434,20 @@ var VueRuntimeDOM = (function (exports) {
434
434
  recordEffectScope(this, scope);
435
435
  }
436
436
  get dirty() {
437
- if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
437
+ if (this._dirtyLevel === 2)
438
+ return false;
439
+ if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
438
440
  this._dirtyLevel = 1;
439
441
  pauseTracking();
440
442
  for (let i = 0; i < this._depsLength; i++) {
441
443
  const dep = this.deps[i];
442
444
  if (dep.computed) {
445
+ if (dep.computed.effect._dirtyLevel === 2) {
446
+ resetTracking();
447
+ return true;
448
+ }
443
449
  triggerComputed(dep.computed);
444
- if (this._dirtyLevel >= 4) {
450
+ if (this._dirtyLevel >= 5) {
445
451
  break;
446
452
  }
447
453
  }
@@ -451,10 +457,10 @@ var VueRuntimeDOM = (function (exports) {
451
457
  }
452
458
  resetTracking();
453
459
  }
454
- return this._dirtyLevel >= 4;
460
+ return this._dirtyLevel >= 5;
455
461
  }
456
462
  set dirty(v) {
457
- this._dirtyLevel = v ? 4 : 0;
463
+ this._dirtyLevel = v ? 5 : 0;
458
464
  }
459
465
  run() {
460
466
  this._dirtyLevel = 0;
@@ -576,8 +582,17 @@ var VueRuntimeDOM = (function (exports) {
576
582
  pauseScheduling();
577
583
  for (const effect2 of dep.keys()) {
578
584
  let tracking;
585
+ if (!dep.computed && effect2.computed) {
586
+ if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
587
+ effect2._dirtyLevel = 2;
588
+ continue;
589
+ }
590
+ }
579
591
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
580
592
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
593
+ if (effect2.computed && effect2._dirtyLevel === 2) {
594
+ effect2._shouldSchedule = true;
595
+ }
581
596
  effect2._dirtyLevel = dirtyLevel;
582
597
  }
583
598
  if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
@@ -585,7 +600,7 @@ var VueRuntimeDOM = (function (exports) {
585
600
  (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
586
601
  }
587
602
  effect2.trigger();
588
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
603
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
589
604
  effect2._shouldSchedule = false;
590
605
  if (effect2.scheduler) {
591
606
  queueEffectSchedulers.push(effect2.scheduler);
@@ -677,7 +692,7 @@ var VueRuntimeDOM = (function (exports) {
677
692
  if (dep) {
678
693
  triggerEffects(
679
694
  dep,
680
- 4,
695
+ 5,
681
696
  {
682
697
  target,
683
698
  type,
@@ -1280,7 +1295,7 @@ var VueRuntimeDOM = (function (exports) {
1280
1295
  () => getter(this._value),
1281
1296
  () => triggerRefValue(
1282
1297
  this,
1283
- this.effect._dirtyLevel === 2 ? 2 : 3
1298
+ this.effect._dirtyLevel === 3 ? 3 : 4
1284
1299
  )
1285
1300
  );
1286
1301
  this.effect.computed = this;
@@ -1289,8 +1304,11 @@ var VueRuntimeDOM = (function (exports) {
1289
1304
  }
1290
1305
  get value() {
1291
1306
  const self = toRaw(this);
1307
+ const lastDirtyLevel = self.effect._dirtyLevel;
1292
1308
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1293
- triggerRefValue(self, 4);
1309
+ if (lastDirtyLevel !== 3) {
1310
+ triggerRefValue(self, 5);
1311
+ }
1294
1312
  }
1295
1313
  trackRefValue(self);
1296
1314
  if (self.effect._dirtyLevel >= 2) {
@@ -1299,7 +1317,7 @@ var VueRuntimeDOM = (function (exports) {
1299
1317
 
1300
1318
  getter: `, this.getter);
1301
1319
  }
1302
- triggerRefValue(self, 2);
1320
+ triggerRefValue(self, 3);
1303
1321
  }
1304
1322
  return self._value;
1305
1323
  }
@@ -1354,7 +1372,7 @@ getter: `, this.getter);
1354
1372
  );
1355
1373
  }
1356
1374
  }
1357
- function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1375
+ function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
1358
1376
  ref2 = toRaw(ref2);
1359
1377
  const dep = ref2.dep;
1360
1378
  if (dep) {
@@ -1405,12 +1423,12 @@ getter: `, this.getter);
1405
1423
  const oldVal = this._rawValue;
1406
1424
  this._rawValue = newVal;
1407
1425
  this._value = useDirectValue ? newVal : toReactive(newVal);
1408
- triggerRefValue(this, 4, newVal, oldVal);
1426
+ triggerRefValue(this, 5, newVal, oldVal);
1409
1427
  }
1410
1428
  }
1411
1429
  }
1412
1430
  function triggerRef(ref2) {
1413
- triggerRefValue(ref2, 4, ref2.value );
1431
+ triggerRefValue(ref2, 5, ref2.value );
1414
1432
  }
1415
1433
  function unref(ref2) {
1416
1434
  return isRef(ref2) ? ref2.value : ref2;
@@ -2738,7 +2756,6 @@ If this is a native custom element, make sure to exclude it from component resol
2738
2756
  }
2739
2757
  },
2740
2758
  hydrate: hydrateSuspense,
2741
- create: createSuspenseBoundary,
2742
2759
  normalize: normalizeSuspenseChildren
2743
2760
  };
2744
2761
  const Suspense = SuspenseImpl ;
@@ -5296,18 +5313,8 @@ If you want to remount the same app, move your app creation logic into a factory
5296
5313
  let domType = node.nodeType;
5297
5314
  vnode.el = node;
5298
5315
  {
5299
- if (!("__vnode" in node)) {
5300
- Object.defineProperty(node, "__vnode", {
5301
- value: vnode,
5302
- enumerable: false
5303
- });
5304
- }
5305
- if (!("__vueParentComponent" in node)) {
5306
- Object.defineProperty(node, "__vueParentComponent", {
5307
- value: parentComponent,
5308
- enumerable: false
5309
- });
5310
- }
5316
+ def(node, "__vnode", vnode, true);
5317
+ def(node, "__vueParentComponent", parentComponent, true);
5311
5318
  }
5312
5319
  if (patchFlag === -2) {
5313
5320
  optimized = false;
@@ -5530,7 +5537,9 @@ Server rendered element contains more child nodes than client vdom.`
5530
5537
  if (props) {
5531
5538
  {
5532
5539
  for (const key in props) {
5533
- 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)) {
5534
5543
  logMismatchError();
5535
5544
  }
5536
5545
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5705,7 +5714,6 @@ Server rendered element contains fewer child nodes than client vdom.`
5705
5714
  return [hydrate, hydrateNode];
5706
5715
  }
5707
5716
  function propHasMismatch(el, key, clientValue, vnode, instance) {
5708
- var _a;
5709
5717
  let mismatchType;
5710
5718
  let mismatchKey;
5711
5719
  let actual;
@@ -5728,13 +5736,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5728
5736
  }
5729
5737
  }
5730
5738
  }
5731
- const root = instance == null ? void 0 : instance.subTree;
5732
- if (vnode === root || // eslint-disable-next-line no-restricted-syntax
5733
- (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
5734
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
5735
- for (const key2 in cssVars) {
5736
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
5737
- }
5739
+ if (instance) {
5740
+ resolveCssVars(instance, vnode, expectedMap);
5738
5741
  }
5739
5742
  if (!isMapEqual(actualMap, expectedMap)) {
5740
5743
  mismatchType = mismatchKey = "style";
@@ -5794,8 +5797,8 @@ Server rendered element contains fewer child nodes than client vdom.`
5794
5797
  const styleMap = /* @__PURE__ */ new Map();
5795
5798
  for (const item of str.split(";")) {
5796
5799
  let [key, value] = item.split(":");
5797
- key = key == null ? void 0 : key.trim();
5798
- value = value == null ? void 0 : value.trim();
5800
+ key = key.trim();
5801
+ value = value && value.trim();
5799
5802
  if (key && value) {
5800
5803
  styleMap.set(key, value);
5801
5804
  }
@@ -5813,6 +5816,18 @@ Server rendered element contains fewer child nodes than client vdom.`
5813
5816
  }
5814
5817
  return true;
5815
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
+ }
5816
5831
 
5817
5832
  let supported;
5818
5833
  let perf;
@@ -6130,14 +6145,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6130
6145
  }
6131
6146
  }
6132
6147
  {
6133
- Object.defineProperty(el, "__vnode", {
6134
- value: vnode,
6135
- enumerable: false
6136
- });
6137
- Object.defineProperty(el, "__vueParentComponent", {
6138
- value: parentComponent,
6139
- enumerable: false
6140
- });
6148
+ def(el, "__vnode", vnode, true);
6149
+ def(el, "__vueParentComponent", parentComponent, true);
6141
6150
  }
6142
6151
  if (dirs) {
6143
6152
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
@@ -6199,6 +6208,9 @@ Server rendered element contains fewer child nodes than client vdom.`
6199
6208
  };
6200
6209
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
6201
6210
  const el = n2.el = n1.el;
6211
+ {
6212
+ el.__vnode = n2;
6213
+ }
6202
6214
  let { patchFlag, dynamicChildren, dirs } = n2;
6203
6215
  patchFlag |= n1.patchFlag & 16;
6204
6216
  const oldProps = n1.props || EMPTY_OBJ;
@@ -7093,6 +7105,9 @@ Server rendered element contains fewer child nodes than client vdom.`
7093
7105
  dirs,
7094
7106
  memoIndex
7095
7107
  } = vnode;
7108
+ if (patchFlag === -2) {
7109
+ optimized = false;
7110
+ }
7096
7111
  if (ref != null) {
7097
7112
  setRef(ref, null, parentSuspense, vnode, true);
7098
7113
  }
@@ -7124,7 +7139,6 @@ Server rendered element contains fewer child nodes than client vdom.`
7124
7139
  vnode,
7125
7140
  parentComponent,
7126
7141
  parentSuspense,
7127
- optimized,
7128
7142
  internals,
7129
7143
  doRemove
7130
7144
  );
@@ -8394,7 +8408,7 @@ Server rendered element contains fewer child nodes than client vdom.`
8394
8408
  }
8395
8409
  updateCssVars(n2);
8396
8410
  },
8397
- remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8411
+ remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
8398
8412
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
8399
8413
  if (target) {
8400
8414
  hostRemove(targetAnchor);
@@ -9566,7 +9580,7 @@ Component that was made reactive: `,
9566
9580
  return true;
9567
9581
  }
9568
9582
 
9569
- const version = "3.4.28";
9583
+ const version = "3.4.30";
9570
9584
  const warn = warn$1 ;
9571
9585
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9572
9586
  const devtools = devtools$1 ;
@@ -10146,7 +10160,10 @@ Component that was made reactive: `,
10146
10160
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
10147
10161
  el.removeAttribute(key);
10148
10162
  } else {
10149
- el.setAttribute(key, isBoolean ? "" : String(value));
10163
+ el.setAttribute(
10164
+ key,
10165
+ isBoolean ? "" : isSymbol(value) ? String(value) : value
10166
+ );
10150
10167
  }
10151
10168
  }
10152
10169
  }
@@ -10307,7 +10324,7 @@ Expected function or array of functions, received type ${typeof value}.`
10307
10324
  parentSuspense,
10308
10325
  unmountChildren
10309
10326
  );
10310
- if (key === "value" || key === "checked" || key === "selected") {
10327
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
10311
10328
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
10312
10329
  }
10313
10330
  } else {
@@ -10355,8 +10372,8 @@ Expected function or array of functions, received type ${typeof value}.`
10355
10372
 
10356
10373
  /*! #__NO_SIDE_EFFECTS__ */
10357
10374
  // @__NO_SIDE_EFFECTS__
10358
- function defineCustomElement(options, hydrate2) {
10359
- const Comp = defineComponent(options);
10375
+ function defineCustomElement(options, extraOptions, hydrate2) {
10376
+ const Comp = defineComponent(options, extraOptions);
10360
10377
  class VueCustomElement extends VueElement {
10361
10378
  constructor(initialProps) {
10362
10379
  super(Comp, initialProps, hydrate2);
@@ -10366,8 +10383,8 @@ Expected function or array of functions, received type ${typeof value}.`
10366
10383
  return VueCustomElement;
10367
10384
  }
10368
10385
  /*! #__NO_SIDE_EFFECTS__ */
10369
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
10370
- return /* @__PURE__ */ defineCustomElement(options, hydrate);
10386
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
10387
+ return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
10371
10388
  };
10372
10389
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
10373
10390
  };