@vue/compat 3.4.3 → 3.4.4

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.
@@ -3464,7 +3464,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3464
3464
  hiddenContainer,
3465
3465
  anchor,
3466
3466
  deps: 0,
3467
- pendingId: 0,
3467
+ pendingId: suspenseId++,
3468
3468
  timeout: typeof timeout === "number" ? timeout : -1,
3469
3469
  activeBranch: null,
3470
3470
  pendingBranch: null,
@@ -3841,7 +3841,6 @@ function doWatch(source, cb, {
3841
3841
  onTrack,
3842
3842
  onTrigger
3843
3843
  } = EMPTY_OBJ) {
3844
- var _a;
3845
3844
  if (cb && once) {
3846
3845
  const _cb = cb;
3847
3846
  cb = (...args) => {
@@ -3849,6 +3848,11 @@ function doWatch(source, cb, {
3849
3848
  unwatch();
3850
3849
  };
3851
3850
  }
3851
+ if (!!(process.env.NODE_ENV !== "production") && deep !== void 0 && typeof deep === "number") {
3852
+ warn$1(
3853
+ `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3854
+ );
3855
+ }
3852
3856
  if (!!(process.env.NODE_ENV !== "production") && !cb) {
3853
3857
  if (immediate !== void 0) {
3854
3858
  warn$1(
@@ -3873,7 +3877,11 @@ function doWatch(source, cb, {
3873
3877
  `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3874
3878
  );
3875
3879
  };
3876
- const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
3880
+ const instance = currentInstance;
3881
+ const reactiveGetter = (source2) => deep === true ? source2 : (
3882
+ // for deep: false, only traverse root-level properties
3883
+ traverse(source2, deep === false ? 1 : void 0)
3884
+ );
3877
3885
  let getter;
3878
3886
  let forceTrigger = false;
3879
3887
  let isMultiSource = false;
@@ -3881,7 +3889,7 @@ function doWatch(source, cb, {
3881
3889
  getter = () => source.value;
3882
3890
  forceTrigger = isShallow(source);
3883
3891
  } else if (isReactive(source)) {
3884
- getter = isShallow(source) || deep === false ? () => traverse(source, 1) : () => traverse(source);
3892
+ getter = () => reactiveGetter(source);
3885
3893
  forceTrigger = true;
3886
3894
  } else if (isArray(source)) {
3887
3895
  isMultiSource = true;
@@ -3890,7 +3898,7 @@ function doWatch(source, cb, {
3890
3898
  if (isRef(s)) {
3891
3899
  return s.value;
3892
3900
  } else if (isReactive(s)) {
3893
- return traverse(s, isShallow(s) || deep === false ? 1 : void 0);
3901
+ return reactiveGetter(s);
3894
3902
  } else if (isFunction(s)) {
3895
3903
  return callWithErrorHandling(s, instance, 2);
3896
3904
  } else {
@@ -3902,9 +3910,6 @@ function doWatch(source, cb, {
3902
3910
  getter = () => callWithErrorHandling(source, instance, 2);
3903
3911
  } else {
3904
3912
  getter = () => {
3905
- if (instance && instance.isUnmounted) {
3906
- return;
3907
- }
3908
3913
  if (cleanup) {
3909
3914
  cleanup();
3910
3915
  }
@@ -5877,6 +5882,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5877
5882
  return ref();
5878
5883
  }
5879
5884
  const camelizedName = camelize(name);
5885
+ const hyphenatedName = hyphenate(name);
5880
5886
  const res = customRef((track, trigger) => {
5881
5887
  let localValue;
5882
5888
  watchSyncEffect(() => {
@@ -5894,7 +5900,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5894
5900
  set(value) {
5895
5901
  const rawProps = i.vnode.props;
5896
5902
  if (!(rawProps && // check if parent has passed v-model
5897
- (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
5903
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5898
5904
  localValue = value;
5899
5905
  trigger();
5900
5906
  }
@@ -6490,7 +6496,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6490
6496
  return vm;
6491
6497
  }
6492
6498
  }
6493
- Vue.version = `2.6.14-compat:${"3.4.3"}`;
6499
+ Vue.version = `2.6.14-compat:${"3.4.4"}`;
6494
6500
  Vue.config = singletonApp.config;
6495
6501
  Vue.use = (p, ...options) => {
6496
6502
  if (p && isFunction(p.install)) {
@@ -11277,7 +11283,7 @@ function isMemoSame(cached, memo) {
11277
11283
  return true;
11278
11284
  }
11279
11285
 
11280
- const version = "3.4.3";
11286
+ const version = "3.4.4";
11281
11287
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11282
11288
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11283
11289
  const devtools = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? devtools$1 : void 0;
@@ -3460,7 +3460,7 @@ If this is a native custom element, make sure to exclude it from component resol
3460
3460
  hiddenContainer,
3461
3461
  anchor,
3462
3462
  deps: 0,
3463
- pendingId: 0,
3463
+ pendingId: suspenseId++,
3464
3464
  timeout: typeof timeout === "number" ? timeout : -1,
3465
3465
  activeBranch: null,
3466
3466
  pendingBranch: null,
@@ -3831,7 +3831,6 @@ If this is a native custom element, make sure to exclude it from component resol
3831
3831
  onTrack,
3832
3832
  onTrigger
3833
3833
  } = EMPTY_OBJ) {
3834
- var _a;
3835
3834
  if (cb && once) {
3836
3835
  const _cb = cb;
3837
3836
  cb = (...args) => {
@@ -3839,6 +3838,11 @@ If this is a native custom element, make sure to exclude it from component resol
3839
3838
  unwatch();
3840
3839
  };
3841
3840
  }
3841
+ if (deep !== void 0 && typeof deep === "number") {
3842
+ warn$1(
3843
+ `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3844
+ );
3845
+ }
3842
3846
  if (!cb) {
3843
3847
  if (immediate !== void 0) {
3844
3848
  warn$1(
@@ -3863,7 +3867,11 @@ If this is a native custom element, make sure to exclude it from component resol
3863
3867
  `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3864
3868
  );
3865
3869
  };
3866
- const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
3870
+ const instance = currentInstance;
3871
+ const reactiveGetter = (source2) => deep === true ? source2 : (
3872
+ // for deep: false, only traverse root-level properties
3873
+ traverse(source2, deep === false ? 1 : void 0)
3874
+ );
3867
3875
  let getter;
3868
3876
  let forceTrigger = false;
3869
3877
  let isMultiSource = false;
@@ -3871,7 +3879,7 @@ If this is a native custom element, make sure to exclude it from component resol
3871
3879
  getter = () => source.value;
3872
3880
  forceTrigger = isShallow(source);
3873
3881
  } else if (isReactive(source)) {
3874
- getter = isShallow(source) || deep === false ? () => traverse(source, 1) : () => traverse(source);
3882
+ getter = () => reactiveGetter(source);
3875
3883
  forceTrigger = true;
3876
3884
  } else if (isArray(source)) {
3877
3885
  isMultiSource = true;
@@ -3880,7 +3888,7 @@ If this is a native custom element, make sure to exclude it from component resol
3880
3888
  if (isRef(s)) {
3881
3889
  return s.value;
3882
3890
  } else if (isReactive(s)) {
3883
- return traverse(s, isShallow(s) || deep === false ? 1 : void 0);
3891
+ return reactiveGetter(s);
3884
3892
  } else if (isFunction(s)) {
3885
3893
  return callWithErrorHandling(s, instance, 2);
3886
3894
  } else {
@@ -3892,9 +3900,6 @@ If this is a native custom element, make sure to exclude it from component resol
3892
3900
  getter = () => callWithErrorHandling(source, instance, 2);
3893
3901
  } else {
3894
3902
  getter = () => {
3895
- if (instance && instance.isUnmounted) {
3896
- return;
3897
- }
3898
3903
  if (cleanup) {
3899
3904
  cleanup();
3900
3905
  }
@@ -5838,6 +5843,7 @@ If this is a native custom element, make sure to exclude it from component resol
5838
5843
  return ref();
5839
5844
  }
5840
5845
  const camelizedName = camelize(name);
5846
+ const hyphenatedName = hyphenate(name);
5841
5847
  const res = customRef((track, trigger) => {
5842
5848
  let localValue;
5843
5849
  watchSyncEffect(() => {
@@ -5855,7 +5861,7 @@ If this is a native custom element, make sure to exclude it from component resol
5855
5861
  set(value) {
5856
5862
  const rawProps = i.vnode.props;
5857
5863
  if (!(rawProps && // check if parent has passed v-model
5858
- (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
5864
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5859
5865
  localValue = value;
5860
5866
  trigger();
5861
5867
  }
@@ -6449,7 +6455,7 @@ If this is a native custom element, make sure to exclude it from component resol
6449
6455
  return vm;
6450
6456
  }
6451
6457
  }
6452
- Vue.version = `2.6.14-compat:${"3.4.3"}`;
6458
+ Vue.version = `2.6.14-compat:${"3.4.4"}`;
6453
6459
  Vue.config = singletonApp.config;
6454
6460
  Vue.use = (p, ...options) => {
6455
6461
  if (p && isFunction(p.install)) {
@@ -11152,7 +11158,7 @@ Component that was made reactive: `,
11152
11158
  return true;
11153
11159
  }
11154
11160
 
11155
- const version = "3.4.3";
11161
+ const version = "3.4.4";
11156
11162
  const warn = warn$1 ;
11157
11163
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11158
11164
  const devtools = devtools$1 ;