This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-07
Channels
- # beginners (7)
- # boot (25)
- # clojure (66)
- # clojure-australia (10)
- # clojure-berlin (1)
- # clojure-czech (1)
- # clojure-denmark (2)
- # clojure-france (27)
- # clojure-italy (6)
- # clojure-japan (1)
- # clojure-nl (5)
- # clojure-norway (1)
- # clojure-russia (25)
- # clojurescript (55)
- # cursive (27)
- # datascript (2)
- # datomic (5)
- # editors (4)
- # emacs (2)
- # hoplon (183)
- # ldnclj (45)
- # off-topic (4)
- # om (2)
- # rdf (5)
- # re-frame (11)
- # reagent (5)
- # ring (3)
@phil_r: (re: my datascript issue) Just updating figwheel didn't work for me. With the help of jaen over in #C07V8N22C I figured out the specific versions of things I needed to get it to work: https://github.com/bmaddy/prochaine/commit/09aa87e8327ada5b7e2d821f6e8b08a12ad1961e Thanks again for taking a look!
@bhauman, maybe vim + ClojureScript + figwheel is such an edge case that there isn’t much demand for a solution?
That, and vimscript isn’t on the top of people’s list of languages to learn.
hmm.. anybody got an idea why this is happening
Marks-MacBook-Pro:opplz underplank$ lein figwheel
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Named
at clojure.core$name.invoke (core.clj:1518)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:626)
clojure.core$update_in.doInvoke (core.clj:5698)
clojure.lang.RestFn.invoke (RestFn.java:445)
figwheel_sidecar.config$apply_to_key.invoke (config.clj:117)
figwheel_sidecar.config$fix_build_options.invoke (config.clj:164)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invoke (core.clj:626)
clojure.core$update_in.doInvoke (core.clj:5698)
clojure.lang.RestFn.invoke (RestFn.java:445)
figwheel_sidecar.config$fix_build.invoke (config.clj:187)
clojure.core$mapv$fn__6311.invoke (core.clj:6353)
clojure.lang.ArrayChunk.reduce (ArrayChunk.java:63)
clojure.core.protocols/fn (protocols.clj:98)
clojure.core.protocols$fn__6057$G__6052__6066.invoke (protocols.clj:19)
clojure.core.protocols$seq_reduce.invoke (protocols.clj:31)
clojure.core.protocols/fn (protocols.clj:60)
clojure.core.protocols$fn__6031$G__6026__6044.invoke (protocols.clj:13)
clojure.core$reduce.invoke (core.clj:6289)
clojure.core$mapv.invoke (core.clj:6353)
figwheel_sidecar.config$fix_builds.invoke (config.clj:190)
figwheel_sidecar.config$prep_builds.invoke (config.clj:273)
leiningen.figwheel$figwheel.doInvoke (figwheel.clj:75)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.Var.invoke (Var.java:379)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invoke (core.clj:626)
leiningen.core.main$partial_task$fn__6071.doInvoke (main.clj:253)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invoke (core.clj:626)
leiningen.core.main$apply_task.invoke (main.clj:303)
leiningen.core.main$resolve_and_apply.invoke (main.clj:309)
leiningen.core.main$_main$fn__6136.invoke (main.clj:377)
leiningen.core.main$_main.doInvoke (main.clj:366)
clojure.lang.RestFn.invoke (RestFn.java:408)
clojure.lang.Var.invoke (Var.java:379)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.Var.applyTo (Var.java:700)
clojure.core$apply.invoke (core.clj:624)
clojure.main$main_opt.invoke (main.clj:315)
clojure.main$main.doInvoke (main.clj:420)
clojure.lang.RestFn.invoke (RestFn.java:436)
clojure.lang.Var.invoke (Var.java:388)
clojure.lang.AFn.applyToHelper (AFn.java:160)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)
@underplank: can you post your figwheel config? It looks like you’ve put a list in place of a symbol
{:id "dev"
:source-paths ["src/cljs" "src/cljc" "env/dev/cljs" "test/cljs"]
:figwheel true
;; {:css-dirs ["resources/public/css"] ;; watch and update CSS
;; :on-jsload "opplz.dev/main"}
:compiler {:main "opplz.dev"
:asset-path "/js/compiled/out"
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:source-map "resources/public/js/compiled/out.js.map"
:optimizations :none
:cache-analysis true
:pretty-print true
:source-map-timestamp true}}
is that what you wanted?
@underplank: the figwheel config looks fine to me. Just a hunch, but it may be a typo somewhere in the project file. I came across a similar-ish ClassCastException when I had a typo in a project.clj and was trying to use lein run
@nikp: thanks. i'll have a look around and see if I can find something like that. although its wierd that its only happening when starting figwheel, not doing a cljsbuild or anything else.
@nikp: thanks for the pointer. worked out it was a quoted namespace that was messing it up, from one of the other build targets.
@underplank: ahhh okay. Glad you worked it out
@bmaddy: yeah i was trying to reduce it to the smallest change to your project.clj that made it work, but i think i forgot a lein clean
somewhere inbetween, sorry
@wildermuthn: I use vim + figwheel for cljs; you can make it work if you use a version of fireplace from https://github.com/tpope/vim-fireplace/pull/222
but to be honest I almost never turn it on, figwheel is great for me on its own (thanks @bhauman!)
I’m wondering if it is possible to set some of my namespace(s) as implicit in my lein project, so I don’t have to require/prefix them in all files
I have just created a new library and I want to use the trick where macros ns and library ns have the same name so the consumer does not have to include macros explicitly. I was unable to make it work. I see that Om uses it, but I wasn’t able to setup my repo to do the same thing. Help would be much appreciated, here is my code: https://github.com/binaryage/cljs-plate
ah, nevermind, it does not work with :require :refer, it works when doing :require :as
I have a js js/Image object, I do not understand how it render in IRender/IRenderState
a.espolov: Render works against the virtual dom. What you have is a real dom element
@a.espolov: or actually, did-update
https://facebook.github.io/react/docs/component-specs.html#updating-componentdidupdate
Ok. I realized where I can insert your js/Image, but I was early I will not understand how to do it? Insert directly into the dom?
@a.espolov: just use jquery or however you would like to do it. You can also use a ref. This is all I can say about, without repeating documentation.
@a.espolov: their doc talks about accessing the dom directly - https://facebook.github.io/react/docs/working-with-the-browser.html. That might give you some ideas.
@a.espolov: this is a good illustration also: http://stackoverflow.com/questions/26556436/react-after-render-code
@darwin, I’ve started using .cljc
files for macros I’m going to use in ClojureScript, you wind up getting the empty .cljs
namespace for free without having an extra file in there.
@timgilbert: thanks, will try
@timgilbert: That's cool. The one thing I also wonder is whether you can do this in bootstrapped ClojureScript as well. I think to be portable there you need .cljs
for the main ns and .cljc
for the macros ns. And to be portable to Clojure, you need to simply put your macros in a differently-named ns.
I managed to implement server side prerendering of my reagent/re-frame single page application, but running JS on the server is quite slow. I’m wondering whether I should white-list the well known browsers and skip it for them, since they don’t really need it.
@darwin any progress with your boilerplate project? I've been trying to get macros to work correctly today, failing after 2 hours and counting
FYI I'm using the chestnut template, which starts with a src/{cljs,clj}/projectname structure
so far, it seems like macros aren't getting pulled regardless of whether I put the file in cljs nor clj, and regardless of the file extension
@whacked It works for me, I just have to reference the macros using :require :as, not :require :refer
maybe you didn’t set proper paths into lein’s project.clj? both :source-paths and :cljsbuild :builds … :source-paths are important
top-level source-paths is for macros (via clojure), cljsbuild paths are for clojurescript files
usually you want to set all source-paths to the same thing, see om: https://github.com/omcljs/om/blob/master/project.clj
is datascript known to be slow from JavaScript, I get very long read times even for a few hundreds datoms
like 10s
@darwin ugh I got it. It appears that macros must be syntax-quote
ed. My toy examples all looked like (defmacro [x] x)
and those were failing
is there an agreed upon form of saying "clojure and clojurescript"? Clojure/Script?
@martinklepsch: Clojure(Script) is the one I've seen the most
cl/js ?