luminus

jmckitrick 2022-01-27T22:25:31.920779Z

General question for you all… is there any compelling reason NOT to use a simple, server side design for a CRUD app these days?

lsenjov 2022-01-27T22:27:33.584399Z

Depends, what do you need to do with that CRUD?

lsenjov 2022-01-27T22:29:24.654849Z

If you’re only doing basic CRUD, then sure, stick with that.

jmckitrick 2022-01-27T22:29:47.668189Z

A dashboard of tables, forms for adding/editing. That’s it.

lsenjov 2022-01-27T22:30:10.935729Z

When you start needing to link to something within 10k rows, maybe it’s time to start bringing in some async for searching

lsenjov 2022-01-27T22:30:24.731329Z

But until that point, go nuts with pure server side rendering

jmckitrick 2022-01-27T22:32:33.763969Z

AJAX and re-frame are just so fun, lol… but it adds so much complexity. Other than, say, async searching, and partial page updates, is there anything else that server side cannot do almost as well?

lsenjov 2022-01-27T22:41:46.184159Z

You’ll still need something to async display depending on search query

lsenjov 2022-01-27T22:41:46.987479Z

But that’s something to care about when you hit that order of magnitude

jmckitrick 2022-01-27T22:43:08.822009Z

That’s not going to happen in this case. It’s a small niche app

lsenjov 2022-01-27T22:43:46.866289Z

Then if you don’t want anything client side, don’t use it

jmckitrick 2022-01-27T22:44:56.200049Z

My last concern is if so much emphasis has been on client side, that perhaps server side capability is behind the cutting edge. But it doesn’t seem that’s the case with luminus.

lsenjov 2022-01-27T22:45:55.918289Z

Also note that if later you need the js, you don’t need an entire SPA to do the things you need. You can make small bits of JS/cljs and attach them to whatever you need them to work on

jmckitrick 2022-01-27T22:47:23.830439Z

I’ve not done such an incremental approach, but I guess it would be a learning experience.

lsenjov 2022-01-27T22:48:08.267439Z

When you do an SPA, the general pattern is to attach the whole thing to <app>, which is usually the first child of <body>

lsenjov 2022-01-27T22:49:11.206429Z

But you can attach any thing to any other thing, so a <select id="mycomponent"> will also work in the tree

jmckitrick 2022-01-27T22:49:18.897009Z

I’m sure I could use my other luminus re-frame apps as a guide. If it can be done as a template, it cannot be that difficult to add in.

lsenjov 2022-01-27T22:50:13.255939Z

Re-frame is generally working under the assumption of an SPA where everything is in the DB. Maybe just reagent would be a better use case for this?

lsenjov 2022-01-27T22:51:02.402639Z

Although this is all getting into design hypotheticals. The point is more that you can build pure server side to start, and add cljs where appropriate to cover features pure html rendering can’t accomplish

jmckitrick 2022-01-27T22:51:03.723519Z

It’s been a while, but that could be true as well. I have an older, rather large reagent app from a few years ago I could also use as a guide.

jmckitrick 2022-01-27T22:51:38.113319Z

I think you’ve convinced me. Straight server-side will mean faster dev time for me, and that’s key right now. Fancy features can come later.

👍 1
lsenjov 2022-01-27T22:51:56.650749Z

If you’re doing a small niche crud app, likely you won’t need any frontend goodies

jmckitrick 2022-01-27T22:52:42.231519Z

I’m already looking forward to it. Clojure really shines on the backend, obviously.

jmckitrick 2022-01-27T22:53:18.010349Z

It will be refreshing change to work without worrying about client/server interaction.

jmckitrick 2022-01-27T22:57:15.180929Z

Thanks for the advice.

👍 1
jmckitrick 2022-01-27T23:20:24.074159Z

Oh, one more quick question… selmer vs hiccup? I’ve mostly used hiccup, but I’m flexible.

jmckitrick 2022-01-27T23:22:37.526409Z

Oh wait… I’ll still need to maintain server-side html, even with hiccup.

jmckitrick 2022-01-27T23:26:57.314409Z

I think that’s ultimately the reason I have gone with reagent. I almost never need to deal with raw html.

lsenjov 2022-01-27T23:27:56.435119Z

Can’t give you an answer on that one, all my work has been SPA stuff, dealing with long-running connections

Steven Deobald 2022-01-28T01:11:34.436129Z

@jmckitrick They're both great, but each has a different feel to it. Personally, I've preferred hiccup since it was born because I prefer to do as much as possible in Clojure-land, but I've heard compelling arguments for Selmer: You might want a UI designer unfamiliar with Clojure but familiar with HTML to edit templates, you may want to do your templates in something that's not Clojure-specific in case you move to another platform, it helps with SoC, etc. I'd recommend giving them both a try and seeing which approach feels better to you.