Fork me on GitHub
#clojure
<
2024-05-14
>
Hoon Wee07:05:34

Is there anyone using Squint CLJS in large apps?

thheller07:05:11

probably more luck asking this in #C03U8L2NXNC

Hoon Wee07:05:55

You're right, thanks!

m3tti13:05:29

i'm currently thinking about that myself 😄

👀 1
John David Eriksen15:05:27

Hey y'all, any Rollbar users here? We've been using an in-house patched version https://github.com/circleci/rollcage for a while but it seems like the project is no longer maintained. Even the https://clojars.org/circleci/rollcage/versions/1.0.218 uses org.clojure/tools.logging 0.4.0 which has a number of CVEs including vulnerability to the log4j / log4shell exploit. Just wondering what Rollbar libraries folks out there are using. Thanks!

p-himik15:05:49

FWIW, I'd use a plain HTTP client for it.

👍 1
Alex Miller (Clojure team)15:05:50

tools.logging has only a test dependency on log4j and does not have a vulnerability from that

dpsutton15:05:41

i suspect the cheshire dep is the one that’s older and vulnerable. Clojure easily allows you to override transitive deps and the stable nature of the ecosystem means this usually works.

1
conormcd19:05:41

We're using managed dependencies to override all the dependencies of rollcage in practice. I'll see what I can do about getting a version bump of rollcage with more up to date versions of its dependencies.

conormcd10:05:35

I just released https://clojars.org/circleci/rollcage/versions/1.0.241 with more up-to-date dependencies if that helps.

phronmophobic20:05:52

Is there a way to get notified when a particular namespace either interns or unmaps a var?

phronmophobic20:05:38

For context, I'm thinking about building a clerk-like dev tool that can watch a namespace and automatically update as you're developing at the repl.

jpmonettas20:05:31

I don't think so, since the mappings are kept in a PersistentMap referenced by an AtomicReference instead of an atom, which doesn't support watches

p-himik20:05:45

Two solutions I can think of: • Use a modified version of Clojure • Monitor the values in a loop

phronmophobic20:05:15

Ok, that's more or less what I could gather. Thanks for the input!

phronmophobic20:05:10

One crazy idea is to create a subclass of Namespace that does support watches and replace the namespace instances I'm interested in with the subclass.

2
phronmophobic20:05:34

But @U2FRKM4TW’s idea to regularly poll is probably more straightforward.

jpmonettas20:05:52

interesting, but when do you replace it?

phronmophobic20:05:24

At dev time when I'm interested in tracking a namespace for changes.

jpmonettas20:05:21

oh, ok, I thought you needed something automatic

phronmophobic20:05:11

It does seem like it's possible to get notified when the list of *loaded-libs* changes. I would be happy if I could just watch a specific namespace, but it seems like it wouldn't be that hard to extend it to automatically track new namespaces.

respatialized20:05:56

imagine a world where you can run fully reactive datalog queries against the state of your program, its vars, and namespaces

p-himik20:05:46

I think there was a project similar to what you're describing. I can certainly imagine such a world. I fail to imagine the use. :)

phronmophobic20:05:10

Another option is some sort of IDE middleware (eg. cider/nrepl middleware). The idea would be to parse forms sent for eval and do something when you find a def call.

1
vemv21:05:00

with nrepl middleware you can have arbitrarily powerful features. Personally I wouldn't parse the evaled forms - instead I'd check the ns vars programatically. If they're not identical? they changed

phronmophobic21:05:38

So just check the ns's mappings on every eval?

phronmophobic21:05:06

That seems pretty reasonable.

vemv21:05:16

Seems very cheap/fast cider-nrepl's track-state middleware roughly works that way - it's re-performed on each eval-like op. There's some caching. (you can grep ops-that-can-eval in the cider-nrepl repo)

👍 3
🙏 1
p-himik21:05:33

@UK0810AQ2 Never encountered it before, but looks interesting.

john21:05:16

Rich had some idea for storing the whole runtime in some queriable in memory DB iirc

john21:05:00

That was it

phronmophobic04:05:20

Seems to work well enough.

nice 2
john10:05:44

That doesn't actually solve your original problem does it?

phronmophobic15:05:22

Yes, I get notified when a namespace either interns, unmaps, or a var changes so that I can update the UI.