This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-10
Channels
- # aws (45)
- # bangalore-clj (16)
- # beginners (109)
- # boot (137)
- # cider (7)
- # cljs-dev (54)
- # cljsrn (22)
- # clojure (77)
- # clojure-conj (1)
- # clojure-greece (2)
- # clojure-nl (5)
- # clojure-russia (36)
- # clojure-spec (15)
- # clojure-uk (54)
- # clojurescript (118)
- # cursive (7)
- # datomic (25)
- # emacs (33)
- # hoplon (276)
- # klipse (38)
- # lein-figwheel (1)
- # leiningen (9)
- # melbourne (1)
- # off-topic (18)
- # om (98)
- # onyx (6)
- # pedestal (1)
- # perun (24)
- # re-frame (46)
- # reagent (6)
- # ring-swagger (3)
- # spacemacs (67)
- # specter (15)
- # untangled (33)
- # vim (6)
i have a clojure library that I want to call from a clojurescript (figwheel) front end
i have toyed with standard figwheel template projects, and added the clojurescript and figwheel entries to the project.clj
and copied the standard resource files and core.cljs from a bare fighweel template over to the existing project.
but i'm getting ` Failed to compile "resources/public/js/compiled/pairwise.js" in 16.328 seconds. ---- Could not Analyze ---- /core.cljs is not a relative path`
That should be: >>Failed to compile "resources/public/js/compiled/pairwise.js" in 16.328 seconds. ---- Could not Analyze ---- /core.cljs is not a relative path
@dbsgtk: could you post your project.clj? If not, you could try starting again with the figwheel template and see if you can get it working from there.
You've got a part .core/on-js-reload
that I think should be something like pairwise.core/on-js-load
Thank you! I must have missed it when I was editing those sections of the file after copying from the figwheel starter project. 😕
Anyone using spacemacs and successfully connecting to a cljs nrepl? I start-figwheel! (scripted) and I see the output Figwheel: Starting nREPL server on port: 7888. When I try to connect to 7888 from spacemacs with cider-connect, it doesn't suggest the port and when I manually enter 7888 it connects to a clj repl (not cljs).
I have piggieback and the middleware in my project dependencies
@danielstockton: I remember the wiki said if you want to connect nrepl manually ,set :nrepl-port __ in :figwheel. And It is easy to start cljsrepl use (cljs-repl)
I followed this guide, am using cljs-repl in a script... The repl itself is fine, I just can't connect to it from spacemacs
(js/alert "test")
works at the repl and causes an alert in my browser at localhost:3449, i just want to be able to do the same within the editor
I'm wondering if its a CIDER/spacemacs issue
Maybe you should require your :main key 's value in you repl, I haven't use my laptop now, sorry I can't test whether I said is true:hear_no_evil:
I start the repl with rlwrap lein run -m clojure.main script/figwheel.clj
and pass the cljsbuild options to start-figwheel!
in this script
Try to start repl with cider-jack-in, I didn't try to start the repl according your command....
Trouble is, I want it to all be hooked up with figwheel. clojurescript-jack-in
will start a separate headless repl
I know what you mean, I think you can start with lein figwheel
in your shell and set :nrepl-port
, then use cider-connect-repl
to connect you repl
this is my spacemacs process and I use cider-jack-in
, the top is for cider and refacetor middleware, and next is the figwheel server
there are so many ways of doing things, you really have to understand how each part works
I don't have a deep study about *repl start*, so sorry I can't help you more with more info:grimacing:
every guide i read does things slightly differently
@danielstockton Let me suggest you one more way: https://gist.github.com/rauhs/2a02e5e04b5bd4e4b4b5
for conceptual overview, you could try to look here: https://github.com/binaryage/dirac/blob/master/docs/about-repls.md it is not cider/spacemacs specific, but I had to understand whole picture to make Dirac REPL + Figwheel work (the last schema)
Thanks, hopefully I can piece it together
Congrats to @anmonteiro with Lumo topping HN :)
I get a strange message from the compiler when trying to compare goog.date.DateTime
, try this in planck:
(require '[goog.date.DateTime])
(def d (goog.date.DateTime.))
(< d (goog.date.DateTime.))
It returns true
but the compiler throws the following warning:
WARNING: cljs.core/<, all arguments must be numbers, got [nil goog/date.DateTime] instead. at line 1
The analyzer can see the type of the second argument and thus it can emit a warning. <
only works for numbers.
that is the fact that it happens to work is an implementation detail - not a guarantee
@dnolen Got it, any pointers on comparing date-times? If I extend goog.dateDateTime, adding ICompare, would that make it work properly?
however nothing is stopping you from writing your own arithmetic operators with full overloading
(extend-type goog.date.DateTime
IComparable
(-compare [x y] (goog.date.Date/compare x y)))
@vikeri Yep. Or if you don’t want to extend, just use it directly, of course
(defn earlier? [x y] (neg? (goog.date.Date/compare x y)))
finally managed to get a cljs cider repl working according to https://github.com/clojure-emacs/cider/blob/master/doc/up_and_running.md#using-the-figwheel-repl-leiningen-only but now the figwheel autobuild isn't working 😄
ah brilliant, newer versions of figwheel validate the config and don't allow css-output-to from om-css
there is a :validate-config false
option for that
okay, so I know that clojurescript is growing and changing super rapidly, and I've yet to get into it. is Modern-Cljs https://github.com/magomimmo/modern-cljs still the best place to get started?
i liked http://shop.oreilly.com/product/0636920025139.do fwiw, although it’s from 2012
if you read that book and work through https://github.com/clojure/clojurescript/wiki/Quick-Start , and look up figwheel and reagent, i think that’d be a good foundation
Cursive for IntelliJ, my preferred editor, is all very leiningen based, so I really dont want to use boot.
@idiomancy I have been doing CLJS/CLJ for over 3 years now and never had a problem with lein, never had a reason to even look at boot. quite happy with lein.
Cool. Learning the boot stack is real frustrating. Have you been doing figwheel/react stuff?
ah, interesting. I mean I love clojure so i'm not opposed to building tooling, but the problem is my whole career has been backend focused, so I dont have a lot of front-end experience to draw from when setting stuff up
yeah. I believe it. I mean, to the degree that one can. Its like learning clojure without java
I know basic rules about function scope and prototype chains etc for your run of the mill javascript stuff
Hmm. Well, I guess I'll keep working through these books. An aside, @thheller you said you dont use boot, but @markx do you know if theres a boot new <project>
equivelant of lein?
@idiomancy I don’t know. I haven’t tried boot.
@idiomancy I switched to boot from lein mainly because it let me use one JVM only for all the stuff. Then, I never hade the time to keep updated both the boot and the lein version of the modern-cljs series. Unlikely I have no time to keep modern-cljs updated as well. Anyway, there is still the old modern-cljs version available in the git repo which is based on lein and cljsbuild, but it’s even older than the boot one. https://github.com/magomimmo/modern-cljs/tree/master/doc/first-edition
gotcha. I think the problem is mostly personal attachment to my intelliJ tooling that I need to just get over.
oh but how about this: https://github.com/boot-clj/boot/wiki/For-Cursive-Users
@idiomancy I tried to leave emacs more times, but my fingers do not agree 🙂
@magomimmo I just got hired by a shop that "encourages" uniformity in dev environments, and they're a mac/emacs shop