@absolutejs/absolute 0.19.0-beta.396 → 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/index.js CHANGED
@@ -172662,7 +172662,9 @@ if (isHMR) {
172662
172662
  }
172663
172663
  component = mount(Component, { target, props: mergedProps });
172664
172664
  window.__HMR_PRESERVED_STATE__ = undefined;
172665
- } else if (isSsrDirty || hasIslandHtml || !shouldHydrate) {
172665
+ } else if (!shouldHydrate) {
172666
+ component = undefined;
172667
+ } else if (isSsrDirty || hasIslandHtml) {
172666
172668
  component = mount(Component, { target, props: initialProps });
172667
172669
  } else {
172668
172670
  component = hydrate(Component, { target, props: initialProps });
@@ -172670,7 +172672,7 @@ if (isHMR) {
172670
172672
 
172671
172673
  if (typeof window !== "undefined") {
172672
172674
  window.__SVELTE_COMPONENT__ = component;
172673
- window.__SVELTE_UNMOUNT__ = function() { unmount(component); };
172675
+ window.__SVELTE_UNMOUNT__ = function() { if (component) { unmount(component); } };
172674
172676
  window.__ABS_SLOT_HYDRATION_PENDING__ = shouldHydrate;
172675
172677
  var releaseStreamingSlots = function() {
172676
172678
  window.__ABS_SLOT_HYDRATION_PENDING__ = false;
@@ -173016,7 +173018,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
173016
173018
  "// During HMR or after SSR dirty, use createApp (fresh mount) to avoid hydration mismatch with stale DOM",
173017
173019
  'const isHMR = typeof window !== "undefined" && sessionStorage.getItem("__HMR_ACTIVE__");',
173018
173020
  'const isSsrDirty = typeof window !== "undefined" && window.__SSR_DIRTY__;',
173019
- "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);",
173020
173023
  'app.mount("#root");',
173021
173024
  "",
173022
173025
  "// Store app instance for HMR - used for manual component updates",
@@ -173070,6 +173073,24 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
173070
173073
  "",
173071
173074
  "// Clear preserved state after applying",
173072
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") {',
173073
173094
  " window.__HMR_PRESERVED_STATE__ = undefined;",
173074
173095
  "}"
173075
173096
  ].join(`
@@ -173259,7 +173280,7 @@ ${registrations}
173259
173280
  ({ tsLibDir } = cached);
173260
173281
  cached.lastUsed = Date.now();
173261
173282
  } else {
173262
- const tsPath = __require.resolve("typescript");
173283
+ const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
173263
173284
  const tsRootDir = dirname9(tsPath);
173264
173285
  tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve18(tsRootDir, "lib");
173265
173286
  const config = readConfiguration("./tsconfig.json");
@@ -176352,7 +176373,7 @@ var init_pageHandler3 = __esm(() => {
176352
176373
  // src/vue/pageHandler.ts
176353
176374
  import { readdir as readdir4 } from "fs/promises";
176354
176375
  import { basename as basename11, dirname as dirname11 } from "path";
176355
- 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;", injectSlotPreamble = (headTag) => headTag.includes("</head>") ? headTag.replace("</head>", `<script>${hydrateSlotPreamble}</script></head>`) : `${headTag}<script>${hydrateSlotPreamble}</script>`, isRecord9 = (value) => typeof value === "object" && value !== null, isGenericVueComponent = (value) => typeof value === "function" || isRecord9(value), readHasIslands2 = (value) => {
176356
176377
  if (!isRecord9(value))
176357
176378
  return false;
176358
176379
  const hasIslands = value["__ABSOLUTE_PAGE_HAS_ISLANDS__"];
@@ -176374,8 +176395,9 @@ var ssrDirty4 = false, isRecord9 = (value) => typeof value === "object" && value
176374
176395
  }
176375
176396
  }, buildDirtyResponse3 = (headTag, indexPath, maybeProps) => {
176376
176397
  const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})};`;
176398
+ const hydratedHead = injectSlotPreamble(headTag);
176377
176399
  const dirtyFlag = "window.__SSR_DIRTY__=true;";
176378
- 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>`;
176379
176401
  return new Response(html, {
176380
176402
  headers: { "Content-Type": "text/html" }
176381
176403
  });
@@ -176411,7 +176433,7 @@ var ssrDirty4 = false, isRecord9 = (value) => typeof value === "object" && value
176411
176433
  render: () => h2(resolvedPage.component, maybeProps ?? null)
176412
176434
  });
176413
176435
  const bodyStream = renderToWebStream(app);
176414
- const head = `<!DOCTYPE html><html>${headTag}<body><div id="root">`;
176436
+ const head = `<!DOCTYPE html><html>${injectSlotPreamble(headTag)}<body><div id="root">`;
176415
176437
  const tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})}</script><script type="module" src="${indexPath}"></script></body></html>`;
176416
176438
  const stream = new ReadableStream({
176417
176439
  start(controller) {
@@ -187588,5 +187610,5 @@ export {
187588
187610
  ANGULAR_INIT_TIMEOUT_MS
187589
187611
  };
187590
187612
 
187591
- //# debugId=D6C7DB70CE4735CB64756E2164756E21
187613
+ //# debugId=900D9DFBBCD14BB164756E2164756E21
187592
187614
  //# sourceMappingURL=index.js.map