@vue/compat 3.5.12 → 3.5.13

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.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -141,10 +141,9 @@ function parseStringStyle(cssText) {
141
141
  return ret;
142
142
  }
143
143
  function stringifyStyle(styles) {
144
+ if (!styles) return "";
145
+ if (isString(styles)) return styles;
144
146
  let ret = "";
145
- if (!styles || isString(styles)) {
146
- return ret;
147
- }
148
147
  for (const key in styles) {
149
148
  const value = styles[key];
150
149
  if (isString(value) || typeof value === "number") {
@@ -405,17 +404,21 @@ class EffectScope {
405
404
  }
406
405
  stop(fromParent) {
407
406
  if (this._active) {
407
+ this._active = false;
408
408
  let i, l;
409
409
  for (i = 0, l = this.effects.length; i < l; i++) {
410
410
  this.effects[i].stop();
411
411
  }
412
+ this.effects.length = 0;
412
413
  for (i = 0, l = this.cleanups.length; i < l; i++) {
413
414
  this.cleanups[i]();
414
415
  }
416
+ this.cleanups.length = 0;
415
417
  if (this.scopes) {
416
418
  for (i = 0, l = this.scopes.length; i < l; i++) {
417
419
  this.scopes[i].stop(true);
418
420
  }
421
+ this.scopes.length = 0;
419
422
  }
420
423
  if (!this.detached && this.parent && !fromParent) {
421
424
  const last = this.parent.scopes.pop();
@@ -425,7 +428,6 @@ class EffectScope {
425
428
  }
426
429
  }
427
430
  this.parent = void 0;
428
- this._active = false;
429
431
  }
430
432
  }
431
433
  }
@@ -1191,6 +1193,7 @@ class BaseReactiveHandler {
1191
1193
  this._isShallow = _isShallow;
1192
1194
  }
1193
1195
  get(target, key, receiver) {
1196
+ if (key === "__v_skip") return target["__v_skip"];
1194
1197
  const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
1195
1198
  if (key === "__v_isReactive") {
1196
1199
  return !isReadonly2;
@@ -2027,7 +2030,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2027
2030
  const scope = getCurrentScope();
2028
2031
  const watchHandle = () => {
2029
2032
  effect.stop();
2030
- if (scope) {
2033
+ if (scope && scope.active) {
2031
2034
  remove(scope.effects, effect);
2032
2035
  }
2033
2036
  };
@@ -3515,11 +3518,32 @@ const TeleportImpl = {
3515
3518
  updateCssVars(n2, true);
3516
3519
  }
3517
3520
  if (isTeleportDeferred(n2.props)) {
3518
- queuePostRenderEffect(mountToTarget, parentSuspense);
3521
+ queuePostRenderEffect(() => {
3522
+ mountToTarget();
3523
+ n2.el.__isMounted = true;
3524
+ }, parentSuspense);
3519
3525
  } else {
3520
3526
  mountToTarget();
3521
3527
  }
3522
3528
  } else {
3529
+ if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
3530
+ queuePostRenderEffect(() => {
3531
+ TeleportImpl.process(
3532
+ n1,
3533
+ n2,
3534
+ container,
3535
+ anchor,
3536
+ parentComponent,
3537
+ parentSuspense,
3538
+ namespace,
3539
+ slotScopeIds,
3540
+ optimized,
3541
+ internals
3542
+ );
3543
+ delete n1.el.__isMounted;
3544
+ }, parentSuspense);
3545
+ return;
3546
+ }
3523
3547
  n2.el = n1.el;
3524
3548
  n2.targetStart = n1.targetStart;
3525
3549
  const mainAnchor = n2.anchor = n1.anchor;
@@ -3825,10 +3849,9 @@ const BaseTransitionImpl = {
3825
3849
  if (innerChild.type !== Comment) {
3826
3850
  setTransitionHooks(innerChild, enterHooks);
3827
3851
  }
3828
- const oldChild = instance.subTree;
3829
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3852
+ let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
3830
3853
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
3831
- const leavingHooks = resolveTransitionHooks(
3854
+ let leavingHooks = resolveTransitionHooks(
3832
3855
  oldInnerChild,
3833
3856
  rawProps,
3834
3857
  state,
@@ -3843,6 +3866,7 @@ const BaseTransitionImpl = {
3843
3866
  instance.update();
3844
3867
  }
3845
3868
  delete leavingHooks.afterLeave;
3869
+ oldInnerChild = void 0;
3846
3870
  };
3847
3871
  return emptyPlaceholder(child);
3848
3872
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3856,10 +3880,19 @@ const BaseTransitionImpl = {
3856
3880
  earlyRemove();
3857
3881
  el[leaveCbKey] = void 0;
3858
3882
  delete enterHooks.delayedLeave;
3883
+ oldInnerChild = void 0;
3884
+ };
3885
+ enterHooks.delayedLeave = () => {
3886
+ delayedLeave();
3887
+ delete enterHooks.delayedLeave;
3888
+ oldInnerChild = void 0;
3859
3889
  };
3860
- enterHooks.delayedLeave = delayedLeave;
3861
3890
  };
3891
+ } else {
3892
+ oldInnerChild = void 0;
3862
3893
  }
3894
+ } else if (oldInnerChild) {
3895
+ oldInnerChild = void 0;
3863
3896
  }
3864
3897
  return child;
3865
3898
  };
@@ -4167,6 +4200,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4167
4200
  return;
4168
4201
  }
4169
4202
  if (isAsyncWrapper(vnode) && !isUnmount) {
4203
+ if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
4204
+ setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
4205
+ }
4170
4206
  return;
4171
4207
  }
