Add DOM primitives (dom-set-prop, dom-call-method, dom-post-message), bump SW cache v2, remove video demo
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6m57s

New platform_js primitives for direct DOM property/method access and
cross-origin iframe communication. Service worker static cache bumped
to v2 to flush stale assets. Removed experimental video embed from
header island, routes, and home page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 21:51:05 +00:00
parent b8018ba385
commit 8f88e52b27
7 changed files with 27 additions and 76 deletions

View File

@@ -2,9 +2,7 @@
(defcomp ~sx-home-content ()
(div :id "main-content" :class "max-w-3xl mx-auto px-4 py-6"
(~doc-code :code (highlight (component-source "~sx-header") "lisp"))
(~doc-code :code (highlight (component-source "~video-player") "lisp"))
(~doc-code :code (highlight (component-source "~video-embed") "lisp"))))
(~doc-code :code (highlight (component-source "~sx-header") "lisp"))))
(defcomp ~docs-introduction-content ()
(~doc-page :title "Introduction"

View File

@@ -32,7 +32,7 @@
(span :style (str (display "block") (mb 2)
(cssx (:text (colour "violet" 699) (size "4xl") (weight "bold") (family "mono"))))
"(<sx>)")))
;; Tagline — NOT in anchor. Clicking "reactive" cycles colour + fetches video.
;; Tagline — clicking "reactive" cycles colour.
(p :style (str (mb 1) (cssx (:text (colour "stone" 500) (size "lg"))))
"Framework free "
(span
@@ -42,15 +42,7 @@
:on-click (fn (e)
(batch (fn ()
(swap! idx inc)
(reset! shade (+ 400 (* (mod (* (deref idx) 137) 5) 50)))))
;; Only fetch video if none loaded (marsh: reactive + conditional hypermedia)
(let ((embed (dom-query-by-id "video-embed")))
(when (not (dom-get-prop embed "firstChild"))
(dom-dispatch (dom-get-prop e "currentTarget") "fetch-video" {}))))
:sx-get "/api/random-video"
:sx-target "#video-embed"
:sx-swap "innerHTML"
:sx-trigger "fetch-video"
(reset! shade (+ 400 (* (mod (* (deref idx) 137) 5) 50))))))
"reactive")
" hypermedia")
;; Lake: server morphs copyright on navigation without disturbing signals.
@@ -62,12 +54,6 @@
"margin-left:0.5em;")
(str "· " path))))))))
;; Video player island — defisland so the morph algorithm preserves it across
;; navigations. Content swapped in via sx-get from the reactive word click.
;; Empty initially (zero height). Iframe provides height when loaded.
(defisland ~video-player ()
(div :id "video-embed"
:style "position:relative;width:20rem;max-width:66vw;"))
;; @css grid grid-cols-3
@@ -147,11 +133,6 @@
:style (str "opacity:" (+ (* (/ 1 depth) 0.75) 0.25) ";"
"transition:opacity 0.3s;")
(~sx-header :path (or path "/")))
;; Video island — preserved across navigation morphs (like ~sx-header).
;; Outside logo-opacity so it doesn't fade.
;; Marsh demo: reactive click triggers hypermedia fetch, result lands here.
;; Island renders as inline <span>; force it to block so margin:auto centers.
(div :style "display:flex;justify-content:center;" (~video-player))
;; Sibling arrows for EVERY level in the trail
;; Trail row i is level (i+2) of depth — opacity = (i+2)/depth
;; Last row (leaf) gets is-leaf for larger current page title