This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-30
Channels
- # admin-announcements (3)
- # arachne (8)
- # beginners (5)
- # boot (52)
- # braveandtrue (4)
- # cider (17)
- # cljsrn (1)
- # clojure (36)
- # clojure-dusseldorf (2)
- # clojure-india (1)
- # clojure-russia (30)
- # clojure-uk (1)
- # clojurebridge (1)
- # clojurescript (47)
- # clojutre (1)
- # component (1)
- # core-async (3)
- # cursive (5)
- # datascript (1)
- # datomic (4)
- # emacs (1)
- # error-message-catalog (62)
- # garden (3)
- # hoplon (16)
- # jobs (5)
- # luminus (11)
- # mount (1)
- # om (32)
- # onyx (17)
- # spacemacs (4)
- # untangled (20)
- # yada (4)
How does one include external javascript (mixpanel, fullstory, google analytics) but only conditionally for prod and/or staging (but not dev) ?
not necessarily. We do want to use the mixpanel functions to send through specific info. However that happens.
I asked something similar earlier. It seems the best way is to create separate entry points and compile based on environment.
and use sift to move stuff into the jar?
Possibly. I mean along the lines of creating separate tasks that either run or configure the cljs build task to build the entry points you only need using :ids
.
yeah, imagine a mixpanel.js snippet that we only want to include when it’s prod
If you got separate folders then tweaking the resource paths works. If you got everything in one folder and you want to filter then sift
would be convenient.
(deftask dev
"Start the dev env..."
[s speak bool "Notify when build is done"
p port PORT int "Port for web server"]
(merge-env! :resource-paths #{"env/dev/js"})
(comp
(watch)
(reload :on-jsload 'torcaui.core/reinstall-om!)
(cljs-repl)
(cljs :ids #{"main" "devcards"})
(serve :port port :dir "target" :not-found 'reps.server/not-found-handler :reload true)
(target)
(if speak (boot.task.built-in/speak) identity)))
(deftask package
"Build the package"
[]
(merge-env! :resource-paths #{"env/prod/js"})
(comp
(cljs :compiler-options {
:devcards false
:optimizations :advanced
:externs ["externs/jquery-1.9.js"]})
(target)))
In this case, if I am running PROD, it will copy all files from env/prod/js into target/
Actually since it's brought up when using sift
with regexs, is the convention for directory separations always /
or is there the chance that it's different like on WIndows with \
?
oh wow, thanks @dimiter
hey dudes, I’m trying to write a library that includes some boot tasks, and I’m trying to test the tasks. I have
(deftest bootstrap
(boot (tasks/bootstrap-db :uri uri)))
and when I try to run the test with boot-test I get Caused by: java.lang.IllegalArgumentException: No implementation of method: :-mk! of protocol: #'boot.tmpregistry/ITmpRegistry found for class: nil
was just wondering if anyone has suggestions for how to get the test running?
@nonrecursive: did you take a look to https://github.com/boot-clj/boot/blob/master/boot/core/test/boot/task/built_in_test.clj? You could take a similar approach. Only thing is that it's only in 2.6.0-SNAPSHOT AFAIK
hadn’t seen that! thanks
Yes @nonrecursive and ask me if anything ok ;)
I'm working on a Boot module right now. Do I need to push it up or is there a way I can install locally to test it in a boot project?
@jupl do you mean a task or a namesapce? In general you install it locally and you require as any other Clojure namespace
Well basically test it as a dependency before I would push it up someplace like Clojars or something. So reference it from another project. I want to make sure if it works all wired up properly.
So yeah, I would suggest to have bootlaces in your project and install locallyz, let me fetch an example for you
Here is my boot-pack-source
: https://github.com/Lambda-X/boot-pack-source/blob/master/build.boot
Hey, when I try to enter the cider debugger it gives me an error, and I cannot fix it until I run (boot.core/load-data-readers!) in the repl
is there a better way to fix this problem with boot? or is that just something people do when they first start the repl
actually I guess I can put (#'clojure.core/load-data-readers) (set! data-readers (.getRawRoot #'data-readers)) after my set-env! in my build.boot and that solves the problem
Yeah, just set up bootlaces dep and then build-jar
@adamkowalski: you can also put that in your ~/.boot/profile.boot
awesome, thanks for the tip!
@adamkowalski: Boot-system does that for you as well.
@alandipert: I've had difficulties with remove-ns
inside boot tasks. Does that ring a bell?
@danielsz: how do you like component vs mount?
@adamkowalski: I like the idea of both, but I've had only experience with component. We're working on integrating mount
in system, too!
very cool, I will definitely check it out because I like the idea of community managed components. seems like a really good way to enforce best practices and quickly set your project up with the various dependencies it might rely on
@adamkowalski: Exactly. That's the idea.
@alandipert: Basically, when I do a require ns-sym :reload
after remove-ns ns-sym
in a boot task I don't see the new code.
@alandipert: I'm currently investigating, but I thought to ask if that sounds like something you've encountered.
I also like the fileset-driven reloading workflow, I saw that there was a problem with the system
task but I have to say that it is awesomely thought out ;)
Bootos to @danielsz
@danielsz: hm unfortunately i don't recall running into that ever