Fork me on GitHub
Alys Brooks00:04:03

A new release of Kaocha, featuring bug fixes for gc-profiling and --watch:

❤️ 1
Christian Johansen06:04:21

I’m trying to get kaocha-cljs2 up and running, but after adding the dependency and :preloads to my build config, figwheel fails with this message:

No such namespace: platform, could not locate platform.cljs, platform.cljc, or JavaScript source providing "platform" in file resources/public/js/dev/lambdaisland/funnel_client.cljs

   3              [cognitect.transit :as transit]
   4              [goog.object :as gobj]
   5              [lambdaisland.funnel-client.random-id :as random-id]
   6              [lambdaisland.funnel-client.websocket :as websocket]
   7              [lambdaisland.glogi :as log]
   8              [platform :as platform])

oxalorg (Mitesh)06:04:00

Can you try after doing an npm install platform

oxalorg (Mitesh)06:04:59

or maybe "platform" :as platform

oxalorg (Mitesh)06:04:15

I'm just guessing here, not too sure about it

Christian Johansen06:04:07

Well, the dependency is in the kaocha source somwhere (funnel client from the looks of it) so I can’t change the require. But I’ll try npm installing it

oxalorg (Mitesh)06:04:05

shadow automatically picks up npm modules, I'm not sure how it will work with figwheel though

Christian Johansen06:04:57

Ok, so npm install platform gave me a new error. Then I did npm install stacktrace-js, and now figwheel compiles successfully. Those should probably be mentioned in the installation docs?

Christian Johansen06:04:20

Now I have a bunch of runtime errors:


@U9MKYDN4Q did you find this repo? it contains a complete working example of kaocha-cljs2


these are the npm packages we install, agreed that this should be documented:

Christian Johansen14:04:13

thanks, will have a look later!

Christian Johansen14:04:20

I only followed the kaocha-cljs2 readme


Doc PRs would be super welcome, we never had the chance to properly polish this stuff up. I recently started this example repo so at a minimum people can look at a fully working example and copy bits over.

Christian Johansen14:04:02

I’ll see what I can do if I manage to get it running


note that funnel-client has a deps.cljs which mentions platform, so depending on your cljs build tooling that should get pulled in automatically


and stacktrace-js / stack-trace are in the deps.cljs of chui-core

Christian Johansen15:04:25

I’m using figwheel, with what I imagine is pretty vanilla config


You're in unexplored territory then. Adding : install-deps true to your cljs config may help

Christian Johansen06:04:53

Adding that installed the deps for me, but I still have runtime errors when I run the build.

Christian Johansen06:04:50

I looked at the example repo. I see all the examples use shadow-cljs. I don’t know anything about shadow, so translating to my setup will involve rabbit holing into shadow which is a little out of scope right now 😅


yeah, there's a lot of details to be figured out when trying to get it to run with a specific tool. So far we've focused on shadow-cljs because kaocha-cljs2 was created with shadow in mind, the approach for kaocha-cljs does not work for shadow. If you have a fairly vanilla clojure compiler setup than kaocha-cljs might be a better fit, it's still supported, we use it on several projects as well.


The plan is to expand that repo with more examples, there's a lot of permutations of tool x runtime, I'll see if I can get a figwheel example going next

Christian Johansen09:04:00

I completely understand 😅

Christian Johansen09:04:31

I guess the “2” made me think it superseded the other one, that’s why redirected from kaocha-cljs to kaocha-cljs2


yeah, understandable. It is meant as a successor, it fixes some things that we can't fix in kaocha-cljs, but at the cost of a lot of additional complexity. Kaocha-cljs does not work for everyone, but if it works it's much easier to get going.