vue 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.
@@ -3004,7 +3004,7 @@ If this is a native custom element, make sure to exclude it from component resol
3004
3004
  hiddenContainer,
3005
3005
  anchor,
3006
3006
  deps: 0,
3007
- pendingId: 0,
3007
+ pendingId: suspenseId++,
3008
3008
  timeout: typeof timeout === "number" ? timeout : -1,
3009
3009
  activeBranch: null,
3010
3010
  pendingBranch: null,
@@ -3337,7 +3337,6 @@ If this is a native custom element, make sure to exclude it from component resol
3337
3337
  onTrack,
3338
3338
  onTrigger
3339
3339
  } = EMPTY_OBJ) {
3340
- var _a;
3341
3340
  if (cb && once) {
3342
3341
  const _cb = cb;
3343
3342
  cb = (...args) => {
@@ -3345,6 +3344,11 @@ If this is a native custom element, make sure to exclude it from component resol
3345
3344
  unwatch();
3346
3345
  };
3347
3346
  }
3347
+ if (deep !== void 0 && typeof deep === "number") {
3348
+ warn$1(
3349
+ `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
3350
+ );
3351
+ }
3348
3352
  if (!cb) {
3349
3353
  if (immediate !== void 0) {
3350
3354
  warn$1(
@@ -3369,7 +3373,11 @@ If this is a native custom element, make sure to exclude it from component resol
3369
3373
  `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
3370
3374
  );
3371
3375
  };
3372
- const instance = getCurrentScope() === ((_a = currentInstance) == null ? void 0 : _a.scope) ? currentInstance : null;
3376
+ const instance = currentInstance;
3377
+ const reactiveGetter = (source2) => deep === true ? source2 : (
3378
+ // for deep: false, only traverse root-level properties
3379
+ traverse(source2, deep === false ? 1 : void 0)
3380
+ );
3373
3381
  let getter;
3374
3382
  let forceTrigger = false;
3375
3383
  let isMultiSource = false;
@@ -3377,7 +3385,7 @@ If this is a native custom element, make sure to exclude it from component resol
3377
3385
  getter = () => source.value;
3378
3386
  forceTrigger = isShallow(source);
3379
3387
  } else if (isReactive(source)) {
3380
- getter = isShallow(source) || deep === false ? () => traverse(source, 1) : () => traverse(source);
3388
+ getter = () => reactiveGetter(source);
3381
3389
  forceTrigger = true;
3382
3390
  } else if (isArray(source)) {
3383
3391
  isMultiSource = true;
@@ -3386,7 +3394,7 @@ If this is a native custom element, make sure to exclude it from component resol
3386
3394
  if (isRef(s)) {
3387
3395
  return s.value;
3388
3396
  } else if (isReactive(s)) {
3389
- return traverse(s, isShallow(s) || deep === false ? 1 : void 0);
3397
+ return reactiveGetter(s);
3390
3398
  } else if (isFunction(s)) {
3391
3399
  return callWithErrorHandling(s, instance, 2);
3392
3400
  } else {
@@ -3398,9 +3406,6 @@ If this is a native custom element, make sure to exclude it from component resol
3398
3406
  getter = () => callWithErrorHandling(source, instance, 2);
3399
3407
  } else {
3400
3408
  getter = () => {
3401
- if (instance && instance.isUnmounted) {
3402
- return;
3403
- }
3404
3409
  if (cleanup) {
3405
3410
  cleanup();
3406
3411
  }
@@ -3463,10 +3468,11 @@ If this is a native custom element, make sure to exclude it from component resol
3463
3468
  scheduler = () => queueJob(job);
3464
3469
  }
3465
3470
  const effect = new ReactiveEffect(getter, NOOP, scheduler);
3471
+ const scope = getCurrentScope();
3466
3472
  const unwatch = () => {
3467
3473
  effect.stop();
3468
- if (instance && instance.scope) {
3469
- remove(instance.scope.effects, effect);
3474
+ if (scope) {
3475
+ remove(scope.effects, effect);
3470
3476
  }
3471
3477
  };
3472
3478
  {
@@ -4809,6 +4815,7 @@ If this is a native custom element, make sure to exclude it from component resol
4809
4815
  return ref();
4810
4816
  }
4811
4817
  const camelizedName = camelize(name);
4818
+ const hyphenatedName = hyphenate(name);
4812
4819
  const res = customRef((track, trigger) => {
4813
4820
  let localValue;
4814
4821
  watchSyncEffect(() => {
@@ -4826,7 +4833,7 @@ If this is a native custom element, make sure to exclude it from component resol
4826
4833
  set(value) {
4827
4834
  const rawProps = i.vnode.props;
4828
4835
  if (!(rawProps && // check if parent has passed v-model
4829
- (name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
4836
+ (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
4830
4837
  localValue = value;
4831
4838
  trigger();
4832
4839
  }
@@ -9480,7 +9487,7 @@ Component that was made reactive: `,
9480
9487
  return true;
9481
9488
  }
9482
9489
 
9483
- const version = "3.4.3";
9490
+ const version = "3.4.5";
9484
9491
  const warn = warn$1 ;
9485
9492
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9486
9493
  const devtools = devtools$1 ;