diff --git a/shared/static/scripts/sx-browser.js b/shared/static/scripts/sx-browser.js index 3214d2e..9282400 100644 --- a/shared/static/scripts/sx-browser.js +++ b/shared/static/scripts/sx-browser.js @@ -14,6 +14,7 @@ // ========================================================================= var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } }); + var SX_VERSION = "2026-03-06T21:05:23Z"; function isNil(x) { return x === NIL || x === null || x === undefined; } function isSxTruthy(x) { return x !== false && !isNil(x); } @@ -2349,7 +2350,7 @@ callExpr.push(dictGet(kwargs, k)); } } })(); }; // boot-init - var bootInit = function() { return (initCssTracking(), initStyleDict(), processSxScripts(NIL), processPageScripts(), sxHydrateElements(NIL), processElements(NIL)); }; + var bootInit = function() { return (logInfo((String("sx-browser ") + String(SX_VERSION))), initCssTracking(), initStyleDict(), processSxScripts(NIL), processPageScripts(), sxHydrateElements(NIL), processElements(NIL)); }; // ========================================================================= diff --git a/shared/sx/ref/boot.sx b/shared/sx/ref/boot.sx index 41e7fec..0e95e85 100644 --- a/shared/sx/ref/boot.sx +++ b/shared/sx/ref/boot.sx @@ -336,6 +336,7 @@ ;; 5. Hydrate [data-sx] elements ;; 6. Process engine elements (do + (log-info (str "sx-browser " SX_VERSION)) (init-css-tracking) (init-style-dict) (process-sx-scripts nil) diff --git a/shared/sx/ref/bootstrap_js.py b/shared/sx/ref/bootstrap_js.py index c63e54e..f39c979 100644 --- a/shared/sx/ref/bootstrap_js.py +++ b/shared/sx/ref/bootstrap_js.py @@ -476,6 +476,7 @@ class JSEmitter: "process-sx-scripts": "processSxScripts", "process-component-script": "processComponentScript", "init-style-dict": "initStyleDict", + "SX_VERSION": "SX_VERSION", "boot-init": "bootInit", "resolve-mount-target": "resolveMountTarget", "sx-render-with-env": "sxRenderWithEnv", @@ -1288,7 +1289,9 @@ def compile_ref_to_js( parts.append(CONTINUATIONS_JS) parts.append(public_api_js(has_html, has_sx, has_dom, has_engine, has_orch, has_cssx, has_boot, has_parser, adapter_label, has_deps, has_router)) parts.append(EPILOGUE) - return "\n".join(parts) + from datetime import datetime, timezone + build_ts = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ") + return "\n".join(parts).replace("BUILD_TIMESTAMP", build_ts) # --------------------------------------------------------------------------- @@ -1312,6 +1315,7 @@ PREAMBLE = '''\ // ========================================================================= var NIL = Object.freeze({ _nil: true, toString: function() { return "nil"; } }); + var SX_VERSION = "BUILD_TIMESTAMP"; function isNil(x) { return x === NIL || x === null || x === undefined; } function isSxTruthy(x) { return x !== false && !isNil(x); }