Phase 4: Client-side rendering of :data pages via abstract resolve-page-data

Spec layer (orchestration.sx):
- try-client-route now handles :data pages instead of falling back to server
- New abstract primitive resolve-page-data(name, params, callback) — platform
  decides transport (HTTP, IPC, cache, etc)
- Extracted swap-rendered-content and resolve-route-target helpers

Platform layer (bootstrap_js.py):
- resolvePageData() browser implementation: fetches /sx/data/<name>, parses
  SX response, calls callback. Other hosts provide their own transport.

Server layer (pages.py):
- evaluate_page_data() evaluates :data expr, serializes result as SX
- auto_mount_page_data() mounts /sx/data/ endpoint with per-page auth
- _build_pages_sx now computes component deps for all pages (not just pure)

Test page at /isomorphism/data-test exercises the full pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 23:46:30 +00:00
parent 9d0cffb84d
commit a657d0831c
10 changed files with 375 additions and 108 deletions

View File

@@ -449,6 +449,20 @@
:pages pages :total-pages total-pages :client-count client-count
:server-count server-count :registry-sample registry-sample))
(defpage data-test
:path "/isomorphism/data-test"
:auth :public
:layout (:sx-section
:section "Isomorphism"
:sub-label "Isomorphism"
:sub-href "/isomorphism/"
:sub-nav (~section-nav :items isomorphism-nav-items :current "Data Test")
:selected "Data Test")
:data (data-test-data)
:content (~data-test-content
:server-time server-time :items items
:phase phase :transport transport))
;; ---------------------------------------------------------------------------
;; Plans section
;; ---------------------------------------------------------------------------