This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-03
Channels
- # admin-announcements (8)
- # beginners (99)
- # boot (60)
- # cider (44)
- # cljs-dev (47)
- # cljsrn (68)
- # clojure (223)
- # clojure-art (1)
- # clojure-russia (190)
- # clojure-sg (9)
- # clojure-uk (2)
- # clojurecup (1)
- # clojurescript (59)
- # clojurex (3)
- # core-async (43)
- # core-typed (2)
- # cursive (18)
- # datavis (7)
- # datomic (16)
- # events (2)
- # funcool (3)
- # hoplon (3)
- # jobs (1)
- # lein-figwheel (10)
- # leiningen (6)
- # off-topic (1)
- # om (123)
- # onyx (57)
- # parinfer (16)
- # portland-or (2)
- # random (1)
- # re-frame (4)
- # reagent (7)
- # remote-jobs (1)
- # spacemacs (12)
Is it possible to import a java class in a boot.build
file? Or do you need to create the task under separate source tree to do that?
Trying the following, but it’s causing an exception:
let [date-str (-> (java.text.SimpleTextFormat. "yyyyMMdd-HHmmss")
(.format (java.util.Date.)))]
This produces the following:
clojure.lang.ExceptionInfo: java.text.SimpleTextFormat
data: {:file
"/var/folders/b_/42hsm7tx0tj_d0mtyj8hvt4m0000gp/T/boot.user4794018330423818511.clj",
:line 9}
java.lang.ClassNotFoundException: java.text.SimpleTextFormat
I’m using boot-cljs and boot-reload to compile my frontend cljs. (Using saapas as a base). When I had my components in one namespace the auto reload (like figwheel) worked fine, but when I separated some components into a separate view, it started requiring a browser reload to register changes. I.e., I went from having a component in frontend.core namespace, to separating a subcomponent out of it and putting that in frontend.views. I’m sort of guessing it has to do with the .cljs.edn file, so I changed the :require vector to include the new namespace, but still no cigar. Any ideas?
I’m not sure what I’m missing because whenever I make changes to the :require’d namespace, I do still get that little cljs logo pop up from my browser console. Just doesn’t actually reflect the changes until I manually reload the browser.
Does all rendering happen from one mount point, or are there defs that render as well?
I think I’ve figured it out actually, adding a :on-jsload
option pointing to the render function to the reload task solves it
Not sure what the difference is between :on-jsload
in the boot task and the :init-fns
in the edn...
@sooheon: init-fns is like "main" when you make an uberjar. I.e. When you create an advanced build a call to I init-fns is added at the bottom.
on-jsload is only concerned with reloading and is unrelated to what init-fns does
@martinklepsch: I see, thanks :)
Hi. I’m in the process of transitioning to boot from leiningen.
I’m looking for a way to extend the environment for certain tasks, e.g., I want to add my dev
directory only to the :source-paths
for the built in repl
task, but not any of the others.
I can see how to do this when defining my own tasks, but can’t find a reference on how to do it for built in tasks.
@sandhu: check out the -e
option on repl
e.g. boot repl -e '(set-env! :resource-paths #{"dev"})'
I tend to live in emacs, so will need to figure out how to do the equivalent with cider-jack-in
, but thanks for pointing me in the right direction
you can, try this: (task-options! repl {:eval "(set-env! :resource-paths #{\"dev\"})"})
task-options! "curries" tasks, whether or not they're builtins
or you make a dev-repl
task:
(deftask dev-repl
(set-env! …)
(repl))
I’m essentially working through creating the equivalent of
:profiles {:dev {:global-vars {*warn-on-reflection* true}
:plugins [[lein-cljsbuild "1.1.1"]
[lein-doo "0.1.6-rc.1"]]
:dependencies [[reloaded.repl "0.2.0"]
[org.clojure/tools.namespace "0.2.11"]
[org.clojure/test.check "0.8.1"]
[com.gfredericks/test.chuck "0.2.3"]]
:source-paths ["dev"]}}
oh, i suppose you may want to use merge-env
seems cleaner to me than passing strings to :eval
the nice thing about configuring repl
is cider should work (tm)
Thanks @martinklepsch. It does, but I need to get cider-jack-in
to call that instead.
@sandhu: https://github.com/borkdude/lein2boot might be helpful to you in case you haven't seen
I did, but the two issues I ran into were:
1) He was adding things to :dependencies
that were dev only
2) He was creating new tasks instead of extending the built in tasks.
gotcha
btw what @martinklepsch showed is definitely a good way to add paths and deps on a per-task basis.. the repl is a something of a special case
Agreed that the repl is a special case… Will use @martinklepsch’s guidance for the other tasks. Thank you.
Are there any plans to provide before-task
, after-task
or wrap-task
types of functions in the future ?
no, but these could be implemented by the user
(alter-var-root #'repl (fn [f] (fn [& args] (println "before repl called") (apply f args))))
is an example of replacing repl with a version that runs arbitrary code before running the original
that would be another way to add sources in the repl case... by replacing the println
with set-env or whatever else you need in dev
Would you be open to including something like that in boot ? I’m happy to create a PR if it makes sense.
feel free to create a PR to get wider feedback, but personally i'm not in favor of adding... perhaps a library?
another mitigating "feature" we have is that tasks can be anonymous
so it's easy to wrap the functionality of another task by wrapping it with your own (possibly anonymous) task
@alandipert: can I join your team for the clojure cup?
started getting this error after updating to new boot-cljs version
relevant-cljs-edn already refers to: #'adzerk.boot-cljs-repl/relevant-cljs-edn in namespace: boot.user
has this been seen by anyone?
[org.clojure/clojure "1.7.0”]
[org.clojure/clojurescript "1.7.170"]
[adzerk/boot-cljs "1.7.170-3"]
[adzerk/boot-cljs-repl "0.3.0”]
I found the issue!
boot-cljs-repl seems to be the one causing the issue.
If I setup a cljs repl connected up to my browser, is there a way I can run cljs.test tests from it?