@vue/compat 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-alpha.6
2
+ * @vue/compat v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2085,6 +2085,16 @@ class EffectScope {
2085
2085
  return;
2086
2086
  }
2087
2087
  this.flags = 1024;
2088
+ this.reset();
2089
+ const sub = this.subs;
2090
+ if (sub !== void 0) {
2091
+ unlink(sub);
2092
+ }
2093
+ }
2094
+ /**
2095
+ * @internal
2096
+ */
2097
+ reset() {
2088
2098
  let dep = this.deps;
2089
2099
  while (dep !== void 0) {
2090
2100
  const node = dep.dep;
@@ -2095,10 +2105,6 @@ class EffectScope {
2095
2105
  dep = unlink(dep, this);
2096
2106
  }
2097
2107
  }
2098
- const sub = this.subs;
2099
- if (sub !== void 0) {
2100
- unlink(sub);
2101
- }
2102
2108
  cleanup(this);
2103
2109
  }
2104
2110
  }
@@ -2915,6 +2921,7 @@ function checkRecursiveUpdates(seen, fn) {
2915
2921
 
2916
2922
  let isHmrUpdating = false;
2917
2923
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2924
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2918
2925
  if (!!(process.env.NODE_ENV !== "production")) {
2919
2926
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
2920
2927
  createRecord: tryWrap(createRecord),
@@ -2978,9 +2985,10 @@ function reload(id, newComp) {
2978
2985
  const record = map.get(id);
2979
2986
  if (!record) return;
2980
2987
  newComp = normalizeClassComponent(newComp);
2988
+ const isVapor = record.initialDef.__vapor;
2981
2989
  updateComponentDef(record.initialDef, newComp);
2982
2990
  const instances = [...record.instances];
2983
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
2991
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2984
2992
  for (const instance of instances) {
2985
2993
  if (instance.root && instance.root.ce && instance !== instance.root) {
2986
2994
  instance.root.ce._removeChildStyle(instance.type);
@@ -3000,6 +3008,7 @@ function reload(id, newComp) {
3000
3008
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3001
3009
  }
3002
3010
  dirtyInstances.add(instance);
3011
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3003
3012
  instance.appContext.propsCache.delete(instance.type);
3004
3013
  instance.appContext.emitsCache.delete(instance.type);
3005
3014
  instance.appContext.optionsCache.delete(instance.type);
@@ -3040,6 +3049,7 @@ function reload(id, newComp) {
3040
3049
  }
3041
3050
  queuePostFlushCb(() => {
3042
3051
  hmrDirtyComponents.clear();
3052
+ hmrDirtyComponentsMode.clear();
3043
3053
  });
3044
3054
  }
3045
3055
  function updateComponentDef(oldComp, newComp) {
@@ -4201,7 +4211,7 @@ const BaseTransitionPropsValidators = {
4201
4211
  onAppearCancelled: TransitionHookValidator
4202
4212
  };
4203
4213
  const recursiveGetSubtree = (instance) => {
4204
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
4214
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
4205
4215
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
4206
4216
  };
4207
4217
  const BaseTransitionImpl = {
@@ -4512,7 +4522,7 @@ function getInnerChild$1(vnode) {
4512
4522
  }
4513
4523
  function setTransitionHooks(vnode, hooks) {
4514
4524
  if (vnode.shapeFlag & 6 && vnode.component) {
4515
- if (vnode.type.__vapor) {
4525
+ if (isVaporComponent(vnode.type)) {
4516
4526
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
4517
4527
  vnode.component,
4518
4528
  hooks
@@ -7737,7 +7747,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7737
7747
  return vm;
7738
7748
  }
7739
7749
  }
7740
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.6"}`;
7750
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.7"}`;
7741
7751
  Vue.config = singletonApp.config;
7742
7752
  Vue.use = (plugin, ...options) => {
7743
7753
  if (plugin && isFunction(plugin.install)) {
@@ -9795,7 +9805,13 @@ function baseCreateRenderer(options, createHydrationFns) {
9795
9805
  );
9796
9806
  break;
9797
9807
  case VaporSlot:
9798
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
9808
+ getVaporInterface(parentComponent, n2).slot(
9809
+ n1,
9810
+ n2,
9811
+ container,
9812
+ anchor,
9813
+ parentComponent
9814
+ );
9799
9815
  break;
9800
9816
  default:
9801
9817
  if (shapeFlag & 1) {
@@ -11015,7 +11031,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11015
11031
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
11016
11032
  const { el, type, transition, children, shapeFlag } = vnode;
11017
11033
  if (shapeFlag & 6) {
11018
- if (type.__vapor) {
11034
+ if (isVaporComponent(type)) {
11019
11035
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
11020
11036
  } else {
11021
11037
  move(
@@ -11125,7 +11141,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11125
11141
  parentComponent.renderCache[cacheIndex] = void 0;
11126
11142
  }
11127
11143
  if (shapeFlag & 256) {
11128
- if (vnode.type.__vapor) {
11144
+ if (isVaporComponent(vnode.type)) {
11129
11145
  getVaporInterface(parentComponent, vnode).deactivate(
11130
11146
  vnode,
11131
11147
  parentComponent.ctx.getStorageContainer()
@@ -11142,7 +11158,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11142
11158
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
11143
11159
  }
11144
11160
  if (shapeFlag & 6) {
11145
- if (type.__vapor) {
11161
+ if (isVaporComponent(type)) {
11146
11162
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
11147
11163
  return;
11148
11164
  } else {
@@ -11284,7 +11300,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11284
11300
  };
11285
11301
  const getNextHostNode = (vnode) => {
11286
11302
  if (vnode.shapeFlag & 6) {
11287
- if (vnode.type.__vapor) {
11303
+ if (isVaporComponent(vnode.type)) {
11288
11304
  return hostNextSibling(vnode.anchor);
11289
11305
  }
11290
11306
  return getNextHostNode(vnode.component.subTree);
@@ -11476,6 +11492,12 @@ app.use(vaporInteropPlugin)
11476
11492
  }
11477
11493
  return res;
11478
11494
  }
11495
+ function isVaporComponent(type) {
11496
+ if (!!(process.env.NODE_ENV !== "production") && isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
11497
+ return hmrDirtyComponentsMode.get(type);
11498
+ }
11499
+ return type.__vapor;
11500
+ }
11479
11501
  function getInheritedScopeIds(vnode, parentComponent) {
11480
11502
  const inheritedScopeIds = [];
11481
11503
  let currentParent = parentComponent;
@@ -13240,7 +13262,7 @@ function isMemoSame(cached, memo) {
13240
13262
  return true;
13241
13263
  }
13242
13264
 
13243
- const version = "3.6.0-alpha.6";
13265
+ const version = "3.6.0-alpha.7";
13244
13266
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
13245
13267
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13246
13268
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-alpha.6
2
+ * @vue/compat v3.6.0-alpha.7
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2073,6 +2073,16 @@ var Vue = (function () {
2073
2073
  return;
2074
2074
  }
2075
2075
  this.flags = 1024;
2076
+ this.reset();
2077
+ const sub = this.subs;
2078
+ if (sub !== void 0) {
2079
+ unlink(sub);
2080
+ }
2081
+ }
2082
+ /**
2083
+ * @internal
2084
+ */
2085
+ reset() {
2076
2086
  let dep = this.deps;
2077
2087
  while (dep !== void 0) {
2078
2088
  const node = dep.dep;
@@ -2083,10 +2093,6 @@ var Vue = (function () {
2083
2093
  dep = unlink(dep, this);
2084
2094
  }
2085
2095
  }
2086
- const sub = this.subs;
2087
- if (sub !== void 0) {
2088
- unlink(sub);
2089
- }
2090
2096
  cleanup(this);
2091
2097
  }
2092
2098
  }
@@ -2898,6 +2904,7 @@ var Vue = (function () {
2898
2904
 
2899
2905
  let isHmrUpdating = false;
2900
2906
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2907
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2901
2908
  {
2902
2909
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
2903
2910
  createRecord: tryWrap(createRecord),
@@ -2961,9 +2968,10 @@ var Vue = (function () {
2961
2968
  const record = map.get(id);
2962
2969
  if (!record) return;
2963
2970
  newComp = normalizeClassComponent(newComp);
2971
+ const isVapor = record.initialDef.__vapor;
2964
2972
  updateComponentDef(record.initialDef, newComp);
2965
2973
  const instances = [...record.instances];
2966
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
2974
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2967
2975
  for (const instance of instances) {
2968
2976
  if (instance.root && instance.root.ce && instance !== instance.root) {
2969
2977
  instance.root.ce._removeChildStyle(instance.type);
@@ -2983,6 +2991,7 @@ var Vue = (function () {
2983
2991
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2984
2992
  }
2985
2993
  dirtyInstances.add(instance);
2994
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2986
2995
  instance.appContext.propsCache.delete(instance.type);
2987
2996
  instance.appContext.emitsCache.delete(instance.type);
2988
2997
  instance.appContext.optionsCache.delete(instance.type);
@@ -3023,6 +3032,7 @@ var Vue = (function () {
3023
3032
  }
3024
3033
  queuePostFlushCb(() => {
3025
3034
  hmrDirtyComponents.clear();
3035
+ hmrDirtyComponentsMode.clear();
3026
3036
  });
3027
3037
  }
3028
3038
  function updateComponentDef(oldComp, newComp) {
@@ -4181,7 +4191,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4181
4191
  onAppearCancelled: TransitionHookValidator
4182
4192
  };
4183
4193
  const recursiveGetSubtree = (instance) => {
4184
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
4194
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
4185
4195
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
4186
4196
  };
4187
4197
  const BaseTransitionImpl = {
@@ -4491,7 +4501,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4491
4501
  }
4492
4502
  function setTransitionHooks(vnode, hooks) {
4493
4503
  if (vnode.shapeFlag & 6 && vnode.component) {
4494
- if (vnode.type.__vapor) {
4504
+ if (isVaporComponent(vnode.type)) {
4495
4505
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
4496
4506
  vnode.component,
4497
4507
  hooks
@@ -7682,7 +7692,7 @@ If this is a native custom element, make sure to exclude it from component resol
7682
7692
  return vm;
7683
7693
  }
7684
7694
  }
7685
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.6"}`;
7695
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.7"}`;
7686
7696
  Vue.config = singletonApp.config;
7687
7697
  Vue.use = (plugin, ...options) => {
7688
7698
  if (plugin && isFunction(plugin.install)) {
@@ -9672,7 +9682,13 @@ If you want to remount the same app, move your app creation logic into a factory
9672
9682
  );
9673
9683
  break;
9674
9684
  case VaporSlot:
9675
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
9685
+ getVaporInterface(parentComponent, n2).slot(
9686
+ n1,
9687
+ n2,
9688
+ container,
9689
+ anchor,
9690
+ parentComponent
9691
+ );
9676
9692
  break;
9677
9693
  default:
9678
9694
  if (shapeFlag & 1) {
@@ -10881,7 +10897,7 @@ If you want to remount the same app, move your app creation logic into a factory
10881
10897
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
10882
10898
  const { el, type, transition, children, shapeFlag } = vnode;
10883
10899
  if (shapeFlag & 6) {
10884
- if (type.__vapor) {
10900
+ if (isVaporComponent(type)) {
10885
10901
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
10886
10902
  } else {
10887
10903
  move(
@@ -10991,7 +11007,7 @@ If you want to remount the same app, move your app creation logic into a factory
10991
11007
  parentComponent.renderCache[cacheIndex] = void 0;
10992
11008
  }
10993
11009
  if (shapeFlag & 256) {
10994
- if (vnode.type.__vapor) {
11010
+ if (isVaporComponent(vnode.type)) {
10995
11011
  getVaporInterface(parentComponent, vnode).deactivate(
10996
11012
  vnode,
10997
11013
  parentComponent.ctx.getStorageContainer()
@@ -11008,7 +11024,7 @@ If you want to remount the same app, move your app creation logic into a factory
11008
11024
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
11009
11025
  }
11010
11026
  if (shapeFlag & 6) {
11011
- if (type.__vapor) {
11027
+ if (isVaporComponent(type)) {
11012
11028
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
11013
11029
  return;
11014
11030
  } else {
@@ -11150,7 +11166,7 @@ If you want to remount the same app, move your app creation logic into a factory
11150
11166
  };
11151
11167
  const getNextHostNode = (vnode) => {
11152
11168
  if (vnode.shapeFlag & 6) {
11153
- if (vnode.type.__vapor) {
11169
+ if (isVaporComponent(vnode.type)) {
11154
11170
  return hostNextSibling(vnode.anchor);
11155
11171
  }
11156
11172
  return getNextHostNode(vnode.component.subTree);
@@ -11342,6 +11358,12 @@ app.use(vaporInteropPlugin)
11342
11358
  }
11343
11359
  return res;
11344
11360
  }
11361
+ function isVaporComponent(type) {
11362
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
11363
+ return hmrDirtyComponentsMode.get(type);
11364
+ }
11365
+ return type.__vapor;
11366
+ }
11345
11367
  function getInheritedScopeIds(vnode, parentComponent) {
11346
11368
  const inheritedScopeIds = [];
11347
11369
  let currentParent = parentComponent;
@@ -13075,7 +13097,7 @@ Component that was made reactive: `,
13075
13097
  return true;
13076
13098
  }
13077
13099
 
13078
- const version = "3.6.0-alpha.6";
13100
+ const version = "3.6.0-alpha.7";
13079
13101
  const warn = warn$1 ;
13080
13102
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13081
13103
  const devtools = devtools$1 ;