chestnut

vinai 2017-09-04T08:50:15.000389Z

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.

vinai 2017-09-04T08:55:23.000208Z

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

vinai 2017-09-04T08:56:14.000050Z

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.

vinai 2017-09-04T08:57:40.000095Z

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

vinai 2017-09-04T08:58:34.000278Z

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

vinai 2017-09-04T09:04:53.000100Z

hm, nope.

vinai 2017-09-04T09:19:36.000072Z

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.

vinai 2017-09-04T11:34:59.000076Z

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.

vinai 2017-09-04T11:35:10.000295Z

Oh well, I guess I learned something.