Fork me on GitHub
#shadow-cljs
<
2021-06-20
>
Aron12:06:14

this react native thing is difficult to set up

West15:06:39

Ok, so I’m trying to wrap my head around how aliases and builds work within shadow-cljs. When I run the command shadow-cljs watch [buildname] I spin up a repl and everything, but it also seems to load the dependencies I specify. It seems like it’s no different that if I ran shadow-cljs -A:test:dev watch test.

{...
 :aliases {:dev  {:extra-deps {thheller/shadow-cljs          {:mvn/version "2.14.5"}
                               refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"}}}
           :test {:extra-paths ["test"]}}}
I have two aliases. In shadow-cljs.edn I’m referring to two aliases. Does this mean I have the option of using these aliases before running shadow? Or does it load all aliases regardless? I usually spin up a node-repl as opposed to loading a build.
{:deps {:aliases [:dev :test]}...

 :builds {:script ...
          :test   ...}}
My expectation was that within each build I could have it point to an alias in deps.edn but there’s no documentation to suggest that’s possible, neither have I found any examples on github.

thheller15:06:23

that is a deps.edn question. not really a shadow-cljs question.

thheller15:06:59

I mean you can just use deps.edn directly if you want

thheller15:06:26

or configure those aliases. the alias are always loaded yes, it is not supported to specify aliases per build

thheller15:06:01

but if you can clj -A:test -M -m shadow.cljs.devtools.cli compile test or whatever if you must have an alias per build

thheller15:06:36

but .. having extra unused dependencies on your classpath does NOT affect your build in any way

thheller15:06:41

so just always load all of them

West15:06:57

Ok, I thought they would affect build size.

thheller15:06:28

they don't. only namespaces you actually :require are compiled. so having test on the classpath always doesn't matter since you never require your tests in your regular buidl anyways

West15:06:41

Ok, good to know.

thheller15:06:31

so really all this deps.edn alias tinkering isn't required for shadow. you can do it if you really want to but you don't have to

West15:06:05

You really do have some good build tools.

😎 2
☝️ 2
Drew Verlee23:06:48

The reloading process (e.g ^:dev/after-load) seems to happen such that my browser defaults (e.g css grid overlay div selected) always get reset. I would like them not to get reset. I'm trying to understand why they are. Currently my mental model is that the page is refreshing. Edit. It's not refreshing, i meant re-rendering, which yes, i'm telling it to do. I dont think i can get that gird selection to stay.

😀 3