@vue/server-renderer
Advanced tools
| /** | ||
| * @vue/server-renderer v3.6.0-beta.13 | ||
| * @vue/server-renderer v3.6.0-beta.14 | ||
| * (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -4,0 +4,0 @@ * @license MIT |
| /** | ||
| * @vue/server-renderer v3.6.0-beta.13 | ||
| * @vue/server-renderer v3.6.0-beta.14 | ||
| * (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -4,0 +4,0 @@ * @license MIT |
| /** | ||
| * @vue/server-renderer v3.6.0-beta.13 | ||
| * @vue/server-renderer v3.6.0-beta.14 | ||
| * (c) 2018-present Yuxi (Evan) You and Vue contributors | ||
@@ -500,2 +500,3 @@ * @license MIT | ||
| jobsLength = 0; | ||
| jobs.length = 0; | ||
| flushPostFlushCbs(seen); | ||
@@ -539,2 +540,10 @@ currentFlushPromise = null; | ||
| } | ||
| function hasDirtyAncestor(instance, dirtyInstances) { | ||
| let parent = instance.parent; | ||
| while (parent) { | ||
| if (dirtyInstances.has(parent)) return true; | ||
| parent = parent.parent; | ||
| } | ||
| return false; | ||
| } | ||
| function rerender(id, newRender) { | ||
@@ -571,38 +580,65 @@ const record = map.get(id); | ||
| const instances = [...record.instances]; | ||
| if (isVapor && newComp.__vapor && !instances.some((i) => i.ceReload)) { | ||
| if (isVapor && newComp.__vapor && !instances.some((instance) => instance.parent && !instance.parent.vapor) && !instances.some((i) => i.ceReload)) { | ||
| for (const instance of instances) if (instance.root && instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(instance.type); | ||
| for (const instance of instances) instance.hmrReload(newComp); | ||
| } else for (const instance of instances) { | ||
| const oldComp = normalizeClassComponent(instance.type); | ||
| let dirtyInstances = hmrDirtyComponents.get(oldComp); | ||
| if (!dirtyInstances) { | ||
| if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp); | ||
| hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); | ||
| const dirtyInstances = new Set(instances); | ||
| const rerenderedParents = /* @__PURE__ */ new Set(); | ||
| for (const instance of instances) { | ||
| const parent = instance.parent; | ||
| if (parent) { | ||
| if (!hasDirtyAncestor(instance, dirtyInstances) && !rerenderedParents.has(parent)) { | ||
| rerenderedParents.add(parent); | ||
| parent.hmrRerender(); | ||
| } | ||
| } else instance.hmrReload(newComp); | ||
| } | ||
| dirtyInstances.add(instance); | ||
| hmrDirtyComponentsMode.set(oldComp, !!isVapor); | ||
| instance.appContext.propsCache.delete(instance.type); | ||
| instance.appContext.emitsCache.delete(instance.type); | ||
| instance.appContext.optionsCache.delete(instance.type); | ||
| if (instance.ceReload) { | ||
| } else { | ||
| const parentUpdates = /* @__PURE__ */ new Map(); | ||
| const dirtyInstanceSet = new Set(instances); | ||
| for (const instance of instances) { | ||
| const oldComp = normalizeClassComponent(instance.type); | ||
| let dirtyInstances = hmrDirtyComponents.get(oldComp); | ||
| if (!dirtyInstances) { | ||
| if (oldComp !== record.initialDef) updateComponentDef(oldComp, newComp); | ||
| hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); | ||
| } | ||
| dirtyInstances.add(instance); | ||
| instance.ceReload(newComp.styles); | ||
| dirtyInstances.delete(instance); | ||
| } else if (instance.parent) queueJob(() => { | ||
| isHmrUpdating = true; | ||
| const parent = instance.parent; | ||
| if (parent.vapor) parent.hmrRerender(); | ||
| else if (!(parent.effect.flags & 1024)) { | ||
| parent.renderCache = []; | ||
| parent.effect.run(); | ||
| } | ||
| nextTick(() => { | ||
| isHmrUpdating = false; | ||
| hmrDirtyComponentsMode.set(oldComp, !!isVapor); | ||
| instance.appContext.propsCache.delete(instance.type); | ||
| instance.appContext.emitsCache.delete(instance.type); | ||
| instance.appContext.optionsCache.delete(instance.type); | ||
| if (instance.ceReload) { | ||
| dirtyInstances.add(instance); | ||
| instance.ceReload(newComp.styles); | ||
| dirtyInstances.delete(instance); | ||
| } else if (instance.parent) { | ||
| const parent = instance.parent; | ||
| if (!hasDirtyAncestor(instance, dirtyInstanceSet)) { | ||
| let updates = parentUpdates.get(parent); | ||
| if (!updates) parentUpdates.set(parent, updates = []); | ||
| updates.push([instance, dirtyInstances]); | ||
| } | ||
| } else if (instance.appContext.reload) instance.appContext.reload(); | ||
| else if (typeof window !== "undefined") window.location.reload(); | ||
| else console.warn("[HMR] Root or manually mounted instance modified. Full reload required."); | ||
| if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp); | ||
| } | ||
| parentUpdates.forEach((updates, parent) => { | ||
| queueJob(() => { | ||
| isHmrUpdating = true; | ||
| if (parent.vapor) parent.hmrRerender(); | ||
| else { | ||
| const i = parent; | ||
| if (!(i.effect.flags & 1024)) { | ||
| i.renderCache = []; | ||
| i.effect.run(); | ||
| } | ||
| } | ||
| nextTick(() => { | ||
| isHmrUpdating = false; | ||
| }); | ||
| updates.forEach(([instance, dirtyInstances]) => { | ||
| dirtyInstances.delete(instance); | ||
| }); | ||
| }); | ||
| dirtyInstances.delete(instance); | ||
| }); | ||
| else if (instance.appContext.reload) instance.appContext.reload(); | ||
| else if (typeof window !== "undefined") window.location.reload(); | ||
| else console.warn("[HMR] Root or manually mounted instance modified. Full reload required."); | ||
| if (instance.root.ce && instance !== instance.root) instance.root.ce._removeChildStyle(oldComp); | ||
| } | ||
@@ -609,0 +645,0 @@ queuePostFlushCb(() => { |
+4
-4
| { | ||
| "name": "@vue/server-renderer", | ||
| "version": "3.6.0-beta.13", | ||
| "version": "3.6.0-beta.14", | ||
| "description": "@vue/server-renderer", | ||
@@ -49,8 +49,8 @@ "main": "index.js", | ||
| "peerDependencies": { | ||
| "vue": "3.6.0-beta.13" | ||
| "vue": "3.6.0-beta.14" | ||
| }, | ||
| "dependencies": { | ||
| "@vue/shared": "3.6.0-beta.13", | ||
| "@vue/compiler-ssr": "3.6.0-beta.13" | ||
| "@vue/shared": "3.6.0-beta.14", | ||
| "@vue/compiler-ssr": "3.6.0-beta.14" | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
452477
0.5%10070
0.72%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated