Replace sx_call() with render_to_sx() across all services
Python no longer generates s-expression strings. All SX rendering now goes through render_to_sx() which builds AST from native Python values and evaluates via async_eval_to_sx() — no SX string literals in Python. - Add render_to_sx()/render_to_html() infrastructure in shared/sx/helpers.py - Add (abort status msg) IO primitive in shared/sx/primitives_io.py - Convert all 9 services: ~650 sx_call() invocations replaced - Convert shared helpers (root_header_sx, full_page_sx, etc.) to async - Fix likes service import bug (likes.models → models) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -129,7 +129,7 @@ def register():
|
||||
from sx.sx_components import render_like_toggle_button
|
||||
|
||||
if not g.user:
|
||||
return sx_response(render_like_toggle_button(product_slug, False), status=403)
|
||||
return sx_response(await render_like_toggle_button(product_slug, False), status=403)
|
||||
|
||||
user_id = g.user.id
|
||||
|
||||
@@ -138,7 +138,7 @@ def register():
|
||||
})
|
||||
liked = result["liked"]
|
||||
|
||||
return sx_response(render_like_toggle_button(product_slug, liked))
|
||||
return sx_response(await render_like_toggle_button(product_slug, liked))
|
||||
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ def register():
|
||||
from sx.sx_components import render_cart_added_response
|
||||
item_data = getattr(g, "item_data", {})
|
||||
d = item_data.get("d", {})
|
||||
return sx_response(render_cart_added_response(g.cart, ci_ns, d))
|
||||
return sx_response(await render_cart_added_response(g.cart, ci_ns, d))
|
||||
|
||||
# normal POST: go to cart page
|
||||
from shared.infrastructure.urls import cart_url
|
||||
|
||||
Reference in New Issue
Block a user