@vue/compat 3.2.29 → 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.
@@ -280,13 +280,15 @@ var Vue = (function () {
280
280
  * @private
281
281
  */
282
282
  const toDisplayString = (val) => {
283
- return val == null
284
- ? ''
285
- : isArray(val) ||
286
- (isObject(val) &&
287
- (val.toString === objectToString || !isFunction(val.toString)))
288
- ? JSON.stringify(val, replacer, 2)
289
- : String(val);
283
+ return isString(val)
284
+ ? val
285
+ : val == null
286
+ ? ''
287
+ : isArray(val) ||
288
+ (isObject(val) &&
289
+ (val.toString === objectToString || !isFunction(val.toString)))
290
+ ? JSON.stringify(val, replacer, 2)
291
+ : String(val);
290
292
  };
291
293
  const replacer = (_key, val) => {
292
294
  // can't use isRef here since @vue/shared has no deps
@@ -360,6 +362,7 @@ var Vue = (function () {
360
362
  'onVnodeBeforeMount,onVnodeMounted,' +
361
363
  'onVnodeBeforeUpdate,onVnodeUpdated,' +
362
364
  'onVnodeBeforeUnmount,onVnodeUnmounted');
365
+ const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
363
366
  const cacheStringFunction = (fn) => {
364
367
  const cache = Object.create(null);
365
368
  return ((str) => {
@@ -425,11 +428,19 @@ var Vue = (function () {
425
428
  }
426
429
 
427
430
  let activeEffectScope;
428
- const effectScopeStack = [];
429
431
  class EffectScope {
430
432
  constructor(detached = false) {
433
+ /**
434
+ * @internal
435
+ */
431
436
  this.active = true;
437
+ /**
438
+ * @internal
439
+ */
432
440
  this.effects = [];
441
+ /**
442
+ * @internal
443
+ */
433
444
  this.cleanups = [];
434
445
  if (!detached && activeEffectScope) {
435
446
  this.parent = activeEffectScope;
@@ -439,36 +450,46 @@ var Vue = (function () {
439
450
  }
440
451
  run(fn) {
441
452
  if (this.active) {
453
+ const currentEffectScope = activeEffectScope;
442
454
  try {
443
- this.on();
455
+ activeEffectScope = this;
444
456
  return fn();
445
457
  }
446
458
  finally {
447
- this.off();
459
+ activeEffectScope = currentEffectScope;
448
460
  }
449
461
  }
450
462
  else {
451
463
  warn(`cannot run an inactive effect scope.`);
452
464
  }
453
465
  }
466
+ /**
467
+ * This should only be called on non-detached scopes
468
+ * @internal
469
+ */
454
470
  on() {
455
- if (this.active) {
456
- effectScopeStack.push(this);
457
- activeEffectScope = this;
458
- }
471
+ activeEffectScope = this;
459
472
  }
473
+ /**
474
+ * This should only be called on non-detached scopes
475
+ * @internal
476
+ */
460
477
  off() {
461
- if (this.active) {
462
- effectScopeStack.pop();
463
- activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
464
- }
478
+ activeEffectScope = this.parent;
465
479
  }
466
480
  stop(fromParent) {
467
481
  if (this.active) {
468
- this.effects.forEach(e => e.stop());
469
- this.cleanups.forEach(cleanup => cleanup());
482
+ let i, l;
483
+ for (i = 0, l = this.effects.length; i < l; i++) {
484
+ this.effects[i].stop();
485
+ }
486
+ for (i = 0, l = this.cleanups.length; i < l; i++) {
487
+ this.cleanups[i]();
488
+ }
470
489
  if (this.scopes) {
471
- this.scopes.forEach(e => e.stop(true));
490
+ for (i = 0, l = this.scopes.length; i < l; i++) {
491
+ this.scopes[i].stop(true);
492
+ }
472
493
  }
473
494
  // nested scope, dereference from parent to avoid memory leaks
474
495
  if (this.parent && !fromParent) {
@@ -486,8 +507,7 @@ var Vue = (function () {
486
507
  function effectScope(detached) {
487
508
  return new EffectScope(detached);
488
509
  }
489
- function recordEffectScope(effect, scope) {
490
- scope = scope || activeEffectScope;
510
+ function recordEffectScope(effect, scope = activeEffectScope) {
491
511
  if (scope && scope.active) {
492
512
  scope.effects.push(effect);
493
513
  }
@@ -550,7 +570,6 @@ var Vue = (function () {
550
570
  * When recursion depth is greater, fall back to using a full cleanup.
551
571
  */
552
572
  const maxMarkerBits = 30;
553
- const effectStack = [];
554
573
  let activeEffect;
555
574
  const ITERATE_KEY = Symbol('iterate' );
556
575
  const MAP_KEY_ITERATE_KEY = Symbol('Map key iterate' );
@@ -560,35 +579,42 @@ var Vue = (function () {
560
579
  this.scheduler = scheduler;
561
580
  this.active = true;
562
581
  this.deps = [];
582
+ this.parent = undefined;
563
583
  recordEffectScope(this, scope);
564
584
  }
565
585
  run() {
566
586
  if (!this.active) {
567
587
  return this.fn();
568
588
  }
569
- if (!effectStack.length || !effectStack.includes(this)) {
570
- try {
571
- effectStack.push((activeEffect = this));
572
- enableTracking();
573
- trackOpBit = 1 << ++effectTrackDepth;
574
- if (effectTrackDepth <= maxMarkerBits) {
575
- initDepMarkers(this);
576
- }
577
- else {
578
- cleanupEffect(this);
579
- }
580
- return this.fn();
589
+ let parent = activeEffect;
590
+ let lastShouldTrack = shouldTrack;
591
+ while (parent) {
592
+ if (parent === this) {
593
+ return;
581
594
  }
582
- finally {
583
- if (effectTrackDepth <= maxMarkerBits) {
584
- finalizeDepMarkers(this);
585
- }
586
- trackOpBit = 1 << --effectTrackDepth;
587
- resetTracking();
588
- effectStack.pop();
589
- const n = effectStack.length;
590
- activeEffect = n > 0 ? effectStack[n - 1] : undefined;
595
+ parent = parent.parent;
596
+ }
597
+ try {
598
+ this.parent = activeEffect;
599
+ activeEffect = this;
600
+ shouldTrack = true;
601
+ trackOpBit = 1 << ++effectTrackDepth;
602
+ if (effectTrackDepth <= maxMarkerBits) {
603
+ initDepMarkers(this);
604
+ }
605
+ else {
606
+ cleanupEffect(this);
591
607
  }
608
+ return this.fn();
609
+ }
610
+ finally {
611
+ if (effectTrackDepth <= maxMarkerBits) {
612
+ finalizeDepMarkers(this);
613
+ }
614
+ trackOpBit = 1 << --effectTrackDepth;
615
+ activeEffect = this.parent;
616
+ shouldTrack = lastShouldTrack;
617
+ this.parent = undefined;
592
618
  }
593
619
  }
594
620
  stop() {
@@ -636,32 +662,24 @@ var Vue = (function () {
636
662
  trackStack.push(shouldTrack);
637
663
  shouldTrack = false;
638
664
  }
639
- function enableTracking() {
640
- trackStack.push(shouldTrack);
641
- shouldTrack = true;
642
- }
643
665
  function resetTracking() {
644
666
  const last = trackStack.pop();
645
667
  shouldTrack = last === undefined ? true : last;
646
668
  }
647
669
  function track(target, type, key) {
648
- if (!isTracking()) {
649
- return;
650
- }
651
- let depsMap = targetMap.get(target);
652
- if (!depsMap) {
653
- targetMap.set(target, (depsMap = new Map()));
654
- }
655
- let dep = depsMap.get(key);
656
- if (!dep) {
657
- depsMap.set(key, (dep = createDep()));
670
+ if (shouldTrack && activeEffect) {
671
+ let depsMap = targetMap.get(target);
672
+ if (!depsMap) {
673
+ targetMap.set(target, (depsMap = new Map()));
674
+ }
675
+ let dep = depsMap.get(key);
676
+ if (!dep) {
677
+ depsMap.set(key, (dep = createDep()));
678
+ }
679
+ const eventInfo = { effect: activeEffect, target, type, key }
680
+ ;
681
+ trackEffects(dep, eventInfo);
658
682
  }
659
- const eventInfo = { effect: activeEffect, target, type, key }
660
- ;
661
- trackEffects(dep, eventInfo);
662
- }
663
- function isTracking() {
664
- return shouldTrack && activeEffect !== undefined;
665
683
  }
666
684
  function trackEffects(dep, debuggerEventExtraInfo) {
667
685
  let shouldTrack = false;
@@ -679,9 +697,7 @@ var Vue = (function () {
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
  }
@@ -1346,13 +1362,10 @@ var Vue = (function () {
1346
1362
  const toReadonly = (value) => isObject(value) ? readonly(value) : value;
1347
1363
 
1348
1364
  function trackRefValue(ref) {
1349
- if (isTracking()) {
1365
+ if (shouldTrack && activeEffect) {
1350
1366
  ref = toRaw(ref);
1351
- if (!ref.dep) {
1352
- ref.dep = createDep();
1353
- }
1354
1367
  {
1355
- trackEffects(ref.dep, {
1368
+ trackEffects(ref.dep || (ref.dep = createDep()), {
1356
1369
  target: ref,
1357
1370
  type: "get" /* GET */,
1358
1371
  key: 'value'
@@ -1374,7 +1387,7 @@ var Vue = (function () {
1374
1387
  }
1375
1388
  }
1376
1389
  function isRef(r) {
1377
- return Boolean(r && r.__v_isRef === true);
1390
+ return !!(r && r.__v_isRef === true);
1378
1391
  }
1379
1392
  function ref(value) {
1380
1393
  return createRef(value, false);
@@ -2185,23 +2198,23 @@ var Vue = (function () {
2185
2198
  ["GLOBAL_MOUNT" /* GLOBAL_MOUNT */]: {
2186
2199
  message: `The global app bootstrapping API has changed: vm.$mount() and the "el" ` +
2187
2200
  `option have been removed. Use createApp(RootComponent).mount() instead.`,
2188
- link: `https://v3.vuejs.org/guide/migration/global-api.html#mounting-app-instance`
2201
+ link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#mounting-app-instance`
2189
2202
  },
2190
2203
  ["GLOBAL_MOUNT_CONTAINER" /* GLOBAL_MOUNT_CONTAINER */]: {
2191
2204
  message: `Vue detected directives on the mount container. ` +
2192
2205
  `In Vue 3, the container is no longer considered part of the template ` +
2193
2206
  `and will not be processed/replaced.`,
2194
- link: `https://v3.vuejs.org/guide/migration/mount-changes.html`
2207
+ link: `https://v3-migration.vuejs.org/breaking-changes/mount-changes.html`
2195
2208
  },
2196
2209
  ["GLOBAL_EXTEND" /* GLOBAL_EXTEND */]: {
2197
2210
  message: `Vue.extend() has been removed in Vue 3. ` +
2198
2211
  `Use defineComponent() instead.`,
2199
- link: `https://v3.vuejs.org/api/global-api.html#definecomponent`
2212
+ link: `https://vuejs.org/api/general.html#definecomponent`
2200
2213
  },
2201
2214
  ["GLOBAL_PROTOTYPE" /* GLOBAL_PROTOTYPE */]: {
2202
2215
  message: `Vue.prototype is no longer available in Vue 3. ` +
2203
2216
  `Use app.config.globalProperties instead.`,
2204
- link: `https://v3.vuejs.org/guide/migration/global-api.html#vue-prototype-replaced-by-config-globalproperties`
2217
+ link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#vue-prototype-replaced-by-config-globalproperties`
2205
2218
  },
2206
2219
  ["GLOBAL_SET" /* GLOBAL_SET */]: {
2207
2220
  message: `Vue.set() has been removed as it is no longer needed in Vue 3. ` +
@@ -2214,7 +2227,7 @@ var Vue = (function () {
2214
2227
  ["GLOBAL_OBSERVABLE" /* GLOBAL_OBSERVABLE */]: {
2215
2228
  message: `Vue.observable() has been removed. ` +
2216
2229
  `Use \`import { reactive } from "vue"\` from Composition API instead.`,
2217
- link: `https://v3.vuejs.org/api/basic-reactivity.html`
2230
+ link: `https://vuejs.org/api/reactivity-core.html#reactive`
2218
2231
  },
2219
2232
  ["GLOBAL_PRIVATE_UTIL" /* GLOBAL_PRIVATE_UTIL */]: {
2220
2233
  message: `Vue.util has been removed. Please refactor to avoid its usage ` +
@@ -2233,11 +2246,11 @@ var Vue = (function () {
2233
2246
  ["CONFIG_KEY_CODES" /* CONFIG_KEY_CODES */]: {
2234
2247
  message: `config.keyCodes has been removed. ` +
2235
2248
  `In Vue 3, you can directly use the kebab-case key names as v-on modifiers.`,
2236
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
2249
+ link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2237
2250
  },
2238
2251
  ["CONFIG_PRODUCTION_TIP" /* CONFIG_PRODUCTION_TIP */]: {
2239
2252
  message: `config.productionTip has been removed.`,
2240
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-productiontip-removed`
2253
+ link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed`
2241
2254
  },
2242
2255
  ["CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */]: {
2243
2256
  message: () => {
@@ -2250,7 +2263,7 @@ var Vue = (function () {
2250
2263
  }
2251
2264
  return msg;
2252
2265
  },
2253
- link: `https://v3.vuejs.org/guide/migration/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
2266
+ link: `https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement`
2254
2267
  },
2255
2268
  ["CONFIG_WHITESPACE" /* CONFIG_WHITESPACE */]: {
2256
2269
  // this warning is only relevant in the full build when using runtime
@@ -2273,12 +2286,12 @@ var Vue = (function () {
2273
2286
  },
2274
2287
  ["INSTANCE_DESTROY" /* INSTANCE_DESTROY */]: {
2275
2288
  message: `vm.$destroy() has been removed. Use app.unmount() instead.`,
2276
- link: `https://v3.vuejs.org/api/application-api.html#unmount`
2289
+ link: `https://vuejs.org/api/application.html#app-unmount`
2277
2290
  },
2278
2291
  ["INSTANCE_EVENT_EMITTER" /* INSTANCE_EVENT_EMITTER */]: {
2279
2292
  message: `vm.$on/$once/$off() have been removed. ` +
2280
2293
  `Use an external event emitter library instead.`,
2281
- link: `https://v3.vuejs.org/guide/migration/events-api.html`
2294
+ link: `https://v3-migration.vuejs.org/breaking-changes/events-api.html`
2282
2295
  },
2283
2296
  ["INSTANCE_EVENT_HOOKS" /* INSTANCE_EVENT_HOOKS */]: {
2284
2297
  message: event => `"${event}" lifecycle events are no longer supported. From templates, ` +
@@ -2286,23 +2299,23 @@ var Vue = (function () {
2286
2299
  `should be changed to @vnode-${event.slice(5)}. ` +
2287
2300
  `From JavaScript, use Composition API to dynamically register lifecycle ` +
2288
2301
  `hooks.`,
2289
- link: `https://v3.vuejs.org/guide/migration/vnode-lifecycle-events.html`
2302
+ link: `https://v3-migration.vuejs.org/breaking-changes/vnode-lifecycle-events.html`
2290
2303
  },
2291
2304
  ["INSTANCE_CHILDREN" /* INSTANCE_CHILDREN */]: {
2292
2305
  message: `vm.$children has been removed. Consider refactoring your logic ` +
2293
2306
  `to avoid relying on direct access to child components.`,
2294
- link: `https://v3.vuejs.org/guide/migration/children.html`
2307
+ link: `https://v3-migration.vuejs.org/breaking-changes/children.html`
2295
2308
  },
2296
2309
  ["INSTANCE_LISTENERS" /* INSTANCE_LISTENERS */]: {
2297
2310
  message: `vm.$listeners has been removed. In Vue 3, parent v-on listeners are ` +
2298
2311
  `included in vm.$attrs and it is no longer necessary to separately use ` +
2299
2312
  `v-on="$listeners" if you are already using v-bind="$attrs". ` +
2300
2313
  `(Note: the Vue 3 behavior only applies if this compat config is disabled)`,
2301
- link: `https://v3.vuejs.org/guide/migration/listeners-removed.html`
2314
+ link: `https://v3-migration.vuejs.org/breaking-changes/listeners-removed.html`
2302
2315
  },
2303
2316
  ["INSTANCE_SCOPED_SLOTS" /* INSTANCE_SCOPED_SLOTS */]: {
2304
2317
  message: `vm.$scopedSlots has been removed. Use vm.$slots instead.`,
2305
- link: `https://v3.vuejs.org/guide/migration/slots-unification.html`
2318
+ link: `https://v3-migration.vuejs.org/breaking-changes/slots-unification.html`
2306
2319
  },
2307
2320
  ["INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */]: {
2308
2321
  message: componentName => `Component <${componentName || 'Anonymous'}> has \`inheritAttrs: false\` but is ` +
@@ -2313,17 +2326,17 @@ var Vue = (function () {
2313
2326
  `If you are binding $attrs to a non-root element and expecting ` +
2314
2327
  `class/style to fallthrough on root, you will need to now manually bind ` +
2315
2328
  `them on root via :class="$attrs.class".`,
2316
- link: `https://v3.vuejs.org/guide/migration/attrs-includes-class-style.html`
2329
+ link: `https://v3-migration.vuejs.org/breaking-changes/attrs-includes-class-style.html`
2317
2330
  },
2318
2331
  ["OPTIONS_DATA_FN" /* OPTIONS_DATA_FN */]: {
2319
2332
  message: `The "data" option can no longer be a plain object. ` +
2320
2333
  `Always use a function.`,
2321
- link: `https://v3.vuejs.org/guide/migration/data-option.html`
2334
+ link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html`
2322
2335
  },
2323
2336
  ["OPTIONS_DATA_MERGE" /* OPTIONS_DATA_MERGE */]: {
2324
2337
  message: (key) => `Detected conflicting key "${key}" when merging data option values. ` +
2325
2338
  `In Vue 3, data keys are merged shallowly and will override one another.`,
2326
- link: `https://v3.vuejs.org/guide/migration/data-option.html#mixin-merge-behavior-change`
2339
+ link: `https://v3-migration.vuejs.org/breaking-changes/data-option.html#mixin-merge-behavior-change`
2327
2340
  },
2328
2341
  ["OPTIONS_BEFORE_DESTROY" /* OPTIONS_BEFORE_DESTROY */]: {
2329
2342
  message: `\`beforeDestroy\` has been renamed to \`beforeUnmount\`.`
@@ -2337,23 +2350,23 @@ var Vue = (function () {
2337
2350
  `If current usage is intended, you can disable the compat behavior and ` +
2338
2351
  `suppress this warning with:` +
2339
2352
  `\n\n configureCompat({ ${"WATCH_ARRAY" /* WATCH_ARRAY */}: false })\n`,
2340
- link: `https://v3.vuejs.org/guide/migration/watch.html`
2353
+ link: `https://v3-migration.vuejs.org/breaking-changes/watch.html`
2341
2354
  },
2342
2355
  ["PROPS_DEFAULT_THIS" /* PROPS_DEFAULT_THIS */]: {
2343
2356
  message: (key) => `props default value function no longer has access to "this". The compat ` +
2344
2357
  `build only offers access to this.$options.` +
2345
2358
  `(found in prop "${key}")`,
2346
- link: `https://v3.vuejs.org/guide/migration/props-default-this.html`
2359
+ link: `https://v3-migration.vuejs.org/breaking-changes/props-default-this.html`
2347
2360
  },
2348
2361
  ["CUSTOM_DIR" /* CUSTOM_DIR */]: {
2349
2362
  message: (legacyHook, newHook) => `Custom directive hook "${legacyHook}" has been removed. ` +
2350
2363
  `Use "${newHook}" instead.`,
2351
- link: `https://v3.vuejs.org/guide/migration/custom-directives.html`
2364
+ link: `https://v3-migration.vuejs.org/breaking-changes/custom-directives.html`
2352
2365
  },
2353
2366
  ["V_ON_KEYCODE_MODIFIER" /* V_ON_KEYCODE_MODIFIER */]: {
2354
2367
  message: `Using keyCode as v-on modifier is no longer supported. ` +
2355
2368
  `Use kebab-case key name modifiers instead.`,
2356
- link: `https://v3.vuejs.org/guide/migration/keycode-modifiers.html`
2369
+ link: `https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html`
2357
2370
  },
2358
2371
  ["ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */]: {
2359
2372
  message: (name) => `Attribute "${name}" with v-bind value \`false\` will render ` +
@@ -2361,7 +2374,7 @@ var Vue = (function () {
2361
2374
  `use \`null\` or \`undefined\` instead. If the usage is intended, ` +
2362
2375
  `you can disable the compat behavior and suppress this warning with:` +
2363
2376
  `\n\n configureCompat({ ${"ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */}: false })\n`,
2364
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
2377
+ link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2365
2378
  },
2366
2379
  ["ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */]: {
2367
2380
  message: (name, value, coerced) => `Enumerated attribute "${name}" with v-bind value \`${value}\` will ` +
@@ -2370,7 +2383,7 @@ var Vue = (function () {
2370
2383
  `If the usage is intended, ` +
2371
2384
  `you can disable the compat behavior and suppress this warning with:` +
2372
2385
  `\n\n configureCompat({ ${"ATTR_ENUMERATED_COERCION" /* ATTR_ENUMERATED_COERCION */}: false })\n`,
2373
- link: `https://v3.vuejs.org/guide/migration/attribute-coercion.html`
2386
+ link: `https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html`
2374
2387
  },
2375
2388
  ["TRANSITION_CLASSES" /* TRANSITION_CLASSES */]: {
2376
2389
  message: `` // this feature cannot be runtime-detected
@@ -2381,7 +2394,7 @@ var Vue = (function () {
2381
2394
  `for styling, you can disable the compat behavior and suppress this ` +
2382
2395
  `warning with:` +
2383
2396
  `\n\n configureCompat({ ${"TRANSITION_GROUP_ROOT" /* TRANSITION_GROUP_ROOT */}: false })\n`,
2384
- link: `https://v3.vuejs.org/guide/migration/transition-group.html`
2397
+ link: `https://v3-migration.vuejs.org/breaking-changes/transition-group.html`
2385
2398
  },
2386
2399
  ["COMPONENT_ASYNC" /* COMPONENT_ASYNC */]: {
2387
2400
  message: (comp) => {
@@ -2394,7 +2407,7 @@ var Vue = (function () {
2394
2407
  `warning with:` +
2395
2408
  `\n\n configureCompat({ ${"COMPONENT_ASYNC" /* COMPONENT_ASYNC */}: false })\n`);
2396
2409
  },
2397
- link: `https://v3.vuejs.org/guide/migration/async-components.html`
2410
+ link: `https://v3-migration.vuejs.org/breaking-changes/async-components.html`
2398
2411
  },
2399
2412
  ["COMPONENT_FUNCTIONAL" /* COMPONENT_FUNCTIONAL */]: {
2400
2413
  message: (comp) => {
@@ -2405,7 +2418,7 @@ var Vue = (function () {
2405
2418
  `components usage have been migrated and its compat behavior has ` +
2406
2419
  `been disabled.`);
2407
2420
  },
2408
- link: `https://v3.vuejs.org/guide/migration/functional-components.html`
2421
+ link: `https://v3-migration.vuejs.org/breaking-changes/functional-components.html`
2409
2422
  },
2410
2423
  ["COMPONENT_V_MODEL" /* COMPONENT_V_MODEL */]: {
2411
2424
  message: (comp) => {
@@ -2422,20 +2435,20 @@ var Vue = (function () {
2422
2435
  `to work with v-model should now use the "modelValue" prop and emit the ` +
2423
2436
  `"update:modelValue" event. You can update the usage and then ${configMsg}`);
2424
2437
  },
2425
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
2438
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
2426
2439
  },
2427
2440
  ["RENDER_FUNCTION" /* RENDER_FUNCTION */]: {
2428
2441
  message: `Vue 3's render function API has changed. ` +
2429
2442
  `You can opt-in to the new API with:` +
2430
2443
  `\n\n configureCompat({ ${"RENDER_FUNCTION" /* RENDER_FUNCTION */}: false })\n` +
2431
2444
  `\n (This can also be done per-component via the "compatConfig" option.)`,
2432
- link: `https://v3.vuejs.org/guide/migration/render-function-api.html`
2445
+ link: `https://v3-migration.vuejs.org/breaking-changes/render-function-api.html`
2433
2446
  },
2434
2447
  ["FILTERS" /* FILTERS */]: {
2435
2448
  message: `filters have been removed in Vue 3. ` +
2436
2449
  `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
2437
2450
  `Use method calls or computed properties instead.`,
2438
- link: `https://v3.vuejs.org/guide/migration/filters.html`
2451
+ link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
2439
2452
  },
2440
2453
  ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
2441
2454
  message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
@@ -2503,7 +2516,7 @@ var Vue = (function () {
2503
2516
  warn$1(`Deprecation config "${key}" is compiler-specific and you are ` +
2504
2517
  `running a runtime-only build of Vue. This deprecation should be ` +
2505
2518
  `configured via compiler options in your build setup instead.\n` +
2506
- `Details: https://v3.vuejs.org/guide/migration/migration-build.html`);
2519
+ `Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`);
2507
2520
  }
2508
2521
  }
2509
2522
  else {
@@ -3717,12 +3730,10 @@ var Vue = (function () {
3717
3730
  return doWatch(effect, null, options);
3718
3731
  }
3719
3732
  function watchPostEffect(effect, options) {
3720
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'post' })
3721
- ));
3733
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
3722
3734
  }
3723
3735
  function watchSyncEffect(effect, options) {
3724
- return doWatch(effect, null, (Object.assign(options || {}, { flush: 'sync' })
3725
- ));
3736
+ return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
3726
3737
  }
3727
3738
  // initial value for watchers to trigger on undefined initial values
3728
3739
  const INITIAL_WATCHER_VALUE = {};
@@ -4032,7 +4043,9 @@ var Vue = (function () {
4032
4043
  const { mode } = rawProps;
4033
4044
  // check mode
4034
4045
  if (mode &&
4035
- mode !== 'in-out' && mode !== 'out-in' && mode !== 'default') {
4046
+ mode !== 'in-out' &&
4047
+ mode !== 'out-in' &&
4048
+ mode !== 'default') {
4036
4049
  warn$1(`invalid <transition> mode: ${mode}`);
4037
4050
  }
4038
4051
  // at this point children has a guaranteed length of 1.
@@ -4262,20 +4275,24 @@ var Vue = (function () {
4262
4275
  vnode.transition = hooks;
4263
4276
  }
4264
4277
  }
4265
- function getTransitionRawChildren(children, keepComment = false) {
4278
+ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4266
4279
  let ret = [];
4267
4280
  let keyedFragmentCount = 0;
4268
4281
  for (let i = 0; i < children.length; i++) {
4269
- const child = children[i];
4282
+ let child = children[i];
4283
+ // #5360 inherit parent key in case of <template v-for>
4284
+ const key = parentKey == null
4285
+ ? child.key
4286
+ : String(parentKey) + String(child.key != null ? child.key : i);
4270
4287
  // handle fragment children case, e.g. v-for
4271
4288
  if (child.type === Fragment) {
4272
4289
  if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
4273
4290
  keyedFragmentCount++;
4274
- ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
4291
+ ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
4275
4292
  }
4276
4293
  // comment placeholders should be skipped, e.g. v-if
4277
4294
  else if (keepComment || child.type !== Comment) {
4278
- ret.push(child);
4295
+ ret.push(key != null ? cloneVNode(child, { key }) : child);
4279
4296
  }
4280
4297
  }
4281
4298
  // #1126 if a transition children list contains multiple sub fragments, these
@@ -5333,6 +5350,10 @@ var Vue = (function () {
5333
5350
  const propsToUpdate = instance.vnode.dynamicProps;
5334
5351
  for (let i = 0; i < propsToUpdate.length; i++) {
5335
5352
  let key = propsToUpdate[i];
5353
+ // skip if the prop key is a declared emit event listener
5354
+ if (isEmitListener(instance.emitsOptions, key)) {
5355
+ continue;
5356
+ }
5336
5357
  // PROPS flag guarantees rawProps to be non-null
5337
5358
  const value = rawProps[key];
5338
5359
  if (options) {
@@ -5904,7 +5925,6 @@ var Vue = (function () {
5904
5925
  [bar, this.y]
5905
5926
  ])
5906
5927
  */
5907
- const isBuiltInDirective = /*#__PURE__*/ makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo');
5908
5928
  function validateDirectiveName(name) {
5909
5929
  if (isBuiltInDirective(name)) {
5910
5930
  warn$1('Do not use built-in directive ids as custom directive id: ' + name);
@@ -5919,7 +5939,8 @@ var Vue = (function () {
5919
5939
  warn$1(`withDirectives can only be used inside render functions.`);
5920
5940
  return vnode;
5921
5941
  }
5922
- const instance = internalInstance.proxy;
5942
+ const instance = getExposeProxy(internalInstance) ||
5943
+ internalInstance.proxy;
5923
5944
  const bindings = vnode.dirs || (vnode.dirs = []);
5924
5945
  for (let i = 0; i < directives.length; i++) {
5925
5946
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
@@ -6039,7 +6060,7 @@ var Vue = (function () {
6039
6060
  return vm;
6040
6061
  }
6041
6062
  }
6042
- Vue.version = `2.6.14-compat:${"3.2.29"}`;
6063
+ Vue.version = `2.6.14-compat:${"3.2.32"}`;
6043
6064
  Vue.config = singletonApp.config;
6044
6065
  Vue.use = (p, ...options) => {
6045
6066
  if (p && isFunction(p.install)) {
@@ -6466,6 +6487,9 @@ var Vue = (function () {
6466
6487
  let uid = 0;
6467
6488
  function createAppAPI(render, hydrate) {
6468
6489
  return function createApp(rootComponent, rootProps = null) {
6490
+ if (!isFunction(rootComponent)) {
6491
+ rootComponent = Object.assign({}, rootComponent);
6492
+ }
6469
6493
  if (rootProps != null && !isObject(rootProps)) {
6470
6494
  warn$1(`root props passed to app.mount() must be an object.`);
6471
6495
  rootProps = null;
@@ -6665,6 +6689,9 @@ var Vue = (function () {
6665
6689
  if (!isArray(existing)) {
6666
6690
  if (_isString) {
6667
6691
  refs[ref] = [refValue];
6692
+ if (hasOwn(setupState, ref)) {
6693
+ setupState[ref] = refs[ref];
6694
+ }
6668
6695
  }
6669
6696
  else {
6670
6697
  ref.value = [refValue];
@@ -6863,7 +6890,8 @@ var Vue = (function () {
6863
6890
  // e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
6864
6891
  const forcePatchValue = (type === 'input' && dirs) || type === 'option';
6865
6892
  // skip props & children if this is hoisted static nodes
6866
- if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {
6893
+ // #5405 in dev, always hydrate children for HMR
6894
+ {
6867
6895
  if (dirs) {
6868
6896
  invokeDirectiveHook(vnode, null, parentComponent, 'created');
6869
6897
  }
@@ -7036,7 +7064,7 @@ var Vue = (function () {
7036
7064
  perf.mark(`vue-${type}-${instance.uid}`);
7037
7065
  }
7038
7066
  {
7039
- devtoolsPerfStart(instance, type, supported ? perf.now() : Date.now());
7067
+ devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
7040
7068
  }
7041
7069
  }
7042
7070
  function endMeasure(instance, type) {
@@ -7049,7 +7077,7 @@ var Vue = (function () {
7049
7077
  perf.clearMarks(endTag);
7050
7078
  }
7051
7079
  {
7052
- devtoolsPerfEnd(instance, type, supported ? perf.now() : Date.now());
7080
+ devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
7053
7081
  }
7054
7082
  }
7055
7083
  function isSupported() {
@@ -10017,9 +10045,11 @@ var Vue = (function () {
10017
10045
  const { data, setupState, ctx } = instance;
10018
10046
  if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
10019
10047
  setupState[key] = value;
10048
+ return true;
10020
10049
  }
10021
10050
  else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
10022
10051
  data[key] = value;
10052
+ return true;
10023
10053
  }
10024
10054
  else if (hasOwn(instance.props, key)) {
10025
10055
  warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
@@ -10053,6 +10083,16 @@ var Vue = (function () {
10053
10083
  hasOwn(ctx, key) ||
10054
10084
  hasOwn(publicPropertiesMap, key) ||
10055
10085
  hasOwn(appContext.config.globalProperties, key));
10086
+ },
10087
+ defineProperty(target, key, descriptor) {
10088
+ if (descriptor.get != null) {
10089
+ // invalidate key cache of a getter based property #5417
10090
+ target.$.accessCache[key] = 0;
10091
+ }
10092
+ else if (hasOwn(descriptor, 'value')) {
10093
+ this.set(target, key, descriptor.value, null);
10094
+ }
10095
+ return Reflect.defineProperty(target, key, descriptor);
10056
10096
  }
10057
10097
  };
10058
10098
  {
@@ -10938,7 +10978,7 @@ var Vue = (function () {
10938
10978
  }
10939
10979
 
10940
10980
  // Core API ------------------------------------------------------------------
10941
- const version = "3.2.29";
10981
+ const version = "3.2.32";
10942
10982
  /**
10943
10983
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10944
10984
  * @internal
@@ -13510,13 +13550,13 @@ var Vue = (function () {
13510
13550
  message: `Platform-native elements with "is" prop will no longer be ` +
13511
13551
  `treated as components in Vue 3 unless the "is" value is explicitly ` +
13512
13552
  `prefixed with "vue:".`,
13513
- link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`
13553
+ link: `https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html`
13514
13554
  },
13515
13555
  ["COMPILER_V_BIND_SYNC" /* COMPILER_V_BIND_SYNC */]: {
13516
13556
  message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +
13517
13557
  `argument instead. \`v-bind:${key}.sync\` should be changed to ` +
13518
13558
  `\`v-model:${key}\`.`,
13519
- link: `https://v3.vuejs.org/guide/migration/v-model.html`
13559
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-model.html`
13520
13560
  },
13521
13561
  ["COMPILER_V_BIND_PROP" /* COMPILER_V_BIND_PROP */]: {
13522
13562
  message: `.prop modifier for v-bind has been removed and no longer necessary. ` +
@@ -13528,11 +13568,11 @@ var Vue = (function () {
13528
13568
  `that appears before v-bind in the case of conflict. ` +
13529
13569
  `To retain 2.x behavior, move v-bind to make it the first attribute. ` +
13530
13570
  `You can also suppress this warning if the usage is intended.`,
13531
- link: `https://v3.vuejs.org/guide/migration/v-bind.html`
13571
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-bind.html`
13532
13572
  },
13533
13573
  ["COMPILER_V_ON_NATIVE" /* COMPILER_V_ON_NATIVE */]: {
13534
13574
  message: `.native modifier for v-on has been removed as is no longer necessary.`,
13535
- link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`
13575
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html`
13536
13576
  },
13537
13577
  ["COMPILER_V_IF_V_FOR_PRECEDENCE" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {
13538
13578
  message: `v-if / v-for precedence when used on the same element has changed ` +
@@ -13540,7 +13580,7 @@ var Vue = (function () {
13540
13580
  `access to v-for scope variables. It is best to avoid the ambiguity ` +
13541
13581
  `with <template> tags or use a computed property that filters v-for ` +
13542
13582
  `data source.`,
13543
- link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`
13583
+ link: `https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html`
13544
13584
  },
13545
13585
  ["COMPILER_NATIVE_TEMPLATE" /* COMPILER_NATIVE_TEMPLATE */]: {
13546
13586
  message: `<template> with no special directives will render as a native template ` +
@@ -13548,13 +13588,13 @@ var Vue = (function () {
13548
13588
  },
13549
13589
  ["COMPILER_INLINE_TEMPLATE" /* COMPILER_INLINE_TEMPLATE */]: {
13550
13590
  message: `"inline-template" has been removed in Vue 3.`,
13551
- link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`
13591
+ link: `https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html`
13552
13592
  },
13553
13593
  ["COMPILER_FILTER" /* COMPILER_FILTERS */]: {
13554
13594
  message: `filters have been removed in Vue 3. ` +
13555
13595
  `The "|" symbol will be treated as native JavaScript bitwise OR operator. ` +
13556
13596
  `Use method calls or computed properties instead.`,
13557
- link: `https://v3.vuejs.org/guide/migration/filters.html`
13597
+ link: `https://v3-migration.vuejs.org/breaking-changes/filters.html`
13558
13598
  }
13559
13599
  };
13560
13600
  function getCompatValue(key, context) {
@@ -16662,7 +16702,7 @@ var Vue = (function () {
16662
16702
  }
16663
16703
  }
16664
16704
  }
16665
- else {
16705
+ else if (!isBuiltInDirective(name)) {
16666
16706
  // no built-in transform, this is a user custom directive.
16667
16707
  runtimeDirectives.push(prop);
16668
16708
  // custom dirs may use beforeUpdate so they need to force blocks