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

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,23 @@ 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;", hydrateSlotReleaseScript = `(function() {
176377
+ var releaseSlots = function() {
176378
+ if (window.__ABS_SLOT_HYDRATION_PENDING__ !== false) {
176379
+ window.__ABS_SLOT_HYDRATION_PENDING__ = false;
176380
+ }
176381
+ if (typeof window.__ABS_SLOT_FLUSH__ === "function") {
176382
+ window.__ABS_SLOT_FLUSH__();
176383
+ }
176384
+ };
176385
+ if (typeof requestAnimationFrame === "function") {
176386
+ requestAnimationFrame(function() {
176387
+ requestAnimationFrame(releaseSlots);
176388
+ });
176389
+ } else if (typeof setTimeout === "function") {
176390
+ setTimeout(releaseSlots, 0);
176391
+ }
176392
+ })();`, injectSlotPreamble = (headTag) => headTag.includes("</head>") ? headTag.replace("</head>", `<script>${hydrateSlotPreamble}</script></head>`) : `${headTag}<script>${hydrateSlotPreamble}</script>`, injectSlotReleaseScript = (content) => content + `<script>${hydrateSlotReleaseScript}</script>`, isRecord8 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord8(value), readHasIslands2 = (value) => {
176358
176393
  if (!isRecord8(value))
176359
176394
  return false;
176360
176395
  const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
@@ -176376,8 +176411,9 @@ var ssrDirty4 = false, isRecord8 = (value) => typeof value === "object" && value
176376
176411
  }
176377
176412
  }, buildDirtyResponse3 = (headTag, indexPath, maybeProps) => {
176378
176413
  const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})};`;
176414
+ const hydratedHead = injectSlotPreamble(headTag);
176379
176415
  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>`;
176416
+ const html = `<!DOCTYPE html><html>${hydratedHead}<body><div id="root"></div>` + `<script>${propsScript}${dirtyFlag}</script>` + injectSlotReleaseScript(`<script type="module" src="${indexPath}"></script>`) + `</body></html>`;
176381
176417
  return new Response(html, {
176382
176418
  headers: { "Content-Type": "text/html" }
176383
176419
  });
@@ -176413,8 +176449,8 @@ var ssrDirty4 = false, isRecord8 = (value) => typeof value === "object" && value
176413
176449
  render: () => h2(resolvedPage.component, maybeProps ?? null)
176414
176450
  });
176415
176451
  const bodyStream = renderToWebStream(app);
176416
- const head = `<!DOCTYPE html><html>${headTag}<body><div id="root">`;
176417
- const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${indexPath}"></script></body></html>`;
176452
+ const head = `<!DOCTYPE html><html>${injectSlotPreamble(headTag)}<body><div id="root">`;
176453
+ const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script>${injectSlotReleaseScript(`<script type="module" src="${indexPath}"></script>`)}</body></html>`;
176418
176454
  const stream = new ReadableStream({
176419
176455
  start(controller) {
176420
176456
  controller.enqueue(head);
@@ -179219,5 +179255,5 @@ export {
179219
179255
  build
179220
179256
  };
179221
179257
 
179222
- //# debugId=3B6CA0D01FB2BA8B64756E2164756E21
179258
+ //# debugId=3034DDEE8E2BAF6F64756E2164756E21
179223
179259
  //# sourceMappingURL=build.js.map