Clean up debug logs from try-client-route, keep deps check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 01:16:24 +00:00
parent b90cc59029
commit 1387d97c82
2 changed files with 5 additions and 11 deletions

View File

@@ -14,7 +14,7 @@
// =========================================================================
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
var SX_VERSION = "2026-03-07T01:13:04Z";
var SX_VERSION = "2026-03-07T01:16:18Z";
function isNil(x) { return x === NIL || x === null || x === undefined; }
function isSxTruthy(x) { return x !== false && !isNil(x); }
@@ -2066,10 +2066,9 @@ return domAppendToHead(link); }, domQueryAll(container, "link[rel=\"stylesheet\"
var pageName = get(match, "name");
return (isSxTruthy(sxOr(isNil(contentSrc), isEmpty(contentSrc))) ? (logWarn((String("sx:route no content for ") + String(pathname))), false) : (function() {
var target = resolveRouteTarget(targetSel);
return (isSxTruthy(isNil(target)) ? (logWarn((String("sx:route target not found: ") + String(targetSel))), false) : (isSxTruthy(!isSxTruthy(depsSatisfied_p(match))) ? (logInfo((String("sx:route deps not loaded for ") + String(pageName))), false) : (logInfo((String("sx:route has-data=") + String(get(match, "has-data")) + String(" type=") + String(typeOf(get(match, "has-data"))) + String(" page=") + String(pageName))), (isSxTruthy(get(match, "has-data")) ? (function() {
return (isSxTruthy(isNil(target)) ? (logWarn((String("sx:route target not found: ") + String(targetSel))), false) : (isSxTruthy(!isSxTruthy(depsSatisfied_p(match))) ? (logInfo((String("sx:route deps miss for ") + String(pageName))), false) : (isSxTruthy(get(match, "has-data")) ? (function() {
var cacheKey = pageDataCacheKey(pageName, params);
var cached = pageDataCacheGet(cacheKey);
logInfo((String("sx:route cache-key=") + String(cacheKey) + String(" cached=") + String(!isSxTruthy(isNil(cached)))));
return (isSxTruthy(cached) ? (function() {
var env = merge(closure, params, cached);
var rendered = tryEvalContent(contentSrc, env);
@@ -2084,7 +2083,7 @@ return (function() {
var env = merge(closure, params);
var rendered = tryEvalContent(contentSrc, env);
return (isSxTruthy(isNil(rendered)) ? (logInfo((String("sx:route server (eval failed) ") + String(pathname))), false) : (swapRenderedContent(target, rendered, pathname), true));
})()))));
})())));
})());
})());
})(); };

View File

@@ -647,16 +647,11 @@
(if (nil? target)
(do (log-warn (str "sx:route target not found: " target-sel)) false)
(if (not (deps-satisfied? match))
(do (log-info (str "sx:route deps not loaded for " page-name)) false)
(do
(log-info (str "sx:route has-data=" (get match "has-data")
" type=" (type-of (get match "has-data"))
" page=" page-name))
(do (log-info (str "sx:route deps miss for " page-name)) false)
(if (get match "has-data")
;; Data page: check cache, else resolve asynchronously
(let ((cache-key (page-data-cache-key page-name params))
(cached (page-data-cache-get cache-key)))
(log-info (str "sx:route cache-key=" cache-key " cached=" (not (nil? cached))))
(if cached
;; Cache hit: render immediately
(let ((env (merge closure params cached))
@@ -686,7 +681,7 @@
(do (log-info (str "sx:route server (eval failed) " pathname)) false)
(do
(swap-rendered-content target rendered pathname)
true))))))))))))))
true)))))))))))))
(define bind-client-route-link