vue 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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.13
2
+ * vue v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@ import * as runtimeDom from "@vue/runtime-dom";
7
7
  import { initCustomFormatter, registerRuntimeCompiler, warn } from "@vue/runtime-dom";
8
8
  import { compile } from "@vue/compiler-dom";
9
9
  import { NOOP, extend, genCacheKey, generateCodeFrame, isString } from "@vue/shared";
10
- import { withAsyncContext } from "@vue/runtime-vapor";
10
+ import { defineVaporAsyncComponent, withAsyncContext } from "@vue/runtime-vapor";
11
11
  export * from "@vue/runtime-dom";
12
12
  export * from "@vue/runtime-vapor";
13
13
  //#endregion
@@ -51,4 +51,4 @@ function compileToFunction(template, options) {
51
51
  }
52
52
  registerRuntimeCompiler(compileToFunction);
53
53
  //#endregion
54
- export { compileToFunction as compile, withAsyncContext };
54
+ export { compileToFunction as compile, defineVaporAsyncComponent, withAsyncContext };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.6.0-beta.13
2
+ * vue v3.6.0-beta.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2668,6 +2668,7 @@ var Vue = (function(exports) {
2668
2668
  }
2669
2669
  flushIndex = 0;
2670
2670
  jobsLength = 0;
2671
+ jobs.length = 0;
2671
2672
  flushPostFlushCbs(seen);
2672
2673
  currentFlushPromise = null;
2673
2674
  if (jobsLength || postJobs.length) flushJobs(seen);
@@ -2725,6 +2726,14 @@ var Vue = (function(exports) {
2725
2726
  function normalizeClassComponent(component) {
2726
2727
  return isClassComponent(component) ? component.__vccOpts : component;
2727
2728
  }
2729
+ function hasDirtyAncestor(instance, dirtyInstances) {
2730
+ let parent = instance.parent;
2731
+ while (parent) {
2732
+ if (dirtyInstances.has(parent)) return true;
2733
+ parent = parent.parent;
2734
+ }
2735
+ return false;
2736
+ }
2728
2737
  function rerender(id, newRender) {
2729
2738
  const record = map.get(id);
2730
2739
  if (!record) return;
@@ -2756,42 +2765,69 @@ var Vue = (function(exports) {
2756
2765
  const isVapor = record.initialDef.__vapor;
2757
2766
  updateComponentDef(record.initialDef, newComp);
2758
2767
  const instances = [...record.instances];
2759
- if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) {
2768
+ if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) {
2760
2769
  for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type);
2761
- for (const instance of instances) instance.hmrReload(newComp);
2762
- } else for (const instance of instances) {
2763
- const oldComp = normalizeClassComponent(instance.type);
2764
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2765
- if (!dirtyInstances) {
2766
- if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2767
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2768
- }
2769
- dirtyInstances.add(instance);
2770
- hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2771
- instance.appContext.propsCache.delete(instance.type);
2772
- instance.appContext.emitsCache.delete(instance.type);
2773
- instance.appContext.optionsCache.delete(instance.type);
2774
- if (instance.ceReload) {
2775
- dirtyInstances.add(instance);
2776
- instance.ceReload(newComp.styles);
2777
- dirtyInstances.delete(instance);
2778
- } else if (instance.parent) queueJob(() => {
2779
- isHmrUpdating = true;
2770
+ const dirtyInstances = new Set(instances);
2771
+ const rerenderedParents = /* @__PURE__ */ new Set();
2772
+ for (const instance of instances) {
2780
2773
  const parent = instance.parent;
2781
- if (parent.vapor) parent.hmrRerender();
2782
- else if (!(parent.effect.flags & 1024)) {
2783
- parent.renderCache = [];
2784
- parent.effect.run();
2774
+ if (parent) {
2775
+ if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) {
2776
+ rerenderedParents.add(parent);
2777
+ parent.hmrRerender();
2778
+ }
2779
+ } else instance.hmrReload(newComp);
2780
+ }
2781
+ } else {
2782
+ const parentUpdates = /* @__PURE__ */ new Map();
2783
+ const dirtyInstanceSet = new Set(instances);
2784
+ for (const instance of instances) {
2785
+ const oldComp = normalizeClassComponent(instance.type);
2786
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2787
+ if (!dirtyInstances) {
2788
+ if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp);
2789
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2785
2790
  }
2786
- nextTick(() => {
2787
- isHmrUpdating = false;
2791
+ dirtyInstances.add(instance);
2792
+ hmrDirtyComponentsMode.set(oldComp, !!isVapor);
2793
+ instance.appContext.propsCache.delete(instance.type);
2794
+ instance.appContext.emitsCache.delete(instance.type);
2795
+ instance.appContext.optionsCache.delete(instance.type);
2796
+ if (instance.ceReload) {
2797
+ dirtyInstances.add(instance);
2798
+ instance.ceReload(newComp.styles);
2799
+ dirtyInstances.delete(instance);
2800
+ } else if (instance.parent) {
2801
+ const parent = instance.parent;
2802
+ if (!hasDirtyAncestor(instance, dirtyInstanceSet)) {
2803
+ let updates = parentUpdates.get(parent);
2804
+ if (!updates) parentUpdates.set(parent, updates = []);
2805
+ updates.push([instance, dirtyInstances]);
2806
+ }
2807
+ } else if (instance.appContext.reload) instance.appContext.reload();
2808
+ else if (typeof window !== "undefined") window.location.reload();
2809
+ else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2810
+ if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2811
+ }
2812
+ parentUpdates.forEach((updates, parent) => {
2813
+ queueJob(() => {
2814
+ isHmrUpdating = true;
2815
+ if (parent.vapor) parent.hmrRerender();
2816
+ else {
2817
+ const i = parent;
2818
+ if (!(i.effect.flags & 1024)) {
2819
+ i.renderCache = [];
2820
+ i.effect.run();
2821
+ }
2822
+ }
2823
+ nextTick(() => {
2824
+ isHmrUpdating = false;
2825
+ });
2826
+ updates.forEach(([instance, dirtyInstances]) => {
2827
+ dirtyInstances.delete(instance);
2828
+ });
2788
2829
  });
2789
- dirtyInstances.delete(instance);
2790
2830
  });
2791
- else if (instance.appContext.reload) instance.appContext.reload();
2792
- else if (typeof window !== "undefined") window.location.reload();
2793
- else console.warn("[HMR] Root or manually mounted instance modified. Full reload required.");
2794
- if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp);
2795
2831
  }
2796
2832
  queuePostFlushCb(() => {
2797
2833
  hmrDirtyComponents.clear();
@@ -4739,6 +4775,7 @@ var Vue = (function(exports) {
4739
4775
  slot: vaporSlot,
4740
4776
  fallback
4741
4777
  };
4778
+ if (!noSlotted && ret.scopeId) ret.slotScopeIds = [ret.scopeId + "-s"];
4742
4779
  return ret;
4743
4780
  }
4744
4781
  if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
@@ -8443,7 +8480,7 @@ var Vue = (function(exports) {
8443
8480
  }
8444
8481
  //#endregion
8445
8482
  //#region packages/runtime-core/src/index.ts
8446
- const version = "3.6.0-beta.13";
8483
+ const version = "3.6.0-beta.14";
8447
8484
  const warn = warn$1;
8448
8485
  /**
8449
8486
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -14192,6 +14229,7 @@ var Vue = (function(exports) {
14192
14229
  exports.defineProps = defineProps;
14193
14230
  exports.defineSSRCustomElement = defineSSRCustomElement;
14194
14231
  exports.defineSlots = defineSlots;
14232
+ exports.defineVaporAsyncComponent = defineAsyncComponent;
14195
14233
  exports.devtools = devtools;
14196
14234
  exports.effect = effect;
14197
14235
  exports.effectScope = effectScope;