reagent

borkdude 2025-10-04T09:25:41.755729Z

@juhoteperi After reading the updated intro with examples with defc I had this idea for clj-kondo: https://github.com/clj-kondo/clj-kondo/issues/25#issuecomment-3368066114

borkdude 2025-10-04T09:26:01.160459Z

Btw, is it recommended now to use defc for everything?

juhoteperi 2025-10-04T14:55:16.453709Z

@borkdude Hm, I'd say only recommended for new code using hooks. Or maybe I'll recommend it for all new code, but very likely existing projects mostly keep using defn.

borkdude 2025-10-04T14:56:08.764869Z

@juhoteperi then way is the demo using defc all over the place?

juhoteperi 2025-10-04T14:59:08.867179Z

Yeah for most projects there will be both

borkdude 2025-10-04T14:59:23.091139Z

👍 then you might as well just do it always I guess? any trade-offs?

borkdude 2025-10-04T14:59:56.129429Z

will you be able to use dynamic hiccup in defc? I looked at the macro and it looked like it did some pre-compilation stuff maybe?

juhoteperi 2025-10-04T15:00:13.388279Z

the hiccup to React elements will happen runtime, like previously

juhoteperi 2025-10-04T15:00:32.504399Z

it just wraps the defc body in a wrapper fn to handle ratom watchers

juhoteperi 2025-10-04T15:00:38.312329Z

which is for defns also done on runtime

juhoteperi 2025-10-04T15:01:27.723449Z

Can kondo do kind of "multi-pass" checks? Keep a registry of symbols defined with defc and then check hiccup-like uses against that?

borkdude 2025-10-04T15:06:43.979059Z

I'll keep thinking about it. You can't do it in user space currently