@stacksjs/sites 0.74.50 → 0.74.52

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/README.md CHANGED
@@ -14,10 +14,13 @@ A host resolves in this order:
14
14
 
15
15
  - **API / bun-router:** the `siteResolver` middleware stamps `request.site`
16
16
  and the ambient AsyncLocalStorage context (`currentSite()`, `requireSite()`).
17
- - **STX pages:** ALS does not survive into stx-serve's render. The serving
18
- layer stashes `toSiteSnapshot(site)` on the request-context snapshot, and
19
- `<script server>` blocks read `requestContext.site()`. Never call
20
- `currentSite()` from an stx server script.
17
+ - **STX pages:** the view servers resolve the site after an `await` in stx
18
+ serve's `onRequest` hook, and the ALS context `setCurrentSite` enters there
19
+ ends with the hook, before the render. The serving layer stores
20
+ `toSiteSnapshot(site)` on the request's snapshot (`enterRequestScope` in
21
+ `@stacksjs/config`), and `<script server>` blocks read
22
+ `requestContext.site()`. Never call `currentSite()` from an stx server
23
+ script.
21
24
 
22
25
  ## Scoping is explicit
23
26
 
@@ -3,8 +3,8 @@ export declare function toSiteSnapshot(site: SiteContext | null | undefined): Si
3
3
  /**
4
4
  * The shape the stx serving layer stashes on the request-context snapshot
5
5
  * (`RequestContextSnapshot.site` in `@stacksjs/config`), which is how
6
- * `<script server>` blocks see the site - ALS does not survive into
7
- * stx-serve's render, so this is the one channel that works there.
6
+ * `<script server>` blocks see the site. The snapshot rides on the request
7
+ * scope both view servers enter at the start of onRequest.
8
8
  */
9
9
  export declare interface SiteSnapshotShape {
10
10
  id: number
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/sites",
3
3
  "type": "module",
4
- "version": "0.74.50",
4
+ "version": "0.74.52",
5
5
  "description": "The Stacks multi-site (request-level tenancy) functionality.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -56,18 +56,18 @@
56
56
  "prepublishOnly": "bun run build"
57
57
  },
58
58
  "dependencies": {
59
- "@stacksjs/auth": "0.74.50",
60
- "@stacksjs/config": "0.74.50",
61
- "@stacksjs/database": "0.74.50",
62
- "@stacksjs/router": "0.74.50"
59
+ "@stacksjs/auth": "0.74.52",
60
+ "@stacksjs/config": "0.74.52",
61
+ "@stacksjs/database": "0.74.52",
62
+ "@stacksjs/router": "0.74.52"
63
63
  },
64
64
  "devDependencies": {
65
- "@stacksjs/error-handling": "0.74.50",
65
+ "@stacksjs/error-handling": "0.74.52",
66
66
  "better-dx": "^0.2.24"
67
67
  },
68
68
  "sideEffects": false,
69
69
  "peerDependencies": {
70
- "@stacksjs/cms": "0.74.50"
70
+ "@stacksjs/cms": "0.74.52"
71
71
  },
72
72
  "peerDependenciesMeta": {
73
73
  "@stacksjs/cms": {