Fork me on GitHub
#clojurescript
<
2017-03-15
>
qqq02:03:20

What is the state of the art of cljs evaluating cljs ? The particular use case as I'm hacking on a mini-emacs except it's HTML/DOM/CLJS instead of GTK/Elisp based. I'm a big fan of Emacs' C-h f, C-h v, C-x X-e. Thus I'm curious: what is evaluating cljs in cljs like ?

mfikes02:03:43

@qqq There is a namespace cljs.js in ClojureScript that you can use to evaluate ClojureScript forms.

richiardiandrea04:03:39

@qqq shameless plug, replumb is a wrapper over cljs.js that provides common functionalities for repls

joshkh10:03:31

are there any online cljs compilers that support clojars? i'm interested in giving an interactive demo to a group requiring reagent and a cljs library that i wrote.

gklijs10:03:13

Not sure if this, http://thegeez.net/2017/02/03/crepl_collaborative_editor.html fits your purpose? It does support gists.

joshkh10:03:54

hmm, it doesn't appear to support dependencies. but thanks anyway 🙂

joshkh11:03:05

aye, that gets me one step closer but it looks like reagent is baked in. i'd also like to require https://clojars.org/intermine/imcljs

dnolen12:03:58

@miikka that’s not an official release

dnolen12:03:43

occasionally for various reasons some quick fix thing gets cut

devth14:03:49

why does random-uuid exist in in ClojureScript but not Clojure?

hlolli14:03:04

I believe it exists as java interop in Clojure. (but yes that function is missing with that symbol)

souenzzo14:03:28

user=> (def random-uuid java.util.UUID/randomUUID)
CompilerException java.lang.RuntimeException: Unable to find static field: randomUUID in class java.util.UUID, compiling:(NO_SOURCE_PATH:16:1) 
user=> (def random-uuid #(java.util.UUID/randomUUID))
#'user/random-uuid
I did not understand this behavior

nwjsmith14:03:57

java.util.UUID/randomUUID is looking for a public static UUID randomUUID; field on the UUID class.

souenzzo16:03:27

So, java is a lisp-2? 😝

nwjsmith14:03:28

(java.util.UUID/randomUUID) is looking for a public static UUID randomUUID() method on the UUID class

not-raspberry15:03:03

Assigning java static methods, passing them as values like you would pass clojure functions, is impossible.

not-raspberry15:03:46

this should be a good enough clone, you can obtain a string

negaduck16:03:46

hello. How to make the css-transition-group work? I’m trying this:

[css-transition-group {:transition-name "example"}
      (if @(<re-frame.core/subscribe [:key-in-db "whatever"])
        ^{:key "whatever"} [:p "text"])]
It complains: TypeError: Cannot read property 'findDOMNode' of null

negaduck17:03:18

error occurs here:

transition: function (animationType, finishCallback, userSpecifiedDelay) {
    var node = ReactAddonsDOMDependencies.getReactDOM().findDOMNode(this);
    ...

qqq17:03:40

are there cljs functions for "here is a string; read the first cljs-string out of it" "read the first cljs-symbol out of it" "read the first cljs-number out of it"

darwin17:03:17

yes, it is called “reader"

qqq17:03:32

read-string reads a sexp

nfisher22:03:40

Hello hopefully a quick one… what’re people using to test CLJS? Rhino, Node, Phantom? Mix? Particularly interested in testing re-frame looked at this not a lot of reference to what works and doesn't: https://github.com/Day8/re-frame/wiki/Testing

richiardiandrea23:03:50

@nfisher lein-doo is probably the best option for testing at the moment because you can mix and match: https://github.com/bensu/doo