This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-13
Channels
- # arachne (2)
- # architecture (23)
- # bangalore-clj (5)
- # beginners (35)
- # boot (79)
- # cider (6)
- # cljs-dev (34)
- # cljsrn (9)
- # clojure (164)
- # clojure-argentina (2)
- # clojure-austin (4)
- # clojure-italy (7)
- # clojure-russia (40)
- # clojure-serbia (1)
- # clojure-spec (76)
- # clojure-uk (36)
- # clojurescript (47)
- # cursive (14)
- # datascript (2)
- # datomic (8)
- # dirac (19)
- # emacs (29)
- # heroku (7)
- # hoplon (35)
- # jobs-rus (1)
- # juxt (2)
- # leiningen (1)
- # lumo (23)
- # mount (4)
- # off-topic (22)
- # om (16)
- # onyx (19)
- # parinfer (10)
- # pedestal (47)
- # proton (5)
- # re-frame (88)
- # rum (1)
- # spacemacs (33)
- # sql (29)
- # uncomplicate (1)
- # unrepl (131)
- # untangled (5)
- # yada (12)
In the Castra template boot.build, why are .clj files in :resource-paths, and everything else is in in :source-paths ?
:resource-paths #{"resources" "src/clj"}
:source-paths #{"src/cljs" "src/hl"})
Can i just mix .clj and .cljs.hl files folders in subjectively named folders, and simply do :source-paths #{"src"}
and have Castra still work?
ps. I have all my static assets in "resources". I had trouble getting .css
files to load from "assets". But this was a while back. Is that ok? Is using "assets" folder still recommended? I noticed it's not specified in the template.
the difference between the :source-paths
and :resource-paths
is that things in :resource-paths
will end up in packaging (like jar files etc) and things in :source-paths
will not
only :resource-paths
stuff shows up in "target"?
Ok. is :asset-paths
still a thing?
it's described in detail here: https://github.com/boot-clj/boot/wiki/Filesets#roles-of-files
So per the first question. Why are .clj files in the castra template in "resources"? You suggested it's not required for the proper war/deployment stuff...?
if you are making a war file for deployment you will want to have the files that will be included in the war have the "output" role
sorry, i meant :resource-paths
. Like in
:resource-paths #{"resources" "src/clj"}
:source-paths #{"src/cljs" "src/hl"})
Yes. I want to deploy a war file to Heroku
So does that mean I put all my app .cljs, .cljs.hl, & .clj files in :resource-paths
?
here is a table that illustrates: https://github.com/boot-clj/boot/wiki/Filesets#fileset-components
the reason the template puts cljs and hl in source paths is because those are converted into javascript as part of the build, and there's no reason to deliver them
vs. the .clj which is both compiled and run on the server after deployment
probably doesn't matter if .cljs ends up in your servlet tho
so there's no hard reason not to put everything in resource-paths
Ok. I see the strata of file roles more clearly.
And that clears up the Heroku war context for me more.
So to paraphrase: .cljs.hl and .cljs
is compiled at boot-compile time by (boot-cljs) and (boot-hoplon)
tasks and do not need to be packaged for the server-runtime context output-role -> war-file -> heroku:deploy
. But in a servlet, there's not much downside to including them (maybe a bit more upload time and war file size). The benefit of this would be to mix .cljs and .clj
files in my namespace structure more freely (without re-jiggering the boot.build path declarations).
👌 sounds legit
another way to strip them out is w/ sift