@vue/compat 3.6.0-beta.13 → 3.6.0-beta.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.
@@ -1027,7 +1027,7 @@ interface VaporInteropInterface {
1027
1027
  setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
1028
1028
  vdomMount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, once?: boolean) => any;
1029
1029
  vdomUnmount: UnmountComponentFn;
1030
- vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean) => any;
1030
+ vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any, once?: boolean, slotRoot?: boolean) => any;
1031
1031
  vdomMountVNode: (vnode: VNode, parentComponent: any) => any;
1032
1032
  }
1033
1033
  /**
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-beta.13
2
+ * @vue/compat v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2723,6 +2723,7 @@ function flushJobs(seen) {
2723
2723
  }
2724
2724
  flushIndex = 0;
2725
2725
  jobsLength = 0;
2726
+ jobs.length = 0;
2726
2727
  flushPostFlushCbs(seen);
2727
2728
  currentFlushPromise = null;
2728
2729
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2780,6 +2781,14 @@ function createRecord(id, initialDef) {
2780
2781
  function normalizeClassComponent(component) {
2781
2782
  return isClassComponent(component) ? component.__vccOpts : component;
2782
2783
  }
2784
+ function hasDirtyAncestor(instance, dirtyInstances) {
2785
+ let parent = instance.parent;
2786
+ while (parent) {
2787
+ if (dirtyInstances.has(parent)) return true;
2788
+ parent = parent.parent;
2789
+ }
2790
+ return false;
2791
+ }
2783
2792
  function rerender(id, newRender) {
2784
2793
  const record = map.get(id);
2785
2794
  if (!record) return;
@@ -2811,42 +2820,69 @@ function reload(id, newComp) {
2811
2820
  const isVapor = record.initialDef.__vapor;
2812
2821
  updateComponentDef(record.initialDef, newComp);
2813
2822
  const instances = [...record.instances];
2814
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2823
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2815
2824
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2816
- for (const instance of instances) instance.hmrReload(newComp);
2817
- } else for (const instance of instances) {
2818
- const oldComp = normalizeClassComponent(instance.type);
2819
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2820
- if (!dirtyInstances) {
2821
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2822
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2823
- }
2824
- dirtyInstances.add(instance);
2825
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2826
- instance.appContext.propsCache.delete(instance.type);
2827
- instance.appContext.emitsCache.delete(instance.type);
2828
- instance.appContext.optionsCache.delete(instance.type);
2829
- if (instance.ceReload) {
2830
- dirtyInstances.add(instance);
2831
- instance.ceReload(newComp.styles);
2832
- dirtyInstances.delete(instance);
2833
- } else if (instance.parent) queueJob(() => {
2834
- isHmrUpdating = true;
2825
+ const dirtyInstances = new Set(instances);
2826
+ const rerenderedParents = /* @__PURE__ */ new Set();
2827
+ for (const instance of instances) {
2835
2828
  const parent = instance.parent;
2836
- if (parent.vapor) parent.hmrRerender();
2837
- else if (!(parent.effect.flags & 1024)) {
2838
- parent.renderCache = [];
2839
- parent.effect.run();
2829
+ if (parent) {
2830
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2831
+ rerenderedParents.add(parent);
2832
+ parent.hmrRerender();
2833
+ }
2834
+ } else instance.hmrReload(newComp);
2835
+ }
2836
+ } else {
2837
+ const parentUpdates = /* @__PURE__ */ new Map();
2838
+ const dirtyInstanceSet = new Set(instances);
2839
+ for (const instance of instances) {
2840
+ const oldComp = normalizeClassComponent(instance.type);
2841
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2842
+ if (!dirtyInstances) {
2843
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2844
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2840
2845
  }
2841
- nextTick(() => {
2842
- isHmrUpdating = false;
2846
+ dirtyInstances.add(instance);
2847
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2848
+ instance.appContext.propsCache.delete(instance.type);
2849
+ instance.appContext.emitsCache.delete(instance.type);
2850
+ instance.appContext.optionsCache.delete(instance.type);
2851
+ if (instance.ceReload) {
2852
+ dirtyInstances.add(instance);
2853
+ instance.ceReload(newComp.styles);
2854
+ dirtyInstances.delete(instance);
2855
+ } else if (instance.parent) {
2856
+ const parent = instance.parent;
2857
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2858
+ let updates = parentUpdates.get(parent);
2859
+ if (!updates) parentUpdates.set(parent, updates = []);
2860
+ updates.push([instance, dirtyInstances]);
2861
+ }
2862
+ } else if (instance.appContext.reload) instance.appContext.reload();
2863
+ else if (typeof window !== "undefined") window.location.reload();
2864
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2865
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2866
+ }
2867
+ parentUpdates.forEach((updates, parent) => {
2868
+ queueJob(() => {
2869
+ isHmrUpdating = true;
2870
+ if (parent.vapor) parent.hmrRerender();
2871
+ else {
2872
+ const i = parent;
2873
+ if (!(i.effect.flags & 1024)) {
2874
+ i.renderCache = [];
2875
+ i.effect.run();
2876
+ }
2877
+ }
2878
+ nextTick(() => {
2879
+ isHmrUpdating = false;
2880
+ });
2881
+ updates.forEach(([instance, dirtyInstances]) => {
2882
+ dirtyInstances.delete(instance);
2883
+ });
2843
2884
  });
2844
- dirtyInstances.delete(instance);
2845
2885
  });
2846
- else if (instance.appContext.reload) instance.appContext.reload();
2847
- else if (typeof window !== "undefined") window.location.reload();
2848
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2849
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2850
2886
  }
2851
2887
  queuePostFlushCb(() => {
2852
2888
  hmrDirtyComponents.clear();
@@ -5387,6 +5423,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5387
5423
  slot: vaporSlot,
5388
5424
  fallback
5389
5425
  };
5426
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5390
5427
  return ret;
5391
5428
  }
5392
5429
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -6324,7 +6361,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6324
6361
  if (options.el) return vm.$mount(options.el);
6325
6362
  else return vm;
6326
6363
  }
