@absolutejs/absolute 0.19.0-beta.147 → 0.19.0-beta.148

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.
@@ -198,17 +198,19 @@ export const handleVueUpdate = (message: {
198
198
  const clientStart = performance.now();
199
199
  const modulePath = `${pageModuleUrl}?t=${Date.now()}`;
200
200
 
201
- // When a composable/utility file changed (not the .vue file itself),
202
- // force a full page reload so setup() re-runs with the new composable.
203
- // Vue's rerender only swaps the template, not the setup closure.
204
- if (message.data.forceReload) {
205
- window.location.reload();
206
-
207
- return;
208
- }
209
-
210
201
  import(modulePath)
211
- .then(() => {
202
+ .then((mod) => {
203
+ // When a composable/utility file changed (not the .vue file itself),
204
+ // force reload via __VUE_HMR_RUNTIME__ so setup() re-runs.
205
+ // Vue's rerender only swaps the template, not the setup closure.
206
+ if (message.data.forceReload && (window as any).__VUE_HMR_RUNTIME__) {
207
+ const hmrRuntime = (window as any).__VUE_HMR_RUNTIME__;
208
+ // Find the component's hmrId from the imported module
209
+ const component = mod?.default ?? Object.values(mod ?? {})[0];
210
+ if (component?.__hmrId) {
211
+ hmrRuntime.reload(component.__hmrId, component);
212
+ }
213
+ }
212
214
  sessionStorage.removeItem('__HMR_ACTIVE__');
213
215
 
214
216
  if (window.__HMR_WS__ && message.data.serverDuration != null) {
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.147"
167
+ "version": "0.19.0-beta.148"
168
168
  }