@vue/compat 3.2.22 → 3.2.23

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.
package/dist/vue.cjs.js CHANGED
@@ -667,7 +667,7 @@ const targetMap = new WeakMap();
667
667
  let effectTrackDepth = 0;
668
668
  let trackOpBit = 1;
669
669
  /**
670
- * The bitwise track markers support at most 30 levels op recursion.
670
+ * The bitwise track markers support at most 30 levels of recursion.
671
671
  * This value is chosen to enable modern JS engines to use a SMI on all platforms.
672
672
  * When recursion depth is greater, fall back to using a full cleanup.
673
673
  */
@@ -988,7 +988,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
988
988
  function createSetter(shallow = false) {
989
989
  return function set(target, key, value, receiver) {
990
990
  let oldValue = target[key];
991
- if (!shallow) {
991
+ if (!shallow && !isReadonly(value)) {
992
992
  value = toRaw(value);
993
993
  oldValue = toRaw(oldValue);
994
994
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
@@ -3444,7 +3444,8 @@ const BaseTransitionImpl = {
3444
3444
  const rawProps = toRaw(props);
3445
3445
  const { mode } = rawProps;
3446
3446
  // check mode
3447
- if (mode && !['in-out', 'out-in', 'default'].includes(mode)) {
3447
+ if (mode &&
3448
+ mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
3448
3449
  warn$1(`invalid <transition> mode: ${mode}`);
3449
3450
  }
3450
3451
  // at this point children has a guaranteed length of 1.
@@ -4090,7 +4091,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
4090
4091
  }
4091
4092
  current = current.parent;
4092
4093
  }
4093
- hook();
4094
+ return hook();
4094
4095
  });
4095
4096
  injectHook(type, wrappedHook, target);
4096
4097
  // In addition to registering it on the target instance, we walk up the parent
@@ -5449,7 +5450,7 @@ function createCompatVue(createApp, createSingletonApp) {
5449
5450
  return vm;
5450
5451
  }
5451
5452
  }
5452
- Vue.version = "3.2.22";
5453
+ Vue.version = "3.2.23";
5453
5454
  Vue.config = singletonApp.config;
5454
5455
  Vue.use = (p, ...options) => {
5455
5456
  if (p && isFunction(p.install)) {
@@ -9348,23 +9349,23 @@ const PublicInstanceProxyHandlers = {
9348
9349
  const n = accessCache[key];
9349
9350
  if (n !== undefined) {
9350
9351
  switch (n) {
9351
- case 0 /* SETUP */:
9352
+ case 1 /* SETUP */:
9352
9353
  return setupState[key];
9353
- case 1 /* DATA */:
9354
+ case 2 /* DATA */:
9354
9355
  return data[key];
9355
- case 3 /* CONTEXT */:
9356
+ case 4 /* CONTEXT */:
9356
9357
  return ctx[key];
9357
- case 2 /* PROPS */:
9358
+ case 3 /* PROPS */:
9358
9359
  return props[key];
9359
9360
  // default: just fallthrough
9360
9361
  }
9361
9362
  }
9362
9363
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
9363
- accessCache[key] = 0 /* SETUP */;
9364
+ accessCache[key] = 1 /* SETUP */;
9364
9365
  return setupState[key];
9365
9366
  }
9366
9367
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
9367
- accessCache[key] = 1 /* DATA */;
9368
+ accessCache[key] = 2 /* DATA */;
9368
9369
  return data[key];
9369
9370
  }
9370
9371
  else if (
@@ -9372,15 +9373,15 @@ const PublicInstanceProxyHandlers = {
9372
9373
  // props
9373
9374
  (normalizedProps = instance.propsOptions[0]) &&
9374
9375
  hasOwn(normalizedProps, key)) {
9375
- accessCache[key] = 2 /* PROPS */;
9376
+ accessCache[key] = 3 /* PROPS */;
9376
9377
  return props[key];
9377
9378
  }
9378
9379
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
9379
- accessCache[key] = 3 /* CONTEXT */;
9380
+ accessCache[key] = 4 /* CONTEXT */;
9380
9381
  return ctx[key];
9381
9382
  }
9382
9383
  else if (shouldCacheAccess) {
9383
- accessCache[key] = 4 /* OTHER */;
9384
+ accessCache[key] = 0 /* OTHER */;
9384
9385
  }
9385
9386
  }
9386
9387
  const publicGetter = publicPropertiesMap[key];
@@ -9401,7 +9402,7 @@ const PublicInstanceProxyHandlers = {
9401
9402
  }
9402
9403
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
9403
9404
  // user may set custom properties to `this` that start with `$`
9404
- accessCache[key] = 3 /* CONTEXT */;
9405
+ accessCache[key] = 4 /* CONTEXT */;
9405
9406
  return ctx[key];
9406
9407
  }
