Fork me on GitHub
#clojurescript
<
2019-07-09
>
oconn12:07:46

I’m working through an issue I’m seeing with simple/advanced compilation and clj->js. I’ve created a minimal reproducible example here https://github.com/oconn/cljs-sandbox - It seems that $keyword-fn$$ is undefined when parsing keywords in a cljs map.

oconn12:07:24

So looks like it’s because I left :pseudo-names enabled when I switched to simple optimizations.

dnolen13:07:55

that's a bit strange but probably nothing we can do about that

ghadi13:07:16

thanks for your help yesterday @dnolen -- fatter resources helped source-maps vs not source maps was still about a 2x increase on from scratch builds Also lein's default JVM parameters were interfering (shakes fist)

ghadi13:07:03

(`lein` forces single tier compilation in a misguided attempt to help startup time, at the expense of throughput)

dnolen14:07:10

and yes 2x sounds more reasonable

john15:07:54

JS is getting weak references where you can give a callback that fires when a specific object is GC'd https://v8.dev/features/weak-references

👀 4
john15:07:53

Should help with coordinating objects/memory between js isolates and other runtimes running in wasm

akjetma18:07:36

hey, i'm working on a cljs project with a custom google closure lib (ie, my own js code, specified by the :libs option), wondering if there's a way to tell figwheel to watch the closure lib's source directory and hotload when i make changes to it

oskarkv19:07:46

I find debugging ClojureScript to be a lot harder than debugging Clojure. What do I do, for example, with an error message like this? http://ix.io/1O9i Any tips?

dnolen19:07:41

just look in the browser

dnolen19:07:48

you should have source maps and better stack traces

oskarkv20:07:32

For some reason the file I'm currently working in I can't see in the browser. Clicking it in the stacktrace takes me to an empty file.

oskarkv20:07:09

And even though the stacktrace is a little bit nicer it still does not say exactly on which line the error occurred, or it's off, because the line it points to is (when-not (zero? i) which is not wrong.

at trainers.cljs:90
    at game$trainers$simulate_trainers (trainers.cljs:101)
90 is (when-not ... and 101 does not exist, or it's just a comment at the end of the file. 😕

oskarkv20:07:30

Oh well, refreshing the browser helped with that

oskarkv20:07:45

Still no source code in browser though

nenadalm05:07:06

I found that sometimes I cannot see code in Chrome, but I can in Firefox when I click through stack traces.

lilactown20:07:32

I've never seen stack traces show pre-compiled actual code, but can map line numbers if source-maps are available

oskarkv20:07:48

If I click on the reference in the stack trace, it is supposed to take me to the file (cljs), but it doesn't work for this particular file. I can see ClojureScript core sources and some other files of my project. 😛

oskarkv20:07:56

Oh, the reference in the stacktrace is wrong, for some reason, it's file:cljs-out/game/target/public/cljs-out/game/game, but if I go to file:cljs-out/game/game I can see the file... maybe misconfigured something 😛