@vue/compat 3.5.18 → 3.5.20

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.5.18
2
+ * @vue/compat v3.5.20
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -59,10 +59,10 @@ var Vue = (function () {
59
59
  );
60
60
  const cacheStringFunction = (fn) => {
61
61
  const cache = /* @__PURE__ */ Object.create(null);
62
- return (str) => {
62
+ return ((str) => {
63
63
  const hit = cache[str];
64
64
  return hit || (cache[str] = fn(str));
65
- };
65
+ });
66
66
  };
67
67
  const camelizeRE = /-(\w)/g;
68
68
  const camelize = cacheStringFunction(
@@ -1094,7 +1094,7 @@ var Vue = (function () {
1094
1094
  join(separator) {
1095
1095
  return reactiveReadArray(this).join(separator);
1096
1096
  },
1097
- // keys() iterator only reads `length`, no optimisation required
1097
+ // keys() iterator only reads `length`, no optimization required
1098
1098
  lastIndexOf(...args) {
1099
1099
  return searchProxy(this, "lastIndexOf", args);
1100
1100
  },
@@ -1295,7 +1295,13 @@ var Vue = (function () {
1295
1295
  }
1296
1296
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1297
1297
  if (isOldValueReadonly) {
1298
- return false;
1298
+ {
1299
+ warn$2(
1300
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1301
+ target[key]
1302
+ );
1303
+ }
1304
+ return true;
1299
1305
  } else {
1300
1306
  oldValue.value = value;
1301
1307
  return true;
@@ -1440,7 +1446,7 @@ var Vue = (function () {
1440
1446
  get size() {
1441
1447
  const target = this["__v_raw"];
1442
1448
  !readonly && track(toRaw(target), "iterate", ITERATE_KEY);
1443
- return Reflect.get(target, "size", target);
1449
+ return target.size;
1444
1450
  },
1445
1451
  has(key) {
1446
1452
  const target = this["__v_raw"];
@@ -2662,7 +2668,9 @@ var Vue = (function () {
2662
2668
  }
2663
2669
  instance.renderCache = [];
2664
2670
  isHmrUpdating = true;
2665
- instance.update();
2671
+ if (!(instance.job.flags & 8)) {
2672
+ instance.update();
2673
+ }
2666
2674
  isHmrUpdating = false;
2667
2675
  });
2668
2676
  }
@@ -4254,7 +4262,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4254
4262
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
4255
4263
  const setupState = owner.setupState;
4256
4264
  const rawSetupState = toRaw(setupState);
4257
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4265
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
4258
4266
  {
4259
4267
  if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4260
4268
  warn$1(
@@ -4267,6 +4275,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4267
4275
  }
4268
4276
  return hasOwn(rawSetupState, key);
4269
4277
  };
4278
+ const canSetRef = (ref2) => {
4279
+ return !knownTemplateRefs.has(ref2);
4280
+ };
4270
4281
  if (oldRef != null && oldRef !== ref) {
4271
4282
  if (isString(oldRef)) {
4272
4283
  refs[oldRef] = null;
@@ -4274,7 +4285,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4274
4285
  setupState[oldRef] = null;
4275
4286
  }
4276
4287
  } else if (isRef(oldRef)) {
4277
- oldRef.value = null;
4288
+ if (canSetRef(oldRef)) {
4289
+ oldRef.value = null;
4290
+ }
4291
+ const oldRawRefAtom = oldRawRef;
4292
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
4278
4293
  }
4279
4294
  }
4280
4295
  if (isFunction(ref)) {
@@ -4285,7 +4300,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4285
4300
  if (_isString || _isRef) {
4286
4301
  const doSet = () => {
4287
4302
  if (rawRef.f) {
4288
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
4303
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
4289
4304
  if (isUnmount) {
4290
4305
  isArray(existing) && remove(existing, refValue);
4291
4306
  } else {
@@ -4296,8 +4311,11 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4296
4311
  setupState[ref] = refs[ref];
4297
4312
  }
4298
4313
  } else {
4299
- ref.value = [refValue];
4300
- if (rawRef.k) refs[rawRef.k] = ref.value;
4314
+ const newVal = [refValue];
4315
+ if (canSetRef(ref)) {
4316
+ ref.value = newVal;
4317
+ }
4318
+ if (rawRef.k) refs[rawRef.k] = newVal;
4301
4319
  }
4302
4320
  } else if (!existing.includes(refValue)) {
4303
4321
  existing.push(refValue);
@@ -4309,7 +4327,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4309
4327
  setupState[ref] = value;
4310
4328
  }
4311
4329
  } else if (_isRef) {
4312
- ref.value = value;
4330
+ if (canSetRef(ref)) {
4331
+ ref.value = value;
4332
+ }
4313
4333
  if (rawRef.k) refs[rawRef.k] = value;
4314
4334
  } else {
4315
4335
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6063,7 +6083,7 @@ If this is a native custom element, make sure to exclude it from component resol
6063
6083
  }
6064
6084
  return renderSlot(instance.slots, name, props, fallback && (() => fallback));
6065
6085
  }
6066
- function legacyresolveScopedSlots(fns, raw, hasDynamicKeys) {
6086
+ function legacyResolveScopedSlots(fns, raw, hasDynamicKeys) {
6067
6087
  return createSlots(
6068
6088
  raw || { $stable: !hasDynamicKeys },
6069
6089
  mapKeyToName(fns)
@@ -6230,7 +6250,7 @@ If this is a native custom element, make sure to exclude it from component resol
6230
6250
  _b: () => legacyBindObjectProps,
6231
6251
  _v: () => createTextVNode,
6232
6252
  _e: () => createCommentVNode,
6233
- _u: () => legacyresolveScopedSlots,
6253
+ _u: () => legacyResolveScopedSlots,
6234
6254
  _g: () => legacyBindObjectListeners,
6235
6255
  _d: () => legacyBindDynamicKeys,
6236
6256
  _p: () => legacyPrependModifier
@@ -6401,10 +6421,10 @@ If this is a native custom element, make sure to exclude it from component resol
6401
6421
  return true;
6402
6422
  },
6403
6423
  has({
6404
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
6424
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
6405
6425
  }, key) {
6406
- let normalizedProps;
6407
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
6426
+ let normalizedProps, cssModules;
6427
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
6408
6428
  },
6409
6429
  defineProperty(target, key, descriptor) {
6410
6430
  if (descriptor.get != null) {
@@ -7146,7 +7166,7 @@ If this is a native custom element, make sure to exclude it from component resol
7146
7166
  return vm;
7147
7167
  }
7148
7168
  }
7149
- Vue.version = `2.6.14-compat:${"3.5.18"}`;
7169
+ Vue.version = `2.6.14-compat:${"3.5.20"}`;
7150
7170
  Vue.config = singletonApp.config;
7151
7171
  Vue.use = (plugin, ...options) => {
7152
7172
  if (plugin && isFunction(plugin.install)) {
@@ -7160,22 +7180,22 @@ If this is a native custom element, make sure to exclude it from component resol
7160
7180
  singletonApp.mixin(m);
7161
7181
  return Vue;
7162
7182
  };
7163
- Vue.component = (name, comp) => {
7183
+ Vue.component = ((name, comp) => {
7164
7184
  if (comp) {
7165
7185
  singletonApp.component(name, comp);
7166
7186
  return Vue;
7167
7187
  } else {
7168
7188
  return singletonApp.component(name);
7169
7189
  }
7170
- };
7171
- Vue.directive = (name, dir) => {
7190
+ });
7191
+ Vue.directive = ((name, dir) => {
7172
7192
  if (dir) {
7173
7193
  singletonApp.directive(name, dir);
7174
7194
  return Vue;
7175
7195
  } else {
7176
7196
  return singletonApp.directive(name);
7177
7197
  }
7178
- };
7198
+ });
7179
7199
  Vue.options = { _base: Vue };
7180
7200
  let cid = 1;
7181
7201
  Vue.cid = cid;
@@ -7238,14 +7258,14 @@ If this is a native custom element, make sure to exclude it from component resol
7238
7258
  assertCompatEnabled("GLOBAL_OBSERVABLE", null);
7239
7259
  return reactive(target);
7240
7260
  };
7241
- Vue.filter = (name, filter) => {
7261
+ Vue.filter = ((name, filter) => {
7242
7262
  if (filter) {
7243
7263
  singletonApp.filter(name, filter);
7244
7264
  return Vue;
7245
7265
  } else {
7246
7266
  return singletonApp.filter(name);
7247
7267
  }
7248
- };
7268
+ });
7249
7269
  const util = {
7250
7270
  warn: warn$1 ,
7251
7271
  extend,
@@ -8239,7 +8259,7 @@ If you want to remount the same app, move your app creation logic into a factory
8239
8259
  return args.some((elem) => elem.toLowerCase() === "boolean");
8240
8260
  }
8241
8261
 
8242
- const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
8262
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
8243
8263
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
8244
8264
  const normalizeSlot = (key, rawSlot, ctx) => {
8245
8265
  if (rawSlot._n) {
@@ -8293,8 +8313,6 @@ If you want to remount the same app, move your app creation logic into a factory
8293
8313
  const initSlots = (instance, children, optimized) => {
8294
8314
  const slots = instance.slots = createInternalObject();
8295
8315
  if (instance.vnode.shapeFlag & 32) {
8296
- const cacheIndexes = children.__;
8297
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
8298
8316
  const type = children._;
8299
8317
  if (type) {
8300
8318
  assignSlots(slots, children, optimized);
@@ -8355,12 +8373,10 @@ If you want to remount the same app, move your app creation logic into a factory
8355
8373
  if (instance.appContext.config.performance && isSupported()) {
8356
8374
  const startTag = `vue-${type}-${instance.uid}`;
8357
8375
  const endTag = startTag + `:end`;
8376
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
8358
8377
  perf.mark(endTag);
8359
- perf.measure(
8360
- `<${formatComponentName(instance, instance.type)}> ${type}`,
8361
- startTag,
8362
- endTag
8363
- );
8378
+ perf.measure(measureName, startTag, endTag);
8379
+ perf.clearMeasures(measureName);
8364
8380
  perf.clearMarks(startTag);
8365
8381
  perf.clearMarks(endTag);
8366
8382
  }
@@ -9577,6 +9593,12 @@ If you want to remount the same app, move your app creation logic into a factory
9577
9593
  }
9578
9594
  };
9579
9595
  const performLeave = () => {
9596
+ if (el._isLeaving) {
9597
+ el[leaveCbKey](
9598
+ true
9599
+ /* cancelled */
9600
+ );
9601
+ }
9580
9602
  leave(el, () => {
9581
9603
  remove2();
9582
9604
  afterLeave && afterLeave();
@@ -9722,27 +9744,12 @@ If you want to remount the same app, move your app creation logic into a factory
9722
9744
  if (instance.type.__hmrId) {
9723
9745
  unregisterHMR(instance);
9724
9746
  }
9725
- const {
9726
- bum,
9727
- scope,
9728
- job,
9729
- subTree,
9730
- um,
9731
- m,
9732
- a,
9733
- parent,
9734
- slots: { __: slotCacheKeys }
9735
- } = instance;
9747
+ const { bum, scope, job, subTree, um, m, a } = instance;
9736
9748
  invalidateMount(m);
9737
9749
  invalidateMount(a);
9738
9750
  if (bum) {
9739
9751
  invokeArrayFns(bum);
9740
9752
  }
9741
- if (parent && isArray(slotCacheKeys)) {
9742
- slotCacheKeys.forEach((v) => {
9743
- parent.renderCache[v] = void 0;
9744
- });
9745
- }
9746
9753
  if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9747
9754
  instance.emit("hook:beforeDestroy");
9748
9755
  }
@@ -9763,12 +9770,6 @@ If you want to remount the same app, move your app creation logic into a factory
9763
9770
  queuePostRenderEffect(() => {
9764
9771
  instance.isUnmounted = true;
9765
9772
  }, parentSuspense);
9766
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
9767
- parentSuspense.deps--;
9768
- if (parentSuspense.deps === 0) {
9769
- parentSuspense.resolve();
9770
- }
9771
- }
9772
9773
  {
9773
9774
  devtoolsComponentRemoved(instance);
9774
9775
  }
@@ -9869,7 +9870,8 @@ If you want to remount the same app, move your app creation logic into a factory
9869
9870
  if (!shallow && c2.patchFlag !== -2)
9870
9871
  traverseStaticChildren(c1, c2);
9871
9872
  }
9872
- if (c2.type === Text) {
9873
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
9874
+ c2.patchFlag !== -1) {
9873
9875
  c2.el = c1.el;
9874
9876
  }
9875
9877
  if (c2.type === Comment && !c2.el) {
@@ -12272,7 +12274,7 @@ Component that was made reactive: `,
12272
12274
  return true;
12273
12275
  }
12274
12276
 
12275
- const version = "3.5.18";
12277
+ const version = "3.5.20";
12276
12278
  const warn = warn$1 ;
12277
12279
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12278
12280
  const devtools = devtools$1 ;
@@ -12704,6 +12706,8 @@ Component that was made reactive: `,
12704
12706
  const vShowOriginalDisplay = Symbol("_vod");
12705
12707
  const vShowHidden = Symbol("_vsh");
12706
12708
  const vShow = {
12709
+ // used for prop mismatch check during hydration
12710
+ name: "show",
12707
12711
  beforeMount(el, { value }, { transition }) {
12708
12712
  el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
12709
12713
  if (transition && value) {
@@ -12737,9 +12741,6 @@ Component that was made reactive: `,
12737
12741
  setDisplay(el, value);
12738
12742
  }
12739
12743
  };
12740
- {
12741
- vShow.name = "show";
12742
- }
12743
12744
  function setDisplay(el, value) {
12744
12745
  el.style.display = value ? el[vShowOriginalDisplay] : "none";
12745
12746
  el[vShowHidden] = !value;
@@ -13198,10 +13199,10 @@ Expected function or array of functions, received type ${typeof value}.`
13198
13199
  VueCustomElement.def = Comp;
13199
13200
  return VueCustomElement;
13200
13201
  }
13201
- /*! #__NO_SIDE_EFFECTS__ */
13202
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13202
+
13203
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13203
13204
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13204
- };
13205
+ });
13205
13206
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
13206
13207
  };
13207
13208
  class VueElement extends BaseClass {
@@ -14025,13 +14026,13 @@ Expected function or array of functions, received type ${typeof value}.`
14025
14026
  const withModifiers = (fn, modifiers) => {
14026
14027
  const cache = fn._withMods || (fn._withMods = {});
14027
14028
  const cacheKey = modifiers.join(".");
14028
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
14029
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
14029
14030
  for (let i = 0; i < modifiers.length; i++) {
14030
14031
  const guard = modifierGuards[modifiers[i]];
14031
14032
  if (guard && guard(event, modifiers)) return;
14032
14033
  }
14033
14034
  return fn(event, ...args);
14034
- });
14035
+ }));
14035
14036
  };
14036
14037
  const keyNames = {
14037
14038
  esc: "escape",
@@ -14061,7 +14062,7 @@ Expected function or array of functions, received type ${typeof value}.`
14061
14062
  }
14062
14063
  const cache = fn._withKeys || (fn._withKeys = {});
14063
14064
  const cacheKey = modifiers.join(".");
14064
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
14065
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
14065
14066
  if (!("key" in event)) {
14066
14067
  return;
14067
14068
  }
@@ -14091,7 +14092,7 @@ Expected function or array of functions, received type ${typeof value}.`
14091
14092
  }
14092
14093
  }
14093
14094
  }
14094
- });
14095
+ }));
14095
14096
  };
14096
14097
 
14097
14098
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -14105,13 +14106,13 @@ Expected function or array of functions, received type ${typeof value}.`
14105
14106
  enabledHydration = true;
14106
14107
  return renderer;
14107
14108
  }
14108
- const render = (...args) => {
14109
+ const render = ((...args) => {
14109
14110
  ensureRenderer().render(...args);
14110
- };
14111
- const hydrate = (...args) => {
14111
+ });
14112
+ const hydrate = ((...args) => {
14112
14113
  ensureHydrationRenderer().hydrate(...args);
14113
- };
14114
- const createApp = (...args) => {
14114
+ });
14115
+ const createApp = ((...args) => {
14115
14116
  const app = ensureRenderer().createApp(...args);
14116
14117
  {
14117
14118
  injectNativeTagCheck(app);
@@ -14148,8 +14149,8 @@ Expected function or array of functions, received type ${typeof value}.`
14148
14149
  return proxy;
14149
14150
  };
14150
14151
  return app;
14151
- };
14152
- const createSSRApp = (...args) => {
14152
+ });
14153
+ const createSSRApp = ((...args) => {
14153
14154
  const app = ensureHydrationRenderer().createApp(...args);
14154
14155
  {
14155
14156
  injectNativeTagCheck(app);
@@ -14163,7 +14164,7 @@ Expected function or array of functions, received type ${typeof value}.`
14163
14164
  }
14164
14165
  };
14165
14166
  return app;
14166
- };
14167
+ });
14167
14168
  function resolveRootNamespace(container) {
14168
14169
  if (container instanceof SVGElement) {
14169
14170
  return "svg";
@@ -14431,13 +14432,13 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14431
14432
  }
14432
14433
 
14433
14434
  const Vue = createCompatVue();
14434
- Vue.compile = () => {
14435
+ Vue.compile = (() => {
14435
14436
  {
14436
14437
  warn(
14437
14438
  `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
14438
14439
  );
14439
14440
  }
14440
- };
14441
+ });
14441
14442
 
14442
14443
  return Vue;
14443
14444