Fork me on GitHub
#kaocha
<
2022-04-12
>
Alys Brooks00:04:03

A new release of Kaocha, featuring bug fixes for gc-profiling and --watch: https://github.com/lambdaisland/kaocha/releases/tag/v1.65.1029

❤️ 1
cjohansen06: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

cjohansen06: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

cjohansen06: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?

cjohansen06:04:20

Now I have a bunch of runtime errors:

plexus14:04:34

@U9MKYDN4Q did you find this repo? it contains a complete working example of kaocha-cljs2 https://github.com/plexus/cljs-test-example

plexus14:04:51

these are the npm packages we install, agreed that this should be documented: https://github.com/plexus/cljs-test-example/blob/main/shadow-browser-kaocha-cljs2/package.json

cjohansen14:04:13

thanks, will have a look later!

cjohansen14:04:20

I only followed the kaocha-cljs2 readme

plexus14:04:08

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.

cjohansen14:04:02

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

plexus14:04:53

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

plexus14:04:21

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

cjohansen15:04:07

they didn’t

cjohansen15:04:25

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

plexus04:04:04

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

cjohansen06:04:53

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

cjohansen06: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 😅

plexus09:04:01

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.

plexus09:04:44

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

cjohansen09:04:00

I completely understand 😅

cjohansen09:04:31

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

plexus13:04:49

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.