This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-06
Channels
- # announcements (12)
- # babashka (34)
- # beginners (85)
- # calva (76)
- # cider (14)
- # clj-kondo (49)
- # cljs-dev (32)
- # clojure (418)
- # clojure-europe (3)
- # clojure-france (4)
- # clojure-italy (17)
- # clojure-losangeles (8)
- # clojure-nl (5)
- # clojure-norway (2)
- # clojure-spec (2)
- # clojure-uk (88)
- # clojuredesign-podcast (4)
- # clojurescript (49)
- # clojurex (75)
- # clr (2)
- # core-async (13)
- # cursive (6)
- # datomic (57)
- # duct (31)
- # emacs (6)
- # fulcro (25)
- # graalvm (67)
- # graphql (13)
- # hoplon (1)
- # java (6)
- # juxt (11)
- # kaocha (5)
- # keechma (2)
- # leiningen (16)
- # mount (1)
- # off-topic (19)
- # pathom (2)
- # pedestal (1)
- # re-frame (11)
- # reagent (21)
- # reitit (22)
- # rewrite-clj (1)
- # shadow-cljs (98)
- # spacemacs (5)
- # sql (16)
- # tools-deps (8)
- # vim (28)
- # xtdb (4)
any reason this commands doesn't return a repl? clj -m cljs.main -H '0.0.0.0' -p 8080 -ro '{:launch-browser false}' -c hello-world.core -r
the browser connects fine and displays https://clojurescript.org/images/content/guides/quick-start/browser.png
@lockdown- you can't use -c
together with -r
oh hrm, I guess you can, I keep forgetting we tweaked that to work together - do you see any errors in the browser JS console?
@dnolen in the console I get an error connection refused for http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22FSbb3twDOo%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2F3.19.55.194%3A8080%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D
The issue is localhost
is hardcoded here https://github.com/clojure/clojurescript/blob/master/src/main/cljs/clojure/browser/repl.cljs#L31
Can anyone point me at a compare function that can be used to to sort mixed types?
I am looking to compare strings, numbers, booleans and keywords.
Something along the lines of (defn safe-compare [x y]
(if (or (identical? (type x) (type y)) (and (number? x) (number? y)))
(compare x y)
(let [type-preced #(cond
(number? %) 0
(string? %) 1
(boolean? %) 2
(keyword? %) 3
:else 4)]
(< (type-preced x) (type-preced y)))))
@lockdown- You should be able to override that by adding -co '{clojure.browser.repl/HOST "my-host"}'
to your command line
Hello guys, I try to make react-beautiful-dnd
work with shadow-cljs
but it doesn’t seem to work. I imported react-flatpickr
that worked fine.
Okay, I found my solution, for anyone wandering around like myself, here is the solution: https://github.com/atlassian/react-beautiful-dnd/issues/427#issuecomment-420563943
@lockdown- @mfikes and I believe that's actually done
I'm working with a wiredo JS object that (map f (js/Array.from x))
works but (map f (seq x))
dont
I just wanna know if there is a idiomatic wrap like enumerator-seq
or something like
You could also implement ISeqable so you're able to just (map f x)
(extend-type js/NodeList
ISeqable
(-seq [array] (array-seq array 0)))
Just replace js/NodeList
with whatever weirdo JS type you're dealing with@mfikes @dnolen just tried that, the browser still tries to request the file from localhost
@lockdown- try removing your output directory and try again
Hi all, I’m trying to pretty print a piece of EDN but for some reason the CLJS compiler is saying pprint doesn’t exist:
(with-out-str (cljs.pprint/pprint {:foo 1}))
cljs.user=> (require '[cljs.pprint :as pprint])
nil
cljs.user=> cljs.pprint/pprint
#object[Function]
welll... it's way more complicated than that. but that's the way to think about clojure namespaces at least
@lockdown- it's possible it's just a bug - the standard browser REPL is mostly used for testing, not quite enough there yet for serious development
whatever it is that you want to do you can definitely do with something like Figwheel which is much more mature due to the number of users
@dnolen oh, I see, looks like the browser repl in cljs is a complex subject (compared to clojure). Using just --watch (and my own web server) and refreshing the browser has been enough for playing with cljs for now, will look into figwheel next.
nm, will take a look at http://cljs.github.io/api/cljs.build.api/watch