shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Jason 2021-03-03T00:21:15.211Z

Is it possible to specify a path to shadow-cljs.edn in the command line?

lsenjov 2021-03-03T00:23:07.211900Z

Workaround if not:

npx shadow-cljs --config-data "$(cat /path/to/shadow-cljs.edn)"

Jason 2021-03-03T00:27:22.214600Z

I'm trying to sort out multiproject monorepo deps, so i am trying to start via chained namespaces and`clj`like :

clj -M:defaults:dev:ui -A:shadow-cljs watch app 
but I need to say which subproject's app build i mean and have all the paths work out.

1
Jason 2021-03-03T00:28:08.215100Z

so I can't do it with npx

Jason 2021-03-03T01:37:28.217200Z

Or can one add extra :source-paths per build?

thheller 2021-03-03T08:05:37.218400Z

@jasonhlogic this is not possible. either put a separate shadow-cljs.edn into each project or use one at the root

thheller 2021-03-03T08:06:09.219Z

also separating depedencies per build is not something you need to do per build

thheller 2021-03-03T08:06:47.219900Z

each build only uses whatever the build actually requires in the namespaces. you can have thousands of extra dependencies on the classpath, they won't matter as they won't be used.

šŸ‘ 1
denik 2021-03-03T22:47:56.224200Z

@thheller Iā€™m exploring a system where frontend code is generated by the backend and would need to be compiled on the fly. All dependencies of that code would already exist on the frontend. One example is sending a react component as hiccup with handlers that call into frontend code. The backend sends:

'[:input {:type          "text"
          :default-value "foo"
          :on-change     (fn [e]
                           (frontend-ns.state/assoc-in id (.. e -target -value)))}]
which on the frontend should result in a CLJS hiccup vector where the function is a js function compiled from the CLJS counterpart.

šŸ˜² 1