@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.
package/dist/vue.cjs.js CHANGED
@@ -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
  **/
@@ -2123,6 +2123,16 @@ class EffectScope {
2123
2123
  return;
2124
2124
  }
2125
2125
  this.flags = 1024;
2126
+ this.reset();
2127
+ const sub = this.subs;
2128
+ if (sub !== void 0) {
2129
+ unlink(sub);
2130
+ }
2131
+ }
2132
+ /**
2133
+ * @internal
2134
+ */
2135
+ reset() {
2126
2136
  let dep = this.deps;
2127
2137
  while (dep !== void 0) {
2128
2138
  const node = dep.dep;
@@ -2133,10 +2143,6 @@ class EffectScope {
2133
2143
  dep = unlink(dep, this);
2134
2144
  }
2135
2145
  }
2136
- const sub = this.subs;
2137
- if (sub !== void 0) {
2138
- unlink(sub);
2139
- }
2140
2146
  cleanup(this);
2141
2147
  }
2142
2148
  }
@@ -2948,6 +2954,7 @@ function checkRecursiveUpdates(seen, fn) {
2948
2954
 
2949
2955
  let isHmrUpdating = false;
2950
2956
  const hmrDirtyComponents = /* @__PURE__ */ new Map();
2957
+ const hmrDirtyComponentsMode = /* @__PURE__ */ new Map();
2951
2958
  {
2952
2959
  getGlobalThis().__VUE_HMR_RUNTIME__ = {
2953
2960
  createRecord: tryWrap(createRecord),
@@ -3011,9 +3018,10 @@ function reload(id, newComp) {
3011
3018
  const record = map.get(id);
3012
3019
  if (!record) return;
3013
3020
  newComp = normalizeClassComponent(newComp);
3021
+ const isVapor = record.initialDef.__vapor;
3014
3022
  updateComponentDef(record.initialDef, newComp);
3015
3023
  const instances = [...record.instances];
3016
- if (newComp.__vapor && !instances.some((i) => i.ceReload)) {
3024
+ if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
3017
3025
  for (const instance of instances) {
3018
3026
  if (instance.root && instance.root.ce && instance !== instance.root) {
3019
3027
  instance.root.ce._removeChildStyle(instance.type);
@@ -3033,6 +3041,7 @@ function reload(id, newComp) {
3033
3041
  hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
3034
3042
  }
3035
3043
  dirtyInstances.add(instance);
3044
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
3036
3045
  instance.appContext.propsCache.delete(instance.type);
3037
3046
  instance.appContext.emitsCache.delete(instance.type);
3038
3047
  instance.appContext.optionsCache.delete(instance.type);
@@ -3073,6 +3082,7 @@ function reload(id, newComp) {
3073
3082
  }
3074
3083
  queuePostFlushCb(() => {
3075
3084
  hmrDirtyComponents.clear();
3085
+ hmrDirtyComponentsMode.clear();
3076
3086
  });
3077
3087
  }
3078
3088
  function updateComponentDef(oldComp, newComp) {
@@ -4231,7 +4241,7 @@ const BaseTransitionPropsValidators = {
4231
4241
  onAppearCancelled: TransitionHookValidator
4232
4242
  };
4233
4243
  const recursiveGetSubtree = (instance) => {
4234
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
4244
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
4235
4245
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
4236
4246
  };
4237
4247
  const BaseTransitionImpl = {
@@ -4541,7 +4551,7 @@ function getInnerChild$1(vnode) {
4541
4551
  }
4542
4552
  function setTransitionHooks(vnode, hooks) {
4543
4553
  if (vnode.shapeFlag & 6 && vnode.component) {
4544
- if (vnode.type.__vapor) {
4554
+ if (isVaporComponent(vnode.type)) {
4545
4555
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
4546
4556
  vnode.component,
4547
4557
  hooks
@@ -7738,7 +7748,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7738
7748
  return vm;
7739
7749
  }
7740
7750
  }
7741
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.6"}`;
7751
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.7"}`;
7742
7752
  Vue.config = singletonApp.config;
7743
7753
  Vue.use = (plugin, ...options) => {
7744
7754
  if (plugin && isFunction(plugin.install)) {
@@ -9756,7 +9766,13 @@ function baseCreateRenderer(options, createHydrationFns) {
9756
9766
  );
9757
9767
  break;
9758
9768
  case VaporSlot:
9759
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
9769
+ getVaporInterface(parentComponent, n2).slot(
9770
+ n1,
9771
+ n2,
9772
+ container,
9773
+ anchor,
9774
+ parentComponent
9775
+ );
9760
9776
  break;
9761
9777
  default:
9762
9778
  if (shapeFlag & 1) {
@@ -10965,7 +10981,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10965
10981
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
10966
10982
  const { el, type, transition, children, shapeFlag } = vnode;
10967
10983
  if (shapeFlag & 6) {
10968
- if (type.__vapor) {
10984
+ if (isVaporComponent(type)) {
10969
10985
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
10970
10986
  } else {
10971
10987
  move(
@@ -11075,7 +11091,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11075
11091
  parentComponent.renderCache[cacheIndex] = void 0;
11076
11092
  }
11077
11093
  if (shapeFlag & 256) {
11078
- if (vnode.type.__vapor) {
11094
+ if (isVaporComponent(vnode.type)) {
11079
11095
  getVaporInterface(parentComponent, vnode).deactivate(
11080
11096
  vnode,
11081
11097
  parentComponent.ctx.getStorageContainer()
@@ -11092,7 +11108,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11092
11108
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
11093
11109
  }
11094
11110
  if (shapeFlag & 6) {
11095
- if (type.__vapor) {
11111
+ if (isVaporComponent(type)) {
11096
11112
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
11097
11113
  return;
11098
11114
  } else {
@@ -11234,7 +11250,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11234
11250
  };
11235
11251
  const getNextHostNode = (vnode) => {
11236
11252
  if (vnode.shapeFlag & 6) {
11237
- if (vnode.type.__vapor) {
11253
+ if (isVaporComponent(vnode.type)) {
11238
11254
  return hostNextSibling(vnode.anchor);
11239
11255
  }
11240
11256
  return getNextHostNode(vnode.component.subTree);
@@ -11426,6 +11442,12 @@ app.use(vaporInteropPlugin)
11426
11442
  }
11427
11443
  return res;
11428
11444
  }
11445
+ function isVaporComponent(type) {
11446
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
11447
+ return hmrDirtyComponentsMode.get(type);
11448
+ }
11449
+ return type.__vapor;
11450
+ }
11429
11451
  function getInheritedScopeIds(vnode, parentComponent) {
11430
11452
  const inheritedScopeIds = [];
11431
11453
  let currentParent = parentComponent;
@@ -13173,7 +13195,7 @@ function isMemoSame(cached, memo) {
13173
13195
  return true;
13174
13196
  }
13175
13197
 
13176
- const version = "3.6.0-alpha.6";
13198
+ const version = "3.6.0-alpha.7";
13177
13199
  const warn = warn$1 ;
13178
13200
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13179
13201
  const devtools = devtools$1 ;
@@ -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
  **/
@@ -1874,6 +1874,16 @@ class EffectScope {
1874
1874
  return;
1875
1875
  }
1876
1876
  this.flags = 1024;
1877
+ this.reset();
1878
+ const sub = this.subs;
1879
+ if (sub !== void 0) {
1880
+ unlink(sub);
1881
+ }
1882
+ }
1883
+ /**
1884
+ * @internal
1885
+ */
1886
+ reset() {
1877
1887
  let dep = this.deps;
1878
1888
  while (dep !== void 0) {
1879
1889
  const node = dep.dep;
@@ -1884,10 +1894,6 @@ class EffectScope {
1884
1894
  dep = unlink(dep, this);
1885
1895
  }
1886
1896
  }
1887
- const sub = this.subs;
1888
- if (sub !== void 0) {
1889
- unlink(sub);
1890
- }
1891
1897
  cleanup(this);
1892
1898
  }
1893
1899
  }
@@ -3342,7 +3348,7 @@ const BaseTransitionPropsValidators = {
3342
3348
  onAppearCancelled: TransitionHookValidator
3343
3349
  };
3344
3350
  const recursiveGetSubtree = (instance) => {
3345
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
3351
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
3346
3352
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
3347
3353
  };
3348
3354
  const BaseTransitionImpl = {
@@ -3644,7 +3650,7 @@ function getInnerChild$1(vnode) {
3644
3650
  }
3645
3651
  function setTransitionHooks(vnode, hooks) {
3646
3652
  if (vnode.shapeFlag & 6 && vnode.component) {
3647
- if (vnode.type.__vapor) {
3653
+ if (isVaporComponent(vnode.type)) {
3648
3654
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
3649
3655
  vnode.component,
3650
3656
  hooks
@@ -6309,7 +6315,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6309
6315
  return vm;
6310
6316
  }
6311
6317
  }
6312
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.6"}`;
6318
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.7"}`;
6313
6319
  Vue.config = singletonApp.config;
6314
6320
  Vue.use = (plugin, ...options) => {
6315
6321
  if (plugin && isFunction(plugin.install)) {
@@ -7853,7 +7859,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7853
7859
  );
7854
7860
  break;
7855
7861
  case VaporSlot:
7856
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
7862
+ getVaporInterface(parentComponent, n2).slot(
7863
+ n1,
7864
+ n2,
7865
+ container,
7866
+ anchor,
7867
+ parentComponent
7868
+ );
7857
7869
  break;
7858
7870
  default:
7859
7871
  if (shapeFlag & 1) {
@@ -8944,7 +8956,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8944
8956
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
8945
8957
  const { el, type, transition, children, shapeFlag } = vnode;
8946
8958
  if (shapeFlag & 6) {
8947
- if (type.__vapor) {
8959
+ if (isVaporComponent(type)) {
8948
8960
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
8949
8961
  } else {
8950
8962
  move(
@@ -9054,7 +9066,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9054
9066
  parentComponent.renderCache[cacheIndex] = void 0;
9055
9067
  }
9056
9068
  if (shapeFlag & 256) {
9057
- if (vnode.type.__vapor) {
9069
+ if (isVaporComponent(vnode.type)) {
9058
9070
  getVaporInterface(parentComponent, vnode).deactivate(
9059
9071
  vnode,
9060
9072
  parentComponent.ctx.getStorageContainer()
@@ -9071,7 +9083,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9071
9083
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
9072
9084
  }
9073
9085
  if (shapeFlag & 6) {
9074
- if (type.__vapor) {
9086
+ if (isVaporComponent(type)) {
9075
9087
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
9076
9088
  return;
9077
9089
  } else {
@@ -9199,7 +9211,7 @@ function baseCreateRenderer(options, createHydrationFns) {
9199
9211
  };
9200
9212
  const getNextHostNode = (vnode) => {
9201
9213
  if (vnode.shapeFlag & 6) {
9202
- if (vnode.type.__vapor) {
9214
+ if (isVaporComponent(vnode.type)) {
9203
9215
  return hostNextSibling(vnode.anchor);
9204
9216
  }
9205
9217
  return getNextHostNode(vnode.component.subTree);
@@ -9372,6 +9384,9 @@ function getVaporInterface(instance, vnode) {
9372
9384
  const res = ctx && ctx.vapor;
9373
9385
  return res;
9374
9386
  }
9387
+ function isVaporComponent(type) {
9388
+ return type.__vapor;
9389
+ }
9375
9390
  function getInheritedScopeIds(vnode, parentComponent) {
9376
9391
  const inheritedScopeIds = [];
9377
9392
  let currentParent = parentComponent;
@@ -10756,7 +10771,7 @@ function isMemoSame(cached, memo) {
10756
10771
  return true;
10757
10772
  }
10758
10773
 
10759
- const version = "3.6.0-alpha.6";
10774
+ const version = "3.6.0-alpha.7";
10760
10775
  const warn$1 = NOOP;
10761
10776
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10762
10777
  const devtools = 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
  **/
@@ -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) {
@@ -4178,7 +4188,7 @@ const BaseTransitionPropsValidators = {
4178
4188
  onAppearCancelled: TransitionHookValidator
4179
4189
  };
4180
4190
  const recursiveGetSubtree = (instance) => {
4181
- const subTree = instance.type.__vapor ? instance.block : instance.subTree;
4191
+ const subTree = isVaporComponent(instance.type) ? instance.block : instance.subTree;
4182
4192
  return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
4183
4193
  };
4184
4194
  const BaseTransitionImpl = {
@@ -4488,7 +4498,7 @@ function getInnerChild$1(vnode) {
4488
4498
  }
4489
4499
  function setTransitionHooks(vnode, hooks) {
4490
4500
  if (vnode.shapeFlag & 6 && vnode.component) {
4491
- if (vnode.type.__vapor) {
4501
+ if (isVaporComponent(vnode.type)) {
4492
4502
  getVaporInterface(vnode.component, vnode).setTransitionHooks(
4493
4503
  vnode.component,
4494
4504
  hooks
@@ -7688,7 +7698,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7688
7698
  return vm;
7689
7699
  }
7690
7700
  }
7691
- Vue.version = `2.6.14-compat:${"3.6.0-alpha.6"}`;
7701
+ Vue.version = `2.6.14-compat:${"3.6.0-alpha.7"}`;
7692
7702
  Vue.config = singletonApp.config;
7693
7703
  Vue.use = (plugin, ...options) => {
7694
7704
  if (plugin && isFunction(plugin.install)) {
@@ -9706,7 +9716,13 @@ function baseCreateRenderer(options, createHydrationFns) {
9706
9716
  );
9707
9717
  break;
9708
9718
  case VaporSlot:
9709
- getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
9719
+ getVaporInterface(parentComponent, n2).slot(
9720
+ n1,
9721
+ n2,
9722
+ container,
9723
+ anchor,
9724
+ parentComponent
9725
+ );
9710
9726
  break;
9711
9727
  default:
9712
9728
  if (shapeFlag & 1) {
@@ -10915,7 +10931,7 @@ function baseCreateRenderer(options, createHydrationFns) {
10915
10931
  const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
10916
10932
  const { el, type, transition, children, shapeFlag } = vnode;
10917
10933
  if (shapeFlag & 6) {
10918
- if (type.__vapor) {
10934
+ if (isVaporComponent(type)) {
10919
10935
  getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
10920
10936
  } else {
10921
10937
  move(
@@ -11025,7 +11041,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11025
11041
  parentComponent.renderCache[cacheIndex] = void 0;
11026
11042
  }
11027
11043
  if (shapeFlag & 256) {
11028
- if (vnode.type.__vapor) {
11044
+ if (isVaporComponent(vnode.type)) {
11029
11045
  getVaporInterface(parentComponent, vnode).deactivate(
11030
11046
  vnode,
11031
11047
  parentComponent.ctx.getStorageContainer()
@@ -11042,7 +11058,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11042
11058
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
11043
11059
  }
11044
11060
  if (shapeFlag & 6) {
11045
- if (type.__vapor) {
11061
+ if (isVaporComponent(type)) {
11046
11062
  getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
11047
11063
  return;
11048
11064
  } else {
@@ -11184,7 +11200,7 @@ function baseCreateRenderer(options, createHydrationFns) {
11184
11200
  };
11185
11201
  const getNextHostNode = (vnode) => {
11186
11202
  if (vnode.shapeFlag & 6) {
11187
- if (vnode.type.__vapor) {
11203
+ if (isVaporComponent(vnode.type)) {
11188
11204
  return hostNextSibling(vnode.anchor);
11189
11205
  }
11190
11206
  return getNextHostNode(vnode.component.subTree);
@@ -11376,6 +11392,12 @@ app.use(vaporInteropPlugin)
11376
11392
  }
11377
11393
  return res;
11378
11394
  }
11395
+ function isVaporComponent(type) {
11396
+ if (isHmrUpdating && hmrDirtyComponentsMode.has(type)) {
11397
+ return hmrDirtyComponentsMode.get(type);
11398
+ }
11399
+ return type.__vapor;
11400
+ }
11379
11401
  function getInheritedScopeIds(vnode, parentComponent) {
11380
11402
  const inheritedScopeIds = [];
11381
11403
  let currentParent = parentComponent;
@@ -13123,7 +13145,7 @@ function isMemoSame(cached, memo) {
13123
13145
  return true;
13124
13146
  }
13125
13147
 
13126
- const version = "3.6.0-alpha.6";
13148
+ const version = "3.6.0-alpha.7";
13127
13149
  const warn = warn$1 ;
13128
13150
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
13129
13151
  const devtools = devtools$1 ;