@vue/compat 3.5.12 → 3.5.14

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.12
2
+ * @vue/compat v3.5.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -158,10 +158,9 @@ function parseStringStyle(cssText) {
158
158
  return ret;
159
159
  }
160
160
  function stringifyStyle(styles) {
161
+ if (!styles) return "";
162
+ if (isString(styles)) return styles;
161
163
  let ret = "";
162
- if (!styles || isString(styles)) {
163
- return ret;
164
- }
165
164
  for (const key in styles) {
166
165
  const value = styles[key];
167
166
  if (isString(value) || typeof value === "number") {
@@ -367,6 +366,10 @@ class EffectScope {
367
366
  * @internal
368
367
  */
369
368
  this._active = true;
369
+ /**
370
+ * @internal track `on` calls, allow `on` call multiple times
371
+ */
372
+ this._on = 0;
370
373
  /**
371
374
  * @internal
372
375
  */
@@ -435,28 +438,38 @@ class EffectScope {
435
438
  * @internal
436
439
  */
437
440
  on() {
438
- activeEffectScope = this;
441
+ if (++this._on === 1) {
442
+ this.prevScope = activeEffectScope;
443
+ activeEffectScope = this;
444
+ }
439
445
  }
440
446
  /**
441
447
  * This should only be called on non-detached scopes
442
448
  * @internal
443
449
  */
444
450
  off() {
445
- activeEffectScope = this.parent;
451
+ if (this._on > 0 && --this._on === 0) {
452
+ activeEffectScope = this.prevScope;
453
+ this.prevScope = void 0;
454
+ }
446
455
  }
447
456
  stop(fromParent) {
448
457
  if (this._active) {
458
+ this._active = false;
449
459
  let i, l;
450
460
  for (i = 0, l = this.effects.length; i < l; i++) {
451
461
  this.effects[i].stop();
452
462
  }
463
+ this.effects.length = 0;
453
464
  for (i = 0, l = this.cleanups.length; i < l; i++) {
454
465
  this.cleanups[i]();
455
466
  }
467
+ this.cleanups.length = 0;
456
468
  if (this.scopes) {
457
469
  for (i = 0, l = this.scopes.length; i < l; i++) {
458
470
  this.scopes[i].stop(true);
459
471
  }
472
+ this.scopes.length = 0;
460
473
  }
461
474
  if (!this.detached && this.parent && !fromParent) {
462
475
  const last = this.parent.scopes.pop();
@@ -466,7 +479,6 @@ class EffectScope {
466
479
  }
467
480
  }
468
481
  this.parent = void 0;
469
- this._active = false;
470
482
  }
471
483
  }
472
484
  }
@@ -517,7 +529,7 @@ class ReactiveEffect {
517
529
  }
518
530
  resume() {
519
531
  if (this.flags & 64) {
520
- this.flags &= ~64;
532
+ this.flags &= -65;
521
533
  if (pausedQueueEffects.has(this)) {
522
534
  pausedQueueEffects.delete(this);
523
535
  this.trigger();
@@ -552,7 +564,7 @@ class ReactiveEffect {
552
564
  cleanupDeps(this);
553
565
  activeSub = prevEffect;
554
566
  shouldTrack = prevShouldTrack;
555
- this.flags &= ~2;
567
+ this.flags &= -3;
556
568
  }
557
569
  }
558
570
  stop() {
@@ -563,7 +575,7 @@ class ReactiveEffect {
563
575
  this.deps = this.depsTail = void 0;
564
576
  cleanupEffect(this);
565
577
  this.onStop && this.onStop();
566
- this.flags &= ~1;
578
+ this.flags &= -2;
567
579
  }
568
580
  }
569
581
  trigger() {
@@ -613,7 +625,7 @@ function endBatch() {
613
625
  while (e) {
614
626
  const next = e.next;
615
627
  e.next = void 0;
616
- e.flags &= ~8;
628
+ e.flags &= -9;
617
629
  e = next;
618
630
  }
619
631
  }
@@ -624,7 +636,7 @@ function endBatch() {
624
636
  while (e) {
625
637
  const next = e.next;
626
638
  e.next = void 0;
627
- e.flags &= ~8;
639
+ e.flags &= -9;
628
640
  if (e.flags & 1) {
629
641
  try {
630
642
  ;
@@ -680,17 +692,16 @@ function refreshComputed(computed) {
680
692
  if (computed.flags & 4 && !(computed.flags & 16)) {
681
693
  return;
682
694
  }
683
- computed.flags &= ~16;
695
+ computed.flags &= -17;
684
696
  if (computed.globalVersion === globalVersion) {
685
697
  return;
686
698
  }
687
699
  computed.globalVersion = globalVersion;
688
- const dep = computed.dep;
689
- computed.flags |= 2;
690
- if (dep.version > 0 && !computed.isSSR && computed.deps && !isDirty(computed)) {
691
- computed.flags &= ~2;
700
+ if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
692
701
  return;
693
702
  }
703
+ computed.flags |= 2;
704
+ const dep = computed.dep;
694
705
  const prevSub = activeSub;
695
706
  const prevShouldTrack = shouldTrack;
696
707
  activeSub = computed;
@@ -699,6 +710,7 @@ function refreshComputed(computed) {
699
710
  prepareDeps(computed);
700
711
  const value = computed.fn(computed._value);
701
712
  if (dep.version === 0 || hasChanged(value, computed._value)) {
713
+ computed.flags |= 128;
702
714
  computed._value = value;
703
715
  dep.version++;
704
716
  }
@@ -709,7 +721,7 @@ function refreshComputed(computed) {
709
721
  activeSub = prevSub;
710
722
  shouldTrack = prevShouldTrack;
711
723
  cleanupDeps(computed);
712
- computed.flags &= ~2;
724
+ computed.flags &= -3;
713
725
  }
714
726
  }
715
727
  function removeSub(link, soft = false) {
@@ -725,7 +737,7 @@ function removeSub(link, soft = false) {
725
737
  if (dep.subs === link) {
726
738
  dep.subs = prevSub;
727
739
  if (!prevSub && dep.computed) {
728
- dep.computed.flags &= ~4;
740
+ dep.computed.flags &= -5;
729
741
  for (let l = dep.computed.deps; l; l = l.nextDep) {
730
742
  removeSub(l, true);
731
743
  }
@@ -1180,6 +1192,7 @@ class BaseReactiveHandler {
1180
1192
  this._isShallow = _isShallow;
1181
1193
  }
1182
1194
  get(target, key, receiver) {
1195
+ if (key === "__v_skip") return target["__v_skip"];
1183
1196
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1184
1197
  if (key === "__v_isReactive") {
1185
1198
  return !isReadonly2;
@@ -1575,14 +1588,14 @@ function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandl
1575
1588
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
1576
1589
  return target;
1577
1590
  }
1578
- const existingProxy = proxyMap.get(target);
1579
- if (existingProxy) {
1580
- return existingProxy;
1581
- }
1582
1591
  const targetType = getTargetType(target);
1583
1592
  if (targetType === 0 /* INVALID */) {
1584
1593
  return target;
1585
1594
  }
1595
+ const existingProxy = proxyMap.get(target);
1596
+ if (existingProxy) {
1597
+ return existingProxy;
1598
+ }
1586
1599
  const proxy = new Proxy(
1587
1600
  target,
1588
1601
  targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers
@@ -1932,7 +1945,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1932
1945
  const scope = getCurrentScope();
1933
1946
  const watchHandle = () => {
1934
1947
  effect.stop();
1935
- if (scope) {
1948
+ if (scope && scope.active) {
1936
1949
  remove(scope.effects, effect);
1937
1950
  }
1938
1951
  };
@@ -2245,11 +2258,11 @@ function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2245
2258
  queue.splice(i, 1);
2246
2259
  i--;
2247
2260
  if (cb.flags & 4) {
2248
- cb.flags &= ~1;
2261
+ cb.flags &= -2;
2249
2262
  }
2250
2263
  cb();
2251
2264
  if (!(cb.flags & 4)) {
2252
- cb.flags &= ~1;
2265
+ cb.flags &= -2;
2253
2266
  }
2254
2267
  }
2255
2268
  }
@@ -2268,10 +2281,10 @@ function flushPostFlushCbs(seen) {
2268
2281
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
2269
2282
  const cb = activePostFlushCbs[postFlushIndex];
2270
2283
  if (cb.flags & 4) {
2271
- cb.flags &= ~1;
2284
+ cb.flags &= -2;
2272
2285
  }
2273
2286
  if (!(cb.flags & 8)) cb();
2274
- cb.flags &= ~1;
2287
+ cb.flags &= -2;
2275
2288
  }
2276
2289
  activePostFlushCbs = null;
2277
2290
  postFlushIndex = 0;
@@ -2301,7 +2314,7 @@ function flushJobs(seen) {
2301
2314
  for (; flushIndex < queue.length; flushIndex++) {
2302
2315
  const job = queue[flushIndex];
2303
2316
  if (job) {
2304
- job.flags &= ~1;
2317
+ job.flags &= -2;
2305
2318
  }
2306
2319
  }
2307
2320
  flushIndex = -1;
@@ -2739,11 +2752,32 @@ const TeleportImpl = {
2739
2752
  updateCssVars(n2, true);
2740
2753
  }
2741
2754
  if (isTeleportDeferred(n2.props)) {
2742
- queuePostRenderEffect(mountToTarget, parentSuspense);
2755
+ queuePostRenderEffect(() => {
2756
+ mountToTarget();
2757
+ n2.el.__isMounted = true;
2758
+ }, parentSuspense);
2743
2759
  } else {
2744
2760
  mountToTarget();
2745
2761
  }
2746
2762
  } else {
2763
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
2764
+ queuePostRenderEffect(() => {
2765
+ TeleportImpl.process(
2766
+ n1,
2767
+ n2,
2768
+ container,
2769
+ anchor,
2770
+ parentComponent,
2771
+ parentSuspense,
2772
+ namespace,
2773
+ slotScopeIds,
2774
+ optimized,
2775
+ internals
2776
+ );
2777
+ delete n1.el.__isMounted;
2778
+ }, parentSuspense);
2779
+ return;
2780
+ }
2747
2781
  n2.el = n1.el;
2748
2782
  n2.targetStart = n1.targetStart;
2749
2783
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3040,10 +3074,9 @@ const BaseTransitionImpl = {
3040
3074
  if (innerChild.type !== Comment) {
3041
3075
  setTransitionHooks(innerChild, enterHooks);
3042
3076
  }
3043
- const oldChild = instance.subTree;
3044
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3077
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3045
3078
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3046
- const leavingHooks = resolveTransitionHooks(
3079
+ let leavingHooks = resolveTransitionHooks(
3047
3080
  oldInnerChild,
3048
3081
  rawProps,
3049
3082
  state,
@@ -3058,6 +3091,7 @@ const BaseTransitionImpl = {
3058
3091
  instance.update();
3059
3092
  }
3060
3093
  delete leavingHooks.afterLeave;
3094
+ oldInnerChild = void 0;
3061
3095
  };
3062
3096
  return emptyPlaceholder(child);
3063
3097
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3071,10 +3105,19 @@ const BaseTransitionImpl = {
3071
3105
  earlyRemove();
3072
3106
  el[leaveCbKey] = void 0;
3073
3107
  delete enterHooks.delayedLeave;
3108
+ oldInnerChild = void 0;
3109
+ };
3110
+ enterHooks.delayedLeave = () => {
3111
+ delayedLeave();
3112
+ delete enterHooks.delayedLeave;
3113
+ oldInnerChild = void 0;
3074
3114
  };
3075
- enterHooks.delayedLeave = delayedLeave;
3076
3115
  };
3116
+ } else {
3117
+ oldInnerChild = void 0;
3077
3118
  }
3119
+ } else if (oldInnerChild) {
3120
+ oldInnerChild = void 0;
3078
3121
  }
3079
3122
  return child;
3080
3123
  };
@@ -3261,6 +3304,9 @@ function getInnerChild$1(vnode) {
3261
3304
  }
3262
3305
  return vnode;
3263
3306
  }
3307
+ if (vnode.component) {
3308
+ return vnode.component.subTree;
3309
+ }
3264
3310
  const { shapeFlag, children } = vnode;
3265
3311
  if (children) {
3266
3312
  if (shapeFlag & 16) {
@@ -3357,6 +3403,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3357
3403
  return;
3358
3404
  }
3359
3405
  if (isAsyncWrapper(vnode) && !isUnmount) {
3406
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
3407
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
3408
+ }
3360
3409
  return;
3361
3410
  }
3362
3411
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -3585,7 +3634,7 @@ function createHydrationFunctions(rendererInternals) {
3585
3634
  getContainerType(container),
3586
3635
  optimized
3587
3636
  );
3588
- if (isAsyncWrapper(vnode)) {
3637
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
3589
3638
  let subTree;
3590
3639
  if (isFragmentStart) {
3591
3640
  subTree = createVNode(Fragment);
@@ -3822,6 +3871,10 @@ function createHydrationFunctions(rendererInternals) {
3822
3871
  getContainerType(container),
3823
3872
  slotScopeIds
3824
3873
  );
3874
+ if (parentComponent) {
3875
+ parentComponent.vnode.el = vnode.el;
3876
+ updateHOCHostEl(parentComponent, vnode.el);
3877
+ }
3825
3878
  return next;
3826
3879
  };
3827
3880
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -4284,7 +4337,7 @@ const KeepAliveImpl = {
4284
4337
  );
4285
4338
  const { include, exclude, max } = props;
4286
4339
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4287
- vnode.shapeFlag &= ~256;
4340
+ vnode.shapeFlag &= -257;
4288
4341
  current = vnode;
4289
4342
  return rawVNode;
4290
4343
  }
@@ -4375,8 +4428,8 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
4375
4428
  }, target);
4376
4429
  }
4377
4430
  function resetShapeFlag(vnode) {
4378
- vnode.shapeFlag &= ~256;
4379
- vnode.shapeFlag &= ~512;
4431
+ vnode.shapeFlag &= -257;
4432
+ vnode.shapeFlag &= -513;
4380
4433
  }
4381
4434
  function getInnerChild(vnode) {
4382
4435
  return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
@@ -4764,14 +4817,16 @@ function renderList(source, renderItem, cache, index) {
4764
4817
  if (sourceIsArray || isString(source)) {
4765
4818
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
4766
4819
  let needsWrap = false;
4820
+ let isReadonlySource = false;
4767
4821
  if (sourceIsReactiveArray) {
4768
4822
  needsWrap = !isShallow(source);
4823
+ isReadonlySource = isReadonly(source);
4769
4824
  source = shallowReadArray(source);
4770
4825
  }
4771
4826
  ret = new Array(source.length);
4772
4827
  for (let i = 0, l = source.length; i < l; i++) {
4773
4828
  ret[i] = renderItem(
4774
- needsWrap ? toReactive(source[i]) : source[i],
4829
+ needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i],
4775
4830
  i,
4776
4831
  void 0,
4777
4832
  cached && cached[i]
@@ -5761,7 +5816,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5761
5816
  return vm;
5762
5817
  }
5763
5818
  }
5764
- Vue.version = `2.6.14-compat:${"3.5.12"}`;
5819
+ Vue.version = `2.6.14-compat:${"3.5.14"}`;
5765
5820
  Vue.config = singletonApp.config;
5766
5821
  Vue.use = (plugin, ...options) => {
5767
5822
  if (plugin && isFunction(plugin.install)) {
@@ -6632,7 +6687,7 @@ const normalizeVNodeSlots = (instance, children) => {
6632
6687
  };
6633
6688
  const assignSlots = (slots, children, optimized) => {
6634
6689
  for (const key in children) {
6635
- if (optimized || key !== "_") {
6690
+ if (optimized || !isInternalKey(key)) {
6636
6691
  slots[key] = children[key];
6637
6692
  }
6638
6693
  }
@@ -7743,7 +7798,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7743
7798
  queuePostRenderEffect(() => transition.enter(el), parentSuspense);
7744
7799
  } else {
7745
7800
  const { leave, delayLeave, afterLeave } = transition;
7746
- const remove2 = () => hostInsert(el, container, anchor);
7801
+ const remove2 = () => {
7802
+ if (vnode.ctx.isUnmounted) {
7803
+ hostRemove(el);
7804
+ } else {
7805
+ hostInsert(el, container, anchor);
7806
+ }
7807
+ };
7747
7808
  const performLeave = () => {
7748
7809
  leave(el, () => {
7749
7810
  remove2();
@@ -7776,7 +7837,9 @@ function baseCreateRenderer(options, createHydrationFns) {
7776
7837
  optimized = false;
7777
7838
  }
7778
7839
  if (ref != null) {
7840
+ pauseTracking();
7779
7841
  setRef(ref, null, parentSuspense, vnode, true);
7842
+ resetTracking();
7780
7843
  }
7781
7844
  if (cacheIndex != null) {
7782
7845
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -7877,12 +7940,27 @@ function baseCreateRenderer(options, createHydrationFns) {
7877
7940
  hostRemove(end);
7878
7941
  };
7879
7942
  const unmountComponent = (instance, parentSuspense, doRemove) => {
7880
- const { bum, scope, job, subTree, um, m, a } = instance;
7943
+ const {
7944
+ bum,
7945
+ scope,
7946
+ job,
7947
+ subTree,
7948
+ um,
7949
+ m,
7950
+ a,
7951
+ parent,
7952
+ slots: { __: slotCacheKeys }
7953
+ } = instance;
7881
7954
  invalidateMount(m);
7882
7955
  invalidateMount(a);
7883
7956
  if (bum) {
7884
7957
  invokeArrayFns(bum);
7885
7958
  }
7959
+ if (parent && isArray(slotCacheKeys)) {
7960
+ slotCacheKeys.forEach((v) => {
7961
+ parent.renderCache[v] = void 0;
7962
+ });
7963
+ }
7886
7964
  if (isCompatEnabled$1("INSTANCE_EVENT_HOOKS", instance)) {
7887
7965
  instance.emit("hook:beforeDestroy");
7888
7966
  }
@@ -7984,8 +8062,8 @@ function toggleRecurse({ effect, job }, allowed) {
7984
8062
  effect.flags |= 32;
7985
8063
  job.flags |= 4;
7986
8064
  } else {
7987
- effect.flags &= ~32;
7988
- job.flags &= ~4;
8065
+ effect.flags &= -33;
8066
+ job.flags &= -5;
7989
8067
  }
7990
8068
  }
7991
8069
  function needTransition(parentSuspense, transition) {
@@ -8009,6 +8087,9 @@ function traverseStaticChildren(n1, n2, shallow = false) {
8009
8087
  if (c2.type === Text) {
8010
8088
  c2.el = c1.el;
8011
8089
  }
8090
+ if (c2.type === Comment && !c2.el) {
8091
+ c2.el = c1.el;
8092
+ }
8012
8093
  }
8013
8094
  }
8014
8095
  }
@@ -9199,9 +9280,9 @@ function closeBlock() {
9199
9280
  currentBlock = blockStack[blockStack.length - 1] || null;
9200
9281
  }
9201
9282
  let isBlockTreeEnabled = 1;
9202
- function setBlockTracking(value) {
9283
+ function setBlockTracking(value, inVOnce = false) {
9203
9284
  isBlockTreeEnabled += value;
9204
- if (value < 0 && currentBlock) {
9285
+ if (value < 0 && currentBlock && inVOnce) {
9205
9286
  currentBlock.hasOnce = true;
9206
9287
  }
9207
9288
  }
@@ -9672,7 +9753,7 @@ function setupComponent(instance, isSSR = false, optimized = false) {
9672
9753
  const { props, children } = instance.vnode;
9673
9754
  const isStateful = isStatefulComponent(instance);
9674
9755
  initProps(instance, props, isStateful, isSSR);
9675
- initSlots(instance, children, optimized);
9756
+ initSlots(instance, children, optimized || isSSR);
9676
9757
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9677
9758
  isSSR && setInSSRSetupState(false);
9678
9759
  return setupResult;
@@ -9890,7 +9971,7 @@ function isMemoSame(cached, memo) {
9890
9971
  return true;
9891
9972
  }
9892
9973
 
9893
- const version = "3.5.12";
9974
+ const version = "3.5.14";
9894
9975
  const warn$1 = NOOP;
9895
9976
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9896
9977
  const devtools = void 0;
@@ -10099,7 +10180,8 @@ function resolveTransitionProps(rawProps) {
10099
10180
  onAppear = onEnter,
10100
10181
  onAppearCancelled = onEnterCancelled
10101
10182
  } = baseProps;
10102
- const finishEnter = (el, isAppear, done) => {
10183
+ const finishEnter = (el, isAppear, done, isCancelled) => {
10184
+ el._enterCancelled = isCancelled;
10103
10185
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10104
10186
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10105
10187
  done && done();
@@ -10157,8 +10239,13 @@ function resolveTransitionProps(rawProps) {
10157
10239
  if (legacyClassEnabled && legacyLeaveFromClass) {
10158
10240
  addTransitionClass(el, legacyLeaveFromClass);
10159
10241
  }
10160
- addTransitionClass(el, leaveActiveClass);
10161
- forceReflow();
10242
+ if (!el._enterCancelled) {
10243
+ forceReflow();
10244
+ addTransitionClass(el, leaveActiveClass);
10245
+ } else {
10246
+ addTransitionClass(el, leaveActiveClass);
10247
+ forceReflow();
10248
+ }
10162
10249
  nextFrame(() => {
10163
10250
  if (!el._isLeaving) {
10164
10251
  return;
@@ -10175,11 +10262,11 @@ function resolveTransitionProps(rawProps) {
10175
10262
  callHook(onLeave, [el, resolve]);
10176
10263
  },
10177
10264
  onEnterCancelled(el) {
10178
- finishEnter(el, false);
10265
+ finishEnter(el, false, void 0, true);
10179
10266
  callHook(onEnterCancelled, [el]);
10180
10267
  },
10181
10268
  onAppearCancelled(el) {
10182
- finishEnter(el, true);
10269
+ finishEnter(el, true, void 0, true);
10183
10270
  callHook(onAppearCancelled, [el]);
10184
10271
  },
10185
10272
  onLeaveCancelled(el) {
@@ -10687,7 +10774,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
10687
10774
  }
10688
10775
  return false;
10689
10776
  }
10690
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
10777
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
10691
10778
  return false;
10692
10779
  }
10693
10780
  if (key === "form") {
@@ -10938,6 +11025,8 @@ class VueElement extends BaseClass {
10938
11025
  this._update();
10939
11026
  }
10940
11027
  if (shouldReflect) {
11028
+ const ob = this._ob;
11029
+ ob && ob.disconnect();
10941
11030
  if (val === true) {
10942
11031
  this.setAttribute(hyphenate(key), "");
10943
11032
  } else if (typeof val === "string" || typeof val === "number") {
@@ -10945,6 +11034,7 @@ class VueElement extends BaseClass {
10945
11034
  } else if (!val) {
10946
11035
  this.removeAttribute(hyphenate(key));
10947
11036
  }
11037
+ ob && ob.observe(this, { attributes: true });
10948
11038
  }
10949
11039
  }
10950
11040
  }
@@ -11114,6 +11204,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11114
11204
  instance.vnode.el,
11115
11205
  moveClass
11116
11206
  )) {
11207
+ prevChildren = [];
11117
11208
  return;
11118
11209
  }
11119
11210
  prevChildren.forEach(callPendingCbs);
@@ -11137,6 +11228,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11137
11228
  };
11138
11229
  el.addEventListener("transitionend", cb);
11139
11230
  });
11231
+ prevChildren = [];
11140
11232
  });
11141
11233
  return () => {
11142
11234
  const rawProps = toRaw(props);
@@ -12081,12 +12173,13 @@ function createConditionalExpression(test, consequent, alternate, newline = true
12081
12173
  loc: locStub
12082
12174
  };
12083
12175
  }
12084
- function createCacheExpression(index, value, needPauseTracking = false) {
12176
+ function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
12085
12177
  return {
12086
12178
  type: 20,
12087
12179
  index,
12088
12180
  value,
12089
12181
  needPauseTracking,
12182
+ inVOnce,
12090
12183
  needArraySpread: false,
12091
12184
  loc: locStub
12092
12185
  };
@@ -13315,7 +13408,7 @@ function isReferenced(node, parent, grandparent) {
13315
13408
  if (parent.key === node) {
13316
13409
  return !!parent.computed;
13317
13410
  }
13318
- return !grandparent;
13411
+ return true;
13319
13412
  // no: class { NODE = value; }
13320
13413
  // yes: class { [NODE] = value; }
13321
13414
  // yes: class { key = NODE; }
@@ -13934,7 +14027,7 @@ const tokenizer = new Tokenizer(stack, {
13934
14027
  "COMPILER_V_BIND_SYNC",
13935
14028
  currentOptions,
13936
14029
  currentProp.loc,
13937
- currentProp.rawName
14030
+ currentProp.arg.loc.source
13938
14031
  )) {
13939
14032
  currentProp.name = "model";
13940
14033
  currentProp.modifiers.splice(syncIndex, 1);
@@ -14489,6 +14582,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14489
14582
  }
14490
14583
  }
14491
14584
  let cachedAsArray = false;
14585
+ const slotCacheKeys = [];
14492
14586
  if (toCache.length === children.length && node.type === 1) {
14493
14587
  if (node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
14494
14588
  node.codegenNode.children = getCacheExpression(
@@ -14498,6 +14592,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14498
14592
  } else if (node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14499
14593
  const slot = getSlotNode(node.codegenNode, "default");
14500
14594
  if (slot) {
14595
+ slotCacheKeys.push(context.cached.length);
14501
14596
  slot.returns = getCacheExpression(
14502
14597
  createArrayExpression(slot.returns)
14503
14598
  );
@@ -14507,6 +14602,7 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14507
14602
  const slotName = findDir(node, "slot", true);
14508
14603
  const slot = slotName && slotName.arg && getSlotNode(parent.codegenNode, slotName.arg);
14509
14604
  if (slot) {
14605
+ slotCacheKeys.push(context.cached.length);
14510
14606
  slot.returns = getCacheExpression(
14511
14607
  createArrayExpression(slot.returns)
14512
14608
  );
@@ -14516,9 +14612,18 @@ function walk(node, parent, context, doNotHoistNode = false, inFor = false) {
14516
14612
  }
14517
14613
  if (!cachedAsArray) {
14518
14614
  for (const child of toCache) {
14615
+ slotCacheKeys.push(context.cached.length);
14519
14616
  child.codegenNode = context.cache(child.codegenNode);
14520
14617
  }
14521
14618
  }
14619
+ if (slotCacheKeys.length && node.type === 1 && node.tagType === 1 && node.codegenNode && node.codegenNode.type === 13 && node.codegenNode.children && !isArray(node.codegenNode.children) && node.codegenNode.children.type === 15) {
14620
+ node.codegenNode.children.properties.push(
14621
+ createObjectProperty(
14622
+ `__`,
14623
+ createSimpleExpression(JSON.stringify(slotCacheKeys), false)
14624
+ )
14625
+ );
14626
+ }
14522
14627
  function getCacheExpression(value) {
14523
14628
  const exp = context.cache(value);
14524
14629
  if (inFor && context.hmr) {
@@ -14845,11 +14950,12 @@ function createTransformContext(root, {
14845
14950
  identifier.hoisted = exp;
14846
14951
  return identifier;
14847
14952
  },
14848
- cache(exp, isVNode = false) {
14953
+ cache(exp, isVNode = false, inVOnce = false) {
14849
14954
  const cacheExp = createCacheExpression(
14850
14955
  context.cached.length,
14851
14956
  exp,
14852
- isVNode
14957
+ isVNode,
14958
+ inVOnce
14853
14959
  );
14854
14960
  context.cached.push(cacheExp);
14855
14961
  return cacheExp;
@@ -15684,7 +15790,9 @@ function genCacheExpression(node, context) {
15684
15790
  push(`_cache[${node.index}] || (`);
15685
15791
  if (needPauseTracking) {
15686
15792
  indent();
15687
- push(`${helper(SET_BLOCK_TRACKING)}(-1),`);
15793
+ push(`${helper(SET_BLOCK_TRACKING)}(-1`);
15794
+ if (node.inVOnce) push(`, true`);
15795
+ push(`),`);
15688
15796
  newline();
15689
15797
  push(`(`);
15690
15798
  }
@@ -15772,12 +15880,14 @@ const transformExpression = (node, context) => {
15772
15880
  context
15773
15881
  );
15774
15882
  } else if (node.type === 1) {
15883
+ const memo = findDir(node, "memo");
15775
15884
  for (let i = 0; i < node.props.length; i++) {
15776
15885
  const dir = node.props[i];
15777
15886
  if (dir.type === 7 && dir.name !== "for") {
15778
15887
  const exp = dir.exp;
15779
15888
  const arg = dir.arg;
15780
- if (exp && exp.type === 4 && !(dir.name === "on" && arg)) {
15889
+ if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
15890
+ !(memo && arg && arg.type === 4 && arg.content === "key")) {
15781
15891
  dir.exp = processExpression(
15782
15892
  exp,
15783
15893
  context,
@@ -16296,10 +16406,19 @@ const transformFor = createStructuralDirectiveTransform(
16296
16406
  const isTemplate = isTemplateNode(node);
16297
16407
  const memo = findDir(node, "memo");
16298
16408
  const keyProp = findProp(node, `key`, false, true);
16299
- if (keyProp && keyProp.type === 7 && !keyProp.exp) {
16409
+ const isDirKey = keyProp && keyProp.type === 7;
16410
+ if (isDirKey && !keyProp.exp) {
16300
16411
  transformBindShorthand(keyProp, context);
16301
16412
  }
16302
- const keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16413
+ let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
16414
+ if (memo && keyExp && isDirKey) {
16415
+ {
16416
+ keyProp.exp = keyExp = processExpression(
16417
+ keyExp,
16418
+ context
16419
+ );
16420
+ }
16421
+ }
16303
16422
  const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
16304
16423
  if (isTemplate) {
16305
16424
  if (memo) {
@@ -17658,8 +17777,8 @@ const transformOnce = (node, context) => {
17658
17777
  if (cur.codegenNode) {
17659
17778
  cur.codegenNode = context.cache(
17660
17779
  cur.codegenNode,
17780
+ true,
17661
17781
  true
17662
- /* isVNode */
17663
17782
  );
17664
17783
  }
17665
17784
  };