Users caught by this change should receive a clear compile-time error.
Apologies for the nuissance!! This change is part of a final review
of names before the release of v1 final.
Users caught by this change should receive a clear compile-time error.
Apologies for the nuissance!! This change is part of a final review
of names before the release of v1 final.
Users caught by this change should receive a clear compile-time error.
Apologies for the nuissance!! This change is part of a final review
of names before the release of v1 final.
Motivations:
- "xfn" is a lot shorter than "middleware", making it more
convenient to use at signal calls, compare:
(log! {:middleware my-fn} "msg")
(log! {:xfn my-fn} "msg"}
- "middleware" was originally chosen to match Timbre's terminology,
but actually carries some misleading connotations that in hindsight
are probably better avoided while we still have the chance to change
this.
This change will only affect rare advanced users that depend on
the return value of `log!` or `event!`. For all other users this
will be a non-breaking change.
Before this commit:
`log!` and `event!` returned true iff signal was allowed.
After this commit:
`log!` and `event!` now ALWAYS return nil.
`log!?` and `event!?` have been added that keep the old behaviour.
Motivation:
It's pretty rare to use the return value when generating log or event
signals. I originally included the return value since it CAN be handy,
and I figured it could just be ignored by those that don't need it.
But #53 showed that there's a downside I hadn't anticipated - some
users may actually depend on / prefer a nil return to prevent
accidentally affecting program flow.
I think that's a legitimate enough concern to still make a change now
before v1 final.
Apologies for the nuissance!
This is a BREAKING change to get in before v1 final.
Signal keys BEFORE this commit:
`:location` ---- ?{:keys [ns file line column]} signal creator callsite
`:ns` ---------- ?str namespace of signal creator callsite, same as (:ns location)
`:line` -------- ?int line of signal creator callsite, same as (:line location)
`:column` ------ ?int column of signal creator callsite, same as (:column location)
`:file` -------- ?str filename of signal creator callsite, same as (:file location)
Signal keys AFTER this commit:
`:ns` ---------- ?str namespace of signal creator callsite
`:coords` ------ ?[line column] of signal creator callsite
Motivation for the breaking change:
The new callsite schema is simpler to use/override, reduces noise, and can reduce
code expansion size (and so Cljs build size).
- `:file` was rarely useful, but often added large embedded strings.
- `:location` was redundant, and often difficult for Closure's
advanced build to properly de-duplicate.
This schema will be shared by Truss v2 and Tufte v3.
- Simplified some util name (only relevant to folks customizing handler behaviour)
- Merged `format-signal->edn-fn`, `format-signal->json-fn` to single `pr-signal-fn`