vue 3.6.0-alpha.6 → 3.6.0-alpha.7

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-alpha.6
2
+ * vue v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-alpha.6
2
+ * vue v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-alpha.6
2
+ * vue v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2070,6 +2070,16 @@ class EffectScope {
2070
2070
  return;
2071
2071
  }
2072
2072
  this.flags = 1024;
2073
+ this.reset();
2074
+ const sub = this.subs;
2075
+ if (sub !== void 0) {
2076
+ unlink(sub);
2077
+ }
2078
+ }
2079
+ /**
2080
+ * @internal
2081
+ */
2082
+ reset() {
2073
2083
  let dep = this.deps;
2074
2084
  while (dep !== void 0) {
2075
2085
  const node = dep.dep;
@@ -2080,10 +2090,6 @@ class EffectScope {
2080
2090
  dep = unlink(dep, this);
2081
2091
  }
2082
2092
  }
2083
- const sub = this.subs;
2084
- if (sub !== void 0) {
2085
- unlink(sub);
2086
- }
2087
2093
  cleanup(this);
2088
2094
  }
2089
2095
  }
@@ -2895,6 +2901,7 @@ function checkRecursiveUpdates(seen, fn) {
2895
2901
 
2896
2902
  let isHmrUpdating = false;
2897
2903
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2904
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2898
2905
  {
2899
2906
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
2900
2907
  createRecord: tryWrap(createRecord),
@@ -2958,9 +2965,10 @@ function reload(id, newComp) {
2958
2965
  const record = map.get(id);
2959
2966
  if (!record) return;
2960
2967
  newComp = normalizeClassComponent(newComp);
2968
+ const isVapor = record.initialDef.__vapor;
2961
2969
  updateComponentDef(record.initialDef, newComp);
2962
2970
  const instances = [...record.instances];
2963
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
2971
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2964
2972
  for (const instance of instances) {
2965
2973
  if (instance.root && instance.root.ce && instance !== instance.root) {
2966
2974
  instance.root.ce._removeChildStyle(instance.type);
@@ -2980,6 +2988,7 @@ function reload(id, newComp) {
2980
2988
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2981
2989
  }
2982
2990
  dirtyInstances.add(instance);
2991
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2983
2992
  instance.appContext.propsCache.delete(instance.type);
2984
2993
  instance.appContext.emitsCache.delete(instance.type);
2985
2994
  instance.appContext.optionsCache.delete(instance.type);
@@ -3020,6 +3029,7 @@ function reload(id, newComp) {
3020
3029
  }
3021
3030
  queuePostFlushCb(() => {
3022
3031
  hmrDirtyComponents.clear();
3032
+ hmrDirtyComponentsMode.clear();
3023
3033
  });
3024
3034
  }
3025
3035
  function updateComponentDef(oldComp, newComp) {
@@ -3650,7 +3660,7 @@ const BaseTransitionPropsValidators = {
3650
3660
  onAppearCancelled: TransitionHookValidator
3651
3661
  };
3652
3662
  const recursiveGetSubtree = (instance) => {
3653
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3663
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
3654
3664
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3655
3665
  };
3656
3666
  const BaseTransitionImpl = {
@@ -3957,7 +3967,7 @@ function getInnerChild$1(vnode) {
3957
3967
  }
3958
3968
  function setTransitionHooks(vnode, hooks) {
3959
3969
  if (vnode.shapeFlag & 6 && vnode.component) {
3960
- if (vnode.type.__vapor) {
3970
+ if (isVaporComponent(vnode.type)) {
3961
3971
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
3962
3972
  vnode.component,
3963
3973
  hooks
@@ -8046,7 +8056,13 @@ function baseCreateRenderer(options, createHydrationFns) {
8046
8056
  );
8047
8057
  break;
8048
8058
  case VaporSlot:
8049
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
8059
+ getVaporInterface(parentComponent, n2).slot(
8060
+ n1,
8061
+ n2,
8062
+ container,
8063
+ anchor,
8064
+ parentComponent
8065
+ );
8050
8066
  break;
8051
8067
  default:
8052
8068
  if (shapeFlag & 1) {
@@ -9227,7 +9243,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9227
9243
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
9228
9244
  const { el, type, transition, children, shapeFlag } = vnode;
9229
9245
  if (shapeFlag & 6) {
9230
- if (type.__vapor) {
9246
+ if (isVaporComponent(type)) {
9231
9247
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
9232
9248
  } else {
9233
9249
  move(
@@ -9337,7 +9353,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9337
9353
  parentComponent.renderCache[cacheIndex] = void 0;
9338
9354
  }
9339
9355
  if (shapeFlag & 256) {
9340
- if (vnode.type.__vapor) {
9356
+ if (isVaporComponent(vnode.type)) {
9341
9357
  getVaporInterface(parentComponent, vnode).deactivate(
9342
9358
  vnode,
9343
9359
  parentComponent.ctx.getStorageContainer()
@@ -9354,7 +9370,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9354
9370
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
9355
9371
  }
9356
9372
  if (shapeFlag & 6) {
9357
- if (type.__vapor) {
9373
+ if (isVaporComponent(type)) {
9358
9374
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
9359
9375
  return;
9360
9376
  } else {
@@ -9486,7 +9502,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9486
9502
  };
9487
9503
  const getNextHostNode = (vnode) => {
9488
9504
  if (vnode.shapeFlag & 6) {
9489
- if (vnode.type.__vapor) {
9505
+ if (isVaporComponent(vnode.type)) {
9490
9506
  return hostNextSibling(vnode.anchor);
9491
9507
  }
9492
9508
  return getNextHostNode(vnode.component.subTree);
@@ -9676,6 +9692,12 @@ app.use(vaporInteropPlugin)
9676
9692
  }
9677
9693
  return res;
9678
9694
  }
9695
+ function isVaporComponent(type) {
9696
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
9697
+ return hmrDirtyComponentsMode.get(type);
9698
+ }
9699
+ return type.__vapor;
9700
+ }
9679
9701
  function getInheritedScopeIds(vnode, parentComponent) {
9680
9702
  const inheritedScopeIds = [];
9681
9703
  let currentParent = parentComponent;
@@ -11344,7 +11366,7 @@ function isMemoSame(cached, memo) {
11344
11366
  return true;
11345
11367
  }
11346
11368
 
11347
- const version = "3.6.0-alpha.6";
11369
+ const version = "3.6.0-alpha.7";
11348
11370
  const warn = warn$1 ;
11349
11371
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11350
11372
  const devtools = devtools$1 ;