6327
- Vue.version = `2.6.14-compat:3.6.0-beta.13`;
6364
+ Vue.version = `2.6.14-compat:3.6.0-beta.14`;
6328
6365
  Vue.config = singletonApp.config;
6329
6366
  Vue.use = (plugin, ...options) => {
6330
6367
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -9794,7 +9831,7 @@ function isMemoSame(cached, memo) {
9794
9831
  }
9795
9832
  //#endregion
9796
9833
  //#region packages/runtime-core/src/index.ts
9797
- const version = "3.6.0-beta.13";
9834
+ const version = "3.6.0-beta.14";
9798
9835
  const warn = warn$1;
9799
9836
  /**
9800
9837
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-beta.13
2
+ * @vue/compat v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2407,6 +2407,7 @@ function flushJobs(seen) {
2407
2407
  }
2408
2408
  flushIndex = 0;
2409
2409
  jobsLength = 0;
2410
+ jobs.length = 0;
2410
2411
  flushPostFlushCbs(seen);
2411
2412
  currentFlushPromise = null;
2412
2413
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -4482,6 +4483,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4482
4483
  slot: vaporSlot,
4483
4484
  fallback
4484
4485
  };
4486
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4485
4487
  return ret;
4486
4488
  }
4487
4489
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -5253,7 +5255,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5253
5255
  if (options.el) return vm.$mount(options.el);
5254
5256
  else return vm;
5255
5257
  }
5256
- Vue.version = `2.6.14-compat:3.6.0-beta.13`;
5258
+ Vue.version = `2.6.14-compat:3.6.0-beta.14`;
5257
5259
  Vue.config = singletonApp.config;
5258
5260
  Vue.use = (plugin, ...options) => {
5259
5261
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -8025,7 +8027,7 @@ function isMemoSame(cached, memo) {
8025
8027
  }
8026
8028
  //#endregion
8027
8029
  //#region packages/runtime-core/src/index.ts
8028
- const version = "3.6.0-beta.13";
8030
+ const version = "3.6.0-beta.14";
8029
8031
  const warn = NOOP;
8030
8032
  /**
8031
8033
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.6.0-beta.13
2
+ * @vue/compat v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2678,6 +2678,7 @@ function flushJobs(seen) {
2678
2678
  }
2679
2679
  flushIndex = 0;
2680
2680
  jobsLength = 0;
2681
+ jobs.length = 0;
2681
2682
  flushPostFlushCbs(seen);
2682
2683
  currentFlushPromise = null;
2683
2684
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2735,6 +2736,14 @@ function createRecord(id, initialDef) {
2735
2736
  function normalizeClassComponent(component) {
2736
2737
  return isClassComponent(component) ? component.__vccOpts : component;
2737
2738
  }
2739
+ function hasDirtyAncestor(instance, dirtyInstances) {
2740
+ let parent = instance.parent;
2741
+ while (parent) {
2742
+ if (dirtyInstances.has(parent)) return true;
2743
+ parent = parent.parent;
2744
+ }
2745
+ return false;
2746
+ }
2738
2747
  function rerender(id, newRender) {
2739
2748
  const record = map.get(id);
2740
2749
  if (!record) return;
@@ -2766,42 +2775,69 @@ function reload(id, newComp) {
2766
2775
  const isVapor = record.initialDef.__vapor;
2767
2776
  updateComponentDef(record.initialDef, newComp);
2768
2777
  const instances = [...record.instances];
2769
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2778
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2770
2779
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2771
- for (const instance of instances) instance.hmrReload(newComp);
2772
- } else for (const instance of instances) {
2773
- const oldComp = normalizeClassComponent(instance.type);
2774
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2775
- if (!dirtyInstances) {
2776
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2777
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2778
- }
2779
- dirtyInstances.add(instance);
2780
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2781
- instance.appContext.propsCache.delete(instance.type);
2782
- instance.appContext.emitsCache.delete(instance.type);
2783
- instance.appContext.optionsCache.delete(instance.type);
2784
- if (instance.ceReload) {
2785
- dirtyInstances.add(instance);
2786
- instance.ceReload(newComp.styles);
2787
- dirtyInstances.delete(instance);
2788
- } else if (instance.parent) queueJob(() => {
2789
- isHmrUpdating = true;
2780
+ const dirtyInstances = new Set(instances);
2781
+ const rerenderedParents = /* @__PURE__ */ new Set();
2782
+ for (const instance of instances) {
2790
2783
  const parent = instance.parent;
2791
- if (parent.vapor) parent.hmrRerender();
2792
- else if (!(parent.effect.flags & 1024)) {
2793
- parent.renderCache = [];
2794
- parent.effect.run();
2784
+ if (parent) {
2785
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2786
+ rerenderedParents.add(parent);
2787
+ parent.hmrRerender();
2788
+ }
2789
+ } else instance.hmrReload(newComp);
2790
+ }
2791
+ } else {
2792
+ const parentUpdates = /* @__PURE__ */ new Map();
2793
+ const dirtyInstanceSet = new Set(instances);
2794
+ for (const instance of instances) {
2795
+ const oldComp = normalizeClassComponent(instance.type);
2796
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2797
+ if (!dirtyInstances) {
2798
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2799
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2795
2800
  }
2796
- nextTick(() => {
2797
- isHmrUpdating = false;
2801
+ dirtyInstances.add(instance);
2802
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2803
+ instance.appContext.propsCache.delete(instance.type);
2804
+ instance.appContext.emitsCache.delete(instance.type);
2805
+ instance.appContext.optionsCache.delete(instance.type);
2806
+ if (instance.ceReload) {
2807
+ dirtyInstances.add(instance);
2808
+ instance.ceReload(newComp.styles);
2809
+ dirtyInstances.delete(instance);
2810
+ } else if (instance.parent) {
2811
+ const parent = instance.parent;
2812
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2813
+ let updates = parentUpdates.get(parent);
2814
+ if (!updates) parentUpdates.set(parent, updates = []);
2815
+ updates.push([instance, dirtyInstances]);
2816
+ }
2817
+ } else if (instance.appContext.reload) instance.appContext.reload();
2818
+ else if (typeof window !== "undefined") window.location.reload();
2819
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2820
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2821
+ }
2822
+ parentUpdates.forEach((updates, parent) => {
2823
+ queueJob(() => {
2824
+ isHmrUpdating = true;
2825
+ if (parent.vapor) parent.hmrRerender();
2826
+ else {
2827
+ const i = parent;
2828
+ if (!(i.effect.flags & 1024)) {
2829
+ i.renderCache = [];
2830
+ i.effect.run();
2831
+ }
2832
+ }
2833
+ nextTick(() => {
2834
+ isHmrUpdating = false;
2835
+ });
2836
+ updates.forEach(([instance, dirtyInstances]) => {
2837
+ dirtyInstances.delete(instance);
2838
+ });
2798
2839
  });
2799
- dirtyInstances.delete(instance);
2800
2840
  });
2801
- else if (instance.appContext.reload) instance.appContext.reload();
2802
- else if (typeof window !== "undefined") window.location.reload();
2803
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2804
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2805
2841
  }
2806
2842
  queuePostFlushCb(() => {
2807
2843
  hmrDirtyComponents.clear();
@@ -5320,6 +5356,7 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5320
5356
  slot: vaporSlot,
5321
5357
  fallback
5322
5358
  };
5359
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
5323
5360
  return ret;
5324
5361
  }
5325
5362
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -6256,7 +6293,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6256
6293
  if (options.el) return vm.$mount(options.el);
6257
6294
  else return vm;
6258
6295
  }
6259
- Vue.version = `2.6.14-compat:3.6.0-beta.13`;
6296
+ Vue.version = `2.6.14-compat:3.6.0-beta.14`;
6260
6297
  Vue.config = singletonApp.config;
6261
6298
  Vue.use = (plugin, ...options) => {
6262
6299
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -9716,7 +9753,7 @@ function isMemoSame(cached, memo) {
9716
9753
  }
9717
9754
  //#endregion
9718
9755
  //#region packages/runtime-core/src/index.ts
9719
- const version = "3.6.0-beta.13";
9756
+ const version = "3.6.0-beta.14";
9720
9757
  const warn = warn$1;
9721
9758
  /**
9722
9759
  * Runtime error messages. Only exposed in dev or esm builds.