sx-http: fix serialize_value for client-side parsing + remove debug code
serialize_value: lists with symbol head emit (fn args...) not (list fn args). This lets the client SX parser recognise special forms like let, when, cond inside component-defs. Data lists (starting with non-symbols) keep the (list ...) wrapper. Fixes "Undefined symbol: let" WASM error that broke all island hydration. Header island now reaches the JIT evaluator (fails on for-each VM error, not parsing). Geography, SXTP, CEK pages fully rendered. Removed debug logging (ssr-debug, debug dump, debug endpoint). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,14 @@ let rec serialize_value = function
|
||||
| Symbol s -> s
|
||||
| Keyword k -> ":" ^ k
|
||||
| List items | ListRef { contents = items } ->
|
||||
"(list " ^ String.concat " " (List.map serialize_value items) ^ ")"
|
||||
(* Lists with a symbol head are call expressions: (fn arg1 arg2).
|
||||
Lists starting with data values are data: (list 1 2 3).
|
||||
This distinction matters for the client parser. *)
|
||||
(match items with
|
||||
| (Symbol _ | Keyword _) :: _ ->
|
||||
"(" ^ String.concat " " (List.map serialize_value items) ^ ")"
|
||||
| _ ->
|
||||
"(list " ^ String.concat " " (List.map serialize_value items) ^ ")")
|
||||
| Dict d ->
|
||||
let pairs = Hashtbl.fold (fun k v acc ->
|
||||
(Printf.sprintf ":%s %s" k (serialize_value v)) :: acc) d [] in
|
||||
|
||||
Reference in New Issue
Block a user