clojurescript

valerauko 2025-03-24T04:08:07.939169Z

Is there some downside of using the "old" reagent.dom/render API over the "new" create-root one?

thheller 2025-03-24T06:40:16.103709Z

depends on which react version you use. the old one is deprecated and will likely be removed from react entirely.

valerauko 2025-03-24T12:22:55.283009Z

I use the react version that I picked up from reagent's package.json (18.3.1) It's just it complains about render being deprecated, and I don't know if there's anything I should be worried about (like the create-root api would be orders of magnitude faster or something) or it's just a deprecation notice

Schmoho 2025-03-24T19:15:26.161239Z

A thing that makes CLJS development really frustrating for me is that on many errors (e.g. something is not deref'able, or seq'able etc.) the entire UI will just instantly blow up and lose its state. I assume I am doing something wrong here, so, does that sound familiar to someone?

Roman Liutikov 2025-03-25T08:20:18.368919Z

> It's re-frame reagent well it is React then error boundaries are like try..catch but in the context of React's execution model, it's actually a straightforward model, think when HTML is generated on server from Hiccup and something throws during that process, maybe data fetching. The whole process stops because of exception. Same applies to React, rendering is a process of transforming Reagent's Hiccup into DOM, if something throws during that process — the process stops.

👍 2
James Amberger 2025-03-25T21:24:17.253249Z

also cljsdevtools helps somewhat with the error messages

James Amberger 2025-03-24T19:24:16.862979Z

I venture to say that’s not specific to cljs but is life in the browser especially if you are using React, and that thoughtful functional programming/cljs gives you a lot of protection here.

James Amberger 2025-03-24T19:25:22.286999Z

There are better people here from whom to get advice but if you want to get more specific about what/how you’re using I’ll say what I can about it 🙂

p-himik 2025-03-24T19:44:49.307369Z

With React, there are error boundaries. If you use something else - well, it might have some other mechanism.

Schmoho 2025-03-24T19:50:54.075609Z

It's re-frame reagent

2025-03-24T21:31:28.131539Z

Maybe not up to date but you can find some informations on Reagent doc: https://github.com/reagent-project/reagent/blob/master/doc/ReactFeatures.md#error-boundaries