This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-10
Channels
- # ai (2)
- # beginners (3)
- # boot (113)
- # bristol-clojurians (2)
- # cider (77)
- # clara (43)
- # cljs-dev (48)
- # cljsrn (9)
- # clojure (319)
- # clojure-austin (2)
- # clojure-czech (4)
- # clojure-denmark (4)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (2)
- # clojure-serbia (10)
- # clojure-spec (79)
- # clojure-uk (64)
- # clojurescript (109)
- # clr (3)
- # conf-proposals (21)
- # core-async (19)
- # cursive (26)
- # datascript (11)
- # datomic (19)
- # devcards (1)
- # emacs (25)
- # figwheel (9)
- # hoplon (31)
- # jobs (7)
- # jobs-discuss (14)
- # leiningen (10)
- # lumo (11)
- # off-topic (37)
- # om (40)
- # onyx (4)
- # perun (8)
- # planck (3)
- # rdf (4)
- # re-frame (40)
- # ring (11)
- # ring-swagger (2)
- # rum (21)
- # spacemacs (2)
- # specter (50)
- # untangled (93)
- # yada (13)
Nevermind. Got it.
(require 'puppetlabs.trapperkeeper.main)
(deftask run-trapperkeeper []
(with-pass-thru _
(puppetlabs.trapperkeeper.main/-main
"--config" "dev-resources/config.conf"
"--bootstrap-config" "dev-resources/bootstrap.cfg")))
Do you guys have any opinion on this pomegranate
thing I found? https://github.com/cemerick/pomegranate/pull/80#issuecomment-278858505
For boot-cljs-repl , when you (start-repl)
, how do you instrument your index.html to connect back to the dynamically generated ws port?
boot.user> (start-repl)
<< started Weasel server on ws://127.0.0.1:55652 >>
<< waiting for client to connect ...
@twashing : my understanding is that you have to run two repls, "boot repl <-- this one you run (serve ... ), and (cljs-repl) , and (watch)" ; then in a seprate shell, you run "boot repl -c // (start-repl)" -- then by some magic, the second one (which I start after the first one), pulls all the port info from the first one
@twashing : you seem like someone who's not afraid of hardwork; let me grab you the uber docs
https://github.com/magomimmo/modern-cljs/tree/master/doc/second-edition <- someone recommended this to me. I worked through the first 6 tutorials (they're very short).
It walks you step by step on how to setup cljs with boot. It's amazing in that it goes "this is the dumb way to do it ;; this become tedious ;; now I will teach you a new feature to make past work trivial "
and at the end of it, you get a very very good understanding of what each of the boot tasks means
boot/cljs did NOT make sense to me until I worked through the first 6 of that series; and afterwards, I got not only a fully working setup, but also a fundamental understanding
There’s already an nrepl service in there: https://github.com/puppetlabs/trapperkeeper/blob/master/documentation/Built-in-nREPL-Service.md
you know what this means? I can't help you 🙂 because you no longer have a boot problem, you have a trapper keeper problem 🙂
I find when I deploy things, it’s nice to have a service that fires up my code and just runs there.
yeah, so if you fire up a regular nrepl in boot, it appears it writes a ./.nrepl-port ; which I thikn is how the other nrepl picks it up
But now, weasel opens a ws on a dynamic port. What I think I’ll do is just spell it out explicitly (cljs-repl 9001)
.
https://github.com/adzerk-oss/boot-cljs-repl/blob/master/src/adzerk/boot_cljs_repl.clj#L191
Then I can just connect to it, from my index.html: https://github.com/tomjakubowski/weasel/blob/master/weasel-example/src/weasel_example/example.cljs#L6
1) I was right, you're definitely hard working. 2) looks like we have returned to your exact solution from an hour ago -- hard coding 9001 🙂
Hi there. I was hoping I could get some guidance when developing using boot for front end (less, cljs), while the backend is running on vagrant. I'd like to run boot locally, and mirror output to another folder which is served from vagrant.. but I think I lose reloading then?
watch rsync: local/src to vagrant/src edit: local/src on save, rsync auto runs, updating vagrant/src this triggers cljs recompile + reload on vagrant
@minikomi In addition to http server serving the files, for reloading browser needs connection to http server set up by boot-reload. You could configure boot-reload to use address and port that are accessible from vagrant.
If I was running boot on the vagrant maching I'd do so, but I'd rather have boot running locally than in the constrained vagrant machine. Also, I won't be using clojure in produciton and I'd like to keep my vagrant machine as close to prod as possible
Yeah, it seems like running boot on the vagrant machine simplifies everything. oh well.
So (1) you're running boot locally (2) you want your browser pointed at VAGRANT, not LOCAL, and (3) you want browser to auto reload?
right. when using gulp i was able to do it since every save compiled and output a file to disk - mirrored and served from vagrant.. but the livereload chrome plugin was notified by local server and reloaded the javascript from there.
So unless your ssh portforward the local ws server to vagrant, it's not clear how it would work.
Actually, there's probably a way to get boot to hardcode the ip address of the ws server, this would cause the browser to load webpage from VAGRANT, but then connect to local for ws.
https://github.com/adzerk-oss/boot-reload/blob/master/src/adzerk/boot_reload/server.clj#L64-L66
the line you want is: (cljs-repl :ip (.getHostAddress (java.net.InetAddress/getLocalHost)))
it's more, the output js / less -- should I do a sift to make it output after every watch?
i'm still a bit unsure how boot-cljs, boot-less and boot-http work without outputting to a build folder
fileset contents are available from classpath
but I think (1) if you just rsync, live.js will pick it up and (2) if you have websockets pointed at correct ip, brepl should work -- and it's not clear you need anything more
local files from my backend folder are automatically mirrored to the vagrant machine
sure.. I guess I'm not sure where files are being output when I don't do a sift/target? Or, should I do that in my dev build too to get the files?
(defmulti foo :foo)
^^ should the above code work inside a browser repl? I'm gettin a weird ferror of "can not read foo of undefined"@qqq The following worked fine for me:
cljs.user> (defmulti foo :foo)
nil
cljs.user> (defmethod foo 1 [] "one")
#object[cljs.core.MultiFn]
cljs.user> (foo {:foo 1})
"one"
@minikomi: thanks! that worked for me too. For some weird reason, the difference is: 1. if I type it in the repl buffer, it works 2. if I type it in my source buffer and do eval-last-sexp, it fails this is very helpful as it points the bug at "what is the difference between typing in repl vs C-x C-e"
Enjoyed reading https://adzerk.com/blog/2017/02/faster-clojure-metadevelopment-with-boot/, thanks @alandipert
the poll
function looks like a great hack
exactly the kind of idea you're inspired to when working from a repl
@pesterhazy thanks man, that was exactly my goal, spark the imagination
this is amazing. I usually don’t write many boot files so that wasn’t a big problem for me to wait 7 seconds. But for demos when you show how to use create boot files (or perun tasks in my case) this is great
@pesterhazy @alandipert pool should be a builtin, I have used (load-file "build.boot") so often that I ask myself "why can't boot just reload this too)
@hiredman Are you making sure dev/test-only source and dependencies are excluded?
@hiredman I think @micha mentioned something about a function which could cache library explosions for uberjars. I'm not sure if it was used in the latest boot or not though.
yes uberjar explosion is cached
in theory that should work fine, unless there are bugs
the build should use .boot
for storing stuff
is there some project that generates nice html docs for boot tasks?
not that I know of
@alandipert Awesome post.
@podviaznikov You could try with codox
.