Uncommitted sx-tools changes: WASM bundles, Playwright specs, engine fixes
WASM browser bundles rebuilt with latest kernel. Playwright test specs updated (helpers, navigation, handler-responses, hypermedia-handlers, isomorphic, SPA navigation). Engine/boot/orchestration SX files updated. Handler examples and not-found page refreshed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2709,18 +2709,19 @@ let http_mode port =
|
||||
let req_method = String.uppercase_ascii !_req_method in
|
||||
let try_key k = try let v = env_get env k in
|
||||
if v <> Nil then Some (k, v) else None with _ -> None in
|
||||
let base = "handler:ex-" ^ slug in
|
||||
(* Try multiple handler name patterns: ex-slug, reactive-slug, slug *)
|
||||
let prefixes = ["handler:ex-" ^ slug; "handler:reactive-" ^ slug; "handler:" ^ slug] in
|
||||
let suffixes = match req_method with
|
||||
| "POST" -> [base; base ^ "-save"; base ^ "-submit"]
|
||||
| "PUT" | "PATCH" -> [base; base ^ "-put"; base ^ "-save"]
|
||||
| "DELETE" -> [base]
|
||||
| _ -> [base; base ^ "-form"; base ^ "-status"] in
|
||||
| "POST" -> List.concat_map (fun base -> [base; base ^ "-save"; base ^ "-submit"]) prefixes
|
||||
| "PUT" | "PATCH" -> List.concat_map (fun base -> [base; base ^ "-put"; base ^ "-save"]) prefixes
|
||||
| "DELETE" -> prefixes
|
||||
| _ -> List.concat_map (fun base -> [base; base ^ "-form"; base ^ "-status"]) prefixes in
|
||||
let found = List.fold_left (fun acc k ->
|
||||
match acc with Some _ -> acc | None -> try_key k) None suffixes in
|
||||
(match found with
|
||||
| None ->
|
||||
http_response ~status:404 ~content_type:"text/sx; charset=utf-8"
|
||||
(Printf.sprintf "(div :class \"p-4 text-rose-600\" \"Handler not found: %s\")" base)
|
||||
(Printf.sprintf "(div :class \"p-4 text-rose-600\" \"Handler not found: %s\")" (List.hd prefixes))
|
||||
| Some (_hk, hdef) ->
|
||||
(match path_param_val with
|
||||
| Some pval ->
|
||||
|
||||
Reference in New Issue
Block a user