@vue/compat 3.5.18 → 3.5.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.5.18
2
+ * @vue/compat v3.5.19
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(
@@ -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;
@@ -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})`);
@@ -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.19"}`;
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.19";
12276
12278
  const warn = warn$1 ;
12277
12279
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12278
12280
  const devtools = devtools$1 ;
@@ -13198,10 +13200,10 @@ Expected function or array of functions, received type ${typeof value}.`
13198
13200
  VueCustomElement.def = Comp;
13199
13201
  return VueCustomElement;
13200
13202
  }
13201
- /*! #__NO_SIDE_EFFECTS__ */
13202
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13203
+
13204
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13203
13205
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13204
- };
13206
+ });
13205
13207
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
13206
13208
  };
13207
13209
  class VueElement extends BaseClass {
@@ -14025,13 +14027,13 @@ Expected function or array of functions, received type ${typeof value}.`
14025
14027
  const withModifiers = (fn, modifiers) => {
14026
14028
  const cache = fn._withMods || (fn._withMods = {});
14027
14029
  const cacheKey = modifiers.join(".");
14028
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
14030
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
14029
14031
  for (let i = 0; i < modifiers.length; i++) {
14030
14032
  const guard = modifierGuards[modifiers[i]];
14031
14033
  if (guard && guard(event, modifiers)) return;
14032
14034
  }
14033
14035
  return fn(event, ...args);
14034
- });
14036
+ }));
14035
14037
  };
14036
14038
  const keyNames = {
14037
14039
  esc: "escape",
@@ -14061,7 +14063,7 @@ Expected function or array of functions, received type ${typeof value}.`
14061
14063
  }
14062
14064
  const cache = fn._withKeys || (fn._withKeys = {});
14063
14065
  const cacheKey = modifiers.join(".");
14064
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
14066
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
14065
14067
  if (!("key" in event)) {
14066
14068
  return;
14067
14069
  }
@@ -14091,7 +14093,7 @@ Expected function or array of functions, received type ${typeof value}.`
14091
14093
  }
14092
14094
  }
14093
14095
  }
14094
- });
14096
+ }));
14095
14097
  };
14096
14098
 
14097
14099
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -14105,13 +14107,13 @@ Expected function or array of functions, received type ${typeof value}.`
14105
14107
  enabledHydration = true;
14106
14108
  return renderer;
14107
14109
  }
14108
- const render = (...args) => {
14110
+ const render = ((...args) => {
14109
14111
  ensureRenderer().render(...args);
14110
- };
14111
- const hydrate = (...args) => {
14112
+ });
14113
+ const hydrate = ((...args) => {
14112
14114
  ensureHydrationRenderer().hydrate(...args);
14113
- };
14114
- const createApp = (...args) => {
14115
+ });
14116
+ const createApp = ((...args) => {
14115
14117
  const app = ensureRenderer().createApp(...args);
14116
14118
  {
14117
14119
  injectNativeTagCheck(app);
@@ -14148,8 +14150,8 @@ Expected function or array of functions, received type ${typeof value}.`
14148
14150
  return proxy;
14149
14151
  };
14150
14152
  return app;
14151
- };
14152
- const createSSRApp = (...args) => {
14153
+ });
14154
+ const createSSRApp = ((...args) => {
14153
14155
  const app = ensureHydrationRenderer().createApp(...args);
14154
14156
  {
14155
14157
  injectNativeTagCheck(app);
@@ -14163,7 +14165,7 @@ Expected function or array of functions, received type ${typeof value}.`
14163
14165
  }
14164
14166
  };
14165
14167
  return app;
14166
- };
14168
+ });
14167
14169
  function resolveRootNamespace(container) {
14168
14170
  if (container instanceof SVGElement) {
14169
14171
  return "svg";
@@ -14431,13 +14433,13 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14431
14433
  }
14432
14434
 
14433
14435
  const Vue = createCompatVue();
14434
- Vue.compile = () => {
14436
+ Vue.compile = (() => {
14435
14437
  {
14436
14438
  warn(
14437
14439
  `Runtime compilation is not supported in this build of Vue.` + (` Use "vue.global.js" instead.` )
14438
14440
  );
14439
14441
  }
14440
- };
14442
+ });
14441
14443
 
14442
14444
  return Vue;
14443
14445