Step 18 (part 8): Playground page + compile handler + url_decode fix

sx/sx/hyperscript.sx — _hyperscript playground page at
  /sx/(applications.(hyperscript))
  - compile-result defcomp (SSR compilation display)
  - pipeline documentation (tokenize → parse → compile)
  - example showcases with pre-compiled output
  - sx-post form → handler for interactive compilation

sx/sx/handlers/hyperscript-api.sx — POST handler:
  /sx/(applications.(hyperscript.(api.compile)))
  Accepts source param, returns compiled SX + parse tree HTML
  NOTE: hs-parse returns (do) in server context — JIT/CEK runtime
  issue where parser closures don't evaluate correctly. Works in
  test runner (3127/3127). Investigating separately.

sx_server.ml — url_decode fix: decode + as space in form data
  Standard application/x-www-form-urlencoded uses + for spaces.

Nav: _hyperscript added to Applications section.
Config: handler:hs- prefix added for handler dispatch.

3127/3127 tests, zero regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 10:10:19 +00:00
parent 770c7fd821
commit cf088a33b4
6 changed files with 211 additions and 1 deletions

View File

@@ -708,6 +708,14 @@
eval-rules
(fn (&key title &rest args) (quasiquote (~geography/eval-rules-content))))
(define
hyperscript
(make-page-fn
"~hyperscript/playground-content"
"~hyperscript/"
nil
"-content"))
(define
sxtp
(make-page-fn