@vue/compat 3.4.17 → 3.4.19

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.17
2
+ * @vue/compat v3.4.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1265,6 +1265,7 @@ function markRaw(value) {
1265
1265
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
1266
1266
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1267
1267
 
1268
+ const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
1268
1269
  class ComputedRefImpl {
1269
1270
  constructor(getter, _setter, isReadonly, isSSR) {
1270
1271
  this._setter = _setter;
@@ -1289,6 +1290,7 @@ class ComputedRefImpl {
1289
1290
  }
1290
1291
  trackRefValue(self);
1291
1292
  if (self.effect._dirtyLevel >= 2) {
1293
+ !!(process.env.NODE_ENV !== "production") && warn$2(COMPUTED_SIDE_EFFECT_WARN);
1292
1294
  triggerRefValue(self, 2);
1293
1295
  }
1294
1296
  return self._value;
@@ -1312,7 +1314,7 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1312
1314
  if (onlyGetter) {
1313
1315
  getter = getterOrOptions;
1314
1316
  setter = !!(process.env.NODE_ENV !== "production") ? () => {
1315
- console.warn("Write operation failed: computed value is readonly");
1317
+ warn$2("Write operation failed: computed value is readonly");
1316
1318
  } : NOOP;
1317
1319
  } else {
1318
1320
  getter = getterOrOptions.get;
@@ -1688,13 +1690,11 @@ const ErrorTypeStrings$1 = {
1688
1690
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1689
1691
  };
1690
1692
  function callWithErrorHandling(fn, instance, type, args) {
1691
- let res;
1692
1693
  try {
1693
- res = args ? fn(...args) : fn();
1694
+ return args ? fn(...args) : fn();
1694
1695
  } catch (err) {
1695
1696
  handleError(err, instance, type);
1696
1697
  }
1697
- return res;
1698
1698
  }
1699
1699
  function callWithAsyncErrorHandling(fn, instance, type, args) {
1700
1700
  if (isFunction(fn)) {
@@ -6475,7 +6475,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6475
6475
  return vm;
6476
6476
  }
6477
6477
  }
6478
- Vue.version = `2.6.14-compat:${"3.4.17"}`;
6478
+ Vue.version = `2.6.14-compat:${"3.4.19"}`;
6479
6479
  Vue.config = singletonApp.config;
6480
6480
  Vue.use = (p, ...options) => {
6481
6481
  if (p && isFunction(p.install)) {
@@ -7415,7 +7415,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
7415
7415
  return res;
7416
7416
  }
7417
7417
  function validatePropName(key) {
7418
- if (key[0] !== "$") {
7418
+ if (key[0] !== "$" && !isReservedProp(key)) {
7419
7419
  return true;
7420
7420
  } else if (!!(process.env.NODE_ENV !== "production")) {
7421
7421
  warn$1(`Invalid prop name: "${key}" is a reserved property.`);
@@ -7423,8 +7423,16 @@ function validatePropName(key) {
7423
7423
  return false;
7424
7424
  }
7425
7425
  function getType(ctor) {
7426
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
7427
- return match ? match[2] : ctor === null ? "null" : "";
7426
+ if (ctor === null) {
7427
+ return "null";
7428
+ }
7429
+ if (typeof ctor === "function") {
7430
+ return ctor.name || "";
7431
+ } else if (typeof ctor === "object") {
7432
+ const name = ctor.constructor && ctor.constructor.name;
7433
+ return name || "";
7434
+ }
7435
+ return "";
7428
7436
  }
7429
7437
  function isSameType(a, b) {
7430
7438
  return getType(a) === getType(b);
@@ -8233,9 +8241,12 @@ function propHasMismatch(el, key, clientValue, vnode, instance) {
8233
8241
  }
8234
8242
  }
8235
8243
  }
8236
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
8237
- for (const key2 in cssVars) {
8238
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
8244
+ const root = instance == null ? void 0 : instance.subTree;
8245
+ if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
8246
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
8247
+ for (const key2 in cssVars) {
8248
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
8249
+ }
8239
8250
  }
8240
8251
  if (!isMapEqual(actualMap, expectedMap)) {
8241
8252
  mismatchType = mismatchKey = "style";
@@ -11381,7 +11392,7 @@ function isMemoSame(cached, memo) {
11381
11392
  return true;
11382
11393
  }
11383
11394
 
11384
- const version = "3.4.17";
11395
+ const version = "3.4.19";
11385
11396
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11386
11397
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11387
11398
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11810,7 +11821,7 @@ const vShow = {
11810
11821
  }
11811
11822
  },
11812
11823
  updated(el, { value, oldValue }, { transition }) {
11813
- if (!value === !oldValue)
11824
+ if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
11814
11825
  return;
11815
11826
  if (transition) {
11816
11827
  if (value) {
@@ -11910,10 +11921,12 @@ function setVarsOnNode(el, vars) {
11910
11921
  }
11911
11922
  }
11912
11923
 
11924
+ const displayRE = /(^|;)\s*display\s*:/;
11913
11925
  function patchStyle(el, prev, next) {
11914
11926
  const style = el.style;
11915
- const currentDisplay = style.display;
11916
11927
  const isCssString = isString(next);
11928
+ const currentDisplay = style.display;
11929
+ let hasControlledDisplay = false;
11917
11930
  if (next && !isCssString) {
11918
11931
  if (prev && !isString(prev)) {
11919
11932
  for (const key in prev) {
@@ -11923,6 +11936,9 @@ function patchStyle(el, prev, next) {
11923
11936
  }
11924
11937
  }
11925
11938
  for (const key in next) {
11939
+ if (key === "display") {
11940
+ hasControlledDisplay = true;
11941
+ }
11926
11942
  setStyle(style, key, next[key]);
11927
11943
  }
11928
11944
  } else {
@@ -11933,12 +11949,14 @@ function patchStyle(el, prev, next) {
11933
11949
  next += ";" + cssVarText;
11934
11950
  }
11935
11951
  style.cssText = next;
11952
+ hasControlledDisplay = displayRE.test(next);
11936
11953
  }
11937
11954
  } else if (prev) {
11938
11955
  el.removeAttribute("style");
11939
11956
  }
11940
11957
  }
11941
11958
  if (vShowOldKey in el) {
11959
+ el[vShowOldKey] = hasControlledDisplay ? style.display : "";
11942
11960
  style.display = currentDisplay;
11943
11961
  }
11944
11962
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.17
2
+ * @vue/compat v3.4.19
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1268,6 +1268,7 @@ var Vue = (function () {
1268
1268
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
1269
1269
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1270
1270
 
1271
+ const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
1271
1272
  class ComputedRefImpl {
1272
1273
  constructor(getter, _setter, isReadonly, isSSR) {
1273
1274
  this._setter = _setter;
@@ -1292,6 +1293,7 @@ var Vue = (function () {
1292
1293
  }
1293
1294
  trackRefValue(self);
1294
1295
  if (self.effect._dirtyLevel >= 2) {
1296
+ warn$2(COMPUTED_SIDE_EFFECT_WARN);
1295
1297
  triggerRefValue(self, 2);
1296
1298
  }
1297
1299
  return self._value;
@@ -1315,7 +1317,7 @@ var Vue = (function () {
1315
1317
  if (onlyGetter) {
1316
1318
  getter = getterOrOptions;
1317
1319
  setter = () => {
1318
- console.warn("Write operation failed: computed value is readonly");
1320
+ warn$2("Write operation failed: computed value is readonly");
1319
1321
  } ;
1320
1322
  } else {
1321
1323
  getter = getterOrOptions.get;
@@ -1689,13 +1691,11 @@ var Vue = (function () {
1689
1691
  [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
1690
1692
  };
1691
1693
  function callWithErrorHandling(fn, instance, type, args) {
1692
- let res;
1693
1694
  try {
1694
- res = args ? fn(...args) : fn();
1695
+ return args ? fn(...args) : fn();
1695
1696
  } catch (err) {
1696
1697
  handleError(err, instance, type);
1697
1698
  }
1698
- return res;
1699
1699
  }
1700
1700
  function callWithAsyncErrorHandling(fn, instance, type, args) {
1701
1701
  if (isFunction(fn)) {
@@ -6434,7 +6434,7 @@ If this is a native custom element, make sure to exclude it from component resol
6434
6434
  return vm;
6435
6435
  }
6436
6436
  }
6437
- Vue.version = `2.6.14-compat:${"3.4.17"}`;
6437
+ Vue.version = `2.6.14-compat:${"3.4.19"}`;
6438
6438
  Vue.config = singletonApp.config;
6439
6439
  Vue.use = (p, ...options) => {
6440
6440
  if (p && isFunction(p.install)) {
@@ -7371,7 +7371,7 @@ If you want to remount the same app, move your app creation logic into a factory
7371
7371
  return res;
7372
7372
  }
7373
7373
  function validatePropName(key) {
7374
- if (key[0] !== "$") {
7374
+ if (key[0] !== "$" && !isReservedProp(key)) {
7375
7375
  return true;
7376
7376
  } else {
7377
7377
  warn$1(`Invalid prop name: "${key}" is a reserved property.`);
@@ -7379,8 +7379,16 @@ If you want to remount the same app, move your app creation logic into a factory
7379
7379
  return false;
7380
7380
  }
7381
7381
  function getType(ctor) {
7382
- const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
7383
- return match ? match[2] : ctor === null ? "null" : "";
7382
+ if (ctor === null) {
7383
+ return "null";
7384
+ }
7385
+ if (typeof ctor === "function") {
7386
+ return ctor.name || "";
7387
+ } else if (typeof ctor === "object") {
7388
+ const name = ctor.constructor && ctor.constructor.name;
7389
+ return name || "";
7390
+ }
7391
+ return "";
7384
7392
  }
7385
7393
  function isSameType(a, b) {
7386
7394
  return getType(a) === getType(b);
@@ -8179,9 +8187,12 @@ Server rendered element contains fewer child nodes than client vdom.`
8179
8187
  }
8180
8188
  }
8181
8189
  }
8182
- const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
8183
- for (const key2 in cssVars) {
8184
- expectedMap.set(`--${key2}`, String(cssVars[key2]));
8190
+ const root = instance == null ? void 0 : instance.subTree;
8191
+ if (vnode === root || (root == null ? void 0 : root.type) === Fragment && root.children.includes(vnode)) {
8192
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
8193
+ for (const key2 in cssVars) {
8194
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
8195
+ }
8185
8196
  }
8186
8197
  if (!isMapEqual(actualMap, expectedMap)) {
8187
8198
  mismatchType = mismatchKey = "style";
@@ -11256,7 +11267,7 @@ Component that was made reactive: `,
11256
11267
  return true;
11257
11268
  }
11258
11269
 
11259
- const version = "3.4.17";
11270
+ const version = "3.4.19";
11260
11271
  const warn = warn$1 ;
11261
11272
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11262
11273
  const devtools = devtools$1 ;
@@ -11677,7 +11688,7 @@ Component that was made reactive: `,
11677
11688
  }
11678
11689
  },
11679
11690
  updated(el, { value, oldValue }, { transition }) {
11680
- if (!value === !oldValue)
11691
+ if (!value === !oldValue && (el.style.display === el[vShowOldKey] || !value))
11681
11692
  return;
11682
11693
  if (transition) {
11683
11694
  if (value) {
@@ -11770,10 +11781,12 @@ Component that was made reactive: `,
11770
11781
  }
11771
11782
  }
11772
11783
 
11784
+ const displayRE = /(^|;)\s*display\s*:/;
11773
11785
  function patchStyle(el, prev, next) {
11774
11786
  const style = el.style;
11775
- const currentDisplay = style.display;
11776
11787
  const isCssString = isString(next);
11788
+ const currentDisplay = style.display;
11789
+ let hasControlledDisplay = false;
11777
11790
  if (next && !isCssString) {
11778
11791
  if (prev && !isString(prev)) {
11779
11792
  for (const key in prev) {
@@ -11783,6 +11796,9 @@ Component that was made reactive: `,
11783
11796
  }
11784
11797
  }
11785
11798
  for (const key in next) {
11799
+ if (key === "display") {
11800
+ hasControlledDisplay = true;
11801
+ }
11786
11802
  setStyle(style, key, next[key]);
11787
11803
  }
11788
11804
  } else {
@@ -11793,12 +11809,14 @@ Component that was made reactive: `,
11793
11809
  next += ";" + cssVarText;
11794
11810
  }
11795
11811
  style.cssText = next;
11812
+ hasControlledDisplay = displayRE.test(next);
11796
11813
  }
11797
11814
  } else if (prev) {
11798
11815
  el.removeAttribute("style");
11799
11816
  }
11800
11817
  }
11801
11818
  if (vShowOldKey in el) {
11819
+ el[vShowOldKey] = hasControlledDisplay ? style.display : "";
11802
11820
  style.display = currentDisplay;
11803
11821
  }
11804
11822
  }