This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-22
Channels
- # aatree (21)
- # announcements (10)
- # avi (1)
- # aws (15)
- # beginners (96)
- # boot (269)
- # braid-chat (92)
- # cider (9)
- # clara (10)
- # cljs-dev (3)
- # cljsjs (14)
- # cljsrn (20)
- # clojure (198)
- # clojure-art (3)
- # clojure-hamburg (2)
- # clojure-ireland (4)
- # clojure-russia (117)
- # clojure-spain (3)
- # clojured (1)
- # clojurescript (253)
- # code-reviews (6)
- # community-development (7)
- # conf-proposals (52)
- # core-async (4)
- # cursive (4)
- # datomic (4)
- # devcards (1)
- # emacs (59)
- # euroclojure (5)
- # funcool (1)
- # hoplon (39)
- # human (1)
- # jobs (4)
- # ldnclj (15)
- # ldnproclodo (1)
- # leiningen (3)
- # mount (37)
- # off-topic (14)
- # om (77)
- # perun (10)
- # proton (12)
- # rdf (1)
- # re-frame (9)
- # reagent (42)
- # ring-swagger (10)
- # yada (50)
it is too bad no Clojure jar
has corresponding has _source
ah right, there is no need 😄
all the sources are already there unless you AOT right?
i was checking in the jars directly but your version is better 😄
yes that exactly I stated in my post here I am trying to solve: http://blog.scalac.io/2015/12/21/cljs-replumb-require.html
do nested comp
s flatten? e.g is (comp (task1) (comp (task2) (task3)))
equivalent to (comp (task1) (task2) (task3))
?
hmmm I’m guessing “yes”, b/c I just tried it w/ some transducers, and it seemed to work
well...it is not flattening per se, you are just applying functions to functions 😄
hi everyone How to avoid creation of main.out subdirectory in target dir for cljs task (for production builds)?
@nayzak: You can use sift
to filter which files are included in output
It’s looking like a problem with the way I wrote my code that doesn’t allow for it to be reloaded. If anyone has any ideas or an inkling, I can show my code as well.
Strangely, I’ve tried checking out a previously bug free commit, and after a couple cljs changes the browser is showing that error again, so now I’m really confused.
@sooheon: could be the file is reloaded before it's present. I.e. reloading event is sent but you already initiated a new build (by changing a file) and so the requested file isn't there anymore
@sooheon: does it persist after modifying a file again?
@martinklepsch: it appears some time after the first modification, and then recurs after every subsequent one.
@sooheon: how are you serving files? mind pasting your build.boot?
I don't have any good ideas right now. I'd suggest opening an issue. Ideally provide a minimal case. If you can't some relevant code snippets might also help
I know that boot show -d
will show me the dep tree, was there another command to show conflicts? I’m getting a version conflict warning but I can’t seem to find where it originates
@sooheon: boot show -p/--pedantic I believe
@sooheon: boot show --help
should list it
@martinklepsch: ah thanks :) was only looking at boot -h
.
@sooheon: in general all tasks have a -h/--help
option
Is anyone having this error ?
boot -u
/usr/local/bin/boot: array assign: line 1: unexpected EOF while looking for matching `"'
/usr/local/bin/boot: array assign: line 3: syntax error: unexpected end of file
Ah I think you are right :
echo $BOOT_JVM_OPTIONS
-Xmx2g -client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}
So it should be
[ -Xmx2g -client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:-OmitStackTraceInFastThrow -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl} ]
Thanks Hi guys, I’m trying to setup :compiler options
like this :output dir “resources/public/js/compiled/out"
but after running my task boot gives me a warning WARNING: Replacing ClojureScript compiler option :output-dir with automatically set value.
Do you know where the problem can be?
Hey @dajana, with boot-cljs
you usually don't set :output-dir
directly
@dajana: whats your motivation to set it?
so the easiest way to do that is to create a .cljs.edn file as described here https://github.com/adzerk-oss/boot-cljs/wiki/Usage#multiple-builds
(ignore the Multiple builds
thing for now)
this is how my code looks like
(deftask dev
"Start the dev env..."
[]
(set-env! :source-paths #{"src/clj" "src/cljs"})
(comp (serve :dir "resources/public")
(watch)
(speak)
(reload :on-jsload 'cljs-repl-web.core/main)
(cljs-repl)
(cljs :compiler-options {:closure-defines {"goog.DEBUG" false}
:source-map :true
:output-to "resources/public/js/compiled/main.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:main "cljs-repl-web.core"
:optimizations :none
:source-map-timestamp true
})))
if you want the compiled file to end up in your resources in public/js/
then you need to put the cljs.edn file into resources/public/js/my-build.cljs.edn
@dajana there is an example there https://github.com/Deraen/saapas/blob/master/src/cljs/js/main.cljs.edn which I found useful.
basically anything related to where files end up is handled by .cljs.edn — I have to leave now unfortunately but I'm sure you'll figure it out
yes, sure... thanks a lot @martinklepsch
Starting to work with (test-cljs :update-fs? true :js-env :phantom :namespaces '#{aautil.simple-test})
Getting this error:
WARNING: Replacing ClojureScript compiler option :main with automatically set value.
ò output.js
clojure.lang.ExceptionInfo: clojure.lang.ExceptionInfo: ERROR: No such namespace: main.out.cljs.core, could not locate main/out/cljs/core.cljs, main/out/cljs/core.cljc, or Closure namespace "main.out.cljs.core" in file C:\Users\Bill\.boot\cache\tmp\Users\Bill\Documents\aatree\aautil\6uo\9p5por\boot\cljs\main1055.cljs at file boot\cljs\main1055.cljs
It could be my test:
(ns aautil.simple-test)
(println "hi!")
But basically I am clueless. 'elp!
It's all been pushed here: https://github.com/aatree/aautil/
(set-env! :dependencies '[[org.clojure/clojure "1.8.0" :scope "provided"] [org.clojure/clojurescript "1.7.228" :scope "provided"] [org.clojure/tools.logging "0.3.1"] [org.apache.logging.log4j/log4j-core "2.5" :scope "test"] [org.apache.logging.log4j/log4j-slf4j-impl "2.5" :scope "test"] [adzerk/bootlaces "0.1.13" :scope "test"] [adzerk/boot-test "1.1.0" :scope "test"] [adzerk/boot-cljs "1.7.228-1" :scope "test"] [crisptrutski/boot-cljs-test "0.2.1" :scope "test"]] :source-paths #{"test/cljs" "test/clj" "dev-resources"} :resource-paths #{"src/clj" "src/cljs" "src/cljc"}) (require '[adzerk.boot-cljs :refer [cljs]] '[adzerk.bootlaces :refer :all] '[adzerk.boot-test :refer :all] '[crisptrutski.boot-cljs-test :refer [test-cljs]]) (def +version+ "0.0.1") (bootlaces! +version+ :dont-modify-paths? true) (task-options! pom {:project 'aatree/aautil :version +version+ :description "Snippets of useful code." :url "https://github.com/aatree/aautil" :scm {:url "https://github.com/aatree/aautil"} :license {"EPL" "http://www.eclipse.org/legal/epl-v10.html"}}) (deftask dev "Build project for development." [] (comp (build-jar))) (deftask test-it "Setup, compile and run the tests." [] (comp (cljs) (test-cljs :update-fs? true :js-env :phantom :namespaces '#{aautil.simple-test}) ; (run-tests) )) (deftask deploy-release "Build for release." [] (comp (build-jar) (push-release)))
it would be easier to see if you paste into a slack "snippet", or perhaps https://www.refheap.com/
Here's the output: https://www.refheap.com/4f18c624fbe0b05b892aaf36b
So I get the feeling that test-cljs might be looking for a test to run? I don't think it is cljc stuff.
I've dropped most of my code, same error: :source-paths #{"test/cljs"} ; "test/clj" "dev-resources"} ; :resource-paths #{"src/clj" "src/cljs" "src/cljc"} )
Hmm I wonder what causes the warning about :main
option
Not sure, but I don't think so
Perhaps I need to specify a sourcemap on the cljs? This gives lots of errors: (cljs :source-map)
but cljs -s is shown int the cljs example here: https://github.com/adzerk-oss/boot-cljs/wiki/Example
When you define options in Clj you need to provide them as keyword arguments: (cljs :source-map true)
I can reproduce the error
Oh right, I already almost forgot, but it seems that I found the problem
Problem is not with (test-cljs)
It fails when running (cljs)
If you only want to test cljs, you don't need to use (cljs)
because (test-cljs)
already embeds (cljs)
task
with proper options
When you directly use cljs task it will by default require all cljs namespaces, which is often bad idea
With libraries you don't really "want it all", only time you compile cljs in library project is for testing
C:\Users\Bill\Documents\aatree\aautil>boot test-it Writing clj_test\suite.cljs... Writing output.cljs.edn... Compiling ClojureScript... WARNING: Replacing ClojureScript compiler option :main with automatically set value. ò output.js Running cljs tests... ERROR: doo was not loaded from the compiled script. Make sure you start your tests using doo-tests or doo-all-tests and that you include that file in your build C:\Users\Bill\Documents\aatree\aautil>
With applications you would use (cljs)
to compile the application and then (test-cljs)
to compile and run tests
Not sure if that's Windows problem, I see Ran 0 tests containing 0 assertions. 0 failures, 0 errors
Then you use test-cljs and run-tests tasks
Hi guys, now I have my :compiler-options
in resources/public/js/main.cljs.edn
and main.cljs.edn
looks like
{:require [something.core]
:init-fns [something.core/main]
:compiler-options {:output-to "resources/public/js/compiled/something.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:main "something.core"
:closure-defines {"goog.DEBUG" false}
:source-map :true
:source-map-timestamp true}}
and my task (deftask dev
"Start the dev env..."
[]
(set-env! :source-paths #{"src/clj" "src/cljs” “resources/public"})
(comp (serve :dir "resources/public")
(watch)
(speak)
(reload :on-jsload 'something.core/main)
(cljs-repl)
(cljs :ids #{"js/main"} :optimizations :none)
))
But ClojureScript is still compiled into target with warnings
WARNING: Replacing ClojureScript compiler option :output-dir with automatically set value.
WARNING: Replacing ClojureScript compiler option :output-to with automatically set value.
WARNING: Replacing ClojureScript compiler option :main with automatically set value.
Any ideas what I am doing wrong?@dajana: You can't use those options with boot-cljs, they are always automatically determined based on location of .cljs.edn file inside fileset
does boot-cljs
not respect the target
task? it doesn’t look like it’s putting things in the right place
You should not compile it into resources
, it doesn't make any sense with Boot
Unlike with Lein, in Boot the tasks manage temporary files and classpath themselves so you don't need to manually set up paths so that the resulting files would be available in classpath
It is done automatically
JS files created by cljs
task are available in classpath and you can serve the files from there
This is probably better explained in wiki and some tutorials
dajana: Yeah remove most of compiler-options, remove resources/public
from source-paths and remove :dir
option from serve task
if I do “BOOT_EMIT_TARGET=no” then the compiled js doens’t get emitted at all, and if I don’t do it, then the compiled js ends up in target
, even though I have a target
task that indicates that everything should go into the build
directory
serve
task will serve files from classpath if you don't provide it with dir option
the target task only emits things it gets in the fileset that is passed to it by the previous task
@dajana: You might want to use :resource-root "public"
option with serve, so that contents of public prefix in classpath are server in web server root
so @micha @juhoteperi would it make sense to (comp (serve :dir "somedir") (target :dir "somedir") ....
?
and if you have resources folder and you want to serve some static files from it, you should use have resources
in :resource-paths
, this way the files will be correctly under public folder in classpath
@micha: Boot was supposed to disable colors on Windows? I'm still seeing plenty garbage
@juhoteperi: where are you seeing garbage?
At least when downloading deps
Yeah no color codes on log messages but they are present in aether(?) messages
@juhoteperi: can you try 2.6.0-SNAPSHOT on your windows machine please?
ha, not sure how to set env variable on windows
argh, how do I edit an file, no vi
I need to install bazillion apps to test boot-cljs-test on windows
java, boot, git, node, phantomjs...
about this, it would be great to have a docker with all these things in it
I know. I use Windows so rarely that I haven't tried it.
@juhoteperi: what's your address? i can mail you a slackware dvd
sorry, set of floppies
Will you send me a dvd/cd/floppy drive also?
I just refurbished the old drive I had to remove from my laptop to make space for an hd 😄 2$ and a sata 7/13 pin to usb cable ! 😄 😄
If I just find out how to remove files so I can see what happens when it downloads deps again...
@micha: 2.6.0-SNAPSHOT, no change
but snapshot sees your files when you use the watch task, etc? otherwise not terribly broken compared to 2.5.5?
@micha: I don't get that far yet that I could see if watch works 😄 boot-less seems to be broken in Windows
guys I was enhancing the boot doc and I want some help about add-cached* functions, what does cached exactly means here?
@richiardiandrea: that's currently used by the uber task
for efficiency it would be good to cache the unzipped files in a way that they can be added to the fileset again later without needing to look in the jar or extract anything
and the contents of jars can be cached because jars are, ingeneral, immutable artifacts
which takes the following args: fileset
, cache-key
, seedfn
, and the normal :include
, :exclude
, and :mergers
kwargs
clever, I think I will need it too in my task
so add-cached-source
:
> "Same as add-source but tries to store files in the cache area for more efficient retrieval. Refer to add-source for the accepted options"
like if you don't choose a good cache key there will be all kinds of problems that are difficult to debug
ok, I can leave FIXME
as well for now, just change the add-*
@micha: for with-eval-in
I wrote:
> Note2: The macro returned value will be nil unless it is
printable/readable. For instance, returning File objects will not work
as they are not printable/readable by Clojure.
Is this true also for with-call-in
?
@richiardiandrea: you rule for working on docs btw,
ahahha thanks, it is the minimum one can do for such helping people 😄
A question if you guys know, what scope is used by default when you include a package in lein :dependencies
?
In clojurescript for instance I see [com.google.javascript/closure-compiler "v20151216"]
which make me wonder...
ah ok thanks
so if I understood correctly
(core/add-cached-resource
xs (digest/md5 jar) (partial pod/unpack-jar jar)
:include include :exclude exclude :mergers merge)
first unpacks then applies include
and exclude
on the java.io.File
right? But on what does it match? getAbsolutePath
?my problem is, I am doing:
(comp
;; see boot's uber task
(built-in/uber "-j" as-jars "-i" clj-inclusions "-e" clj-exclusions)
(built-in/show "-f"))
but my show just shows the content of src
, maybe not all the fileset content is shown?so I remove -i
and -e
it actually works, meaning that I my regex are never successful
-i
does not seem to work here...I am going into digging mode
works from the command line...digging digging
@richiardiandrea: add-cached-* does't unpack anything
yes, I am following the code, it is very readable, only (built-in/uber "-i" #{#"goog\/.*\.js$"})
does not work for me at the moment
but boot uber -i 'goog\/.*\.js$'
works
that's the problem then, let me try again
what if I want to pass in a set?
well because I am a boot nOOb
(BTW I don't know why but doc
does not work in my boot repl)
(but I will debug another time)
it works!
I mean uber
as usual, thanks