@vue/compat 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/compat v3.4.28
2
+ * @vue/compat v3.4.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -481,7 +481,7 @@ var Vue = (function () {
481
481
  /**
482
482
  * @internal
483
483
  */
484
- this._dirtyLevel = 4;
484
+ this._dirtyLevel = 5;
485
485
  /**
486
486
  * @internal
487
487
  */
@@ -501,14 +501,20 @@ var Vue = (function () {
501
501
  recordEffectScope(this, scope);
502
502
  }
503
503
  get dirty() {
504
- if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
504
+ if (this._dirtyLevel === 2)
505
+ return false;
506
+ if (this._dirtyLevel === 3 || this._dirtyLevel === 4) {
505
507
  this._dirtyLevel = 1;
506
508
  pauseTracking();
507
509
  for (let i = 0; i < this._depsLength; i++) {
508
510
  const dep = this.deps[i];
509
511
  if (dep.computed) {
512
+ if (dep.computed.effect._dirtyLevel === 2) {
513
+ resetTracking();
514
+ return true;
515
+ }
510
516
  triggerComputed(dep.computed);
511
- if (this._dirtyLevel >= 4) {
517
+ if (this._dirtyLevel >= 5) {
512
518
  break;
513
519
  }
514
520
  }
@@ -518,10 +524,10 @@ var Vue = (function () {
518
524
  }
519
525
  resetTracking();
520
526
  }
521
- return this._dirtyLevel >= 4;
527
+ return this._dirtyLevel >= 5;
522
528
  }
523
529
  set dirty(v) {
524
- this._dirtyLevel = v ? 4 : 0;
530
+ this._dirtyLevel = v ? 5 : 0;
525
531
  }
526
532
  run() {
527
533
  this._dirtyLevel = 0;
@@ -643,8 +649,17 @@ var Vue = (function () {
643
649
  pauseScheduling();
644
650
  for (const effect2 of dep.keys()) {
645
651
  let tracking;
652
+ if (!dep.computed && effect2.computed) {
653
+ if (effect2._runnings > 0 && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
654
+ effect2._dirtyLevel = 2;
655
+ continue;
656
+ }
657
+ }
646
658
  if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
647
659
  effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
660
+ if (effect2.computed && effect2._dirtyLevel === 2) {
661
+ effect2._shouldSchedule = true;
662
+ }
648
663
  effect2._dirtyLevel = dirtyLevel;
649
664
  }
650
665
  if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
@@ -652,7 +667,7 @@ var Vue = (function () {
652
667
  (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
653
668
  }
654
669
  effect2.trigger();
655
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
670
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 3) {
656
671
  effect2._shouldSchedule = false;
657
672
  if (effect2.scheduler) {
658
673
  queueEffectSchedulers.push(effect2.scheduler);
@@ -744,7 +759,7 @@ var Vue = (function () {
744
759
  if (dep) {
745
760
  triggerEffects(
746
761
  dep,
747
- 4,
762
+ 5,
748
763
  {
749
764
  target,
750
765
  type,
@@ -1347,7 +1362,7 @@ var Vue = (function () {
1347
1362
  () => getter(this._value),
1348
1363
  () => triggerRefValue(
1349
1364
  this,
1350
- this.effect._dirtyLevel === 2 ? 2 : 3
1365
+ this.effect._dirtyLevel === 3 ? 3 : 4
1351
1366
  )
1352
1367
  );
1353
1368
  this.effect.computed = this;
@@ -1356,8 +1371,11 @@ var Vue = (function () {
1356
1371
  }
1357
1372
  get value() {
1358
1373
  const self = toRaw(this);
1374
+ const lastDirtyLevel = self.effect._dirtyLevel;
1359
1375
  if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1360
- triggerRefValue(self, 4);
1376
+ if (lastDirtyLevel !== 3) {
1377
+ triggerRefValue(self, 5);
1378
+ }
1361
1379
  }
1362
1380
  trackRefValue(self);
1363
1381
  if (self.effect._dirtyLevel >= 2) {
@@ -1366,7 +1384,7 @@ var Vue = (function () {
1366
1384
 
1367
1385
  getter: `, this.getter);
1368
1386
  }
1369
- triggerRefValue(self, 2);
1387
+ triggerRefValue(self, 3);
1370
1388
  }
1371
1389
  return self._value;
1372
1390
  }
@@ -1421,7 +1439,7 @@ getter: `, this.getter);
1421
1439
  );
1422
1440
  }
1423
1441
  }
1424
- function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
1442
+ function triggerRefValue(ref2, dirtyLevel = 5, newVal, oldVal) {
1425
1443
  ref2 = toRaw(ref2);
1426
1444
  const dep = ref2.dep;
1427
1445
  if (dep) {
@@ -1472,12 +1490,12 @@ getter: `, this.getter);
1472
1490
  const oldVal = this._rawValue;
1473
1491
  this._rawValue = newVal;
1474
1492
  this._value = useDirectValue ? newVal : toReactive(newVal);
1475
- triggerRefValue(this, 4, newVal, oldVal);
1493
+ triggerRefValue(this, 5, newVal, oldVal);
1476
1494
  }
1477
1495
  }
1478
1496
  }
1479
1497
  function triggerRef(ref2) {
1480
- triggerRefValue(ref2, 4, ref2.value );
1498
+ triggerRefValue(ref2, 5, ref2.value );
1481
1499
  }
1482
1500
  function unref(ref2) {
1483
1501
  return isRef(ref2) ? ref2.value : ref2;
@@ -3324,7 +3342,6 @@ If this is a native custom element, make sure to exclude it from component resol
3324
3342
  }
3325
3343
  },
3326
3344
  hydrate: hydrateSuspense,
3327
- create: createSuspenseBoundary,
3328
3345
  normalize: normalizeSuspenseChildren
3329
3346
  };
3330
3347
  const Suspense = SuspenseImpl ;
@@ -5680,7 +5697,7 @@ If this is a native custom element, make sure to exclude it from component resol
5680
5697
  return vm;
5681
5698
  }
5682
5699
  }
5683
- Vue.version = `2.6.14-compat:${"3.4.28"}`;
5700
+ Vue.version = `2.6.14-compat:${"3.4.30"}`;
5684
5701
  Vue.config = singletonApp.config;
5685
5702
  Vue.use = (plugin, ...options) => {
5686
5703
  if (plugin && isFunction(plugin.install)) {
@@ -6989,18 +7006,8 @@ If you want to remount the same app, move your app creation logic into a factory
6989
7006
  let domType = node.nodeType;
6990
7007
  vnode.el = node;
6991
7008
  {
6992
- if (!("__vnode" in node)) {
6993
- Object.defineProperty(node, "__vnode", {
6994
- value: vnode,
6995
- enumerable: false
6996
- });
6997
- }
6998
- if (!("__vueParentComponent" in node)) {
6999
- Object.defineProperty(node, "__vueParentComponent", {
7000
- value: parentComponent,
7001
- enumerable: false
7002
- });
7003
- }
7009
+ def(node, "__vnode", vnode, true);
7010
+ def(node, "__vueParentComponent", parentComponent, true);
7004
7011
  }
7005
7012
  if (patchFlag === -2) {
7006
7013
  optimized = false;
@@ -7223,7 +7230,9 @@ Server rendered element contains more child nodes than client vdom.`
7223
7230
  if (props) {
7224
7231
  {
7225
7232
  for (const key in props) {
7226
- if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
7233
+ if (// #11189 skip if this node has directives that have created hooks
7234
+ // as it could have mutated the DOM in any possible way
7235
+ !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
7227
7236
  logMismatchError();
7228
7237
  }
7229
7238
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -7398,7 +7407,6 @@ Server rendered element contains fewer child nodes than client vdom.`
7398
7407
  return [hydrate, hydrateNode];
7399
7408
  }
7400
7409
  function propHasMismatch(el, key, clientValue, vnode, instance) {
7401
- var _a;
7402
7410
  let mismatchType;
7403
7411
  let mismatchKey;
7404
7412
  let actual;
@@ -7421,13 +7429,8 @@ Server rendered element contains fewer child nodes than client vdom.`
7421
7429
  }
7422
7430
  }
7423
7431
  }
7424
- const root = instance == null ? void 0 : instance.subTree;
7425
- if (vnode === root || // eslint-disable-next-line no-restricted-syntax
7426
- (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
7427
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
7428
- for (const key2 in cssVars) {
7429
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
7430
- }
7432
+ if (instance) {
7433
+ resolveCssVars(instance, vnode, expectedMap);
7431
7434
  }
7432
7435
  if (!isMapEqual(actualMap, expectedMap)) {
7433
7436
  mismatchType = mismatchKey = "style";
@@ -7487,8 +7490,8 @@ Server rendered element contains fewer child nodes than client vdom.`
7487
7490
  const styleMap = /* @__PURE__ */ new Map();
7488
7491
  for (const item of str.split(";")) {
7489
7492
  let [key, value] = item.split(":");
7490
- key = key == null ? void 0 : key.trim();
7491
- value = value == null ? void 0 : value.trim();
7493
+ key = key.trim();
7494
+ value = value && value.trim();
7492
7495
  if (key && value) {
7493
7496
  styleMap.set(key, value);
7494
7497
  }
@@ -7506,6 +7509,18 @@ Server rendered element contains fewer child nodes than client vdom.`
7506
7509
  }
7507
7510
  return true;
7508
7511
  }
7512
+ function resolveCssVars(instance, vnode, expectedMap) {
7513
+ const root = instance.subTree;
7514
+ if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
7515
+ const cssVars = instance.getCssVars();
7516
+ for (const key in cssVars) {
7517
+ expectedMap.set(`--${key}`, String(cssVars[key]));
7518
+ }
7519
+ }
7520
+ if (vnode === root && instance.parent) {
7521
+ resolveCssVars(instance.parent, instance.vnode, expectedMap);
7522
+ }
7523
+ }
7509
7524
 
7510
7525
  let supported;
7511
7526
  let perf;
@@ -7823,14 +7838,8 @@ Server rendered element contains fewer child nodes than client vdom.`
7823
7838
  }
7824
7839
  }
7825
7840
  {
7826
- Object.defineProperty(el, "__vnode", {
7827
- value: vnode,
7828
- enumerable: false
7829
- });
7830
- Object.defineProperty(el, "__vueParentComponent", {
7831
- value: parentComponent,
7832
- enumerable: false
7833
- });
7841
+ def(el, "__vnode", vnode, true);
7842
+ def(el, "__vueParentComponent", parentComponent, true);
7834
7843
  }
7835
7844
  if (dirs) {
7836
7845
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
@@ -7892,6 +7901,9 @@ Server rendered element contains fewer child nodes than client vdom.`
7892
7901
  };
7893
7902
  const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7894
7903
  const el = n2.el = n1.el;
7904
+ {
7905
+ el.__vnode = n2;
7906
+ }
7895
7907
  let { patchFlag, dynamicChildren, dirs } = n2;
7896
7908
  patchFlag |= n1.patchFlag & 16;
7897
7909
  const oldProps = n1.props || EMPTY_OBJ;
@@ -8811,6 +8823,9 @@ Server rendered element contains fewer child nodes than client vdom.`
8811
8823
  dirs,
8812
8824
  memoIndex
8813
8825
  } = vnode;
8826
+ if (patchFlag === -2) {
8827
+ optimized = false;
8828
+ }
8814
8829
  if (ref != null) {
8815
8830
  setRef(ref, null, parentSuspense, vnode, true);
8816
8831
  }
@@ -8842,7 +8857,6 @@ Server rendered element contains fewer child nodes than client vdom.`
8842
8857
  vnode,
8843
8858
  parentComponent,
8844
8859
  parentSuspense,
8845
- optimized,
8846
8860
  internals,
8847
8861
  doRemove
8848
8862
  );
@@ -10137,7 +10151,7 @@ Server rendered element contains fewer child nodes than client vdom.`
10137
10151
  }
10138
10152
  updateCssVars(n2);
10139
10153
  },
10140
- remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {
10154
+ remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
10141
10155
  const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;
10142
10156
  if (target) {
10143
10157
  hostRemove(targetAnchor);
@@ -11388,7 +11402,7 @@ Component that was made reactive: `,
11388
11402
  return true;
11389
11403
  }
11390
11404
 
11391
- const version = "3.4.28";
11405
+ const version = "3.4.30";
11392
11406
  const warn = warn$1 ;
11393
11407
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11394
11408
  const devtools = devtools$1 ;
@@ -12015,7 +12029,10 @@ Component that was made reactive: `,
12015
12029
  if (value == null || isBoolean && !includeBooleanAttr(value)) {
12016
12030
  el.removeAttribute(key);
12017
12031
  } else {
12018
- el.setAttribute(key, isBoolean ? "" : String(value));
12032
+ el.setAttribute(
12033
+ key,
12034
+ isBoolean ? "" : isSymbol(value) ? String(value) : value
12035
+ );
12019
12036
  }
12020
12037
  }
12021
12038
  }
@@ -12217,7 +12234,7 @@ Expected function or array of functions, received type ${typeof value}.`
12217
12234
  parentSuspense,
12218
12235
  unmountChildren
12219
12236
  );
12220
- if (key === "value" || key === "checked" || key === "selected") {
12237
+ if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
12221
12238
  patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
12222
12239
  }
12223
12240
  } else {
@@ -12265,8 +12282,8 @@ Expected function or array of functions, received type ${typeof value}.`
12265
12282
 
12266
12283
  /*! #__NO_SIDE_EFFECTS__ */
12267
12284
  // @__NO_SIDE_EFFECTS__
12268
- function defineCustomElement(options, hydrate2) {
12269
- const Comp = defineComponent(options);
12285
+ function defineCustomElement(options, extraOptions, hydrate2) {
12286
+ const Comp = defineComponent(options, extraOptions);
12270
12287
  class VueCustomElement extends VueElement {
12271
12288
  constructor(initialProps) {
12272
12289
  super(Comp, initialProps, hydrate2);
@@ -12276,8 +12293,8 @@ Expected function or array of functions, received type ${typeof value}.`
12276
12293
  return VueCustomElement;
12277
12294
  }
12278
12295
  /*! #__NO_SIDE_EFFECTS__ */
12279
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
12280
- return /* @__PURE__ */ defineCustomElement(options, hydrate);
12296
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
12297
+ return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
12281
12298
  };
12282
12299
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
12283
12300
  };
@@ -17201,9 +17218,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17201
17218
  break;
17202
17219
  }
17203
17220
  }
17204
- if (prev && isTemplateNode(prev) && findDir(prev, "if")) {
17205
- children.splice(i, 1);
17206
- i--;
17221
+ if (prev && isTemplateNode(prev) && findDir(prev, /^(else-)?if$/)) {
17207
17222
  let conditional = dynamicSlots[dynamicSlots.length - 1];
17208
17223
  while (conditional.alternate.type === 19) {
17209
17224
  conditional = conditional.alternate;
@@ -18237,8 +18252,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18237
18252
  }
18238
18253
  if (node.type === 5) {
18239
18254
  rewriteFilter(node.content, context);
18240
- }
18241
- if (node.type === 1) {
18255
+ } else if (node.type === 1) {
18242
18256
  node.props.forEach((prop) => {
18243
18257
  if (prop.type === 7 && prop.name !== "for" && prop.exp) {
18244
18258
  rewriteFilter(prop.exp, context);