@absolutejs/absolute 0.19.0-beta.397 → 0.19.0-beta.398

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.
package/dist/build.js CHANGED
@@ -172437,7 +172437,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
172437
172437
  "// During HMR or after SSR dirty, use createApp (fresh mount) to avoid hydration mismatch with stale DOM",
172438
172438
  'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
172439
172439
  'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
172440
- "const app = (isHMR || isSsrDirty) ? createApp(Comp, mergedProps) : createSSRApp(Comp, mergedProps);",
172440
+ 'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty);',
172441
+ "const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
172441
172442
  'app.mount("#root");',
172442
172443
  "",
172443
172444
  "// Store app instance for HMR - used for manual component updates",
@@ -172491,6 +172492,24 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
172491
172492
  "",
172492
172493
  "// Clear preserved state after applying",
172493
172494
  'if (typeof window !== "undefined") {',
172495
+ " window.__ABS_SLOT_HYDRATION_PENDING__ = shouldHydrate;",
172496
+ " var releaseStreamingSlots = function() {",
172497
+ " window.__ABS_SLOT_HYDRATION_PENDING__ = false;",
172498
+ ' if (typeof window.__ABS_SLOT_FLUSH__ === "function") {',
172499
+ " window.__ABS_SLOT_FLUSH__();",
172500
+ " }",
172501
+ " };",
172502
+ ' if (shouldHydrate && typeof requestAnimationFrame === "function") {',
172503
+ " requestAnimationFrame(function() {",
172504
+ " requestAnimationFrame(releaseStreamingSlots);",
172505
+ " });",
172506
+ ' } else if (typeof window.__ABS_SLOT_FLUSH__ === "function") {',
172507
+ " window.__ABS_SLOT_FLUSH__();",
172508
+ ' } else if (typeof setTimeout === "function") {',
172509
+ " setTimeout(releaseStreamingSlots, 0);",
172510
+ " }",
172511
+ "}",
172512
+ 'if (typeof window !== "undefined") {',
172494
172513
  " window.__HMR_PRESERVED_STATE__ = undefined;",
172495
172514
  "}"
172496
172515
  ].join(`
@@ -176354,7 +176373,7 @@ var init_pageHandler3 = __esm(() => {
176354
176373
  // src/vue/pageHandler.ts
176355
176374
  import { readdir as readdir4 } from "fs/promises";
176356
176375
  import { basename as basename11, dirname as dirname11 } from "path";
176357
- var ssrDirty4 = false, isRecord8 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord8(value), readHasIslands2 = (value) => {
176376
+ var ssrDirty4 = false, hydrateSlotPreamble = "window.__ABS_SLOT_HYDRATION_PENDING__=true;", injectSlotPreamble = (headTag) => headTag.includes("</head>") ? headTag.replace("</head>", `<script>${hydrateSlotPreamble}</script></head>`) : `${headTag}<script>${hydrateSlotPreamble}</script>`, isRecord8 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord8(value), readHasIslands2 = (value) => {
176358
176377
  if (!isRecord8(value))
176359
176378
  return false;
176360
176379
  const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
@@ -176376,8 +176395,9 @@ var ssrDirty4 = false, isRecord8 = (value) => typeof value === "object" && value
176376
176395
  }
176377
176396
  }, buildDirtyResponse3 = (headTag, indexPath, maybeProps) => {
176378
176397
  const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})};`;
176398
+ const hydratedHead = injectSlotPreamble(headTag);
176379
176399
  const dirtyFlag = "window.__SSR_DIRTY__=true;";
176380
- const html = `<!DOCTYPE html><html>${headTag}<body><div id="root"></div>` + `<script>${propsScript}${dirtyFlag}</script>` + `<script type="module" src="${indexPath}"></script>` + `</body></html>`;
176400
+ const html = `<!DOCTYPE html><html>${hydratedHead}<body><div id="root"></div>` + `<script>${propsScript}${dirtyFlag}</script>` + `<script type="module" src="${indexPath}"></script>` + `</body></html>`;
176381
176401
  return new Response(html, {
176382
176402
  headers: { "Content-Type": "text/html" }
176383
176403
  });
@@ -176413,7 +176433,7 @@ var ssrDirty4 = false, isRecord8 = (value) => typeof value === "object" && value
176413
176433
  render: () => h2(resolvedPage.component, maybeProps ?? null)
176414
176434
  });
176415
176435
  const bodyStream = renderToWebStream(app);
176416
- const head = `<!DOCTYPE html><html>${headTag}<body><div id="root">`;
176436
+ const head = `<!DOCTYPE html><html>${injectSlotPreamble(headTag)}<body><div id="root">`;
176417
176437
  const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${indexPath}"></script></body></html>`;
176418
176438
  const stream = new ReadableStream({
176419
176439
  start(controller) {
@@ -179219,5 +179239,5 @@ export {
179219
179239
  build
179220
179240
  };
179221
179241
 
179222
- //# debugId=3B6CA0D01FB2BA8B64756E2164756E21
179242
+ //# debugId=290EF2188A08E67164756E2164756E21
179223
179243
  //# sourceMappingURL=build.js.map