IO registry: defio declares platform suspension points

Core SX has zero IO — platforms extend __io-registry via (defio name
:category :data/:code/:effect ...). The server web platform declares 44
operations in web/io.sx. batchable_helpers now derived from registry
(:batchable true) instead of hardcoded list. Startup validation warns if
bound IO ops lack registry entries. Browser gets empty registry, ready
for step 5 (IO suspension).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 23:21:48 +00:00
parent 17b6c872f2
commit ede05c26f5
16 changed files with 486 additions and 58 deletions

View File

@@ -1,7 +1,5 @@
(define _preload-cache (dict))
(define _css-hash "")
(define
dispatch-trigger-events
:effects (mutation io)
@@ -26,19 +24,6 @@
(dom-dispatch el trimmed (dict)))))
(split header-val ",")))))))
(define
init-css-tracking
:effects (mutation io)
(fn
()
(let
((meta (dom-query "meta[name=\"sx-css-classes\"]")))
(when
meta
(let
((content (dom-get-attr meta "content")))
(when content (set! _css-hash content)))))))
(define
execute-request
:effects (mutation io)
@@ -115,8 +100,7 @@
(final-url (get body-info "url"))
(body (get body-info "body"))
(ct (get body-info "content-type"))
(headers
(build-request-headers el (loaded-component-names) _css-hash))
(headers (build-request-headers el (loaded-component-names)))
(csrf (csrf-token)))
(when
extraParams
@@ -214,9 +198,6 @@
(text :as string))
(let
((resp-headers (process-response-headers get-header)))
(let
((new-hash (get resp-headers "css-hash")))
(when new-hash (set! _css-hash new-hash)))
(dispatch-trigger-events el (get resp-headers "trigger"))
(process-cache-directives el resp-headers text)
(cond
@@ -1144,8 +1125,7 @@
pathname
(build-request-headers
target
(loaded-component-names)
_css-hash))
(loaded-component-names)))
true)
(if
(get match "has-data")
@@ -1181,8 +1161,7 @@
pathname
(build-request-headers
target
(loaded-component-names)
_css-hash)
(loaded-component-names))
0))
(swap-rendered-content
target
@@ -1240,8 +1219,7 @@
pathname
(build-request-headers
target
(loaded-component-names)
_css-hash)
(loaded-component-names))
0))
(swap-rendered-content
target
@@ -1262,8 +1240,7 @@
pathname
(build-request-headers
target
(loaded-component-names)
_css-hash)
(loaded-component-names))
0))
(swap-rendered-content
target
@@ -1293,8 +1270,7 @@
pathname
(build-request-headers
target
(loaded-component-names)
_css-hash)
(loaded-component-names))
0))
(swap-rendered-content
target
@@ -1471,10 +1447,7 @@
info
(do-preload
(get info "url")
(build-request-headers
el
(loaded-component-names)
_css-hash)))))))))))
(build-request-headers el (loaded-component-names))))))))))))
(define
do-preload
@@ -1592,8 +1565,4 @@
:effects (mutation io)
(fn
()
(do
(init-css-tracking)
(sx-process-scripts nil)
(sx-hydrate nil)
(process-elements nil))))
(do (sx-process-scripts nil) (sx-hydrate nil) (process-elements nil))))