This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-04
Channels
- # admin-announcements (14)
- # aleph (3)
- # beginners (75)
- # boot (95)
- # carry (4)
- # cider (23)
- # clojure (39)
- # clojure-android (3)
- # clojure-brasil (2)
- # clojure-dev (17)
- # clojure-gamedev (1)
- # clojure-mexico (12)
- # clojure-poland (12)
- # clojure-romania (1)
- # clojure-russia (10)
- # clojure-spec (8)
- # clojure-uk (36)
- # clojurescript (34)
- # core-async (4)
- # datomic (40)
- # emacs (1)
- # events (7)
- # hoplon (119)
- # instaparse (52)
- # keechma (71)
- # mount (4)
- # off-topic (9)
- # om (4)
- # onyx (3)
- # other-languages (23)
- # protorepl (3)
- # re-frame (9)
- # reagent (26)
- # rethinkdb (5)
- # spacemacs (2)
- # testing (1)
- # yada (1)
@myguidingstar: you should go to boot.user
and trigger a (boot (task) (task))
what's the best boot way to get started on a reagent app?
I tried http://escherize.com/2016/02/29/boot-with-cljs/ but get errors... "clojure.lang.ExceptionInfo: template already refers to: #'boot.core/template in namespace: adzerk.boot-reload"
@timothypratley: what command causes that? Was it:
boot -d seancorfield/boot-new new \
-t tenzing \
-a +reagent \
-n escherize-cljs
hmmm nope, I think that part worked fine, boot dev
is where things went wrong for me... I must have some config messing it up
19:56 $ boot --version
#
#Sun Jul 03 19:56:14 PDT 2016
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.6.0
yes: boot.properties cache profile.boot.bak (I moved it just in case it was messing with me)
# bcm @ brmbp in ~/dv/escherize-cljs [12:58:02] C:130
$ cat boot.properties
#
#Mon Jul 04 12:56:22 EST 2016
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.5.5
BOOT_EMIT_TARGET=no
hmmmm maybe I should change boot versions
groovy no rush, I'll try different versions, that will no doubt fix it
thanks for the help š
upgrading https://github.com/adzerk-oss/boot-reload to version 0.4.11 resolved it
@timothypratley: you can do (ns-unmap (the-ns 'boot.core) 'template)
as a workaround, if nothing else solves it
ooo nice, thanks š handy to know
I like the new HUD š
Alright, guys. I need some help with boot-cljs. The output of the task has bitten me several times and I canāt seem to figure out how to get the JS file compiled & served properly because there are so many complected settings that interact and touch the same things, like output-to vs output-dir vs asset-path vs .cljs.edn and whatās required in there - besides no target files are visible even though it compiles fine. Iām sure itās simple and I misunderstand a lot of it, but I struggle to get it working.
In my project I have a ~/resources/public
path, so I have this in my compojure api setup:
(route/resources "/resources" {:root "publicā})
Then I have ~/src/cljs/js/main.cljs.edn
, which contains:
{:require [myproject.core.init myproject.core.app]
:compiler-options {:asset-path "cljs/out"
:output-to "resources/public/cljs/out/main.js"
:output-dir "resources/public/cljs/out"
:parallel-build true}}
And in build.boot I have,
(set-env!
:source-paths #{"src/cljs" "src/clj" "test"}
:resource-paths #{"resources"}
:target-path "target"
:dependencies ā[...
finally, with (cljs :ids #{"js/mainā})
under my ādevā boot task.
Everything compiles fine, but my compiled .js file is not at /resources/cljs/out/main.js
as I would expect. Actually I have no idea where it is because it is invisible or āin the JARā.
What is going on with my project and how do I figure out where my minified JS file will be available at?OK, after some modification and after adding (target)
to my dev task, I can now see that cljs is outputting files to target/js/main.out/
, but its root main.js is referencing <script src="js/out/goog/base.js"></script>
instead of js/main.out/ā¦
Why does it do this? It knows where itās putting the files, why does it use the wrong folder?
for the specific reason that these options are strongly coupled in weird ways in the compiler
High-level goal is to get my cljs app working without 404s on the files that it compiled
@petrus: Don't use output-to and output-dir with boot-cljs
I worked from saapasā template: https://github.com/Deraen/saapas/blob/master/src/cljs/js/main.cljs.edn
I took out the settings for :output-to
and :output-dir
. Now I have simplified to this:
:compiler-options {:asset-path "js/out"
:parallel-build true}
My index page lives at / and is generated by compojure. It loads but canāt find all the deps. My resources path is working because I can load, http://localhost:10555/cljs/out/goog/base.js, but base.js references cljs/out/goog/base.js, whereas the folder structure is cljs/main.out/goog/base.js
Note: the āmain.outā instead of /out. I suspect this has to do with (cljs :ids #{ājs/mainā})
No it lives at / and is generated by compojure
(GET "/" []
(-> (ok pages/index-page) (content-type "text/html")))
What about your resources route?
(route/resources "/js" {:root "jsā})
(I went back to saapasā template)
Ah, try: :asset-path "js/main.out"
, or even without asset-path
Boot-cljs should set asset-path automatically, though it doesn't always work correctly
Yeah, I wonder why I have it set at Saapas
You probably have it set because cljs has no knowledge of resources folder.
I took out :asset-path and now base.js is trying to load /main.out/cljs_deps.js etc. instead of /js/main.outā¦
it does load a relative path, but relative to the index.html, which is at /
hmmm still
BOOM fixed with :asset-path "/js/main.outā
but if you put the js file in the same dir as the html file it's very simple for tools to figure out on their own
and like i said it's totally an implementation detail, no real benefit in making that fancy
Well, that is not completely true, I still depend on classpath prefix for serving files
Would be extra work etc. and I this case I prefer using the same solution as always
Works for me
Yeah, IIRC our own Shim worked correctly
It is on my list to fix this, with own shim or some other solution, I'll rather support all (most) configurations rather than explain thousand times why something is not supported š
also i'm working on a simplified ns macro for cljs, that handles the macros and all that transparently, with :refer :all and :use :exclude support
If you write some ideas down I can look at them, but I'm not yet ready to completely put my mind into next Boot-cljs/reload
It's been super busy year and I still have few days work before summer vacation
For the first two weeks of vacation I'll probably be mostly offline but then I might start looking this
@juhoteperi: @micha: the thing about programmers, everything is basically an extension of work š
about the next boot-cljs
it would be great to include cool error messaging, I'd love to help with that
Compilation errors like in Figwheel or configuration errors? Or both?
Compilation errors
I guess there is some change that the spec for configuration will be added upstream
both of course is ideal, I don't know if it's worth it
And there is good change I'll leverage Figwheel client code
yeah exactly
if this goes upstream of course there is no point in doing it now