shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Aron 2021-06-20T12:33:14.154200Z

this react native thing is difficult to set up

West 2021-06-20T15:04:39.154400Z

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.

thheller 2021-06-20T15:16:23.154700Z

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

thheller 2021-06-20T15:16:59.155100Z

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

thheller 2021-06-20T15:17:26.156Z

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

thheller 2021-06-20T15:18:01.156800Z

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

thheller 2021-06-20T15:18:36.157900Z

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

thheller 2021-06-20T15:18:41.158100Z

so just always load all of them

West 2021-06-20T15:18:57.158400Z

Ok, I thought they would affect build size.

thheller 2021-06-20T15:19:28.159100Z

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

West 2021-06-20T15:19:41.159300Z

Ok, good to know.

thheller 2021-06-20T15:21:31.160400Z

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

West 2021-06-20T15:25:05.161Z

You really do have some good build tools.

☝️ 1
😎 1
2021-06-20T23:59:48.163900Z

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.

😀 1