@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
  **/
@@ -56,10 +56,10 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
56
56
  );
57
57
  const cacheStringFunction = (fn) => {
58
58
  const cache = /* @__PURE__ */ Object.create(null);
59
- return (str) => {
59
+ return ((str) => {
60
60
  const hit = cache[str];
61
61
  return hit || (cache[str] = fn(str));
62
- };
62
+ });
63
63
  };
64
64
  const camelizeRE = /-(\w)/g;
65
65
  const camelize = cacheStringFunction(
@@ -1296,7 +1296,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1296
1296
  }
1297
1297
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
1298
1298
  if (isOldValueReadonly) {
1299
- return false;
1299
+ if (!!(process.env.NODE_ENV !== "production")) {
1300
+ warn$2(
1301
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
1302
+ target[key]
1303
+ );
1304
+ }
1305
+ return true;
1300
1306
  } else {
1301
1307
  oldValue.value = value;
1302
1308
  return true;
@@ -2674,7 +2680,9 @@ function rerender(id, newRender) {
2674
2680
  }
2675
2681
  instance.renderCache = [];
2676
2682
  isHmrUpdating = true;
2677
- instance.update();
2683
+ if (!(instance.job.flags & 8)) {
2684
+ instance.update();
2685
+ }
2678
2686
  isHmrUpdating = false;
2679
2687
  });
2680
2688
  }
@@ -4270,7 +4278,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4270
4278
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
4271
4279
  const setupState = owner.setupState;
4272
4280
  const rawSetupState = toRaw(setupState);
4273
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
4281
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
4274
4282
  if (!!(process.env.NODE_ENV !== "production")) {
4275
4283
  if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
4276
4284
  warn$1(
@@ -4283,6 +4291,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4283
4291
  }
4284
4292
  return hasOwn(rawSetupState, key);
4285
4293
  };
4294
+ const canSetRef = (ref2) => {
4295
+ return !!!(process.env.NODE_ENV !== "production") || !knownTemplateRefs.has(ref2);
4296
+ };
4286
4297
  if (oldRef != null && oldRef !== ref) {
4287
4298
  if (isString(oldRef)) {
4288
4299
  refs[oldRef] = null;
@@ -4290,7 +4301,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4290
4301
  setupState[oldRef] = null;
4291
4302
  }
4292
4303
  } else if (isRef(oldRef)) {
4293
- oldRef.value = null;
4304
+ if (canSetRef(oldRef)) {
4305
+ oldRef.value = null;
4306
+ }
4307
+ const oldRawRefAtom = oldRawRef;
4308
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
4294
4309
  }
4295
4310
  }
4296
4311
  if (isFunction(ref)) {
@@ -4301,7 +4316,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4301
4316
  if (_isString || _isRef) {
4302
4317
  const doSet = () => {
4303
4318
  if (rawRef.f) {
4304
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
4319
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
4305
4320
  if (isUnmount) {
4306
4321
  isArray(existing) && remove(existing, refValue);
4307
4322
  } else {
@@ -4312,8 +4327,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4312
4327
  setupState[ref] = refs[ref];
4313
4328
  }
4314
4329
  } else {
4315
- ref.value = [refValue];
4316
- if (rawRef.k) refs[rawRef.k] = ref.value;
4330
+ const newVal = [refValue];
4331
+ if (canSetRef(ref)) {
4332
+ ref.value = newVal;
4333
+ }
4334
+ if (rawRef.k) refs[rawRef.k] = newVal;
4317
4335
  }
4318
4336
  } else if (!existing.includes(refValue)) {
4319
4337
  existing.push(refValue);
@@ -4325,7 +4343,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4325
4343
  setupState[ref] = value;
4326
4344
  }
4327
4345
  } else if (_isRef) {
4328
- ref.value = value;
4346
+ if (canSetRef(ref)) {
4347
+ ref.value = value;
4348
+ }
4329
4349
  if (rawRef.k) refs[rawRef.k] = value;
4330
4350
  } else if (!!(process.env.NODE_ENV !== "production")) {
4331
4351
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6434,10 +6454,10 @@ const PublicInstanceProxyHandlers = {
6434
6454
  return true;
6435
6455
  },
6436
6456
  has({
6437
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
6457
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
6438
6458
  }, key) {
6439
- let normalizedProps;
6440
- 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);
6459
+ let normalizedProps, cssModules;
6460
+ 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]);
6441
6461
  },
