shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
bendlas 2020-11-02T12:25:34.240900Z

Does anybody here use cljs.spec.test.alpha/instrument? I just ran into an error, where a var only became instrumented, after deleting .cpcache. Just a restart and regular clean didn't help ...

bendlas 2020-11-02T12:31:55.241500Z

adding the ns calling instrument to :cache-blockers should fix it though, right?

thheller 2020-11-02T12:40:39.241900Z

instrument is a rather difficult beast since it is a macro

thheller 2020-11-02T12:41:06.242500Z

it isn't so much about the ns calling instrument, it is more about ensuring that that ns is compiled after all the namespaces you want to be instrumented

thheller 2020-11-02T12:41:23.242800Z

so the ns calling it should directly require all the namespaces

thheller 2020-11-02T12:42:18.243400Z

so I doubt that .cpcache or any cache really had anything to do with it

thheller 2020-11-02T12:42:43.244Z

rather you were maybe instrumenting a var that just happened to still be compiling when instrument was already running due to parallel compile

bendlas 2020-11-02T12:42:53.244200Z

you mean "directly" as in "transitively"? because that's what we already did.

bendlas 2020-11-02T12:44:09.245700Z

I'm using the no-argument version of instrument, that would instrument all specced vars. After adding the transitively dependent namespace, that also calls instrument, to :cache-blockers, it seems fine ..

thheller 2020-11-02T12:44:52.246700Z

yes if you require transitively then the ns calling the instrument might not recompile

thheller 2020-11-02T12:44:57.246900Z

if you require directly it will

bendlas 2020-11-02T12:45:10.247300Z

oof

thheller 2020-11-02T12:45:19.247600Z

so blocking the cache or (ns ^:dev/always this.calls.instrument) works too

thheller 2020-11-02T12:46:00.248900Z

since it is a macro is must be recompiled to reflect the changes done in other namespaces

bendlas 2020-11-02T12:46:11.249Z

ok, that's good. because fn-specs are already used pervasively throughout the project, and will be used even more in the future ..

bendlas 2020-11-02T12:46:31.249200Z

thanks!

Audrius 2020-11-02T17:55:16.250700Z

Hello! I wonder how do you debug (with stepping debuger) CLJS code when compiling with shadow? I use Cursive IDE so it would be also nice to find out how that works with debugging.

thheller 2020-11-02T21:03:51.251500Z

@stebokas it doesn't work. you can use the chrome built-in debugger a little bit but thats about it.

👍 1