This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-03
Channels
- # bangalore-clj (1)
- # beginners (160)
- # boot (174)
- # cider (57)
- # cljs-dev (16)
- # cljsrn (5)
- # clojure (144)
- # clojure-argentina (1)
- # clojure-austin (6)
- # clojure-finland (2)
- # clojure-france (4)
- # clojure-russia (185)
- # clojure-serbia (4)
- # clojure-spec (61)
- # clojure-uk (126)
- # clojurescript (212)
- # community-development (7)
- # core-async (2)
- # cursive (17)
- # datomic (210)
- # emacs (10)
- # euroclojure (2)
- # gsoc (23)
- # hoplon (86)
- # jobs (8)
- # lein-figwheel (9)
- # luminus (19)
- # lumo (12)
- # off-topic (4)
- # om (14)
- # om-next (6)
- # pedestal (38)
- # perun (11)
- # planck (35)
- # portland-or (2)
- # ring (1)
- # ring-swagger (28)
- # specter (6)
- # untangled (6)
- # yada (2)
@mobileink How would you suggest they could be improved?
@seancorfield: currently there is no documentation on templates. i spent about 20 minutes trying to create a new template using -t template and then gave up.
Happy to help when I'm at my computer (since I wrote boot-new and its "totally useless" documentation) @mobileink :)
Hit me up tomorrow during Pacific office hours if you're around. We can DM and get you up and running. Then I can use that to improve the documentation.
You're 2 hours ahead of me, I believe? Central time?
yes. not sure about schedule tomorrow, though. all i need though is some explanation of what a boot template is supposed to look like and what the development workflow should be. the result of boot -d boot/new new -t template -n my-template does not seem to work:
crash: Could not load template, failed with: Failed to collect dependencies for ...
If they’re about boot, sure; at least, I’ve asked my share of beginner questions without sanction 🙂. If they’re about clojure or the wider ecosystem, #beginners is a better forum.
probably extremely trivial, but I haven't messed with boot filesets yet; all I'm trying to do is write to an asset file (foo/bar.txt). Started from https://github.com/boot-clj/boot/wiki/Filesets#examples, but the file won't appear
(deftask doit []
(let [tmp (tmp-dir!)]
(with-pre-wrap fs
(empty-dir! tmp)
(let [tmpf (->> fs input-files (by-path ["foo/bar.txt"]) first)
[infile inpath] ((juxt tmp-file tmp-path) tmpf)
outfile (doto (io/file tmp inpath) io/make-parents)]
(spit outfile (str (slurp infile) "one more line.\n"))
(-> fs (add-resource tmp) commit!)))))
when your task adds that directory to the fileset it can overwrite files already in the fileset
(deftask my-task []
(let [tmp (tmp-dir!)]
(with-pre-wrap fileset
(empty-dir! tmp)
(doto (io/file tmp "out.txt")
(io/make-parents)
(spit "Why, hello there :)"))
(-> fileset
(add-resource tmp)
(commit!)))))
You may need to follow this task with the target
task, right?
@donaldball bingo! but what if I want to write to a directory other than target
?
Doesn’t it allow a :dir
option?
@donaldball it does. alright, back to docs, thanks for the directions
Is there a way to force boot to download the latest snapshots every time you start it?
in boot, is there a nice way to "compress" three windows into one? I'm building a webapp where server = clj, client = cljs right now, I need one for: boot watching clj files to recompile server side boot watching cljs files to recompile client side boot cljs repl now I really want to compress all three into a single terminal -- it's okay if the output is interleaved -- that doesn't bother me
@qqq, I've wanted this before too
it'd be nice to be able start a "session", with multiple boot processes, as a package
especially because you can't easily combine watch
with repl -c
you pretty much need two terminal windows
@pesterhazy you can run the boot task from inside the repl, like boot.user=> (boot (watch) ...
@micha, can I submit an initial command to the repl?
there is a neat little gfredricks library for in-repl job control that i like to use sometimes
I guess I could make a deftask that runs (future (boot (watch)))
why is a task not a good idea?
yeah exactly
$ boot repl -e '(println "hello")'
nREPL server started on port 51846 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_91-b14
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
hello
boot.user=>
(deftask x []
(set-env! :source-paths #(conj % "src2")))
(require '[foo.bar :as bar])
...
(bar/qux) ;; <= throws no such namespace: bar (-_-。)
that's probably the answer then, thanks
@moxaj you have to use resolve
((resolve 'foo.bar/qux))
you only need it in build.boot - it's not as bad as it looks
I guess you can't even work around this with a convenince macro, since it would still expand to (do ...)
@micha @pesterhazy : tmux/sreen doesn't work, as I want the three output "interleaved"
the first two will run in the background while the last runs in the foreground as usual
I'm stealing "soft yes"
this websever would support websockets ... and in the js side, provide a basic terminal emulator
then, I can run multiple boot 'watch' commands, and have the browser do all the output rendering
I need one for recomiping .js into .class files, and one for recompiling .cljs to .js files
in this linked appraoch, if I update a server clj file, does my cljs -> js recompile as well?
oh, I also need separate processes for this reason: I don't want client side dependencies (huge) to go into server side WAR (want as small classes as possible)
for classpath issues, my approach to that was very hacky in lambone
, but I was able to have the cljs classpath include only frontend deps
boot.user=> (boot.App/runBoot (boot.App/newCore nil) (future boot.pod/worker-pod) (into-array String ["help"]))
so the backend is in a pod: https://github.com/Lambda-X/lambone/blob/master/resources/leiningen/new/lambone/common/dev/boot.clj#L151
the frontend runs in the core pod: https://github.com/Lambda-X/lambone/blob/master/resources/leiningen/new/lambone/common/dev/boot.clj#L209
Right now, to startup my dev environment, I have to do fire up the following 4 terminals: 1) dev_appserver.sh war 2) boot watch-server // clj -> class files 3) boot watch-client // cljs -> js files 4) boot brepl // browser cljs repl This seems kind of crazy.
if you want to reach real classpath isolation and launch one process only, lambone does it for you
in the hacky way above
(aka, run in pods wherever you can)
there was also some discussion around having a way to "hook into" or "configure" the pod running in standard tasks
like boot-cljs-repl
or why not, pass a pod as option
@richiardiandrea : initially, I thought you were asking a different question -- however, based on your last two posts, it seems like you may be answering my question -- is lambone a solution to the "4 windows is too much" problem ?
Three ready to use boot build, boot dev and boot test tasks boot dev with no option launches two Repl instances within the same JVM
also, feel free to steal anything you need 😄
the deps are maybe a bit outdated
@moxaj that might delete your cwd 😞
yeah scary!
might be a good idea to sanity-check target for ^.(/.*)?'
@qqq a few months ago i was typing too fast and i did rm -rf ~/.foop
, but with tab completion and general bad typing skills i ended up with a space between the ~/ and everything else
@micha whoa, you win the shitty typo award; I think the only thing of comparable level would be a "mkfs.ext3 /dev/sd<WRONG-PARTITION>"
holy shit @micha
@micha re writing into a file: I may have misunderstood something .. is there no way to spit into the actual file it read from?
@micha: if it makes you feel any better, i once did "$ sudo rm -rf ./" except i forgot the .
so if you change the contents of a file that is being managed by the fileset it will cause unexpected results
so if you want to modify a file that is in the fileset you would replace the file with your modified copy
@micha I mean the actual actual file 🙂 the one on the filesystem, not in the temp directories
does anyone have a sample usage of the sift
task? I'm using boot-cljs
and outputting my compiled cljs, but id like to move the destination folder to /release/site.min.js
rather than the default /target/js/app.js
@samueldev the target
task uses /target
by default, but you can change it to output to /release
with (target :dir #{"release"})