This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-13
Channels
- # 100-days-of-code (2)
- # announcements (1)
- # beginners (41)
- # boot (1)
- # calva (3)
- # cider (25)
- # cljdoc (20)
- # cljs-dev (24)
- # clojure (16)
- # clojure-conj (1)
- # clojure-dev (9)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-uk (8)
- # clojurescript (25)
- # community-development (14)
- # cursive (4)
- # datascript (2)
- # datomic (20)
- # duct (16)
- # emacs (12)
- # fulcro (168)
- # graphql (1)
- # keechma (3)
- # leiningen (1)
- # luminus (5)
- # off-topic (13)
- # re-frame (8)
- # reagent (3)
- # rum (1)
- # shadow-cljs (24)
- # spacemacs (32)
- # unrepl (2)
- # vim (2)
@pat The WebAssembly JS API externs are in the contrib part of the GCC tree at https://github.com/google/closure-compiler/blob/master/contrib/externs/webassembly.js So you can manually grab and use these
wget
clj -m cljs.main -co '{:externs ["webassembly.js"]}' -O advanced -c wasm.core
I don't see the contrib externs being shipped in any JAR. If they are then you could depend on such a JAR and then use :externs
to specify the path to the file on the classpath.Alternatively, instead of string disptach, you could use externs inference, as in
clj -m cljs.main -co '{:infer-externs true}' -O advanced -c wasm.core
You do automatically get some externs by default. (See https://github.com/google/closure-compiler/blob/50713dceb16b369f8f317e5b49e8a9dec2b47496/src/com/google/javascript/jscomp/DefaultExterns.java#L40-L58) But it is not clear to me how you are supposed to depend on externs in the contrib directory (as they don't appear to ship in any JAR as far as I can tell).
Anyone else happen to run into a blocked thread when you dis/re-connect a browser repl in the same JVM?
I have a suspicion that there’s a race condition around acquiring a connection from the connq. I looked around JIRA and nothing jumped out at me.
My theory is, ordinarily:
1) you exit a cljs repl (via :cljs/quit
)
2) connq
still holds a ref to the now defunct conn
3) you start a new repl, which goes through setup
4) the browser makes its :ready
request which calls (.clear connq)
5) repl initialization invokes (evaluate renv "cljs_deps.js" 1 (slurp depsf))
However, if 4 happens after 5, you’ll be given the defunct conn that is still in connq
, causing you to hang indefinitely.
Anyway, the question here is: is there a reason we shouldn’t clear the connq
on tear-down
?
@potetm I tried and may have immediately repro'd what you are describing. (My relevant stack is at https://gist.github.com/mfikes/0e52f0243c3517936ff6dbd24ad40c26)
To be honest, I've never tested this sequence, especially given that I overly focused on use cases using cljs.main
.
I threw this into https://dev.clojure.org/jira/browse/CLJS-2932
Ahh. Right. Back around 2004 as a (bad multithreaded) Java dev, I learned the mantra "if it's stuck, provide the stack"