9407
9408
  else if (
@@ -9469,7 +9470,7 @@ const PublicInstanceProxyHandlers = {
9469
9470
  },
9470
9471
  has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
9471
9472
  let normalizedProps;
9472
- return (accessCache[key] !== undefined ||
9473
+ return (!!accessCache[key] ||
9473
9474
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
9474
9475
  (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
9475
9476
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
@@ -11065,7 +11066,7 @@ function isMemoSame(cached, memo) {
11065
11066
  }
11066
11067
 
11067
11068
  // Core API ------------------------------------------------------------------
11068
- const version = "3.2.22";
11069
+ const version = "3.2.23";
11069
11070
  const _ssrUtils = {
11070
11071
  createComponentInstance,
11071
11072
  setupComponent,
@@ -11340,12 +11341,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11340
11341
  el[key] = value == null ? '' : value;
11341
11342
  return;
11342
11343
  }
11343
- if (key === 'value' && el.tagName !== 'PROGRESS') {
11344
+ if (key === 'value' &&
11345
+ el.tagName !== 'PROGRESS' &&
11346
+ // custom elements may use _value internally
11347
+ !el.tagName.includes('-')) {
11344
11348
  // store value as _value as well since
11345
11349
  // non-string values will be stringified.
11346
11350
  el._value = value;
11347
11351
  const newValue = value == null ? '' : value;
11348
- if (el.value !== newValue) {
11352
+ if (el.value !== newValue ||
11353
+ // #4956: always set for OPTION elements because its value falls back to
11354
+ // textContent if no value attribute is present. And setting .value for
11355
+ // OPTION has no side effect
11356
+ el.tagName === 'OPTION') {
11349
11357
  el.value = newValue;
11350
11358
  }
11351
11359
  if (value == null) {
@@ -582,7 +582,7 @@ const targetMap = new WeakMap();
582
582
  let effectTrackDepth = 0;
583
583
  let trackOpBit = 1;
584
584
  /**
585
- * The bitwise track markers support at most 30 levels op recursion.
585
+ * The bitwise track markers support at most 30 levels of recursion.
586
586
  * This value is chosen to enable modern JS engines to use a SMI on all platforms.
587
587
  * When recursion depth is greater, fall back to using a full cleanup.
588
588
  */
@@ -891,7 +891,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
891
891
  function createSetter(shallow = false) {
892
892
  return function set(target, key, value, receiver) {
893
893
  let oldValue = target[key];
894
- if (!shallow) {
894
+ if (!shallow && !isReadonly(value)) {
895
895
  value = toRaw(value);
896
896
  oldValue = toRaw(oldValue);
897
897
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
@@ -3207,7 +3207,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
3207
3207
  }
3208
3208
  current = current.parent;
3209
3209
  }
3210
- hook();
3210
+ return hook();
3211
3211
  });
3212
3212
  injectHook(type, wrappedHook, target);
3213
3213
  // In addition to registering it on the target instance, we walk up the parent
@@ -4269,7 +4269,7 @@ function createCompatVue(createApp, createSingletonApp) {
4269
4269
  return vm;
4270
4270
  }
4271
4271
  }
4272
- Vue.version = "3.2.22";
4272
+ Vue.version = "3.2.23";
4273
4273
  Vue.config = singletonApp.config;
4274
4274
  Vue.use = (p, ...options) => {
4275
4275
  if (p && isFunction(p.install)) {
@@ -7754,23 +7754,23 @@ const PublicInstanceProxyHandlers = {
7754
7754
  const n = accessCache[key];
7755
7755
  if (n !== undefined) {
7756
7756
  switch (n) {
7757
- case 0 /* SETUP */:
7757
+ case 1 /* SETUP */:
7758
7758
  return setupState[key];
7759
- case 1 /* DATA */:
7759
+ case 2 /* DATA */:
7760
7760
  return data[key];
7761
- case 3 /* CONTEXT */:
7761
+ case 4 /* CONTEXT */:
7762
7762
  return ctx[key];
7763
- case 2 /* PROPS */:
7763
+ case 3 /* PROPS */:
7764
7764
  return props[key];
7765
7765
  // default: just fallthrough
7766
7766
  }
7767
7767
  }
7768
7768
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
7769
- accessCache[key] = 0 /* SETUP */;
7769
+ accessCache[key] = 1 /* SETUP */;
7770
7770
  return setupState[key];
7771
7771
  }
7772
7772
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
7773
- accessCache[key] = 1 /* DATA */;
7773
+ accessCache[key] = 2 /* DATA */;
7774
7774
  return data[key];
7775
7775
  }
7776
7776
  else if (
@@ -7778,15 +7778,15 @@ const PublicInstanceProxyHandlers = {
7778
7778
  // props
7779
7779
  (normalizedProps = instance.propsOptions[0]) &&
7780
7780
  hasOwn(normalizedProps, key)) {
7781
- accessCache[key] = 2 /* PROPS */;
7781
+ accessCache[key] = 3 /* PROPS */;
7782
7782
  return props[key];
7783
7783
  }
7784
7784
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
7785
- accessCache[key] = 3 /* CONTEXT */;
7785
+ accessCache[key] = 4 /* CONTEXT */;
7786
7786
  return ctx[key];
7787
7787
  }
7788
7788
  else if (shouldCacheAccess) {
7789
- accessCache[key] = 4 /* OTHER */;
7789
+ accessCache[key] = 0 /* OTHER */;
7790
7790
  }
7791
7791
  }
7792
7792
  const publicGetter = publicPropertiesMap[key];
@@ -7806,7 +7806,7 @@ const PublicInstanceProxyHandlers = {
7806
7806
  }
7807
7807
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
7808
7808
  // user may set custom properties to `this` that start with `$`
7809
- accessCache[key] = 3 /* CONTEXT */;
7809
+ accessCache[key] = 4 /* CONTEXT */;
7810
7810
  return ctx[key];
7811
7811
  }
7812
7812
  else if (
@@ -7849,7 +7849,7 @@ const PublicInstanceProxyHandlers = {
7849
7849
  },
7850
7850
  has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
7851
7851
  let normalizedProps;
7852
- return (accessCache[key] !== undefined ||
7852
+ return (!!accessCache[key] ||
7853
7853
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
7854
7854
  (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
7855
7855
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
@@ -8964,7 +8964,7 @@ function isMemoSame(cached, memo) {
8964
8964
  }
8965
8965
 
8966
8966
  // Core API ------------------------------------------------------------------
8967
- const version = "3.2.22";
8967
+ const version = "3.2.23";
8968
8968
  const _ssrUtils = {
8969
8969
  createComponentInstance,
8970
8970
  setupComponent,
@@ -9239,12 +9239,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
9239
9239
  el[key] = value == null ? '' : value;
9240
9240
  return;
9241
9241
  }
9242
- if (key === 'value' && el.tagName !== 'PROGRESS') {
9242
+ if (key === 'value' &&
9243
+ el.tagName !== 'PROGRESS' &&
9244
+ // custom elements may use _value internally
9245
+ !el.tagName.includes('-')) {
9243
9246
  // store value as _value as well since
9244
9247
  // non-string values will be stringified.
9245
9248
  el._value = value;
9246
9249
  const newValue = value == null ? '' : value;
9247
- if (el.value !== newValue) {
9250
+ if (el.value !== newValue ||
9251
+ // #4956: always set for OPTION elements because its value falls back to
9252
+ // textContent if no value attribute is present. And setting .value for
9253
+ // OPTION has no side effect
9254
+ el.tagName === 'OPTION') {
9248
9255
  el.value = newValue;
9249
9256
  }
9250
9257
  if (value == null) {
@@ -530,7 +530,7 @@ const targetMap = new WeakMap();
530
530
  let effectTrackDepth = 0;
531
531
  let trackOpBit = 1;
532
532
  /**
533
- * The bitwise track markers support at most 30 levels op recursion.
533
+ * The bitwise track markers support at most 30 levels of recursion.
534
534
  * This value is chosen to enable modern JS engines to use a SMI on all platforms.
535
535
  * When recursion depth is greater, fall back to using a full cleanup.
536
536
  */
@@ -851,7 +851,7 @@ const shallowSet = /*#__PURE__*/ createSetter(true);
851
851
  function createSetter(shallow = false) {
852
852
  return function set(target, key, value, receiver) {
853
853
  let oldValue = target[key];
854
- if (!shallow) {
854
+ if (!shallow && !isReadonly(value)) {
855
855
  value = toRaw(value);
856
856
  oldValue = toRaw(oldValue);
857
857
  if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
@@ -3307,7 +3307,8 @@ const BaseTransitionImpl = {
3307
3307
  const rawProps = toRaw(props);
3308
3308
  const { mode } = rawProps;
3309
3309
  // check mode
3310
- if (mode && !['in-out', 'out-in', 'default'].includes(mode)) {
3310
+ if (mode &&
3311
+ mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
3311
3312
  warn$1(`invalid <transition> mode: ${mode}`);
3312
3313
  }
3313
3314
  // at this point children has a guaranteed length of 1.
@@ -3953,7 +3954,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
3953
3954
  }
3954
3955
  current = current.parent;
3955
3956
  }
3956
- hook();
3957
+ return hook();
3957
3958
  });
3958
3959
  injectHook(type, wrappedHook, target);
3959
3960
  // In addition to registering it on the target instance, we walk up the parent
@@ -5312,7 +5313,7 @@ function createCompatVue(createApp, createSingletonApp) {
5312
5313
  return vm;
5313
5314
  }
5314
5315
  }
5315
- Vue.version = "3.2.22";
5316
+ Vue.version = "3.2.23";
5316
5317
  Vue.config = singletonApp.config;
5317
5318
  Vue.use = (p, ...options) => {
5318
5319
  if (p && isFunction(p.install)) {
@@ -9211,23 +9212,23 @@ const PublicInstanceProxyHandlers = {
9211
9212
  const n = accessCache[key];
9212
9213
  if (n !== undefined) {
9213
9214
  switch (n) {
9214
- case 0 /* SETUP */:
9215
+ case 1 /* SETUP */:
9215
9216
  return setupState[key];
9216
- case 1 /* DATA */:
9217
+ case 2 /* DATA */:
9217
9218
  return data[key];
9218
- case 3 /* CONTEXT */:
9219
+ case 4 /* CONTEXT */:
9219
9220
  return ctx[key];
9220
- case 2 /* PROPS */:
9221
+ case 3 /* PROPS */:
9221
9222
  return props[key];
9222
9223
  // default: just fallthrough
9223
9224
  }
9224
9225
  }
9225
9226
  else if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
9226
- accessCache[key] = 0 /* SETUP */;
9227
+ accessCache[key] = 1 /* SETUP */;
9227
9228
  return setupState[key];
9228
9229
  }
9229
9230
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
9230
- accessCache[key] = 1 /* DATA */;
9231
+ accessCache[key] = 2 /* DATA */;
9231
9232
  return data[key];
9232
9233
  }
9233
9234
  else if (
@@ -9235,15 +9236,15 @@ const PublicInstanceProxyHandlers = {
9235
9236
  // props
9236
9237
  (normalizedProps = instance.propsOptions[0]) &&
9237
9238
  hasOwn(normalizedProps, key)) {
9238
- accessCache[key] = 2 /* PROPS */;
9239
+ accessCache[key] = 3 /* PROPS */;
9239
9240
  return props[key];
9240
9241
  }
9241
9242
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
9242
- accessCache[key] = 3 /* CONTEXT */;
9243
+ accessCache[key] = 4 /* CONTEXT */;
9243
9244
  return ctx[key];
9244
9245
  }
9245
9246
  else if (shouldCacheAccess) {
9246
- accessCache[key] = 4 /* OTHER */;
9247
+ accessCache[key] = 0 /* OTHER */;
9247
9248
  }
9248
9249
  }
9249
9250
  const publicGetter = publicPropertiesMap[key];
@@ -9264,7 +9265,7 @@ const PublicInstanceProxyHandlers = {
9264
9265
  }
9265
9266
  else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
9266
9267
  // user may set custom properties to `this` that start with `$`
9267
- accessCache[key] = 3 /* CONTEXT */;
9268
+ accessCache[key] = 4 /* CONTEXT */;
9268
9269
  return ctx[key];
9269
9270
  }
9270
9271
  else if (
@@ -9332,7 +9333,7 @@ const PublicInstanceProxyHandlers = {
9332
9333
  },
9333
9334
  has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
9334
9335
  let normalizedProps;
9335
- return (accessCache[key] !== undefined ||
9336
+ return (!!accessCache[key] ||
9336
9337
  (data !== EMPTY_OBJ && hasOwn(data, key)) ||
9337
9338
  (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
9338
9339
  ((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
@@ -10907,7 +10908,7 @@ function isMemoSame(cached, memo) {
10907
10908
  }
10908
10909
 
10909
10910
  // Core API ------------------------------------------------------------------
10910
- const version = "3.2.22";
10911
+ const version = "3.2.23";
10911
10912
  /**
10912
10913
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10913
10914
  * @internal
@@ -11174,12 +11175,19 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
11174
11175
  el[key] = value == null ? '' : value;
11175
11176
  return;
11176
11177
  }
11177
- if (key === 'value' && el.tagName !== 'PROGRESS') {
11178
+ if (key === 'value' &&
11179
+ el.tagName !== 'PROGRESS' &&
11180
+ // custom elements may use _value internally
11181
+ !el.tagName.includes('-')) {
11178
11182
  // store value as _value as well since
11179
11183
  // non-string values will be stringified.
11180
11184
  el._value = value;
11181
11185
  const newValue = value == null ? '' : value;
11182
- if (el.value !== newValue) {
11186
+ if (el.value !== newValue ||
11187
+ // #4956: always set for OPTION elements because its value falls back to
11188
+ // textContent if no value attribute is present. And setting .value for
11189
+ // OPTION has no side effect
11190
+ el.tagName === 'OPTION') {
11183
11191
  el.value = newValue;
11184
11192
  }
11185
11193
  if (value == null) {