This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-21
Channels
- # beginners (201)
- # boot (125)
- # cider (3)
- # cljs-dev (21)
- # cljsrn (165)
- # clojars (8)
- # clojure (332)
- # clojure-belgium (1)
- # clojure-gamedev (8)
- # clojure-russia (75)
- # clojure-spec (25)
- # clojure-uk (96)
- # clojurebridge (2)
- # clojurescript (130)
- # code-reviews (16)
- # cursive (26)
- # datomic (20)
- # devops (6)
- # emacs (6)
- # hoplon (90)
- # jobs (9)
- # luminus (2)
- # off-topic (4)
- # om (65)
- # onyx (5)
- # pedestal (4)
- # protorepl (6)
- # re-frame (34)
- # reagent (12)
- # ring (4)
- # ring-swagger (7)
- # specter (2)
- # test-check (8)
- # untangled (2)
- # vim (1)
- # yada (6)
can anyone teach me how to use crisptrutski.boot-cljs-test
with om.next app? I can’t make it run tests in headless, it throws: `ReferenceError: Can't find variable: React
<phantomjs://code/phantom5076976565885293384.js:81> in onError`
tried setting task options like this:
test-cljs {:js-env :phantom :optimizations :simple
:cljs-opts {:preamble ["react/react.min.js"]
:externs [”react/externs/react.js"]}}
still nothing@ag what if you try :optimization :none
or :whitespace
?
yep it looks like there is not :optimizations here: https://github.com/crisptrutski/boot-cljs-test/blob/master/src/crisptrutski/boot_cljs_test.clj#L152
it would be great to uniform that, but I always check with boot task -h
the options
@richiardiandrea test-cljs
has :optimizations
key, you linked to a subtest which just runs (the already compiled) tests
@ag sounds like you found a bug? definitely working with moved key?
hello everyone! how do we move files between different filesets? say we have two tasks. each of them builds it’s own jar with different classes. each task must sift fileset to have only it’s input, produce jar and then move it to main fs. is this a way to do such things in boot BTW?
I have a clojurescript/node project and I’m seeing this: WARNING: Replacing ClojureScript compiler option :output-to with automatically set value. WARNING: Replacing ClojureScript compiler option :main with automatically set value. My settings:
(deftask development []
(task-options! cljs {:optimizations :none
:compiler-options {:main 'reagnarok.app
:target :nodejs
:output-to "main.js"}
:source-map true
})
identity)
Also using :optimizations :advanced
cause cli arguments not to be passed to my script
$ node main.js foo bar
Newbie (foo bar)
<div>Hifoo</div>
$ node main.js foo bar
Newbie nil
<div>Hi</div>
@borkdude you don't wnat to use :output-to
, because the boot task needs to be able to set that
@crisptrutski oooops weird sorry
From #clojurescript I learned :simple
is supported for node, but :advanced
can cause problems.
:main
is not supported because boot-cljs creates it's own namespace and sets that as :main
@borkdude also there's little need for adv compilation in node
:main
might be supported in future, but it is surprisingly hard to properly support as Boot-reload/cljs-repl use cljs.edn :require
: https://github.com/adzerk-oss/boot-cljs/pull/143 (ping @anmonteiro, I think you asked about this at EuroClojure)
👍 I did
It is easy enough to update boot-reload/cljs-repl to use :preloads
but unfortunately :preloads
are loaded early, and :require
s after the app code has been loaded
One very easy way to support :main
would be to just append that namespace to :require
and still write the Boot-cljs shim namespace
@juhoteperi I'm also OK with having :main
only work for release builds
(where you don't use boot-cljs-repl
or boot-reload
)
at least for a first attempt to making all this work
Hmm. Right. I'll think about this.
I would like to include Gulpfile.js from the project directory into the target directory. I tried:
(task-options!
speak {:theme "woodblock"}
sift {:to-asset #{"index.html" “Gulpfile.js”}})
and also :include
instead of :to-asset
. It only copies index.html@borkdude I think you would need the directory that contains Gulpfile.js
to already be in the fileset before you can work with it via sift
i.e. you need to set that in set-env!
not in task-options!
. Maybe you could put your Gulpfile.js
in a subdirectory and add that to the resource-paths?
Hello guys
Quick question: I have a junit dependency under dev-dependencies but when I'm building the jar, it packs the junit jar
How should I declare the dependency so it doesn't go with the final jar?
hi all, I see the wiki says that boot will work on windows 10. Just curious has anyone tried on windows 7?
@iago.b2wdigital are you making an uberjar?
Well I'm actually doing that
The other dependencies with :scope "test" are not being packed
but the junit is =/
just a sec
you can find out which things to add :exclusions
to by running show -d
after the first pass
Ok, thank you 😃
Hah, cool, I now have this workflow working: boot watches files, re-compiles cljs -> target/main.js, gulp is watching main.js, kicks of node which generates new html file with main.js, gulp reloads browser
https://www.dropbox.com/s/7gn4uqj6iy1ysfs/Screenshot%202016-12-21%2020.09.15.png?dl=0
@iago.b2wdigital i don't see where you're calling set-env!
multiple times?
@micha I’m using boot-reload in my normal cljs projects, yes. Can it reload an html file in the browser instead of hot-reloading js?
Also, tried to remove the dep and it's still packing junit 😢
@micha looks like it's the [expectations "2.0.9"] calling junit lol
changed the scope of expectations to test
@micha just a note: expectations showed junit dependency just when I removed junit from dependencies
boot reload probably only appends something to browser clojurescript, which I’m not using
@borkdude does figwheel reload the HTML?
Because I am working on importing it in boot-reload
Ok I Will check
I am hoping to solve all these problems at the same time: https://github.com/adzerk-oss/boot-reload/pull/105
I am going to need a mixed node +browser project as well btw so i hope to push this to completion soon
so this comes down to figwheel replacing the functionality in boot-reload so efforts are not duplicated?
So for instance HTML reloading could end up in figwheel directly
I am importing the client only
So only cljs code
It would be great to test it as it is as well, so that I catch bugs and missing stuff early
hello folks - we have a too big one build.boot here, getting bloated. are there any examples out there how to put each deftask in a single file somewhere else?
some advice on that would be great
@michael.heuberger perhaps make a directory in your project, src/myproject/tasks.clj
and then in your build.boot: (require '[myproject.tasks :as t])
thanks - is this the recommended way from the boot-clj makers?
yes i decree it 😄
the only other thing to be aware of is that in boot.user
, the namespace that build.boot gets eval'd in
boot.core namespace is automatically refer'd
so you don't need to namespace-qualify e.g. deftask
so in your myproject.tasks
ns you need this at the top:
(ns myproject.tasks
(:require [boot.core :as core]))
(core/deftask foob ...)
(or whatever permutation yuo want)
😄 I do the same in lambone
: https://github.com/Lambda-X/lambone/blob/master/resources/leiningen/new/lambone/common/dev/boot.clj
thanks guys - wow this one is a good example, nice with multimethod
yeah I found it very useful 😄 it is similar to flavors in android projects
also I really would like at some point to be able to avoid this -> https://github.com/Lambda-X/lambone/blob/master/resources/leiningen/new/lambone/common/dev/boot.clj#L133 so that the task can maybe get the arguments from the map under its own namespaced keyword (?) like:
(def opts {:boot.task.built-in/repl {:init-ns 'dev :port 5055}
:boot.task.built-in/jar {:main 'data.core :file \"dada-standalone.jar\"}
:boot.task.built-in/aot {:all true}})
(comp (aot opts) (jar opts))
oh man, formatting lol
of course maybe with aliases to reduce verbosity
it is a simple convention but I found it very powerful
Yes but baked would be nicer 😀 if you like the idea of course 😅
you could say he's "partial" to higher order functions 😁