@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 into the new component instance.
213
- // Only restores refs that exist in both old and new state with
214
- // matching types. Skips functions and computed to avoid stale closures.
215
- if (
216
- window.__VUE_APP__?._instance &&
217
- Object.keys(vuePreservedState).length > 0
218
- ) {
219
- try {
220
- const inst = window.__VUE_APP__._instance;
221
- const ss = inst.setupState;
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
- } catch {
239
- // State shape mismatch — let it reset naturally
240
- }
239
+ });
241
240
  }
242
241
  }
243
242
  }
package/package.json CHANGED
@@ -164,5 +164,5 @@
164
164
  "typecheck": "bun run vue-tsc --noEmit"
165
165
  },
166
166
  "types": "./dist/src/index.d.ts",
167
- "version": "0.19.0-beta.149"
167
+ "version": "0.19.0-beta.150"
168
168
  }