How can I add data_readers to codox?
(let [top (some-> (gdom/getElement id)
(ocall :getBoundingClientRect)
(oget :top))]
(if (and (number? top) (pos? top))
Isn't this valid code? Figwheel is giving me a warning pointing at pos? cljs.core/>, all arguments must be numbers, got [#{nil clj-nil} number] instead
.ClojureScript cannot infer that
you can type hint top
to make it go away
(number? ...)
should propagate it but there's still issues here
QQ: Does clojurescript not have future
?
@web20 no
thanks! curious, is there a technical reason for this?
There is js/Promise
in JS world
@web20 I am not a ClojureScript expert, but at least in Clojure/Java future
creates a separate thread. JavaScript runtimes have only one thread, and cannot create others.
@andy.fingerhut That's true, I thought there might be a js-native solution to mimic future
's behaviour on cljs
Without multiple threads, the best I can imagine is just calling a function and blocking until you get the return value back.
might make sense to have a future-in-webworker
function that can execute the form in a web worker or similar
(for browser contexts at least)
yes, technically webworkers do allow multiple execution threads, but without shared memory between them the way Clojure/Java has.
the problem with doing anything with future
is the deref is blocking
in Clojure - you cannot replicate that in JavaScript - which destroys any portability benefits
When I miss an extern, somehow, I get ie. Uncaught TypeError: http://ZR.Lc is undefined How can I debug what is missing? Is that even possible from the compressed output?
@kah0ona look for the "pseudo-names" compiler option
thanks @pesterhazy
Hi everyone, For some reason I am getting these warnings when source-maps are enabled. I am using shadow-cljs. I may have configured it funny. Please help.
Open one of those .map urls in a separate browser window and look in devtools how does the response look like
from the error it looks like your server is not serving a JSON file, but HTML instead
probably with some error page
Hi @darwin, the files seem to be empty.
look at the source of the files, the warning clearly reports that they start with โ<โ
Oooh... I see what's up. The server is always serving the index.html page.
I think I still need to get my head around :asset-path
vs :output-dir
vs :http-root
Corrected my :asset-path
config and it works. Thanks, @darwin!