Fork me on GitHub
#cljs-dev
<
2018-12-07
>
richiardiandrea15:12:29

Question: does :elide-asserts trim away instrument calls?

dnolen16:12:18

we don't use assert for instrument

dnolen16:12:29

:elide-assert only applies to assert

richiardiandrea16:12:16

@dnolen great thanks! can you think of any compiler switch which would disable instrument ? I would actually like to enable some in production but I do not seem to be able to

mfikes16:12:56

Slightly related: :elide-asserts will also affect cljs.spec.alpha/assert :spec-skip-macros is the only spec-checking related compiler flag, but it is a compile time thing (https://clojurescript.org/reference/compiler-options#spec-skip-macros) Otherwise, instrumentation at runtime is… runtime

borkdude16:12:07

you could elide loading the fdefs themselves in a prod build

borkdude17:12:45

@richiardiandrea put the fdefs in a different namespace or wrap in some conditional?

borkdude17:12:54

and only load that namespace in dev

richiardiandrea17:12:34

oh ok yeah, I thought there was a compiler mechanisms...my goal is to do the opposide...I do not see them happening at runtime in prod...but thanks 😄

borkdude17:12:54

so you want to instrument in prod?

borkdude17:12:26

what’s different about your prod build, only the optimizations?

richiardiandrea17:12:47

yeah well I use :simple basically

borkdude17:12:20

maybe debug by printing the result of (stest/instrument) to the console.

richiardiandrea17:12:35

oh good idea thank you!

borkdude17:12:45

are you on 439?

dnolen18:12:56

@richiardiandrea there's no compiler flag for this but I don't know if that's needed anyway

dnolen18:12:10

you can put your instruments in an ns that you don't require in production

richiardiandrea18:12:30

ok cool thank you