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

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/vue/index.js CHANGED
@@ -1953,7 +1953,13 @@ var createSlotPatchStatement = (id, payload) => `(window.${STREAMING_RUNTIME_GLO
1953
1953
  var createNonceAttr = (nonce) => nonce ? ` nonce="${nonce}"` : "";
1954
1954
  var createStreamingSlotId = () => `${SLOT_ID_PREFIX}${Math.random().toString(36).slice(2, 10)}`;
1955
1955
  var getStreamingSlotsRuntimeScript = () => getStreamSwapRuntimeScript();
1956
- var renderStreamingSlotsRuntimeTag = (nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(getStreamingSlotsRuntimeScript())}</script>`;
1956
+ var renderStreamingSlotsRuntimeTag = (nonce, runtimePreludeScript) => {
1957
+ const runtimeBody = [
1958
+ runtimePreludeScript?.trim() ? runtimePreludeScript.trim() : "",
1959
+ getStreamingSlotsRuntimeScript()
1960
+ ].filter(Boolean).join(";");
1961
+ return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
1962
+ };
1957
1963
  var renderStreamingSlotPlaceholder = (id, fallbackHtml = "") => `<div id="${createSlotPlaceholderId(id)}" data-absolute-slot="true">${fallbackHtml}</div>`;
1958
1964
  var renderStreamingSlotPatchTag = (id, payload, nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(createSlotPatchStatement(id, payload))}</script>`;
1959
1965
  var injectHtmlIntoHead = (html, injection) => {
@@ -2258,8 +2264,8 @@ var streamOutOfOrderSlots = ({
2258
2264
  }
2259
2265
  });
2260
2266
  };
2261
- var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head") => {
2262
- const runtimeTag = renderStreamingSlotsRuntimeTag(nonce);
2267
+ var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head", runtimePreludeScript) => {
2268
+ const runtimeTag = renderStreamingSlotsRuntimeTag(nonce, runtimePreludeScript);
2263
2269
  const encoder = new TextEncoder;
2264
2270
  const decoder = new TextDecoder;
2265
2271
  const closingTag = runtimePlacement === "body" ? CLOSING_BODY_TAG : CLOSING_HEAD_TAG;
@@ -2316,6 +2322,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
2316
2322
  onError,
2317
2323
  onSlotMetric,
2318
2324
  policy,
2325
+ runtimePreludeScript,
2319
2326
  runtimePlacement = "head"
2320
2327
  } = {}) => {
2321
2328
  const resolvedPolicy = resolveStreamingSlotPolicy(policy);
@@ -2333,7 +2340,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
2333
2340
  });
2334
2341
  if (preparedSlots.length === 0)
2335
2342
  return stream;
2336
- const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement) : stream;
2343
+ const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement, runtimePreludeScript) : stream;
2337
2344
  const encoder = new TextEncoder;
2338
2345
  const decoder = new TextDecoder;
2339
2346
  const reader = source.getReader();
@@ -2422,6 +2429,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
2422
2429
  nonce,
2423
2430
  onError,
2424
2431
  runtimePlacement,
2432
+ runtimePreludeScript,
2425
2433
  streamingSlots = [],
2426
2434
  policy
2427
2435
  } = {}) => {
@@ -2432,6 +2440,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
2432
2440
  nonce,
2433
2441
  onError,
2434
2442
  policy,
2443
+ runtimePreludeScript,
2435
2444
  runtimePlacement
2436
2445
  });
2437
2446
  return new Response(body, {
@@ -2783,5 +2792,5 @@ export {
2783
2792
  Image_default as Image
2784
2793
  };
2785
2794
 
2786
- //# debugId=FDC67EF6700E8BCA64756E2164756E21
2795
+ //# debugId=7D602E601E17DFB264756E2164756E21
2787
2796
  //# sourceMappingURL=index.js.map