diff --git a/shared/static/scripts/sx-browser.js b/shared/static/scripts/sx-browser.js index 9282400..e345063 100644 --- a/shared/static/scripts/sx-browser.js +++ b/shared/static/scripts/sx-browser.js @@ -14,7 +14,7 @@ // ========================================================================= var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } }); - var SX_VERSION = "2026-03-06T21:05:23Z"; + var SX_VERSION = "2026-03-06T21:10:17Z"; function isNil(x) { return x === NIL || x === null || x === undefined; } function isSxTruthy(x) { return x !== false && !isNil(x); } @@ -1927,7 +1927,7 @@ return forEach(function(form) { return (isSxTruthy((isSxTruthy(!isProcessed(form // try-client-route var tryClientRoute = function(pathname) { return (function() { var match = findMatchingRoute(pathname, _pageRoutes); - return (isSxTruthy(isNil(match)) ? false : (isSxTruthy(get(match, "has-data")) ? (logInfo((String("sx:route server (has data) ") + String(pathname))), false) : (function() { + return (isSxTruthy(isNil(match)) ? (logInfo((String("sx:route no match (") + String(len(_pageRoutes)) + String(" routes) ") + String(pathname))), false) : (isSxTruthy(get(match, "has-data")) ? (logInfo((String("sx:route server (has data) ") + String(pathname))), false) : (function() { var contentSrc = get(match, "content"); var closure = sxOr(get(match, "closure"), {}); var params = get(match, "params"); @@ -2340,13 +2340,17 @@ callExpr.push(dictGet(kwargs, k)); } } // process-page-scripts var processPageScripts = function() { return (function() { var scripts = queryPageScripts(); - return forEach(function(s) { return (isSxTruthy(!isProcessed(s, "pages")) ? (markProcessed(s, "pages"), (function() { + { var _c = scripts; for (var _i = 0; _i < _c.length; _i++) { var s = _c[_i]; if (isSxTruthy(!isProcessed(s, "pages"))) { + markProcessed(s, "pages"); + (function() { var text = domTextContent(s); return (isSxTruthy((isSxTruthy(text) && !isEmpty(trim(text)))) ? (function() { var pages = parse(text); return forEach(function(page) { return append_b(_pageRoutes, merge(page, {"parsed": parseRoutePattern(get(page, "path"))})); }, pages); })() : NIL); -})()) : NIL); }, scripts); +})(); +} } } + return logInfo((String("pages: ") + String(len(_pageRoutes)) + String(" routes loaded"))); })(); }; // boot-init diff --git a/shared/sx/ref/boot.sx b/shared/sx/ref/boot.sx index 0e95e85..148a416 100644 --- a/shared/sx/ref/boot.sx +++ b/shared/sx/ref/boot.sx @@ -319,7 +319,8 @@ (merge page {"parsed" (parse-route-pattern (get page "path"))}))) pages)))))) - scripts)))) + scripts) + (log-info (str "pages: " (len _page-routes) " routes loaded"))))) ;; -------------------------------------------------------------------------- diff --git a/shared/sx/ref/orchestration.sx b/shared/sx/ref/orchestration.sx index cbf901a..a8fa6f5 100644 --- a/shared/sx/ref/orchestration.sx +++ b/shared/sx/ref/orchestration.sx @@ -543,7 +543,7 @@ ;; Only works for pages without :data dependencies. (let ((match (find-matching-route pathname _page-routes))) (if (nil? match) - false + (do (log-info (str "sx:route no match (" (len _page-routes) " routes) " pathname)) false) (if (get match "has-data") (do (log-info (str "sx:route server (has data) " pathname)) false) (let ((content-src (get match "content"))