Fork me on GitHub
#clojurescript
<
2020-10-27
>
Karol Wójcik08:10:29

How can I add data_readers to codox?

uosl11:10:40

(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.

dnolen13:10:38

ClojureScript cannot infer that

dnolen13:10:05

you can type hint top to make it go away

🎉 3
dnolen13:10:56

(number? ...) should propagate it but there's still issues here

Flo13:10:00

QQ: Does clojurescript not have future?

Flo13:10:11

thanks! curious, is there a technical reason for this?

victorb13:10:06

There is js/Promise in JS world

andy.fingerhut13:10:58

@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.

Flo13:10:36

@U0CMVHBL2 That's true, I thought there might be a js-native solution to mimic future's behaviour on cljs

andy.fingerhut13:10:08

Without multiple threads, the best I can imagine is just calling a function and blocking until you get the return value back.

victorb13:10:08

might make sense to have a future-in-webworker function that can execute the form in a web worker or similar

victorb13:10:18

(for browser contexts at least)

andy.fingerhut13:10:43

yes, technically webworkers do allow multiple execution threads, but without shared memory between them the way Clojure/Java has.

3
dnolen13:10:13

the problem with doing anything with future is the deref is blocking

dnolen13:10:35

in Clojure - you cannot replicate that in JavaScript - which destroys any portability benefits

kah0ona14:10:40

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?

pesterhazy14:10:33

@kah0ona look for the "pseudo-names" compiler option

gomosdg20:10:16

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.

darwin20:10:53

Open one of those .map urls in a separate browser window and look in devtools how does the response look like

darwin20:10:13

from the error it looks like your server is not serving a JSON file, but HTML instead

darwin20:10:25

probably with some error page

gomosdg20:10:29

Hi @U08E3BBST, the files seem to be empty.

darwin20:10:02

look at the source of the files, the warning clearly reports that they start with “<”

gomosdg20:10:42

Oooh... I see what's up. The server is always serving the index.html page.

gomosdg21:10:42

I think I still need to get my head around :asset-path vs :output-dir vs :http-root

gomosdg21:10:51

Corrected my :asset-path config and it works. Thanks, @U08E3BBST!

👍 3