bun-plugin-stx 0.2.219 → 0.2.220
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/serve.js +5 -3
- package/package.json +1 -1
package/dist/serve.js
CHANGED
|
@@ -8718,7 +8718,7 @@ var defaultConfigDir4 = /* @__PURE__ */ resolve12(process20.cwd(), "config");
|
|
|
8718
8718
|
var defaultGeneratedDir4 = /* @__PURE__ */ resolve12(process20.cwd(), "src/generated");
|
|
8719
8719
|
|
|
8720
8720
|
// src/serve.ts
|
|
8721
|
-
import { BUILD_ID_HEADER, extractPageResponseStatus, findContainerRegion, getBuildId, mergeCrosswindConfig, readResponseHeaders, readResponseStatus, stateDir, stateDirName } from "@stacksjs/stx";
|
|
8721
|
+
import { BUILD_ID_HEADER, extractPageResponseStatus, findContainerRegion, FRAGMENT_CACHE_CONTROL, getBuildId, mergeCrosswindConfig, readResponseHeaders, readResponseStatus, SPA_NAV_HEADER, spaNavVaryHeaders, stateDir, stateDirName } from "@stacksjs/stx";
|
|
8722
8722
|
import { buildCodeFrame, locateFailureLine } from "@stacksjs/stx/build-message";
|
|
8723
8723
|
import { clearBundleFailures, getBundleFailures } from "@stacksjs/stx/client-script-bundler";
|
|
8724
8724
|
import { actionRedirectResponse, compressResponse, runPageAction as sharedRunPageAction } from "@stacksjs/stx";
|
|
@@ -10508,7 +10508,7 @@ ${html}`;
|
|
|
10508
10508
|
}
|
|
10509
10509
|
if (content) {
|
|
10510
10510
|
const responseStatus = reqCtx.responseStatus ?? 200;
|
|
10511
|
-
const isSpaNav = req.headers.get(
|
|
10511
|
+
const isSpaNav = req.headers.get(SPA_NAV_HEADER) === "true";
|
|
10512
10512
|
if (isSpaNav) {
|
|
10513
10513
|
const layoutMatch = content.match(/<!-- stx-layout: ([^ ]+) -->/);
|
|
10514
10514
|
const pageLayout = layoutMatch ? layoutMatch[1] : "default";
|
|
@@ -10624,7 +10624,8 @@ ${trailingPageScripts.join(`
|
|
|
10624
10624
|
...pageTitle && { "X-STX-Title": encodeURIComponent(pageTitle) },
|
|
10625
10625
|
[BUILD_ID_HEADER]: getBuildId(),
|
|
10626
10626
|
...containerAttrs && { "X-STX-Container-Attrs": encodeURIComponent(containerAttrs) },
|
|
10627
|
-
|
|
10627
|
+
...spaNavVaryHeaders(),
|
|
10628
|
+
"Cache-Control": FRAGMENT_CACHE_CONTROL,
|
|
10628
10629
|
...corsHeaders
|
|
10629
10630
|
}
|
|
10630
10631
|
});
|
|
@@ -10657,6 +10658,7 @@ ${trailingPageScripts.join(`
|
|
|
10657
10658
|
}
|
|
10658
10659
|
const pageHeaders = new Headers({
|
|
10659
10660
|
"Content-Type": "text/html; charset=utf-8",
|
|
10661
|
+
...spaNavVaryHeaders(),
|
|
10660
10662
|
"Cache-Control": "no-store",
|
|
10661
10663
|
...corsHeaders
|
|
10662
10664
|
});
|
package/package.json
CHANGED