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:
@@ -14,7 +14,7 @@
|
|||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } });
|
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 isNil(x) { return x === NIL || x === null || x === undefined; }
|
||||||
function isSxTruthy(x) { return x !== false && !isNil(x); }
|
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");
|
var pageName = get(match, "name");
|
||||||
return (isSxTruthy(sxOr(isNil(contentSrc), isEmpty(contentSrc))) ? (logWarn((String("sx:route no content for ") + String(pathname))), false) : (function() {
|
return (isSxTruthy(sxOr(isNil(contentSrc), isEmpty(contentSrc))) ? (logWarn((String("sx:route no content for ") + String(pathname))), false) : (function() {
|
||||||
var target = resolveRouteTarget(targetSel);
|
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 cacheKey = pageDataCacheKey(pageName, params);
|
||||||
var cached = pageDataCacheGet(cacheKey);
|
var cached = pageDataCacheGet(cacheKey);
|
||||||
logInfo((String("sx:route cache-key=") + String(cacheKey) + String(" cached=") + String(!isSxTruthy(isNil(cached)))));
|
|
||||||
return (isSxTruthy(cached) ? (function() {
|
return (isSxTruthy(cached) ? (function() {
|
||||||
var env = merge(closure, params, cached);
|
var env = merge(closure, params, cached);
|
||||||
var rendered = tryEvalContent(contentSrc, env);
|
var rendered = tryEvalContent(contentSrc, env);
|
||||||
@@ -2084,7 +2083,7 @@ return (function() {
|
|||||||
var env = merge(closure, params);
|
var env = merge(closure, params);
|
||||||
var rendered = tryEvalContent(contentSrc, env);
|
var rendered = tryEvalContent(contentSrc, env);
|
||||||
return (isSxTruthy(isNil(rendered)) ? (logInfo((String("sx:route server (eval failed) ") + String(pathname))), false) : (swapRenderedContent(target, rendered, pathname), true));
|
return (isSxTruthy(isNil(rendered)) ? (logInfo((String("sx:route server (eval failed) ") + String(pathname))), false) : (swapRenderedContent(target, rendered, pathname), true));
|
||||||
})()))));
|
})())));
|
||||||
})());
|
})());
|
||||||
})());
|
})());
|
||||||
})(); };
|
})(); };
|
||||||
|
|||||||
@@ -647,16 +647,11 @@
|
|||||||
(if (nil? target)
|
(if (nil? target)
|
||||||
(do (log-warn (str "sx:route target not found: " target-sel)) false)
|
(do (log-warn (str "sx:route target not found: " target-sel)) false)
|
||||||
(if (not (deps-satisfied? match))
|
(if (not (deps-satisfied? match))
|
||||||
(do (log-info (str "sx:route deps not loaded for " page-name)) false)
|
(do (log-info (str "sx:route deps miss 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))
|
|
||||||
(if (get match "has-data")
|
(if (get match "has-data")
|
||||||
;; Data page: check cache, else resolve asynchronously
|
;; Data page: check cache, else resolve asynchronously
|
||||||
(let ((cache-key (page-data-cache-key page-name params))
|
(let ((cache-key (page-data-cache-key page-name params))
|
||||||
(cached (page-data-cache-get cache-key)))
|
(cached (page-data-cache-get cache-key)))
|
||||||
(log-info (str "sx:route cache-key=" cache-key " cached=" (not (nil? cached))))
|
|
||||||
(if cached
|
(if cached
|
||||||
;; Cache hit: render immediately
|
;; Cache hit: render immediately
|
||||||
(let ((env (merge closure params cached))
|
(let ((env (merge closure params cached))
|
||||||
@@ -686,7 +681,7 @@
|
|||||||
(do (log-info (str "sx:route server (eval failed) " pathname)) false)
|
(do (log-info (str "sx:route server (eval failed) " pathname)) false)
|
||||||
(do
|
(do
|
||||||
(swap-rendered-content target rendered pathname)
|
(swap-rendered-content target rendered pathname)
|
||||||
true))))))))))))))
|
true)))))))))))))
|
||||||
|
|
||||||
|
|
||||||
(define bind-client-route-link
|
(define bind-client-route-link
|
||||||
|
|||||||
Reference in New Issue
Block a user