day8 / re-frame-debux

A fork of debux for tracing re-frame code (for eventual consumption by re-frame-10x)
Eclipse Public License 1.0
43 stars 7 forks source link

Include all trace - don't filter out the noisy bits #36

Open mike-thompson-day8 opened 4 years ago

mike-thompson-day8 commented 4 years ago

When a form, like (inc 1) gets evaluated, it happens in three steps:

  1. every element of the list is evaluated ... that means inc gets evaluated and 1 gets evaluated. inc is a symbol and it will evaluate to what it is bound to ... which is a function. and 1 will evaluate to 1
  2. the function that inc evaluated to is called with 1 as the actual parameter
  3. the return value of the function is what the form evaluates to

Now .. this library isn't showing ll of this evaluation trace currently. We specifically skip the evaluation of inc and 1 because it isn't interesting. And that's a good thing. Otherwise, the evaluation trace shown in re-frame-10x would be too noisy. And anyway, how would we indicate that inc is a function?

So ... our current approach is very understandable ... but it is inaccurate by omission.

However ... there might be cases, (when using this library outside of the re-frame-10x setting, where we would want to show ALL the trace, not the simplified version. Perhaps in a situation where we are trying to teach ClojureScript. So we might want to be able to configure the generation of trace to include or exclude these noisy bits. OR produce all the trace all the time, but tag some of it as "noisy" so it can, optionally, be filtered out of what is shown to the experienced users in re-frame-10x.