scittle

p-himik 2025-08-12T17:22:43.681209Z

Is there a way to make cljs-devtools work with scittle? Working with the stuff like on the pic is no fun.

borkdude 2025-08-14T18:13:49.049829Z

@p-himik Looking at improving the stacktrace. When I do this:

cljs.user=> (->> (try (sci/eval-string "(defn broken [] [:oh :boy :this :function (js/is_sure) :a :large :one])") (catch js/Error e e)) (sci/stacktrace) (sci/format-stacktrace) (run! prn))
"user/fn           - <expr>:1:43"
"clojure.core/fn   - <built-in>"
"user              - <expr>:1:1"
"clojure.core/defn - <built-in>"
"user              - <expr>:1:1"
"user              - <expr>:1:1"

borkdude 2025-08-14T18:13:58.234259Z

I see a quite ok stacktrace?

borkdude 2025-08-14T18:14:44.329049Z

oh I see

borkdude 2025-08-14T18:14:49.505649Z

I need to add 'js

1
borkdude 2025-08-14T18:15:32.882329Z

yeah bingo:

cljs.user=> (->> (try (sci/eval-string "(defn broken [] [:oh :boy :this :function (js/is_sure) :a :large :one])" {:classes {'js js/globalThis :allow :all}}) (catch js/Error e e)) (sci/stacktrace) (sci/format-stacktrace) (run! prn))
nil

borkdude 2025-08-14T19:03:04.797359Z

cljs.user=> (->> (try (sci/eval-string "(defn broken [] [:dude (js/is_sure) :foo]) (broken)" {:classes {'js js/globalThis :allow :all}}) (catch js/Error e (prn (ex-message e)) e)) (sci/stacktrace) (sci/format-stacktrace) (run! prn))
"Function.prototype.apply was called on undefined, which is a undefined and not a function"
"user/broken - <expr>:1:24"
"user/broken - <expr>:1:1"
"user        - <expr>:1:44"
πŸŽ‰

πŸŽ‰ 2
borkdude 2025-08-15T18:54:46.668009Z

The error message still isn't great when happening in a callback. I'm thinking about how this can be improved... it's hard...

borkdude 2025-08-15T18:55:39.892609Z

Anyway perhaps I can cut a scittle release with dev files. Perhaps it would be best if I could put the production + dev files into one release, so you don't accidentally mix those up. I can also name all the dev files scittle.dev.js for example

borkdude 2025-08-15T18:56:20.739509Z

and then you get scittle.js + scittle.js.map + .js. + .js.map all in one release

borkdude 2025-08-15T18:56:46.105999Z

That would also fix this issue: https://github.com/babashka/scittle/issues/114

borkdude 2025-08-12T18:01:22.560149Z

does cljs-devtools work with advanced compiled JS? that might be the problem? or should I make a cljs-devtools plugin for scittle? that might work

borkdude 2025-08-12T18:01:38.393089Z

so it can be compiled along

p-himik 2025-08-12T18:06:04.025889Z

> does cljs-devtools work with advanced compiled JS? Doesn't seem like it, from https://github.com/binaryage/cljs-devtools/blob/master/docs/faq.md#why-custom-formatters-do-not-work-for-advanced-builds: > There is a technical glitch which currently prevents CLJS devtools to work under :advanced optimizations. Some http://dev.clojure.org/jira/browse/CLJS-1249 and that is why CLJS DevTools cannot recognize objects belonging to CLJS land.

borkdude 2025-08-12T18:09:45.562609Z

that may be challenging then unless you compile scittle yourself

borkdude 2025-08-12T18:23:45.932739Z

can't believe the alternative set! syntax wasn't supported yet in SCI

borkdude 2025-08-12T18:30:19.169069Z

the next scittle will, just pushed it

πŸŽ‰ 2
Chris McCormick 2025-08-13T08:23:18.686939Z

Is it in a plugin or shipped in the main js file?

borkdude 2025-08-13T08:28:40.026989Z

Ambiguous what you’re referring to

Chris McCormick 2025-08-13T08:30:04.995459Z

I mean is cljs-devtools now compiled into the main scittle.js distributed file that will be on e.g. CDNs?

Chris McCormick 2025-08-13T08:30:22.365639Z

Or is it in a separate plugin file?

borkdude 2025-08-13T08:34:28.269809Z

this https://clojurians.slack.com/archives/C034FQN490E/p1755023419169069?thread_ts=1755019363.681209&amp;cid=C034FQN490E was referring to the alternative set syntax

borkdude 2025-08-13T08:34:33.831979Z

see the message just before it

borkdude 2025-08-13T08:35:04.569469Z

I can see how it confuses you, but it was about an issue that @p-himik posted as well

borkdude 2025-08-13T08:35:40.832829Z

https://github.com/babashka/sci/issues/984

borkdude 2025-08-13T08:36:04.092969Z

if you have any ideas how to make cljs-devtools work, feel free to share them

πŸ‘ 1
borkdude 2025-08-13T08:36:31.805029Z

Perhaps I can distribute both a development and production version of scittle

Chris McCormick 2025-08-13T08:42:06.527779Z

Oh sorry, I completely misunderstood!

borkdude 2025-08-13T08:43:21.449559Z

No worries. Would be nice if we could make it work though

Chris McCormick 2025-08-13T08:45:12.831789Z

Yes that would be cool. I miss it from shadow-cljs dev.

borkdude 2025-08-13T08:52:12.678639Z

I don't know what this means: https://github.com/binaryage/cljs-devtools/issues/37 Does it mean that cljs-devtools is always disabled using advanced compilation?

p-himik 2025-08-13T08:59:38.926219Z

I think it is always meant to be disabled, even if it's not used. But that FAQ entry I mentioned hints that even if properly included, it might still not work because advanced optimizations remove some important data.

borkdude 2025-08-13T09:00:34.296329Z

yeah. I could compile scittle using :simple for development but I don't know if shadow-cljs supports it... could try.

p-himik 2025-08-13T09:02:16.990679Z

Why not just :whitespace for development?

borkdude 2025-08-13T09:02:36.389509Z

what's the difference between whitespace and simple?

p-himik 2025-08-13T09:04:20.520689Z

also performs optimizations within expressions and functions, including renaming local variables and function parameters to shorter namesIn other words, :simple makes debugging much worse.

borkdude 2025-08-13T09:05:17.173779Z

alright, with :simple I get output like this:

$APP.cljs.core.map_indexed.cljs$core$IFn$_invoke$arity$2=function(a,b){return function f(d,e){return new $APP.cljs.core.LazySeq(null,function(){var g=$APP.cljs.core.seq(e);if(g){if($APP.cljs.core.chunked_seq_QMARK_(g)){for(var h=$APP.cljs.core.chunk_first(g),k=$APP.cljs.core.count(h),l=$APP.cljs.core.chunk_buffer(k),m=0;;)if(m<k)$APP.cljs.core.chunk_append(l,function(){var p=d+m,q=$APP.cljs.core._nth(h,m);return a.cljs$core$IFn$_invoke$arity$2?a.cljs$core$IFn$_invoke$arity$2(p,q):a.call(null,p,q)}()),
That seems to preserve the necessary info. I'll try whitespace as well.

p-himik 2025-08-13T09:06:08.255949Z

Renaming aside, I'm pretty sure it also straight up reuses some vars.

borkdude 2025-08-13T09:06:37.751669Z

with whitespace:

goog.functions.rateLimit=function(f,interval,opt_scope){let timeout=0;const handleTimeout=function(){timeout=0};return function(var_args){if(!timeout){timeout=goog.global.setTimeout(handleTimeout,interval);f.apply(opt_scope,arguments)}}};goog.functions.isFunction=val=>{return typeof val==="function"};goog.provide("goog.string.TypedString");goog.string.TypedString=function(){};goog.string.TypedString.prototype.implementsGoogStringTypedString;goog.string.TypedString.prototype.getTypedStringValue;goog.provide("goog.string.Const");goog.require("goog.asserts");goog.require("goog.string.TypedString");goog.string.Const=function(opt_token,opt_content){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=opt_token===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&opt_content||"";this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_};goog.string.Const.prototype.implementsGoogStringTypedString=true;

borkdude 2025-08-13T09:06:43.715059Z

(just a random sample)

borkdude 2025-08-13T09:06:54.428479Z

if I now would include cljs-devtools as a plugin I think it would work

borkdude 2025-08-13T09:07:47.519019Z

3144729 13 aug. 11:06 scittle.js only 3mb :)

😍 2
borkdude 2025-08-13T09:08:01.748919Z

but it does work, so that's promising

p-himik 2025-08-13T09:08:03.799119Z

And gzipped?

borkdude 2025-08-13T09:08:08.402519Z

dunno

p-himik 2025-08-13T09:08:26.687989Z

Should be much, much smaller due to all the unoptimized repetitions. Probably less than 1 MB.

borkdude 2025-08-13T09:11:56.594689Z

hm I get all kinds of errors like:

Uncaught TypeError: Cannot set properties of undefined (setting 'NodeType')
    at scittle.js:95:1083
    at scittle.js:7006:4Understand this error
deps.js:1  Failed to load resource: the server responded with a status of 404 (Not Found)

borkdude 2025-08-13T09:13:21.051099Z

goog.dom.NodeType =
seems to not work

borkdude 2025-08-13T09:14:03.278719Z

borkdude 2025-08-13T09:15:59.950299Z

I pushed this to a branch named scittle-dev . Feel free to take a peek. you can compile it with bb prod and the JS files are in resources/public/js. if you start an http server that serves resources/public you can make an html file there and play around.

p-himik 2025-08-13T09:16:11.040989Z

You use shadow-cljs, right? Might be that :simple does more there than the GCC docs describe. If so, maybe :simple should still be used, but with :pretty-print and :pseudo-names compiler options set to true.

borkdude 2025-08-13T09:16:15.710309Z

shadow yes

borkdude 2025-08-13T09:16:33.781089Z

this is using whitespace though

borkdude 2025-08-13T09:16:52.186909Z

I'll try simple again

p-himik 2025-08-13T09:17:53.236679Z

That's what I'm saying - maybe :whitespace doesn't do something in shadow-cljs that's required for Scittle. Given the error, it's probably related to goog modules. And if so, then :whitespace is simply a no-go without also altering shadow-cljs. But of course Thomas would know for sure.

borkdude 2025-08-13T09:18:31.899859Z

lol, with simple:

scittle.js:242 Uncaught SyntaxError: Invalid regular expression: /[Γ–'-Û¯Ûº-ࣿҀ�-οΏ½οΏ½-οΏ½Γ―Β¬-Γ―Β·ΒΏΓ―ΒΉΒ°-ﻼ]/: Range out of order in character class (at scittle.js:242:197)
    at new RegExp (<anonymous>)
    at scittle.js:242:197
    at scittle.js:5866:4

borkdude 2025-08-13T09:19:05.978039Z

I have to step away from this for a bit, but feel free to poke around yourself if you're interested

p-himik 2025-08-13T09:23:21.911099Z

Ugh, I hate that error. It happens something like once a year - infrequent just enough to never remember what the fix is. I think once it was fixed by updating shadow-cljs. And another time by updating some NPM package.

borkdude 2025-08-13T09:23:54.268819Z

I'm a bit behind on shadow so that may be the issue

borkdude 2025-08-13T09:36:44.682129Z

Bumping shadow worked

πŸŽ‰ 1
borkdude 2025-08-13T09:38:18.445839Z

and :whitespace didn't work at all, so simple it is

borkdude 2025-08-13T09:39:13.600979Z

those extra options, should they look like this?

:compiler-options {:optimizations :simple
                      :pretty-print true
                      :pseudo-names true}

p-himik 2025-08-13T09:40:59.328379Z

I believe so, yes.

borkdude 2025-08-13T09:45:56.752379Z

I made a devtools plugin for scittle, but I'm seeing this in the console when I enable it.

scittle.cljs-devtools.js:921 NOT installing CLJS DevTools 1.0.7 under advanced build. See .
pfffff

borkdude 2025-08-13T09:46:13.735439Z

and that faq link gets me a 404. faq this

😁 2
borkdude 2025-08-13T09:46:50.594109Z

borkdude 2025-08-13T09:47:38.701599Z

pushed the changes to scittle-dev Example html:


<html>
  <head>
    <script src="js/scittle.js" type="application/javascript"></script>
    <script src="js/scittle.cljs-devtools.js" type="application/javascript"></script>
    <script type="application/x-scittle">
      (js/console.log {:a 1})

    </script>
  </head>
  <body>
  </body>
</html>

borkdude 2025-08-13T09:48:33.291019Z

ah: > Since version 0.8.3, cljs-devtools detects advanced build situation and refuse to install. If you want to disable this check https://github.com/binaryage/cljs-devtools/blob/master/docs/configuration.md :disable-advanced-mode-check to true prior installing.

borkdude 2025-08-13T09:50:31.171019Z

ok works now:

p-himik 2025-08-13T09:50:47.945109Z

Awesome!

borkdude 2025-08-13T09:51:39.537539Z

pushed it to the branch

borkdude 2025-08-13T09:53:14.906029Z

I'm still not sure if it would solve your original problem though. the uncaught exception still looks cryptic (because it contains internal impl details of SCI)

borkdude 2025-08-13T09:53:27.497619Z

so best to just try this and see how this improve the DX

p-himik 2025-08-13T09:53:59.521849Z

I'll check.

borkdude 2025-08-13T09:54:18.411029Z

so: clone scittle, checkout branch scittle-dev, run bb prod , use js files from resources/public/js

borkdude 2025-08-13T09:54:33.579299Z

and include <script src="js/scittle.cljs-devtools.js" type="application/javascript"></script>

borkdude 2025-08-13T09:55:16.062989Z

perhaps I could just merge this cljs-devtools thing with the main scittle file since it's for debugging anyway

borkdude 2025-08-13T09:55:23.111749Z

but that's something we can decide later

p-himik 2025-08-13T09:55:42.683649Z

BTW is Scittle "interpret always" or more closer to JIT compilation? I'd assume it's the latter.

borkdude 2025-08-13T09:56:11.909859Z

scittle is based on SCI which is an interpreter. what makes you assume it does JIT?

p-himik 2025-08-13T09:57:58.826559Z

I'm probably misnaming things. So when it sees (defn f [] ...) and later at some point (do (f) (f)), the whole f has already been interpreted and is in the memory, right? So everything is interpreted at most once.

borkdude 2025-08-13T09:58:37.328919Z

yes, for sure. it works pretty much like JVM Clojure. function f is analyzed + evaluated and then is in memory

borkdude 2025-08-13T09:59:24.419659Z

the body of f is still interpreted though. it's not as fast as the compiled version.

borkdude 2025-08-13T09:59:47.579999Z

but there is a separate analysis + eval phase, so most things are done in the analysis phase (when possible)

p-himik 2025-08-13T10:00:44.276939Z

Right, that was my intuition, thanks.

borkdude 2025-08-13T10:01:30.495789Z

I think I could also make a scittle version of https://squint-cljs.github.io/squint/ btw, which would then be fully compiled

borkdude 2025-08-13T10:01:44.063639Z

but then you wouldn't get reagent, etc

borkdude 2025-08-13T10:01:53.166489Z

that would work if I used cherry instead

p-himik 2025-08-13T17:51:47.964799Z

Tried scittle-dev with cljs-devtools. The error is incomparably better! Butt-ugly because of the dark theme in Firefox, but at least it's easy to see the actual info. Unfortunately, as expected, it didn't affect the stack trace itself.

p-himik 2025-08-13T18:03:08.362149Z

As for the reproduction of an incomplete stack trace - the symptom is a bit different but the essential problem is still there with this:

(defn broken []
  [:oh :boy
   :this :function
   (js/is_sure)
   :a :large :one])

(broken)
It results in the error on the pic. As you can see, nothing mentions the line with (js/is_sure). The line 125 is where broken is defined.

p-himik 2025-08-13T18:05:39.554069Z

Aha, for that explicit nice Scittle error report to disappear, all you have to do is call (broken) in a JS event handler:

(defn broken []
  [:oh :boy
   :this :function
   (js/is_sure)
   :a :large :one])

(let [b (js/document.createElement "button")]
  (set! (.-textContent b) "Trigger error")
  (.addEventListener b "click"
                     (fn [_]
                       (broken)))
  (js/document.body.append b))

borkdude 2025-08-13T18:18:10.214489Z

yes, perhaps the scittle error report can be done on uncaught exceptions as well, currently only synchronous errors are caught and logged this way

borkdude 2025-08-13T18:18:32.497009Z

I guess js interop doesn't retain the location in the stacktrace, this can be fixed, let me log a SCI issue

borkdude 2025-08-13T18:19:18.725859Z

logged it here: https://github.com/babashka/sci/issues/986

p-himik 2025-08-13T18:20:20.274089Z

Awesome. Yeah, I can see now that (im-actually-nil) properly shows that location, nice.

Chris McCormick 2025-08-14T00:10:51.805849Z

> merge this cljs-devtools thing with the main scittle file would this increase the size a lot?

p-himik 2025-08-14T00:12:53.896209Z

$ l public/scittle.*
-rw-rw-r-- 1 p-himik p-himik 441K Aug 13 20:49 public/scittle.cljs-devtools.js
-rw-rw-r-- 1 p-himik p-himik 4.6M Aug 13 20:47 public/scittle.js

Chris McCormick 2025-08-14T01:36:17.651389Z

> dark theme in Firefox You can get a dark theme in shadow-cljs like this, not sure how to make that work in scittle:

:compiler-options
                {:external-config
                 ;; these are for legibility when using dark theme devtools
                 ;; any of these can be overwritten:
                 ;;  -> defaults.cljs
                 {:devtools/config
                  {:keyword-style   "color: #909113;"
                   :cljs-land-style "background: rgba(0,0,0,0);color:#eee;
                                    border-radius:2px;"
                   :string-style    "color: #16b4c4;"
                   :symbol-style    "color: rgb(239,194,194);"
                   :body-style      "display:inline-block;padding:3px 12px;
                                    border-top:2px solid rgba(60,90,60,.1);
                                    margin:1px;margin-top:0px;
                                    background:transparent;"
                   }}}

πŸ‘ 1
Chris McCormick 2025-08-14T01:41:32.657339Z

Not sure if it can be set at runtime

Chris McCormick 2025-08-14T01:42:02.591449Z

for me personally i'd prefer dev-tools as a plugin

borkdude 2025-08-14T06:51:21.378479Z

I mean just for the dev version of scittle. You wouldn’t use that for prod anyways

πŸ‘ 1
p-himik 2025-08-12T17:28:49.288109Z

Am I doing something wrong? A very basic thing seems to be broken. Just as a sanity check, I have code like this:

(js/console.log #js {:cv   js/cv
                     :mat  (.-Mat js/cv)
                     :mat2 (unchecked-get js/cv "Mat")})
And here's the result. Mat is not there when in Scittle but is there when in JS.

βœ… 1
p-himik 2025-08-12T17:35:39.711439Z

But it does work if I replace js/cv with my own #js {:Mat 1}. Huh.

p-himik 2025-08-12T17:38:38.180109Z

Aaaand refreshing without cache has fixed it. sigh Bloody web development, always some random bullshit.

2
p-himik 2025-08-12T18:49:01.748449Z

Nah, false alarm - it worked exactly once, for an unknown reason. And I can't make it work again. @borkdude There's no js* in Sci or some alternative, is there?

borkdude 2025-08-12T18:50:29.052029Z

@p-himik can you give more context of what you're trying to do? I may be able to explain some corner case

borkdude 2025-08-12T18:51:08.692129Z

there is no js* but you can use js/eval

borkdude 2025-08-12T18:51:27.273609Z

or at least js/globalThis.eval if that doesn't work

p-himik 2025-08-12T18:52:04.259939Z

I'm just trying to use OpenCV.js. In JS, I had new cv.Mat() which was working all the time. Decided to rewrite in in Scittle, so it became (js/cv.Mat.) which was throwing. Tried debugging - apparently (.-Mat js/cv) is undefined. Well, almost always anyway. Ah, right, eval. Will check.

borkdude 2025-08-12T18:52:34.817539Z

how is cv created

borkdude 2025-08-12T18:52:45.240209Z

gimme the HTML and I'll try it

borkdude 2025-08-12T18:57:09.298909Z

This works for me:

<html>
  <head>
    <script src="" type="application/javascript"></script>
    <script src=""></script>

    <script type="application/x-scittle">
      (js/console.log js/cv)
      (js/console.log js/cv.Mat)
      (js/console.log (js/cv.Mat.))
    </script>
  </head>
  <body>
    <button onclick="my_alert()">
      Click me!
    </button>
  </body>
</html>

borkdude 2025-08-12T18:57:42.614389Z

are you by any chance loading opencv via an ESM thing using an async script tag?

p-himik 2025-08-12T19:33:57.103359Z

I tried using defer initially, but it's supposed to execute scripts in order anyway. But the behavior without defer is still the same. I have this in my <head>:

<script src=""></script>
<script src=""></script>
<script src="/public/main.cljs" type="application/x-scittle"></script>
<script type="application/x-scittle">
    (js/console.log "from tag, immediate" (.-Mat js/cv))
    (js/setTimeout #(js/console.log "from tag, delayed" (.-Mat js/cv)) 1000)
</script>
And this in /public/main.cljs:
(js/console.log "from file, immediate" (.-Mat js/cv))
(js/setTimeout #(js/console.log "from file, delayed" (.-Mat js/cv)) 1000)
The output:
from file, immediate undefined
from tag, immediate undefined
from file, delayed function Mat()
from tag, delayed function Mat()

p-himik 2025-08-12T19:36:16.093319Z

Bah, this is some OpenCV.js crap, I bet. I can now see the same behavior in JS. It was masked before by some other code that became irrelevant in the Scittle version.

borkdude 2025-08-12T19:38:33.966049Z

ah if the same happens in JS, I'm relieved ;)

borkdude 2025-08-12T19:40:58.279789Z

I see the same indeed

borkdude 2025-08-12T19:42:05.666429Z

Module = {
  onRuntimeInitialized() {
    // this is our application:
    console.log(cv.getBuildInformation())
  }
}
// Load 'opencv.js' assigning the value to the global variable 'cv'
cv = require('./opencv.js')

borkdude 2025-08-12T19:42:16.862479Z

This is from the node docs, perhaps browser is same?

borkdude 2025-08-12T19:49:42.333969Z

@p-himik ok, discovered this:

<html>
  <head>
    <script src=""></script>
    <script src=""></script>
    <script type="application/x-scittle">
      (set! (.-onRuntimeInitialized js/cv) (fn [] (prn :dude)))
    </script>

  </head>
  <body>
    <button onclick="my_alert()">
      Click me!
    </button>
  </body>
</html>

borkdude 2025-08-12T19:49:51.650359Z

it has a callback that it calls when it's done loading

p-himik 2025-08-12T21:34:46.620469Z

Oh, thank you! I see now that the docs do mention onRuntimeInitialized, but only at the very bottom of the tutorial, not at the start, where it makes more sense.

p-himik 2025-08-12T21:52:41.700129Z

What would be a proper way to debug things? E.g. I'm getting an error like on the pic below, which is inscrutable. The e.data.toString() gives me a more useful

'{:type :sci/error, :line 107, :column 26, :message "d is not a function", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 107, :column 26, :ns #object[qs main], :file "/public/main.cljs", :sci.impl/f-meta {:name process-frame, :ns #object[qs main], :file "/public/main.cljs", :arglists ([ctx video canvas]), :line 39, :column 1}})}], :file "/public/main.cljs"}' 
But it still doesn't include the full stack trace - it's just two levels deep. Line 107, where process-frame is called, and line 39, where it is defined. But the error is clearly somewhere inside process-frame, and that line number is missing.

borkdude 2025-08-12T21:54:29.891999Z

Perhaps this helps? https://github.com/babashka/scittle/discussions/126

borkdude 2025-08-12T21:55:34.164259Z

if the line number is missing, we can possibly improve that in SCI, repro welcome

borkdude 2025-08-12T21:56:06.627989Z

I usually insert lots of prn / js/console.log to debug stuff in SCI (bb, scittle, etc) scripts if the stacktrace isn't sufficient

p-himik 2025-08-12T22:00:10.410119Z

I'll try that, thanks. In the mean time, onRuntimeInitialized did not work. I had to follow the other suggestion in the tutorial - to check if js/cv is a promise...

borkdude 2025-08-12T22:00:34.682959Z

was it a promise?

p-himik 2025-08-12T22:00:51.703949Z

It's race-y.

borkdude 2025-08-12T22:00:59.502879Z

weird, the callback thing did work for me

p-himik 2025-08-12T22:01:18.244509Z

Might depend on the internet, or on the rest of the code. 🀷

borkdude 2025-08-12T22:02:42.005289Z

What I meant is that I did get :dude printed every single time I refreshed the page with this sample: https://clojurians.slack.com/archives/C034FQN490E/p1755028182333969?thread_ts=1755019729.288109&cid=C034FQN490E but of course I haven't test anything else

borkdude 2025-08-12T22:03:02.028289Z

afk for some sleep now

p-himik 2025-08-12T22:03:41.050159Z

When there's enough code, it seems that the module might get initialized before the set! is called.

borkdude 2025-08-12T22:04:34.590869Z

facepalm

borkdude 2025-08-12T22:05:19.692409Z

maybe it has a function for that to check?

borkdude 2025-08-12T22:05:28.111169Z

or property

borkdude 2025-08-12T22:05:38.930199Z

like the constructor you were going to call

p-himik 2025-08-12T22:07:25.842869Z

Eh. Not too keen on digging deeper, it's all just to fool around. :) The promise check works for now.

borkdude 2025-08-12T22:07:48.786289Z

k

borkdude 2025-08-12T22:08:41.000209Z

one more thought I had: perhaps it works when you create the cv object yourself and attach that callback property. so before the script that loads cv. not sure if can handle that. but anyway.

πŸ‘ 1