vue 3.2.31 → 3.2.32

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.
@@ -430,8 +430,17 @@ var Vue = (function (exports) {
430
430
  let activeEffectScope;
431
431
  class EffectScope {
432
432
  constructor(detached = false) {
433
+ /**
434
+ * @internal
435
+ */
433
436
  this.active = true;
437
+ /**
438
+ * @internal
439
+ */
434
440
  this.effects = [];
441
+ /**
442
+ * @internal
443
+ */
435
444
  this.cleanups = [];
436
445
  if (!detached && activeEffectScope) {
437
446
  this.parent = activeEffectScope;
@@ -441,21 +450,30 @@ var Vue = (function (exports) {
441
450
  }
442
451
  run(fn) {
443
452
  if (this.active) {
453
+ const currentEffectScope = activeEffectScope;
444
454
  try {
445
455
  activeEffectScope = this;
446
456
  return fn();
447
457
  }
448
458
  finally {
449
- activeEffectScope = this.parent;
459
+ activeEffectScope = currentEffectScope;
450
460
  }
451
461
  }
452
462
  else {
453
463
  warn(`cannot run an inactive effect scope.`);
454
464
  }
455
465
  }
466
+ /**
467
+ * This should only be called on non-detached scopes
468
+ * @internal
469
+ */
456
470
  on() {
457
471
  activeEffectScope = this;
458
472
  }
473
+ /**
474
+ * This should only be called on non-detached scopes
475
+ * @internal
476
+ */
459
477
  off() {
460
478
  activeEffectScope = this.parent;
461
479
  }
@@ -679,9 +697,7 @@ var Vue = (function (exports) {
679
697
  dep.add(activeEffect);
680
698
  activeEffect.deps.push(dep);
681
699
  if (activeEffect.onTrack) {
682
- activeEffect.onTrack(Object.assign({
683
- effect: activeEffect
684
- }, debuggerEventExtraInfo));
700
+ activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
685
701
  }
686
702
  }
687
703
  }
@@ -3165,12 +3181,10 @@ var Vue = (function (exports) {
3165
3181
  return doWatch(effect, null, options);
3166
3182
  }
3167
3183
  function watchPostEffect(effect, options) {
3168
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'post' })
3169
- ));
3184
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
3170
3185
  }
3171
3186
  function watchSyncEffect(effect, options) {
3172
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'sync' })
3173
- ));
3187
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
3174
3188
  }
3175
3189
  // initial value for watchers to trigger on undefined initial values
3176
3190
  const INITIAL_WATCHER_VALUE = {};
