This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-21
Channels
- # aatree (5)
- # admin-announcements (3)
- # beginners (13)
- # boot (25)
- # cider (4)
- # cljs-dev (2)
- # clojure (107)
- # clojure-austria (2)
- # clojure-japan (12)
- # clojure-russia (128)
- # clojurebridge (2)
- # clojurecup (32)
- # clojurescript (68)
- # css (4)
- # cursive (3)
- # datascript (4)
- # datomic (8)
- # devcards (25)
- # hoplon (19)
- # immutant (2)
- # ldnclj (4)
- # liberator (2)
- # luminus (5)
- # off-topic (184)
- # om (78)
- # onyx (2)
- # portland-or (11)
- # re-frame (27)
- # reagent (11)
- # yada (3)
@pat Using master as a quick test might be good. Are you using bootstrap or regular JVM-based ClojureScript?
@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.
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 (https://github.com/swannodette/cljs-bootstrap) 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
(js/eval
(with-out-str
(c/emit
(ensure
(ana/analyze-fn-method
(assoc (ana/empty-env) :context :expr)
[]
'([] 1)
nil)))))
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: cljs.core.defmacro.call
errors
Iāll have a look for a blog post then
@clumsyjedi: https://github.com/swannodette/swannodette.github.com/blob/master/code/blog/src/blog/cljs_next/core.cljs
@pat ahh. Ok. Perhaps it isn't available in ClojureScript. Makes sense given lack of I/O.
wow, new version of Reagent: http://reagent-project.github.io/news/news060-alpha.html
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
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
@spacepluk: ok, glad to hear itās not a deeper issue
@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
Wow, this is a pretty awesome use case of clojurescript: https://www.cljs4excel.com/examples/k-means/k-means.gif
This works in pre-el capitan Safari:
var r = new XMLHttpRequest(); r.open("GET","
It throws a DOM exception in Safari on El Capitan 10.11.1 and 10.11.2
Seems itās also a āfeatureā with iOS 9: https://forum.ionicframework.com/t/solved-ios9-fails-with-setrequestheader-native-with-custom-headers-in-http-service/32399
@juhoteperi: when you have a second https://github.com/cljsjs/packages/pull/337
@denik: Merged & deployed
@juhoteperi: š thanks!!
Can anyone point me towards a guide for taking a React component from npm, and including it in a cljs project?
@glenjamin: there is lein-npm
for pulling in npm dependencies: https://crossclj.info/doc/lein-npm/latest/index.html
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
I tried adding a foreign-libs section to my build and figwheel started NPEing, so left it for now
For reference, it's https://github.com/jhudson8/react-chartjs 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
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.