Fork me on GitHub

@mfikes I am not, but do I need to be? to use js-interop would make sense


@pat Using master as a quick test might be good. Are you using bootstrap or regular JVM-based ClojureScript?


regular JVM, figwheel into a node repl


@pat In that case, your macros file will be compiled as Clojure (the :clj branch of reader conditionals will be used). Also, master is unlikely to matter in that case, as the JVM-based macro system is mature.


The macro code itself is called, if you put a log statement in there it reads out


so i figure it just doesn't like js/error. I will try bootstrapping, sounds like a good enough excuse 😉


I am trying to compile some clojurescript inside a nodejs process. I have followed the tutorial ( for cljs-bootstrap and I believe my setup is good, the analyze-keyword example from the wiki works. But what I really want to do is eval functions. I can’t quite figure out the magic incantation to make that happen - any pointers? Right now I am trying

          (assoc (ana/empty-env) :context :expr)
          '([] 1)
Which results in throw (new Error([cljs.core.str("No method in multimethod '"),cljs.core.str(na


@pat Well the bit that throws in with-open is at compile time. You can probably use clojure.core/with-open. Your macro appears to be prepared for use in bootstrapped environments, though :)


@clumsyjedi: i think that was pre-1.7, may want to see his blog post on this


@clumsyjedi: recommend using the shipping cljs.js namespace


ok thanks. I had been playing around using eval-str from cljs.js but kept getting undefined method: errors


I’ll have a look for a blog post then


that’s great - thanks @pat and @mfikes


See the examples in the comment at the bottom of cljs.js


@mfikes: cljs/core excludes with-open, do you suggest aliasing it in my macros file?


@pat ahh. Ok. Perhaps it isn't available in ClojureScript. Makes sense given lack of I/O.


@mfikes: I'm working on that!


ahh thats javascript core right


@pat: yes. My experience with Node is limited to using Replum (Elbow repo)


Node has the easiest AWS sdk, clojurescript is great with it but serialization is a pain


Oh, cool


Any predicates for checking if something is metadatable in clojurescript? (satisfies? cljs.core.IMeta [1 2 3]) (implements? cljs.core.IMeta [1 2 3] have come back false thus far.


Hi, I'm trying to write a test for a simple reagent component, with a textbox: (defn choose-city-component [] (let [inner-state (r/atom {:text ""})] (fn [] [:div [:input#txt_city { :type "text" :value (@inner-state :text) :on-change #(swap! inner-state assoc :text (-> % .-target .-value)) ... (deftest choose-city-component-test-out ;;GIVEN render component in test (let [comp (r/render-component [w/choose-city-component] (. js/document (getElementById "test")))] ;;WHEN changing the city (let [$txt_city ($ :#txt_city)] (val $txt_city "london") (trigger $txt_city :change ) basically rendering the component in a div, then usign jquery (jayq) tring to simulate an on-change on the text box. Can anyonw come with a better idea? Thank you


(satisfies? IMeta [1 2 3]) works. Okay. Well. Back to work.


does Clojurescript use ^IPersistentMap type hints in functions?


@dnolen about the sourcemap problem yesterday, I'm stupid and I forgot to set the stackTraceLimit so I was missing the important part for some of the errors facepalm


@spacepluk: ok, glad to hear it’s not a deeper issue simple_smile


@anmonteiro: there’s very little reason to use type hinting in CLJS - the only one that really matters is ^boolean


@anmonteiro: there are a couple of other things but they are a bit subtle to explain and are less likely to contribute to perf gains


@dnolen yeah me too hehe


Wow, this is a pretty awesome use case of clojurescript:


Oh, the joy of browsers.


This works in pre-el capitan Safari: var r = new XMLHttpRequest();"GET",""); r.setRequestHeader("foo","bar “); It throws a DOM exception in Safari on El Capitan 10.11.1 and 10.11.2


Any thoughts on whether it’s a bug or a feature?


(The reason for the exception is the trailing space in ”bar “


Works in all other browsers that I’ve tested


@denik: Merged & deployed


Can anyone point me towards a guide for taking a React component from npm, and including it in a cljs project?


or how to take a UMD file, and use it - that would do for now?


ah, looks like i’d have to create cljsjs packages to make it work effectively


@glenjamin: there is lein-npm for pulling in npm dependencies:


I can’t speak to the ease of pulling in UMD modules.. the JS ecosystem is a complete cluster there to begin with


I forgot to say, this is for browser JS. These days with webpack I can pull in components really easily - but cljsjs seems to be the closest equivalent


cljsjs also adds some hints for the closure compiler’s optimizer


Yeah, I think I could create my own jars that depend on cljsjs bits


I tried adding a foreign-libs section to my build and figwheel started NPEing, so left it for now


For reference, it's I was wanting to try out


Hey all, I’m pretty new to the clojure world as a whole but was impressed enough by what I read of datomic and what I saw of om that I wanted to move over this way for a long-term project I’m starting. I’m running into quite a bit of trouble though figuring out how I can deploy (in the simplest way) a single page clojurescript app which persists data with datomic. I’ve spent about 5 weeks of full time work learning clojure, clojurescript, om-next, compojure/ring, and datomic itself, and have gotten some basic things working on my local machine — even have been able to use docker to deploy some non-persisting learning exercises or simple sql dbs via uberjars, but I’m feeling a little stuck right now, since the only example I’ve seen that tie together datomic and om-next is @dnolen's todo mvc, which both uses @stuartsierra’s component system and some dependencies that don’t appear to be available from clojars. I haven’t found any books — or detailed walkthroughs that tie these things together, and don’t personally know anyone I can ask for help. I’ve gotten to the point that I have a datomic free transactor running on docker, and have a hostname for that I can connect to, but when I set my production hostname to match that, I get an error that the connection has timed out when I’m trying to compile the uberjar. I was trying to escape this through a try catch block, but no luck yet. Does anyone have an example of the minimum Clojurescript/Datomic deployable example — or even just a list of the things I need to be able to do to have a different uri for production/deployment. I’m sure this is a noob question, but I’ve got a lot of gaps in my knowledge and trying to fill them in gradually while still being able to put something basic on the web.


@firinne: that’s just too many questions none of which everyone will know all of the answers to


for Datomic stuff ask in #C03RZMDSH


for Om stuff ask in #C06DT2YSY


the general ClojureScript deployment questions can be directed here


ok, maybe the better question is. Has anyone written down a list of all the things a person needs to learn to get hello-world on the web with datomic and clojurescript


I doubt it. I don’t believe there are many people interacting with datomic directly from cljs


it is like asking if you can query postgres directly from ember/angular/react/backbone etc


I haven’t used datomic, but if I were to use it, I imagine I would go about doing the same thing I do with any other database.


@roberto: yeah, that’s why I tried to learn compojure/ring as well


provide an API to the front end


@firinne: I know people are playing around with Datomic integrations in the #C06DT2YSY channel so you might want to ask a more narrow question there as well


@dnolen gotcha, thanks