This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-29
Channels
- # aws (1)
- # aws-lambda (1)
- # beginners (34)
- # boot (61)
- # cljs-dev (126)
- # cljsjs (10)
- # cljsrn (4)
- # clojure (27)
- # clojure-russia (7)
- # clojure-spec (1)
- # clojure-uk (26)
- # clojurescript (42)
- # cursive (31)
- # datascript (4)
- # datomic (16)
- # hoplon (51)
- # klipse (1)
- # lein-figwheel (1)
- # lumo (79)
- # off-topic (16)
- # om (7)
- # parinfer (5)
- # planck (2)
- # re-frame (6)
- # reagent (3)
- # ring-swagger (5)
- # untangled (11)
@sihingkk I found/was told that you have to be doing advanced or some other mode of compilation that results in a single file. When I made that change, I was able to package my Hoplon electron app.
@maxp you can call set-env!
at any point in time but maybe explain what you’re trying to achieve first?
@maxp why do you need that? 🙂
you mean as in separate directory? You can add multiple directories to :source-paths
@maxp
@maxp: if you don't require the sources at runtime you don't need the dependency no?
I think the easiest option might be to compile garden first and then remove the garden related files using sift
when I have some file in source tree with (:require garden ) I should put it into dependencies
Only way around this is that the namespaces you aot compile don't require garden
No other way around this
Yes and that would solve nothing
There is probably some other difference here, or some difference in how aot compilation works
What namespaces have you defined your aot
task to compile?
Only single main namespace?
Yeah, that is the problem
That will AOT compile garden
Or the css namespaces, which will in turn require garden
The source/resource-paths can only be modified outside of the Boot pipeline (the tasks combined with comp
)
Inside this pipeline tasks access the state through fileset
Fileset is created when Boot is invoked (or in watch case, when a file is changed) and changes to source/resource-paths during the build won't affect fileset
BUT because aot
task also uses fileset to fild all namespaces, you could filter unwanted files from fileset before aot
task and add them back to fileset after the task
Then aot
wouldn't see them
(comp ... (with-filter (complement #(re-find #"^garden-files/" (b/tmp-path %)) (aot)))
(`with-filter` doesn't exist, but there are examples on how to implement it)
But it would be easier to just define single namespace to aot
compile, unless you really need to aot
compile everything to save a few seconds at app startup
You probably have your clojure source in source-paths
instead of resource-paths
files in resource-paths
will be included in output
If you don't use aot
In my experience Clojure apps (at least server apps) only use AOT compilation to compile single main namespace: https://github.com/Deraen/saapas/blob/master/src/clj/backend/main.clj
And the Clojure will compile other namespaces runtime
AOT compilation can cause hard to debug problems with macros
And you'd anyway find compile problems when running tests, as that would probably compile all or most namespaces
Or when developing the app using repl
Well then, here is a with-files
function which wraps a task so that is only sees part of the fileset: https://github.com/Deraen/less4clj/blob/master/build.boot#L26-L41
if you can filter the garden files using a path filter that should work
Unfortunately the temp files in fileset don't know about their original source-path, so you can't use that for filtering
I've got a macro that is used during CLJ and CLJS build. It's using an atom that holds some state which I would like shared across it. I'm led to believe that CLJ and CLJS uses two different JVM's which means that this atom has two different states. Is it possible to share the state with the atom using something like pods? Or is it better for me to just persist the state to disk at the end of Clojure JVM and pick it back up at start of CLJS JVM?
Thinking of using this to put the atom on disk. https://github.com/alandipert/enduro