This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-20
Channels
- # aleph (19)
- # aws-lambda (8)
- # bangalore-clj (1)
- # beginners (13)
- # boot (179)
- # cljs-dev (12)
- # cljsjs (2)
- # cljsrn (6)
- # clojure (174)
- # clojure-italy (14)
- # clojure-nl (2)
- # clojure-russia (172)
- # clojure-spec (29)
- # clojure-uk (22)
- # clojurebridge (10)
- # clojureremote (1)
- # clojurescript (79)
- # cursive (46)
- # data-science (1)
- # datascript (8)
- # datomic (18)
- # defnpodcast (2)
- # emacs (9)
- # events (6)
- # hoplon (11)
- # klipse (13)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (1)
- # lumo (88)
- # numerical-computing (1)
- # off-topic (24)
- # om (33)
- # onyx (58)
- # protorepl (8)
- # re-frame (10)
- # reagent (26)
- # ring (8)
- # ring-swagger (7)
- # rum (22)
- # spacemacs (25)
- # specter (5)
- # uncomplicate (37)
- # untangled (75)
- # vim (17)
- # yada (3)
@micha only now getting to try out your suggestion of boot.pod/add-classpath
to add a local JAR to the classpath
The JAR in question is the current master of the ClojureScript compiler
but it seems that it doesn’t get picked up by e.g. boot-cljs
and I’m unsure if it will given that Boot-cljs creates a pod to run the compiler in based on the :dependencies
of the current env https://github.com/boot-clj/boot-cljs/blob/master/src/adzerk/boot_cljs.clj#L96
I don’t think I can get away without actually specifying a dependency in my set-env!
call
The problem is exactly what you describe @anmonteiro at the moment there is no easy way to add stuff to it after a pod is created
By iirc there is a way to get all the pods spinned up
It think it is boot.pod/pods
I have never tried myself but I am be curious to see if add-classpath
works so if you try please do report back
I tried add-classpath
but I couldn’t get it to work
I mean on a pod in pods
.. not the default pod though
ah right.
You need to fetch the one created by boot-cljs
I don’t know how I can do that before boot-cljs
starting the compilation process
Yeah It is created after the first "run"
There have been some talk about this particular problem, I personally wanted to avoid calling set-env!
and pass the env to each pipeline, but we haven't got any plan for it
right
the hack I came up with is having the JAR in a directory in my repo
and I set :local-repo
to that directory
Ah nice!
let’s see if it works. CI is running now
looks like it’s working
Great, nice workaround then!
Hi there. Can someone give me a hand using :checkouts
with a leiningen-based clojurescript dependency? I've gotten as far as boot telling me Adding checkout dependency ~~
.. but I'm unsure how to edit/update a local version and have it rebuild
@minikomi the idea of :checkouts
is that the consuming process consumes the checkout jar file
so i found a bug with boot-cljs
short discussion here
but wanted to mention it here to make sure my understanding of the intended behavior is correct, and not just what works for my use case
re-upping this, for the non-weekend crowd. Basic question is - are records supported as input to pods?: https://clojurians.slack.com/archives/boot/p1487515021017257
if you use with-call-in
you may pass java objects as arguments to the function you are calling
that will not work, because objects created by one clojure runtime do not implement the same interfaces and are not the same classes as the ones with the same name in another clojure runtime
that is to say, if i create a vector in pod A and pass it to a function in pod B like this:
so i think if you make sure that data readers are set up correctly in both pods before you try to pass records back and forth it should work
boot.user=> (def m 42)
#'boot.user/m
boot.user=> (defn f [x] (+ x m))
#'boot.user/f
boot.user=> (def p (boot.pod/make-pod (get-env)))
#'boot.user/p
boot.user=> (boot.pod/with-pod p (~f 100))
142
we may need to make some minor tweaks maybe if there is a huge performance gain that is worthwhile to do
it wouldn't be too hard for me to jury-rig something that does the same stuff as with-call-in
, except that it requires the function namespace before deserializing any clojure args, which would be enough for my use case. If the performance takes a significant hit, I'll just do that.
Hi booters. Anybody interested in producing professional-quality documentation for boot is welcome to contribute to https://github.com/mobileink/boot-documentation-library. The catch is you have to use DITA.
@micha: just curious, as an old fart, what does an upside down laughing parrot mean? it looks amusing, but i can't interpret it. :)
How do I make a global exclusion in boot, so I don’t have to exclude cljsjs/react on a lot of libraries?
i do hope nobody is too frightened or intimidated by DITA. It's a lot like Clojure: bit of a learning curve, but in the end peerless for its purpose. Very compositional, you create lots of pieces that do one thing well, then you compose them.
i particularly like the indexing capabilities. makes a big difference for noobs groping around the docs.
hi again, booters. if you're interested in Alexa/Echo development, check out https://github.com/migae/boot-ask. First cut, I could use some beta testers. Feedback warmly welcomed.
is there a boot task that demonstrates how to do this: (1) on (watch) (2) for each file processed, parse out the symbol after (def or (defn or (defmacro ? I know there are other tools to do this (like etags / imenu), but I want an example for oding this in boot so I can build more complciated exampleson top of it
@qqq boot-sass does things for each new file. tools.reader is probably what you want for defs
@dominicm: https://github.com/Deraen/boot-sass/search?utf8=%E2%9C%93&q=tools.reader am I looking at the right repo?
@qqq sorry, boot-sass doesn't use tools.reader. You'd just operate on the files plainly with tools.reader
boot works via (comp ..... ) is there a way to see all the intermediate data being passed around?
I know there's some 'fileset' and 'output' being passed around, but if I could somehow 'see' it, it'd help me understand how this works
watch just kicks off a pipeline, so i'm not sure what you mean by "each file proccessed".
qqq: there’s a notify
task
play with the fns listed at the bottom of https://clojure.org/reference/namespaces.
What I can't figure out is: how to add a task in boot which (1) looks at modified files, (2) runs tool.reader to prse it for (def (defn (defmacro
Just extracting symbol names from namespaces doesn't work -- I need mre info to output emacs auto completion stuff/docs
I think ou're seeing (def (defn (defmacro and thinking "oh, he just needs the symbol names -> look at namesapce functions" The situation is -- I need to parse *.cljs files to output yasnippets -- and I mention (def (defn (defmacro because once I can parse those, I can utput the yasnippets
1) modified namespaces, not files (I think?) 2) what more info? fwiw, i decorate the stuff i'm interested in with metadata; of course this requires a macro. e.g. (defcomponent foo .. ) adds metadata to the var. that way my tooling can pull out the vars of interest.
I don't want to jump into the details of whatelse needs to be extrated -- but symbol names / meta data does not suffice, and I need the actual sexp of the def/defn/defmacro.
I have a clojure function of type "cljs file ==> list of yasnippets" My question is: how do I inject this function into the boot pipeline so it's called whenever a *.cljs file is updated.
i think (but am not sure) that if you want to manipulate the actual defining code of a fn (the sexp) you need macros. do you have an example?
@mobileink: this is getting off-topic for boot, should I PM you?
feedback is welcome folks ^
It is a declarative approach for boot tasks
Yeah naming is hard 😄
but why do we need it? i'm not saying no, just not sure why i would be interested. to me boot tasks are already "declarative".
it looks like defendtask and I'm thiking "what am I defendig vs, is this tower defense for boot" ?
An example is here , I mainly need it for sharing conf and reuse, but is also avoids calling set-env
many times manually and globally (actually it is a global call anyways, but one only)
The conf is local and you are never going to have two tasks calling set-env
twice with different stuff
I have used it with profit in that project
Which has quite a complicated build pipeline
It also easer setting java properties thanks to :props
. One thing I would like to remove is the comp
for tasks, it does no give any value
And you cannot conj
on :pipeline
you know there is a limit to the ability of the human mind to keep track of abstractions. esp. mine. 😉
It is a macro that generates tasks
Well, this is kind of an easy one I hope 😀
I found that a bit more structure was good for me, and I am collecting feedback in order to see if it can be for others 🙂
a naive cynic might view this as re-writing lein in boot, but in my opinion, whenever people exploit the data/code duality, neat things happen
@qqq totally agree, I like the declarative approach and I like to have the choice, so why not exploit the more flexibility in boot and kind of ease things up a bit
Maybe we can win lein users as well (lol)
since deftask is already a macro that generates tasks, defedntask (or whatever) seems ill-advised.
Jokes aside, as long as it is useful, for me it is allowed
@richiardiandrea : I think a nice thing about your approach (vs lein) is that route A = trying to do impure stuff in lein route B = in boot, saying "this section is declarative" routeB is much easier because you just force it to be all data, whereas routeA -- I still have no idea how to o that
Totally
A way to make things pure is to pass data in and let the framework do that side effect
So it is already 2 votes, enough against my only vote...I will change it
fwiw, i do not know what "declarative" means. Clojure fn defns are purely declarative.
there are many related definitions of declarative; to me, in clojure, the I use the most if: pure-data, things consisting of lists, vectors, maps, keywords, strings, and numbers
Uhmmm ...Declarative yes, pure...depends on what you do within it, in general of course everything is data because we are playing with a lisp 😀
You know I like (with-edn ...)
but wouldn't it be too cryptic?
well, fwiw, the whole "pure" thing is total hogwash. there are no "pure" languages of practical use; they are all sinful, tainted by IO at the least.
Of course
That is why you make them pure with things like Io monads
@richiardiandrea could be too cryptic but on the other hand it is a common idiom.
This doesn't mean we should not try to abstract over this impurity to make things easier for the final user
Like Haskell did with the Io monad...Does not make it pure, but it improves user experience (in theory)
haskell monads do not solve the problem. they just move it. the hard fact is you cannot do io in a functional language, period, end of story.
Agree, but in theory things are more readable and manageable for developers that way, which apparently saves money, which apparently is a good thing
I also agree with renaming it took too many attempts to read the function name 😛
lol I will rename it then
overwhelming majority
i dont know that I really see the use for it tho, it's almost as much typing as just writing a task?? what is your use case?
mainly here: https://github.com/elasticpath/rest-resource-viz/blob/master/build.boot#L42-L92
with the caveat that the :pipeline
key needs to be made a sequence probably
@richiardiandrea wow! cool :thumbsup:
thats a really clean lookin file
thanks!