This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-09
Channels
- # aleph (4)
- # beginners (31)
- # boot (33)
- # cider (7)
- # cljs-dev (263)
- # cljsrn (1)
- # clojure (33)
- # clojure-austin (2)
- # clojure-dev (1)
- # clojure-russia (6)
- # clojure-spec (19)
- # clojure-uk (7)
- # clojurescript (79)
- # cursive (21)
- # datascript (1)
- # datomic (13)
- # dirac (12)
- # emacs (15)
- # hoplon (26)
- # lein-figwheel (3)
- # leiningen (1)
- # luminus (5)
- # lumo (20)
- # mount (1)
- # off-topic (17)
- # om (13)
- # onyx (24)
- # parinfer (70)
- # pedestal (2)
- # re-frame (19)
- # reagent (1)
- # ring-swagger (3)
- # unrepl (8)
- # untangled (58)
- # yada (2)
So in context of the below message, I need to compile my clojurescript and add it's location to resource-paths, so it can be accessed by the webserver I'm running and served to the client. What's the idomatic way to do this in boot?
Usually you need to place the sources in : source-paths
and boot-cljs
takes care of adding the js to the the served files @donyorm
You might need to add assets to resource-paths
though
Yeah I found the asset-paths
key after I posted that. I think it does what I want, but I still have yet to get it working.
Yeah static files are not compiled and therefore you add them in there
JS is added for you
@richiardiandrea So what path should I put into my html file. I currently have it looking in /js/main.js
and it's not finding anything. /main.js
also doesn't exist.
donyorm: in which folder is this?
Sorry this is the html file loaded at localhost:3000/index.html
. It's the luminus project I'm converting to boot, if that context helps.
donyorm: so if you add resources/
then the content will be served at localhost:3000/js/index.html
...
Unless there is something else going on there
see above, :resources-paths
. What I meant is that what you have in :resources-paths
will be served at the root of localhost:3000
Hi, I’m trying to setup a boot task that - reloads clientside only when clojurescript changes, - serverside only restart when clojure code changes. The tasks themselves work fine, but right now only changes in clojurescript are picked up. Does anyone know how to accomplish this?
(deftask run-clj-dev []
(comp
(watch :verbose true :include #{#"\.(clj|cljc)$"})
(system :sys #'dev-system :auto true :files ["api.clj"])
(reload)
(repl :server true :port 8009)))
(deftask run-cljs-dev []
(comp
(watch :verbose true :include #{#"\.(cljs|cljc)$"})
(reload :ids #{"js/main"})
(cljs-repl :ids #{"js/main"} :nrepl-opts {:port 9009})
(cljs :ids #{"js/main"} :optimizations :none :source-map true)))
(deftask run-dev []
(comp
(run-clj-dev)
(run-cljs-dev)))
@freakinruben you can’t have two watch
tasks in the same pipeline
try boot watch run-clj-dev run-cljs-dev
with the watch tasks inside these tasks removed
martinklepsch: tnx! that works, but then my clojurescript also gets recompiled when clj files change
hm. In theory .clj files might affect cljs compilation (bc. macros) so I’m not sure if there’s an easy way to avoid it
@freakinruben the compilation of your cljs should be super quick though given that nothing changed. What kind of compile times are you seeing?
my boot installation appears to be broken. No matter what command I try to run, I get the same stack trace, which seems to be lacking critical details, like the path to the file with the error in it:
Ah, found it! I had a typo on line 150 of build.boot
. It's unfortunate that neither that line number nor that file appeared anywhere in boot's error message.
hm, actually line 150 is mentioned in the stack trace, for ClojureRuntimeShimImpl.java
-- is that coincidence or a clue?
@chouser boot.user:37
at the bottom there, does that correspond to the error? you can see boot’s idea of your build.boot with boot -b | cat -n