@absolutejs/absolute 0.19.0-beta.422 → 0.19.0-beta.424

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.
@@ -169199,7 +169199,7 @@ ${registrations}
169199
169199
  ({ tsLibDir } = cached);
169200
169200
  cached.lastUsed = Date.now();
169201
169201
  } else {
169202
- const tsPath = __require.resolve("typescript");
169202
+ const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
169203
169203
  const tsRootDir = dirname(tsPath);
169204
169204
  tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve(tsRootDir, "lib");
169205
169205
  const config = readConfiguration("./tsconfig.json");
@@ -180700,6 +180700,11 @@ var streamSwapRuntime = () => {
180700
180700
  const consumers = window.__ABS_SLOT_CONSUMERS__;
180701
180701
  const pending = window.__ABS_SLOT_PENDING__;
180702
180702
  const canApplyImmediately = () => window.__ABS_SLOT_HYDRATION_PENDING__ !== true;
180703
+ const isAngularDeferPayload = (payload) => {
180704
+ if (!payload || typeof payload !== "object")
180705
+ return false;
180706
+ return payload.kind === "angular-defer";
180707
+ };
180703
180708
  const resolveHtml = (payload) => {
180704
180709
  if (!payload || typeof payload !== "object") {
180705
180710
  return typeof payload === "string" ? payload : "";
@@ -180723,6 +180728,10 @@ var streamSwapRuntime = () => {
180723
180728
  return;
180724
180729
  }
180725
180730
  }
180731
+ if (isAngularDeferPayload(payload)) {
180732
+ pending[id] = payload;
180733
+ return;
180734
+ }
180726
180735
  const node = document.getElementById(`slot-${id}`);
180727
180736
  if (!node) {
180728
180737
  pending[id] = payload;
@@ -180785,7 +180794,13 @@ var createSlotPatchStatement = (id, payload) => `(window.${STREAMING_RUNTIME_GLO
180785
180794
  var createNonceAttr = (nonce) => nonce ? ` nonce="${nonce}"` : "";
180786
180795
  var createStreamingSlotId = () => `${SLOT_ID_PREFIX}${Math.random().toString(36).slice(2, 10)}`;
180787
180796
  var getStreamingSlotsRuntimeScript = () => getStreamSwapRuntimeScript();
180788
- var renderStreamingSlotsRuntimeTag = (nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(getStreamingSlotsRuntimeScript())}</script>`;
180797
+ var renderStreamingSlotsRuntimeTag = (nonce, runtimePreludeScript) => {
180798
+ const runtimeBody = [
180799
+ runtimePreludeScript?.trim() ? runtimePreludeScript.trim() : "",
180800
+ getStreamingSlotsRuntimeScript()
180801
+ ].filter(Boolean).join(";");
180802
+ return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
180803
+ };
180789
180804
  var renderStreamingSlotPlaceholder = (id, fallbackHtml = "") => `<div id="${createSlotPlaceholderId(id)}" data-absolute-slot="true">${fallbackHtml}</div>`;
180790
180805
  var renderStreamingSlotPatchTag = (id, payload, nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(createSlotPatchStatement(id, payload))}</script>`;
180791
180806
  var injectHtmlIntoHead = (html, injection) => {
@@ -181090,8 +181105,8 @@ var streamOutOfOrderSlots = ({
181090
181105
  }
181091
181106
  });
181092
181107
  };
181093
- var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head") => {
181094
- const runtimeTag = renderStreamingSlotsRuntimeTag(nonce);
181108
+ var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head", runtimePreludeScript) => {
181109
+ const runtimeTag = renderStreamingSlotsRuntimeTag(nonce, runtimePreludeScript);
181095
181110
  const encoder = new TextEncoder;
181096
181111
  const decoder = new TextDecoder;
181097
181112
  const closingTag = runtimePlacement === "body" ? CLOSING_BODY_TAG : CLOSING_HEAD_TAG;
@@ -181148,6 +181163,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
181148
181163
  onError,
181149
181164
  onSlotMetric,
181150
181165
  policy,
181166
+ runtimePreludeScript,
181151
181167
  runtimePlacement = "head"
181152
181168
  } = {}) => {
181153
181169
  const resolvedPolicy = resolveStreamingSlotPolicy(policy);
@@ -181165,7 +181181,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
181165
181181
  });
181166
181182
  if (preparedSlots.length === 0)
181167
181183
  return stream;
181168
- const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement) : stream;
181184
+ const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement, runtimePreludeScript) : stream;
181169
181185
  const encoder = new TextEncoder;
181170
181186
  const decoder = new TextDecoder;
181171
181187
  const reader = source.getReader();
@@ -181254,6 +181270,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
181254
181270
  nonce,
181255
181271
  onError,
181256
181272
  runtimePlacement,
181273
+ runtimePreludeScript,
181257
181274
  streamingSlots = [],
181258
181275
  policy
181259
181276
  } = {}) => {
@@ -181264,6 +181281,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
181264
181281
  nonce,
181265
181282
  onError,
181266
181283
  policy,
181284
+ runtimePreludeScript,
181267
181285
  runtimePlacement
181268
181286
  });
181269
181287
  return new Response(body, {
@@ -181926,5 +181944,5 @@ export {
181926
181944
  DeferErrorTemplateDirective
181927
181945
  };
181928
181946
 
181929
- //# debugId=F31195CBE3A3C4BB64756E2164756E21
181947
+ //# debugId=A8D79B27DEE8C9BE64756E2164756E21
181930
181948
  //# sourceMappingURL=index.js.map