@@ -3467,7 +3481,9 @@ var Vue = (function (exports) {
3467
3481
  const { mode } = rawProps;
3468
3482
  // check mode
3469
3483
  if (mode &&
3470
- mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
3484
+ mode !== 'in-out' &&
3485
+ mode !== 'out-in' &&
3486
+ mode !== 'default') {
3471
3487
  warn$1(`invalid <transition> mode: ${mode}`);
3472
3488
  }
3473
3489
  // at this point children has a guaranteed length of 1.
@@ -3694,20 +3710,24 @@ var Vue = (function (exports) {
3694
3710
  vnode.transition = hooks;
3695
3711
  }
3696
3712
  }
3697
- function getTransitionRawChildren(children, keepComment = false) {
3713
+ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3698
3714
  let ret = [];
3699
3715
  let keyedFragmentCount = 0;
3700
3716
  for (let i = 0; i < children.length; i++) {
3701
- const child = children[i];
3717
+ let child = children[i];
3718
+ // #5360 inherit parent key in case of <template v-for>
3719
+ const key = parentKey == null
3720
+ ? child.key
3721
+ : String(parentKey) + String(child.key != null ? child.key : i);
3702
3722
  // handle fragment children case, e.g. v-for
3703
3723
  if (child.type === Fragment) {
3704
3724
  if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
3705
3725
  keyedFragmentCount++;
3706
- ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
3726
+ ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
3707
3727
  }
3708
3728
  // comment placeholders should be skipped, e.g. v-if
3709
3729
  else if (keepComment || child.type !== Comment) {
3710
- ret.push(child);
3730
+ ret.push(key != null ? cloneVNode(child, { key }) : child);
3711
3731
  }
3712
3732
  }
3713
3733
  // #1126 if a transition children list contains multiple sub fragments, these
@@ -4673,6 +4693,10 @@ var Vue = (function (exports) {
4673
4693
  const propsToUpdate = instance.vnode.dynamicProps;
4674
4694
  for (let i = 0; i < propsToUpdate.length; i++) {
4675
4695
  let key = propsToUpdate[i];
4696
+ // skip if the prop key is a declared emit event listener
4697
+ if (isEmitListener(instance.emitsOptions, key)) {
4698
+ continue;
4699
+ }
4676
4700
  // PROPS flag guarantees rawProps to be non-null
4677
4701
  const value = rawProps[key];
4678
4702
  if (options) {
@@ -5197,7 +5221,8 @@ var Vue = (function (exports) {
5197
5221
  warn$1(`withDirectives can only be used inside render functions.`);
5198
5222
  return vnode;
5199
5223
  }
5200
- const instance = internalInstance.proxy;
5224
+ const instance = getExposeProxy(internalInstance) ||
5225
+ internalInstance.proxy;
5201
5226
  const bindings = vnode.dirs || (vnode.dirs = []);
5202
5227
  for (let i = 0; i < directives.length; i++) {
5203
5228
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
@@ -5269,6 +5294,9 @@ var Vue = (function (exports) {
5269
5294
  let uid = 0;
5270
5295
  function createAppAPI(render, hydrate) {
5271
5296
  return function createApp(rootComponent, rootProps = null) {
5297
+ if (!isFunction(rootComponent)) {
5298
+ rootComponent = Object.assign({}, rootComponent);
5299
+ }
5272
5300
  if (rootProps != null && !isObject(rootProps)) {
5273
5301
  warn$1(`root props passed to app.mount() must be an object.`);
5274
5302
  rootProps = null;
@@ -5465,6 +5493,9 @@ var Vue = (function (exports) {
5465
5493
  if (!isArray(existing)) {
5466
5494
  if (_isString) {
5467
5495
  refs[ref] = [refValue];
5496
+ if (hasOwn(setupState, ref)) {
5497
+ setupState[ref] = refs[ref];
5498
+ }
5468
5499
  }
5469
5500
  else {
5470
5501
  ref.value = [refValue];
@@ -5837,7 +5868,7 @@ var Vue = (function (exports) {
5837
5868
  perf.mark(`vue-${type}-${instance.uid}`);
5838
5869
  }
5839
5870
  {
5840
- devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());
5871
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
5841
5872
  }
5842
5873
  }
5843
5874
  function endMeasure(instance, type) {
@@ -5850,7 +5881,7 @@ var Vue = (function (exports) {
5850
5881
  perf.clearMarks(endTag);
5851
5882
  }
5852
5883
  {
5853
- devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());
5884
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
5854
5885
  }
5855
5886
  }
5856
5887
  function isSupported() {
@@ -8239,9 +8270,10 @@ var Vue = (function (exports) {
8239
8270
  },
8240
8271
  defineProperty(target, key, descriptor) {
8241
8272
  if (descriptor.get != null) {
8242
- this.set(target, key, descriptor.get(), null);
8273
+ // invalidate key cache of a getter based property #5417
8274
+ target.$.accessCache[key] = 0;
8243
8275
  }
8244
- else if (descriptor.value != null) {
8276
+ else if (hasOwn(descriptor, 'value')) {
8245
8277
  this.set(target, key, descriptor.value, null);
8246
8278
  }
8247
8279
  return Reflect.defineProperty(target, key, descriptor);
@@ -9115,7 +9147,7 @@ var Vue = (function (exports) {
9115
9147
  }
9116
9148
 
9117
9149
  // Core API ------------------------------------------------------------------
9118
- const version = "3.2.31";
9150
+ const version = "3.2.32";
9119
9151
  /**
9120
9152
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
9121
9153
  * @internal