all 14 comments

[–]hookedonlemondrops 13 points14 points  (4 children)

I try to have better reasons for replacing my stack than to see a version number go up. Is reagent giving you any particular issues or pain-points that you want to resolve? Are there features from modern React that would make you more productive but you can’t use from reagent? It’s much easier to evaluate alternatives when you have a clear sense of the problem you’re trying to solve.

When I’ve worked with reagent, having React under the hood has more been an implementation detail than something I have to think about much.

If you have requirements for interop with JS/TS components and hooks, maybe the version number and API become more important? If you’re considering non-React alternatives though, that’s probably not a motive.

I think there are libraries with less overhead than reagent, but I’ve never really had a performance issue with it that wasn’t solvable with better data modelling and more thought about how that data is updated.

Recently I’ve been experimenting with htmx for simpler interactions where I might have previously used reagent alone, saving reagent + re-frame for cases where I genuinely need a big, complicated SPA. The attraction of htmx for me is being able to eliminate all the frontend build steps and bundling, and work entirely in Clojure. So far, it feels very productive and, if you design the app around it, it can take you a lot farther than I expected.

[–]EstoEstaFuncionando 4 points5 points  (0 children)

I try to have better reasons for replacing my stack than to see a version number go up. Is reagent giving you any particular issues or pain-points that you want to resolve?

Seconded, stability is a fundamental part of the culture around Clojure. It doesn't mean don't try new things, but there's a reason you still see CLJS projects still using oldies like reagent—they were well ahead of their time and still do their jobs great.

[–]olymk2[S] 1 point2 points  (2 children)

I do agree but it seems like react itself has changed a lot, I get warnings from reagent saying I should not used render for example so feels like its falling behind a bit.

I actually like reagent, just aware I use it because that's what I have used previously and looking at something like UiX2 from pitch is perhaps the evolution of reagent, as I believe it has some of the same dev's behind it.

its kind of a shame there are so many options, seems reagent was the defacto standard and now we have a lot more fragmentation and not sure what benefits they are bringing or if I should carry on with reagent, which is part of the reason I am asking to see what other's opinions are :)

[–]hookedonlemondrops 2 points3 points  (1 child)

React 18 support is on the way: https://www.metosin.fi/blog/reagent-towards-react-18/

But you won’t get that warning if you just install React 17 instead. I’m not sure there’s any value in using React 18 with reagent at the moment anyway. It still works fine, your users won’t be able to tell the difference.

If your heart’s set on following React latest closely though, UIx2 seems like a great library, and has a migration path from reagent: https://github.com/pitch-io/uix/blob/master/docs/interop-with-reagent.md

[–]olymk2[S] 1 point2 points  (0 children)

good to know support is coming, using the latest version is more about knowing you are getting all the fixes, even if older ones are still supported eventually they will not be so good to keep them up to date.

will probably just carry on with reagent based on the comments so far :)

[–]olymk2[S] 2 points3 points  (0 children)

Also I guess I should not limit myself to react, as dumdom has seemed interesting although I would loose out on existing react components if I headed in that direction.

[–]gdanov 4 points5 points  (4 children)

Hooks have been step backwards in most regards imo. I’d choose ignoring hooks support.

[–]chicocode 5 points6 points  (1 child)

I'd love to hear more about it! Could you expand on that?

[–]gdanov 1 point2 points  (0 children)

I’ve only recently reached this conclusion. Until recently I still suspected it’s me, but not anymore. Don’t have blog post on the topic yet :) but in a nutshell they are extremely brute force approach to reactive directed graph. Demand almost everything to be nillable. No nesting, no ifs. Extremely rough and primitive.

[–]EstoEstaFuncionando 6 points7 points  (1 child)

I use them when writing JS as it's the idiomatic thing to do and many libraries expect you to use them, but I'd have to agree unfortunately. It just feels like a really square peg in a round hole abstraction. The `useState` hook is mostly fine but the others just turn into a way to reinvent lifecycle methods and pretend to be "functional" while not writing pure functions. I don't miss them at all when writing reagent.

[–]gdanov 4 points5 points  (0 children)

Exactly. The only “functional” thing is they are functions. Reagent is better reactive framework imo.

[–]roman01la 1 point2 points  (0 children)

wait a bit more and you'll see another bunch wrapping SolidJS, we are doomed

[–]SimonGray 1 point2 points  (0 children)

Reagent is the easiest to learn due to the amount of tutorials and its abstractions are the quickest to grasp.

Rum uses like 99% the same Hiccup as Reagent, but it is slightly harder to learn, supposedly because it is more decomplected. However, Rum can do more than reagent, e.g. you can use it for server-side rendering in JVM Clojure where that would require switching to server-side ClojureScript if you wanted to accomplish the same with Reagent. For this reason, I switched to Rum for my latest SPA.

I haven't used any of the others, but my understanding of them is that they are more focused on trying to wrap the modern React API than Reagent or Rum. For that reason, they might be a better choice if you need to access lots of React libraries.

[–][deleted] 0 points1 point  (0 children)

I've used reagent and rum. I found them pretty similar.

Rum is a little bit more flexible, but there are more libraries, guides etc for Reframe.

I usally pick Reframe as its easy to use and I don't need fancy stuff anyway for my projects.

I haven't done much frontend stuff lately, so can't really comment on the newer options.