boundary.sx was mixing three concerns in one file:
- Core SX I/O primitives (the language contract)
- Deployment-specific layout I/O (app architecture)
- Per-service page helpers (fully app-specific)
Now split into three tiers:
1. shared/sx/ref/boundary.sx — core I/O only (frag, query, current-user, etc.)
2. shared/sx/ref/boundary-app.sx — deployment layout contexts (*-header-ctx, *-ctx)
3. {service}/sx/boundary.sx — per-service page helpers
The boundary parser loads all three tiers automatically. Validation error
messages now point to the correct file for each tier.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
119 lines
2.9 KiB
Plaintext
119 lines
2.9 KiB
Plaintext
;; ==========================================================================
|
|
;; boundary-app.sx — Deployment-specific boundary declarations
|
|
;;
|
|
;; Layout context I/O primitives for THIS deployment's service architecture.
|
|
;; These are NOT part of the SX language contract — a different deployment
|
|
;; would declare different layout contexts here.
|
|
;;
|
|
;; The core SX I/O contract lives in boundary.sx.
|
|
;; Per-service page helpers live in {service}/sx/boundary.sx.
|
|
;; ==========================================================================
|
|
|
|
|
|
;; --------------------------------------------------------------------------
|
|
;; Layout context providers — deployment-specific I/O
|
|
;; --------------------------------------------------------------------------
|
|
|
|
;; Shared across all services (root layout)
|
|
|
|
(define-io-primitive "root-header-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with root header values (cart-mini, auth-menu, nav-tree, etc.)."
|
|
:context :request)
|
|
|
|
(define-io-primitive "select-colours"
|
|
:params ()
|
|
:returns "string"
|
|
:async true
|
|
:doc "Shared select/hover CSS class string."
|
|
:context :request)
|
|
|
|
(define-io-primitive "account-nav-ctx"
|
|
:params ()
|
|
:returns "any"
|
|
:async true
|
|
:doc "Account nav fragments, or nil."
|
|
:context :request)
|
|
|
|
(define-io-primitive "app-rights"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "User rights dict from g.rights."
|
|
:context :request)
|
|
|
|
;; Blog service layout
|
|
|
|
(define-io-primitive "post-header-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with post-level header values."
|
|
:context :request)
|
|
|
|
;; Cart service layout
|
|
|
|
(define-io-primitive "cart-page-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with cart page header values."
|
|
:context :request)
|
|
|
|
;; Events service layouts
|
|
|
|
(define-io-primitive "events-calendar-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with events calendar header values."
|
|
:context :request)
|
|
|
|
(define-io-primitive "events-day-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with events day header values."
|
|
:context :request)
|
|
|
|
(define-io-primitive "events-entry-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with events entry header values."
|
|
:context :request)
|
|
|
|
(define-io-primitive "events-slot-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with events slot header values."
|
|
:context :request)
|
|
|
|
(define-io-primitive "events-ticket-type-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with ticket type header values."
|
|
:context :request)
|
|
|
|
;; Market service layout
|
|
|
|
(define-io-primitive "market-header-ctx"
|
|
:params ()
|
|
:returns "dict"
|
|
:async true
|
|
:doc "Dict with market header data."
|
|
:context :request)
|
|
|
|
;; Federation service layout
|
|
|
|
(define-io-primitive "federation-actor-ctx"
|
|
:params ()
|
|
:returns "dict?"
|
|
:async true
|
|
:doc "Serialized ActivityPub actor dict or nil."
|
|
:context :request)
|