6442
6462
  defineProperty(target, key, descriptor) {
6443
6463
  if (descriptor.get != null) {
@@ -7184,7 +7204,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7184
7204
  return vm;
7185
7205
  }
7186
7206
  }
7187
- Vue.version = `2.6.14-compat:${"3.5.18"}`;
7207
+ Vue.version = `2.6.14-compat:${"3.5.19"}`;
7188
7208
  Vue.config = singletonApp.config;
7189
7209
  Vue.use = (plugin, ...options) => {
7190
7210
  if (plugin && isFunction(plugin.install)) {
@@ -7198,22 +7218,22 @@ function createCompatVue$1(createApp, createSingletonApp) {
7198
7218
  singletonApp.mixin(m);
7199
7219
  return Vue;
7200
7220
  };
7201
- Vue.component = (name, comp) => {
7221
+ Vue.component = ((name, comp) => {
7202
7222
  if (comp) {
7203
7223
  singletonApp.component(name, comp);
7204
7224
  return Vue;
7205
7225
  } else {
7206
7226
  return singletonApp.component(name);
7207
7227
  }
7208
- };
7209
- Vue.directive = (name, dir) => {
7228
+ });
7229
+ Vue.directive = ((name, dir) => {
7210
7230
  if (dir) {
7211
7231
  singletonApp.directive(name, dir);
7212
7232
  return Vue;
7213
7233
  } else {
7214
7234
  return singletonApp.directive(name);
7215
7235
  }
7216
- };
7236
+ });
7217
7237
  Vue.options = { _base: Vue };
7218
7238
  let cid = 1;
7219
7239
  Vue.cid = cid;
@@ -7276,14 +7296,14 @@ function createCompatVue$1(createApp, createSingletonApp) {
7276
7296
  assertCompatEnabled("GLOBAL_OBSERVABLE", null);
7277
7297
  return reactive(target);
7278
7298
  };
7279
- Vue.filter = (name, filter) => {
7299
+ Vue.filter = ((name, filter) => {
7280
7300
  if (filter) {
7281
7301
  singletonApp.filter(name, filter);
7282
7302
  return Vue;
7283
7303
  } else {
7284
7304
  return singletonApp.filter(name);
7285
7305
  }
7286
- };
7306
+ });
7287
7307
  const util = {
7288
7308
  warn: !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP,
7289
7309
  extend,
@@ -8279,7 +8299,7 @@ function isBoolean(...args) {
8279
8299
  return args.some((elem) => elem.toLowerCase() === "boolean");
8280
8300
  }
8281
8301
 
8282
- const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
8302
+ const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
8283
8303
  const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
8284
8304
  const normalizeSlot = (key, rawSlot, ctx) => {
8285
8305
  if (rawSlot._n) {
@@ -8333,8 +8353,6 @@ const assignSlots = (slots, children, optimized) => {
8333
8353
  const initSlots = (instance, children, optimized) => {
8334
8354
  const slots = instance.slots = createInternalObject();
8335
8355
  if (instance.vnode.shapeFlag & 32) {
8336
- const cacheIndexes = children.__;
8337
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
8338
8356
  const type = children._;
8339
8357
  if (type) {
8340
8358
  assignSlots(slots, children, optimized);
@@ -8395,12 +8413,10 @@ function endMeasure(instance, type) {
8395
8413
  if (instance.appContext.config.performance && isSupported()) {
8396
8414
  const startTag = `vue-${type}-${instance.uid}`;
8397
8415
  const endTag = startTag + `:end`;
8416
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
8398
8417
  perf.mark(endTag);
8399
- perf.measure(
8400
- `<${formatComponentName(instance, instance.type)}> ${type}`,
8401
- startTag,
8402
- endTag
8403
- );
8418
+ perf.measure(measureName, startTag, endTag);
8419
+ perf.clearMeasures(measureName);
8404
8420
  perf.clearMarks(startTag);
8405
8421
  perf.clearMarks(endTag);
8406
8422
  }
@@ -9655,6 +9671,12 @@ function baseCreateRenderer(options, createHydrationFns) {
9655
9671
  }
9656
9672
  };
9657
9673
  const performLeave = () => {
9674
+ if (el._isLeaving) {
9675
+ el[leaveCbKey](
9676
+ true
9677
+ /* cancelled */
9678
+ );
9679
+ }
9658
9680
  leave(el, () => {
9659
9681
  remove2();
9660
9682
  afterLeave && afterLeave();
@@ -9800,27 +9822,12 @@ function baseCreateRenderer(options, createHydrationFns) {
9800
9822
  if (!!(process.env.NODE_ENV !== "production") && instance.type.__hmrId) {
9801
9823
  unregisterHMR(instance);
9802
9824
  }
9803
- const {
9804
- bum,
9805
- scope,
9806
- job,
9807
- subTree,
9808
- um,
9809
- m,
9810
- a,
9811
- parent,
9812
- slots: { __: slotCacheKeys }
9813
- } = instance;
9825
+ const { bum, scope, job, subTree, um, m, a } = instance;
9814
9826
  invalidateMount(m);
9815
9827
  invalidateMount(a);
9816
9828
  if (bum) {
9817
9829
  invokeArrayFns(bum);
9818
9830
  }
9819
- if (parent && isArray(slotCacheKeys)) {
9820
- slotCacheKeys.forEach((v) => {
9821
- parent.renderCache[v] = void 0;
9822
- });
9823
- }
9824
9831
  if (isCompatEnabled("INSTANCE_EVENT_HOOKS", instance)) {
9825
9832
  instance.emit("hook:beforeDestroy");
9826
9833
  }
@@ -9841,12 +9848,6 @@ function baseCreateRenderer(options, createHydrationFns) {
9841
9848
  queuePostRenderEffect(() => {
9842
9849
  instance.isUnmounted = true;
9843
9850
  }, parentSuspense);
9844
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
9845
- parentSuspense.deps--;
9846
- if (parentSuspense.deps === 0) {
9847
- parentSuspense.resolve();
9848
- }
9849
- }
9850
9851
  if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
9851
9852
  devtoolsComponentRemoved(instance);
9852
9853
  }
@@ -9947,7 +9948,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
9947
9948
  if (!shallow && c2.patchFlag !== -2)
9948
9949
  traverseStaticChildren(c1, c2);
9949
9950
  }
9950
- if (c2.type === Text) {
9951
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
9952
+ c2.patchFlag !== -1) {
9951
9953
  c2.el = c1.el;
9952
9954
  }
9953
9955
  if (c2.type === Comment && !c2.el) {
@@ -12406,7 +12408,7 @@ function isMemoSame(cached, memo) {
12406
12408
  return true;
12407
12409
  }
12408
12410
 
12409
- const version = "3.5.18";
12411
+ const version = "3.5.19";
12410
12412
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12411
12413
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12412
12414
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -12883,7 +12885,7 @@ const vShow = {
12883
12885
  setDisplay(el, value);
12884
12886
  }
12885
12887
  };
12886
- if (!!(process.env.NODE_ENV !== "production")) {
12888
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
12887
12889
  vShow.name = "show";
12888
12890
  }
12889
12891
  function setDisplay(el, value) {
@@ -13351,10 +13353,10 @@ function defineCustomElement(options, extraOptions, _createApp) {
13351
13353
  VueCustomElement.def = Comp;
13352
13354
  return VueCustomElement;
13353
13355
  }
13354
- /*! #__NO_SIDE_EFFECTS__ */
13355
- const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13356
+
13357
+ const defineSSRCustomElement = (/* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
13356
13358
  return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
13357
- };
13359
+ });
13358
13360
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
13359
13361
  };
13360
13362
  class VueElement extends BaseClass {
@@ -14224,13 +14226,13 @@ const modifierGuards = {
14224
14226
  const withModifiers = (fn, modifiers) => {
14225
14227
  const cache = fn._withMods || (fn._withMods = {});
14226
14228
  const cacheKey = modifiers.join(".");
14227
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
14229
+ return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
14228
14230
  for (let i = 0; i < modifiers.length; i++) {
14229
14231
  const guard = modifierGuards[modifiers[i]];
14230
14232
  if (guard && guard(event, modifiers)) return;
14231
14233
  }
14232
14234
  return fn(event, ...args);
14233
- });
14235
+ }));
14234
14236
  };
14235
14237
  const keyNames = {
14236
14238
  esc: "escape",
@@ -14260,7 +14262,7 @@ const withKeys = (fn, modifiers) => {
14260
14262
  }
14261
14263
  const cache = fn._withKeys || (fn._withKeys = {});
14262
14264
  const cacheKey = modifiers.join(".");
14263
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
14265
+ return cache[cacheKey] || (cache[cacheKey] = ((event) => {
14264
14266
  if (!("key" in event)) {
14265
14267
  return;
14266
14268
  }
@@ -14290,7 +14292,7 @@ const withKeys = (fn, modifiers) => {
14290
14292
  }
14291
14293
  }
14292
14294
  }
14293
- });
14295
+ }));
14294
14296
  };
14295
14297
 
14296
14298
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -14304,13 +14306,13 @@ function ensureHydrationRenderer() {
14304
14306
  enabledHydration = true;
14305
14307
  return renderer;
14306
14308
  }
14307
- const render = (...args) => {
14309
+ const render = ((...args) => {
14308
14310
  ensureRenderer().render(...args);
14309
- };
14310
- const hydrate = (...args) => {
14311
+ });
14312
+ const hydrate = ((...args) => {
14311
14313
  ensureHydrationRenderer().hydrate(...args);
14312
- };
14313
- const createApp = (...args) => {
14314
+ });
14315
+ const createApp = ((...args) => {
14314
14316
  const app = ensureRenderer().createApp(...args);
14315
14317
  if (!!(process.env.NODE_ENV !== "production")) {
14316
14318
  injectNativeTagCheck(app);
@@ -14347,8 +14349,8 @@ const createApp = (...args) => {
14347
14349
  return proxy;
14348
14350
  };
14349
14351
  return app;
14350
- };
14351
- const createSSRApp = (...args) => {
14352
+ });
14353
+ const createSSRApp = ((...args) => {
14352
14354
  const app = ensureHydrationRenderer().createApp(...args);
14353
14355
  if (!!(process.env.NODE_ENV !== "production")) {
14354
14356
  injectNativeTagCheck(app);
@@ -14362,7 +14364,7 @@ const createSSRApp = (...args) => {
14362
14364
  }
14363
14365
  };
14364
14366
  return app;
14365
- };
14367
+ });
14366
14368
  function resolveRootNamespace(container) {
14367
14369
  if (container instanceof SVGElement) {
14368
14370
  return "svg";
@@ -14631,13 +14633,13 @@ function createCompatVue() {
14631
14633
  }
14632
14634
 
14633
14635
  const Vue = createCompatVue();
14634
- Vue.compile = () => {
14636
+ Vue.compile = (() => {
14635
14637
  if (!!(process.env.NODE_ENV !== "production")) {
14636
14638
  warn(
14637
14639
  `Runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias "vue" to "@vue/compat/dist/vue.esm-bundler.js".` )
14638
14640
  );
14639
14641
  }
14640
- };
14642
+ });
14641
14643
 
14642
14644
  const configureCompat = Vue.configureCompat;
14643
14645