@vue/compat 3.4.3 → 3.4.5

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.
@@ -3457,7 +3457,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3457
3457
  hiddenContainer,
3458
3458
  anchor,
3459
3459
  deps: 0,
3460
- pendingId: 0,
3460
+ pendingId: suspenseId++,
3461
3461
  timeout: typeof timeout === "number" ? timeout : -1,
3462
3462
  activeBranch: null,
3463
3463
  pendingBranch: null,
@@ -3834,7 +3834,6 @@ function doWatch(source, cb, {
3834
3834
  onTrack,
3835
3835
  onTrigger
3836
3836
  } = EMPTY_OBJ) {
3837
- var _a;
3838
3837
  if (cb && once) {
3839
3838
  const _cb = cb;
3840
3839
  cb = (...args) => {
@@ -3842,6 +3841,11 @@ function doWatch(source, cb, {
3842
3841
  unwatch();
3843
3842
  };
3844
3843
  }
3844
+ if (deep !== void 0 && typeof deep === "number") {
3845
+ warn$1(
3846
+ `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3847
+ );
3848
+ }
3845
3849
  if (!cb) {
3846
3850
  if (immediate !== void 0) {
3847
3851
  warn$1(
@@ -3866,7 +3870,11 @@ function doWatch(source, cb, {
3866
3870
  `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3867
3871
  );
3868
3872
  };
3869
- const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
3873
+ const instance = currentInstance;
3874
+ const reactiveGetter = (source2) => deep === true ? source2 : (
3875
+ // for deep: false, only traverse root-level properties
3876
+ traverse(source2, deep === false ? 1 : void 0)
3877
+ );
3870
3878
  let getter;
3871
3879
  let forceTrigger = false;
3872
3880
  let isMultiSource = false;
@@ -3874,7 +3882,7 @@ function doWatch(source, cb, {
3874
3882
  getter = () => source.value;
3875
3883
  forceTrigger = isShallow(source);
3876
3884
  } else if (isReactive(source)) {
3877
- getter = isShallow(source) || deep === false ? () => traverse(source, 1) : () => traverse(source);
3885
+ getter = () => reactiveGetter(source);
3878
3886
  forceTrigger = true;
3879
3887
  } else if (isArray(source)) {
3880
3888
  isMultiSource = true;
@@ -3883,7 +3891,7 @@ function doWatch(source, cb, {
3883
3891
  if (isRef(s)) {
3884
3892
  return s.value;
3885
3893
  } else if (isReactive(s)) {
3886
- return traverse(s, isShallow(s) || deep === false ? 1 : void 0);
3894
+ return reactiveGetter(s);
3887
3895
  } else if (isFunction(s)) {
3888
3896
  return callWithErrorHandling(s, instance, 2);
3889
3897
  } else {
@@ -3895,9 +3903,6 @@ function doWatch(source, cb, {
3895
3903
  getter = () => callWithErrorHandling(source, instance, 2);
3896
3904
  } else {
3897
3905
  getter = () => {
3898
- if (instance && instance.isUnmounted) {
3899
- return;
3900
- }
3901
3906
  if (cleanup) {
3902
3907
  cleanup();
3903
3908
  }
@@ -3970,10 +3975,11 @@ function doWatch(source, cb, {
3970
3975
  scheduler = () => queueJob(job);
3971
3976
  }
3972
3977
  const effect = new ReactiveEffect(getter, NOOP, scheduler);
3978
+ const scope = getCurrentScope();
3973
3979
  const unwatch = () => {
3974
3980
  effect.stop();
3975
- if (instance && instance.scope) {
3976
- remove(instance.scope.effects, effect);
3981
+ if (scope) {
3982
+ remove(scope.effects, effect);
3977
3983
  }
3978
3984
  };
3979
3985
  {
@@ -5841,6 +5847,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5841
5847
  return ref();
5842
5848
  }
5843
5849
  const camelizedName = camelize(name);
5850
+ const hyphenatedName = hyphenate(name);
5844
5851
  const res = customRef((track, trigger) => {
5845
5852
  let localValue;
5846
5853
  watchSyncEffect(() => {
@@ -5858,7 +5865,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
5858
5865
  set(value) {
5859
5866
  const rawProps = i.vnode.props;
5860
5867
  if (!(rawProps && // check if parent has passed v-model
5861
- (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
5868
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
5862
5869
  localValue = value;
5863
5870
  trigger();
5864
5871
  }
@@ -6452,7 +6459,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6452
6459
  return vm;
6453
6460
  }
6454
6461
  }
6455
- Vue.version = `2.6.14-compat:${"3.4.3"}`;
6462
+ Vue.version = `2.6.14-compat:${"3.4.5"}`;
6456
6463
  Vue.config = singletonApp.config;
6457
6464
  Vue.use = (p, ...options) => {
6458
6465
  if (p && isFunction(p.install)) {
@@ -11155,7 +11162,7 @@ function isMemoSame(cached, memo) {
11155
11162
  return true;
11156
11163
  }
11157
11164
 
11158
- const version = "3.4.3";
11165
+ const version = "3.4.5";
11159
11166
  const warn = warn$1 ;
11160
11167
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11161
11168
  const devtools = devtools$1 ;