@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/index.js CHANGED
@@ -173018,7 +173018,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
173018
173018
  "// During HMR or after SSR dirty, use createApp (fresh mount) to avoid hydration mismatch with stale DOM",
173019
173019
  'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
173020
173020
  'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
173021
- "const app = (isHMR || isSsrDirty) ? createApp(Comp, mergedProps) : createSSRApp(Comp, mergedProps);",
173021
+ 'const shouldHydrate = typeof window === "undefined" ? false : !(isHMR || isSsrDirty);',
173022
+ "const app = shouldHydrate ? createSSRApp(Comp, mergedProps) : createApp(Comp, mergedProps);",
173022
173023
  'app.mount("#root");',
173023
173024
  "",
173024
173025
  "// Store app instance for HMR - used for manual component updates",
@@ -173072,6 +173073,24 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
173072
173073
  "",
173073
173074
  "// Clear preserved state after applying",
173074
173075
  'if (typeof window !== "undefined") {',
173076
+ " window.__ABS_SLOT_HYDRATION_PENDING__ = shouldHydrate;",
173077
+ " var releaseStreamingSlots = function() {",
173078
+ " window.__ABS_SLOT_HYDRATION_PENDING__ = false;",
173079
+ ' if (typeof window.__ABS_SLOT_FLUSH__ === "function") {',
173080
+ " window.__ABS_SLOT_FLUSH__();",
173081
+ " }",
173082
+ " };",
173083
+ ' if (shouldHydrate && typeof requestAnimationFrame === "function") {',
173084
+ " requestAnimationFrame(function() {",
173085
+ " requestAnimationFrame(releaseStreamingSlots);",
173086
+ " });",
173087
+ ' } else if (typeof window.__ABS_SLOT_FLUSH__ === "function") {',
173088
+ " window.__ABS_SLOT_FLUSH__();",
173089
+ ' } else if (typeof setTimeout === "function") {',
173090
+ " setTimeout(releaseStreamingSlots, 0);",
173091
+ " }",
173092
+ "}",
173093
+ 'if (typeof window !== "undefined") {',
173075
173094
  " window.__HMR_PRESERVED_STATE__ = undefined;",
173076
173095
  "}"
173077
173096
  ].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, isRecord9 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord9(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>`, isRecord9 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord9(value), readHasIslands2 = (value) => {
176358
176393
  if (!isRecord9(value))
176359
176394
  return false;
176360
176395
  const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
@@ -176376,8 +176411,9 @@ var ssrDirty4 = false, isRecord9 = (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, isRecord9 = (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);
@@ -187590,5 +187626,5 @@ export {
187590
187626
  ANGULAR_INIT_TIMEOUT_MS
187591
187627
  };
187592
187628
 
187593
- //# debugId=6A030229535DDFD264756E2164756E21
187629
+ //# debugId=65A6354D86A31CEC64756E2164756E21
187594
187630
  //# sourceMappingURL=index.js.map