Fork me on GitHub
#chestnut
<
2017-09-04
>
vinai08:09:15

How can I add a cljs repl only component to system? I can't add a dependency to dev/user.clj because it's cljs only. Adding it to dev/cljs/user.cljs doesn't have any effect on the reset calls by figwheel, only if I call reset manually in the cljs.user repl.

vinai08:09:23

So... I guess my question is, where are the project.system/go and project.system/reset functions referenced so they are used by figwheel?

vinai08:09:14

Since that is where the init function is called, which specifies the regular production system. I would like to be able to pass a dev-system there.

vinai08:09:40

Ah! :figwheel {:on-jsload "mage2tv.system/reset"} in the project.clj

vinai08:09:34

Maybe I can change that to cljs.user/reset....

vinai09:09:53

hm, nope.

vinai09:09:36

The figwheel sidecar system documentation https://github.com/bhauman/lein-figwheel/tree/master/sidecar also assumes the component is compilable by clojure. No dice getting the cljs only devtools into there... hm. Turning the user.clj into a user.cljc and using reader conditionals doesn't help either because the system config evaluation happens in clojure.

vinai11:09:59

Okay, turns out I was on a wild goose hunt. Making a component for devtools is not necessary, adding :preloads [devtools.preload] to the closure compiler options in the project.clj cljs build config is enough.

vinai11:09:10

Oh well, I guess I learned something.