From 96fca7ebf793668ae52e2d11639373616386513c Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Thu, 7 May 2026 16:00:53 -0500 Subject: [PATCH] fix(checkout): split checkout_page into helpers to avoid single-function OOM in elc --emit-header Extract nav and style blocks into checkout_nav_html() and checkout_style_html() so the compiler processes each template in isolation rather than one 490-line function with mixed HTML template AST and BinOp string concat. --- src/checkout.el | 52 ++++++++++++++++++------------------------------- src/styles.el | 7 ++++--- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/src/checkout.el b/src/checkout.el index 53fc7d8..6a953df 100644 --- a/src/checkout.el +++ b/src/checkout.el @@ -11,6 +11,17 @@ // 4. User fills name, email, card - submits // 5. stripe.confirmPayment() → redirects to /marketplace/success +fn checkout_nav_html() -> String { + +} + fn checkout_page(plan: String, pub_key: String) -> String { let is_founding: Bool = str_eq(plan, "founding") let is_free: Bool = str_eq(plan, "free") @@ -53,17 +64,9 @@ fn checkout_page(plan: String, pub_key: String) -> String {
  • 2 devices included
  • " } } - return - + let nav_html: String = checkout_nav_html() -
    + let main_html: String =
    @@ -236,23 +239,14 @@ fn checkout_page(plan: String, pub_key: String) -> String {
    - - - - + let style_html: String = checkout_style_html() - - - - - - -{#if is_free} - -{/if} } diff --git a/src/styles.el b/src/styles.el index 3c5d86a..960943d 100644 --- a/src/styles.el +++ b/src/styles.el @@ -1966,7 +1966,8 @@ fn page_open() -> String { } fn page_close() -> String { - return + let widgets: String =
    +
    @@ -2023,6 +2024,6 @@ fn page_close() -> String {
    - - +
    + return widgets + "" }