clojurescript 2025-03-17

I've been trying to play around with reitit's frontend and I ran into the same problem as before with a protocol dispatch. I made a minimal repro at https://github.com/valerauko/proto-repro/commit/a8ad51a225ed44ed134b28a18cc83d272d0d8321 Can someone explain why it's not working?

it looks like the 3ary protocol function is trying to dispatch on its last argument instead of the first and i can't find what i'm doing wrong

Try using real parameter names instead of _.

❤️ 1

Indeed that solved it. Can you explain why that happens? Is that some thing about the way protocol bindings are done in cljs?

I absolutely would not expect the arg names specified at the defprotocol to affect the actual bindings when calling or in extend-protocol

I just mentioned it in #cljs-dev, probably a bug worth fixing. Feel free to create a post on http://ask.clojure.org - I'll link it there as well if you do. I think what's going on is that _ remains _ and just overrides previous values before the protocol dispatch happens. Conceptually, something like this:

(defn -href [& args]
  (let [_ (first args)
        _ (second args)
        _ (nth args 2)]
    (dispatch-proto Linkable _ args)))

What do you use for production browser logging? Sentry? Telemere? Glogi? (feel free to give a very flippant response!)

window.addEventListener("uncaughtException") (and unhandled rejections) plus some custom code. We report every error directly to slack and have a zero production error policy.

windor.onerror to post client side errors to server. no other logging 😛

👌 1

That's basically what I meant 😊