Fork me on GitHub

Is there an equivalent of cljs-devtools for Firefox? (and more general, how does Firefox compare to Chrome for tooling?)


given some symbol, how do resolve it as a var and get its value?


@levitanong There is a newly-introduced resolve macro that may do what you need. For example @(resolve 'foo.core/a)


I suspect it may be constrained to compile-time constructs.


(In other words, the symbol needs to be available at compile time.)


i see, thanks!


@mfikes oh, here’s a snag. I’m working in cljs.analyzer, and resolve is in cljs.analyzer.api


OTOH, in self-hosted ClojureScript, you can do things at runtime:

(def sym 'foo.core/a)
@(planck.core/resolve sym)


oh oops, i was looking at the wrong docs


@levitanong Well, there is cljs.core/resolve


@mfikes here’s a snag. the argument to cljs.core/resolve must be a quoted symbol.



(defrecord Foo [bar])

(def a 'Foo)

(resolve a)
;; Assert failed: Argument to resolve must be a quoted symbol


Right, in JVM ClojureScript, resolve is essentially a compile-time construct.


Are you making a cross domain request?


You may have to setup something on the erver


yes, I’m see http response status and data is ok, but error log in browser console.


at least Access-Control-Allow-Origin and Access-Control-Allow-Headers for each additional header are required.


(on the server)


Yeah, it’s work. Thank u very much.


hi, i remember a project that allowed to use clojurescript in a html file in a script tag with a type=“text/clojurescript” so you would be using cljs directly, all you needed to make it work was include a js file before, but i don’t remember the name of the project, google it but no luck, couldn’t find it again. do anyone remember this project and can point me in the right direction?


no, that wasn’t this one is allows to use cljs inside a script tag as if it were javascript


Sorry, no idea then. It sounds interesting though!


Hi everyone, I am trying to figure out the best practice for handling logins in 2017. Any helpful pointers or strong / passionate opinions ?

Ryan Radomski22:12:51

I've been reading blog posts about Reagent vs Om and from what I've read, people generally tend to say it doesn't matter too (I use very loosely) much which you opt for. Are their use cases for one or the other or are they really that similar? Are there some sort of common exemplars that they both leverage that makes them so interchangeable in people's eyes or are their clear cut strengths of one or the other?


@radomski the three players in the clojurescript world right now with realtime websites are Reagent, Rum, and ... maybe a few others depending on what tools you want to use. Those three are all nice wrappers ovver React elements and the underlying web comms / events will be the same in every one of them. is very opinionated about data organization and components follow an idiomatic layout. it's more like learning how to imitate style to get the components you want out of it. rum and reagent are very similar, rum is made by the same person who maintains datascript, which is like a clientside database -- this is especially nice because when the serverside database changes you can just push transaction deltas to the users and update their clientside database, instead of sending huge chunks of data just send database deltas ...

Ryan Radomski23:12:18

I have been faithfully using since I started doing clojurescript frontends a little while ago and I absolutely love the reconciler. That seems to be the biggest difference to me, but I'm a noob to all 3 major options. Other than easier datascript usage, are there other important differences? I too would also accept passionate opinions.


The Reconciler is great. In Rum you mark certain atoms as Watched/Observed for changes and that will update components that reference that atom val.. aside from those points, the one big thing is HTML/hiccup interplay, in rum one defines the components using hiccup html syntax [:div#main_cointain [:p "hey sup" ] [:p "articles yo"] (rum-component-doug) ] and so you can invoke rum components as functions that spit out hiccup-html .


another topic is serverside rendering, which is fairly essential for SEO and having the appearance of persistent pages, and SSR has been solved in Rum, (in the Fulcro [was "untangled"] library) and presumably reagent. I could never quite get SSR to work in but maybe strides have been made since then


@radomski I think you can be very productive with any of those options. I can’t really offer an impartial opinion. But I will say that you can cross-pollinate ideas into whatever library you chose. I’ve built inspired reagent apps for example.

Ryan Radomski23:12:53

@dnolen That's the precise reason I asked! I had a strong suspicion going in that the ideas from one library weren't mutually exclusive to the next. @sova That's a lot more helpful than the posts I read. I needed something more concrete to start searching for benefits of one over the other. It looks like all of them do a really good job on the simplicity aspect so I'm confident any choice wouldn't paint me into a corner.


any ideas?


what does (first ) return?


some emoji are a double unicode smash iirc


what does (pr-str (second "💩")) print?


noob question; searching is failing me. I'm getting back into clojure after some time away, and playing with ClojureScript & figwheel. I'd like to be able to do lein figwheel and have that start my compojure backend as well as figwheel... Is that possible, or will I have to do lein ring server and lein figwheel separately? I'm using :ring-handler in my project clj and see that it's starting ring successfully but doesn't appear to do anything when I visit http://localhost:3449. a gist of my project.clj is here if it's useful: (my project is laid out as src/clj, src/cljs, and src/cljc if the namespaces look weird)


the last time I messed around with clojure on the web was with noir... so things have changed a bit since the last time I built a website 🙂


@nooga I don’t see that


I see an unprintable character


(.-length "💩") ;; 2 is why though


same “issue” on Clojure JVM