Fork me on GitHub
#re-frame
<
2023-01-31
>
prnc22:01:08

Hello 👋 I’m seeing Subscribe was called outside of a reactive context being logged a tonne, those warning seem to originate from re-pressed (https://github.com/gadfly361/re-pressed/blob/b36e06023764f13baadc99e0dfebe4616c5f6a5c/src/main/re_pressed/impl.cljs#L180) (is there a way to selectively suppress those warnings? any other suggested solutions?)

prnc22:01:13

We are a bit behind the latest re-pressed so apologies if that was fixed there, will update tomorrow to confirm—but looks like it’s not changed much compared to what we have

prnc22:01:54

Sure thing! Do you know maybe how to handle situations when that warning originates from library code rather than application code?

gadfly36123:01:38

@U7MHWDLD8 re-pressed was written before those warnings were added, so sorry for all the warnings! 😟 I am open to PRs if anyone here wants to submit a fix. I haven't used clojurescript in some time and not current on re-frame best practices anymore.

prnc23:01:01

Hi @U0522BZ1R 🙂 No worries, that is of course 100% understandable! Just looking for a way to disable those for library code, I would think there should be a way 😉 🤞 We’re using re-pressed for https://nette.io/ so we might look into that if there is no other way

👌 2
prnc23:01:15

Looking at the implementation on the re-frame side (https://github.com/day8/re-frame/pull/752/files) seems like (set! re-frame.interop/reactive? (constantly true)) could work—but maybe there is better way? `

isak23:01:43

I think that will cause a bug, but maybe you can use the re-frame.loggers namespace and remove one of the warning levels?

isak23:01:21

> Use set-loggers! to change these defaults

prnc23:01:31

Hm, so you’re thinking about patching the warn logger with a function that inspects it’s arguments and filters out those particular messages? Am I understanding correctly?

prnc23:01:34

Thanks BTW!

isak15:02:18

Yea that is what I was thinking