Fork me on GitHub
#clojurescript
<
2022-01-14
>
simongray08:01:30

I’m currently attempting to make a server-side rendered Hiccup Clojure thing into a progressive web app by combining lambdaisland/hiccup on the backend and reagent on the frontend, but mostly since I have quite a but of experience with reagent. However, I just realised that Rum has a server-side rendering component too and it seems ideal for making progressive web app. I have no experience using Rum, though. Do any of you have any experience using Rum for progressive web apps in Clojure/ClojureScript?

magnars09:01:46

If you want to use hiccup-like components on both the server and client, dumdom has your case covered. https://github.com/cjohansen/dumdom#documentation

simongray09:01:07

Hm, not familiar with dumdom. Is it very different from Rum? Looks very similar on the surface.

magnars09:01:30

It is based on Quiescent, but with the React-dependency removed.

simongray10:01:54

Not familiar with Quiescent either. Right now I really just have the github stars to go on, so I am probably more likely to go with Rum if the choice is between either.

1
Arthur02:01:20

Rum’s pretty nice. It basically lets you render the “react” part on the JVM (because it doesn’t really use react if you opt to server-side render). Definitely easier thn Reagent for what you’re trying to achieve

JohnJ15:01:42

dumdom looks interesting, no leveraging the react ecosystem though

magnars18:01:27

I think the idea behind dumdom is to get away from the wild ride of churn that is the React ecosystem, @U01KZDMJ411

👍 1
JohnJ22:01:30

Was to quick to comment without finishing the readme first. Curious, what is your CSS setup with dumdom? use some CSS framework? Is there a public web app I can glance at?

magnars07:01:09

I've used it with plain old CSS-files, and with "css-in-js" style inline styles in components. As for public web apps to look at, maybe the author, @U9MKYDN4Q, can point you somewhere.

cjohansen07:01:32

I’m not aware of a whole lot, but there is one or two linked in the Readme at least

cjohansen08:01:05

I’ve been planning on completing some spare-time projects and publish them, but my completion rate for spare-time projects isn’t great 😅

cjohansen08:01:04

Like @U07FCNURX said, the whole point of dumdom is to exit the React ecosystem, so if that’s important, dumdom is not for you 🙃

Ludwig16:01:30

hi everyone, I'm sending a BigDecimal through transit, since clojurescript doesn't have BigDecimal, what is the best way to handle it in a .cljc file?, would like to be able to reuse code from both environments (jvm,js)

emccue16:01:00

1. Pick a JS library that does what you want https://github.com/MikeMcl/big.js/ (dunno if this one is good) 2. Write a transit handler 3. Write a passthrough to the methods you want to have a common interface to in a cljc file a. (defn add [a b] (:clj (.add a b) :cljs (… a b))) 4. Write tests because you decided to do math, god rest ye soul

❤️ 2
p-himik16:01:24

That's assuming you really do need BigDecimal. If you don't really need it and just happen to have objects of that type, simply convert them to double.

tony.kay21:01:54

Fuclro RAD has a isomorphic bigdecimal math ns you could use/copy from

🙌 1
❤️ 1
Ludwig15:01:34

many thanks!