@absolutejs/absolute 0.19.0-beta.149 → 0.19.0-beta.150
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.
|
@@ -209,17 +209,16 @@ export const handleVueUpdate = (message: {
|
|
|
209
209
|
if (component?.__hmrId) {
|
|
210
210
|
hmrRuntime.reload(component.__hmrId, component);
|
|
211
211
|
|
|
212
|
-
// Restore preserved ref values
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
if (ss) {
|
|
212
|
+
// Restore preserved ref values after Vue re-renders.
|
|
213
|
+
// reload() schedules an async unmount/remount, so we
|
|
214
|
+
// wait for the next animation frame when the new
|
|
215
|
+
// instance is fully mounted with its setupState.
|
|
216
|
+
if (Object.keys(vuePreservedState).length > 0) {
|
|
217
|
+
requestAnimationFrame(() => {
|
|
218
|
+
try {
|
|
219
|
+
const inst = window.__VUE_APP__?._instance;
|
|
220
|
+
const ss = inst?.setupState;
|
|
221
|
+
if (!ss) return;
|
|
223
222
|
for (const key of Object.keys(vuePreservedState)) {
|
|
224
223
|
const newVal = ss[key];
|
|
225
224
|
const oldVal = vuePreservedState[key];
|
|
@@ -234,10 +233,10 @@ export const handleVueUpdate = (message: {
|
|
|
234
233
|
newVal.value = oldVal;
|
|
235
234
|
}
|
|
236
235
|
}
|
|
236
|
+
} catch {
|
|
237
|
+
// State shape mismatch — let it reset naturally
|
|
237
238
|
}
|
|
238
|
-
}
|
|
239
|
-
// State shape mismatch — let it reset naturally
|
|
240
|
-
}
|
|
239
|
+
});
|
|
241
240
|
}
|
|
242
241
|
}
|
|
243
242
|
}
|
package/package.json
CHANGED