@absolutejs/absolute 0.19.0-beta.146 → 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.
@@ -139,6 +139,7 @@ export const handleVueUpdate = (message: {
139
139
  data: {
140
140
  cssBaseName?: string;
141
141
  cssUrl?: string;
142
+ forceReload?: boolean;
142
143
  html?: string;
143
144
  manifest?: Record<string, string>;
144
145
  pageModuleUrl?: string;
@@ -197,17 +198,19 @@ export const handleVueUpdate = (message: {
197
198
  const clientStart = performance.now();
198
199
  const modulePath = `${pageModuleUrl}?t=${Date.now()}`;
199
200
 
200
- // When a composable/utility file changed (not the .vue file itself),
201
- // force a full page reload so setup() re-runs with the new composable.
202
- // Vue's rerender only swaps the template, not the setup closure.
203
- if (message.data.forceReload) {
204
- window.location.reload();
205
-
206
- return;
207
- }
208
-
209
201
  import(modulePath)
210
- .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
+ }
211
214
  sessionStorage.removeItem('__HMR_ACTIVE__');
212
215
 
213
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.146"
167
+ "version": "0.19.0-beta.148"
168
168
  }