Fork me on GitHub
#luminus
<
2022-01-27
>
jmckitrick22:01:31

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

lsenjov22:01:33

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

lsenjov22:01:24

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

jmckitrick22:01:47

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

lsenjov22:01:10

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

lsenjov22:01:24

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

jmckitrick22:01:33

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?

lsenjov22:01:46

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

lsenjov22:01:46

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

jmckitrick22:01:08

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

lsenjov22:01:46

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

jmckitrick22:01:56

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.

lsenjov22:01:55

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

jmckitrick22:01:23

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

lsenjov22:01:08

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

lsenjov22:01:11

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

jmckitrick22:01:18

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.

lsenjov22:01:13

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?

lsenjov22:01:02

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

jmckitrick22:01:03

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.

jmckitrick22:01:38

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
lsenjov22:01:56

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

jmckitrick22:01:42

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

jmckitrick22:01:18

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

jmckitrick22:01:15

Thanks for the advice.

👍 1
jmckitrick23:01:24

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

jmckitrick23:01:37

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

jmckitrick23:01:57

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

lsenjov23:01:56

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

Steven Deobald01:01:34

@U061KMSM7 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.