4172
4208
  const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
@@ -4431,7 +4467,7 @@ function createHydrationFunctions(rendererInternals) {
4431
4467
  getContainerType(container),
4432
4468
  optimized
4433
4469
  );
4434
- if (isAsyncWrapper(vnode)) {
4470
+ if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
4435
4471
  let subTree;
4436
4472
  if (isFragmentStart) {
4437
4473
  subTree = createVNode(Fragment);
@@ -4700,6 +4736,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4700
4736
  getContainerType(container),
4701
4737
  slotScopeIds
4702
4738
  );
4739
+ if (parentComponent) {
4740
+ parentComponent.vnode.el = vnode.el;
4741
+ updateHOCHostEl(parentComponent, vnode.el);
4742
+ }
4703
4743
  return next;
4704
4744
  };
4705
4745
  const locateClosingAnchor = (node, open = "[", close = "]") => {
@@ -7055,7 +7095,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7055
7095
  return vm;
7056
7096
  }
7057
7097
  }
7058
- Vue.version = `2.6.14-compat:${"3.5.12"}`;
7098
+ Vue.version = `2.6.14-compat:${"3.5.13"}`;
7059
7099
  Vue.config = singletonApp.config;
7060
7100
  Vue.use = (plugin, ...options) => {
7061
7101
  if (plugin && isFunction(plugin.install)) {
@@ -10270,7 +10310,7 @@ function renderComponentRoot(instance) {
10270
10310
  }
10271
10311
  if (extraAttrs.length) {
10272
10312
  warn$1(
10273
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
10313
+ `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
10274
10314
  );
10275
10315
  }
10276
10316
  if (eventAttrs.length) {
@@ -11131,9 +11171,9 @@ function closeBlock() {
11131
11171
  currentBlock = blockStack[blockStack.length - 1] || null;
11132
11172
  }
11133
11173
  let isBlockTreeEnabled = 1;
11134
- function setBlockTracking(value) {
11174
+ function setBlockTracking(value, inVOnce = false) {
11135
11175
  isBlockTreeEnabled += value;
11136
- if (value < 0 && currentBlock) {
11176
+ if (value < 0 && currentBlock && inVOnce) {
11137
11177
  currentBlock.hasOnce = true;
11138
11178
  }
11139
11179
  }
@@ -12179,7 +12219,7 @@ function isMemoSame(cached, memo) {
12179
12219
  return true;
12180
12220
  }
12181
12221
 
12182
- const version = "3.5.12";
12222
+ const version = "3.5.13";
12183
12223
  const warn = warn$1 ;
12184
12224
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12185
12225
  const devtools = devtools$1 ;
@@ -12389,7 +12429,8 @@ function resolveTransitionProps(rawProps) {
12389
12429
  onAppear = onEnter,
12390
12430
  onAppearCancelled = onEnterCancelled
12391
12431
  } = baseProps;
12392
- const finishEnter = (el, isAppear, done) => {
12432
+ const finishEnter = (el, isAppear, done, isCancelled) => {
12433
+ el._enterCancelled = isCancelled;
12393
12434
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
12394
12435
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12395
12436
  done && done();
@@ -12447,8 +12488,13 @@ function resolveTransitionProps(rawProps) {
12447
12488
  if (legacyClassEnabled && legacyLeaveFromClass) {
12448
12489
  addTransitionClass(el, legacyLeaveFromClass);
12449
12490
  }
12450
- addTransitionClass(el, leaveActiveClass);
12451
- forceReflow();
12491
+ if (!el._enterCancelled) {
12492
+ forceReflow();
12493
+ addTransitionClass(el, leaveActiveClass);
12494
+ } else {
12495
+ addTransitionClass(el, leaveActiveClass);
12496
+ forceReflow();
12497
+ }
12452
12498
  nextFrame(() => {
12453
12499
  if (!el._isLeaving) {
12454
12500
  return;
@@ -12465,11 +12511,11 @@ function resolveTransitionProps(rawProps) {
12465
12511
  callHook(onLeave, [el, resolve]);
12466
12512
  },
12467
12513
  onEnterCancelled(el) {
12468
- finishEnter(el, false);
12514
+ finishEnter(el, false, void 0, true);
12469
12515
  callHook(onEnterCancelled, [el]);
12470
12516
  },
12471
12517
  onAppearCancelled(el) {
12472
- finishEnter(el, true);
12518
+ finishEnter(el, true, void 0, true);
12473
12519
  callHook(onAppearCancelled, [el]);
12474
12520
  },
12475
12521
  onLeaveCancelled(el) {
@@ -12689,10 +12735,11 @@ function useCssVars(getter) {
12689
12735
  }
12690
12736
  updateTeleports(vars);
12691
12737
  };
12692
- onBeforeMount(() => {
12693
- watchPostEffect(setVars);
12738
+ onBeforeUpdate(() => {
12739
+ queuePostFlushCb(setVars);
12694
12740
  });
12695
12741
  onMounted(() => {
12742
+ watch(setVars, NOOP, { flush: "post" });
12696
12743
  const ob = new MutationObserver(setVars);
12697
12744
  ob.observe(instance.subTree.el.parentNode, { childList: true });
12698
12745
  onUnmounted(() => ob.disconnect());
@@ -13343,6 +13390,8 @@ class VueElement extends BaseClass {
13343
13390
  this._update();
13344
13391
  }
13345
13392
  if (shouldReflect) {
13393
+ const ob = this._ob;
13394
+ ob && ob.disconnect();
13346
13395
  if (val === true) {
13347
13396
  this.setAttribute(hyphenate(key), "");
13348
13397
  } else if (typeof val === "string" || typeof val === "number") {
@@ -13350,6 +13399,7 @@ class VueElement extends BaseClass {
13350
13399
  } else if (!val) {
13351
13400
  this.removeAttribute(hyphenate(key));
13352
13401
  }
13402
+ ob && ob.observe(this, { attributes: true });
13353
13403
  }
13354
13404
  }
13355
13405
  }