Migrate 6 reactive demo handlers from Python f-strings to SX defhandlers

Moved flash-sale, settle-data, search-products/events/posts, and catalog
endpoints from bp/pages/routes.py into sx/sx/handlers/reactive-api.sx.
routes.py now contains only the SSE endpoint (async generators need Python).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 13:26:25 +00:00
parent 96f2862385
commit ee868f686b
3 changed files with 173 additions and 137 deletions

View File

@@ -154,7 +154,9 @@ async def execute_handler(
if use_ocaml:
from .ocaml_bridge import get_bridge
# Serialize handler body with bound params as a let expression
# Serialize handler body with bound params as a let expression.
# Define constants and defcomps from the handler file are available
# in the kernel's global env (loaded by _ensure_components).
param_bindings = []
for param in handler_def.params:
val = args.get(param, args.get(param.replace("-", "_"), NIL))