Fork me on GitHub
#off-topic
<
2021-02-03
>
sova-soars-the-sora04:02:09

build status: 🎉

javahippie07:02:46

What would you use for serverside rendering of HTML if performance ins important? I am seeing Selmer and Hiccup being used, but also rum being an option for SSR (and claiming to be faster than hiccup).

sova-soars-the-sora04:02:05

Currently in production with Selmer -- you can turn page cache on or off as well. I have also used Rum SSR because of a dynamic cljs app and wanted the SSR for SEO and for the perception of very fast page loads -- it works 😃 i don't think it's very hard to be faster than hiccup xD and it's unclear if selmer is faster than rum but the {% inject a variable into the page %} notation is very helpful to selectively render components. if you are building an SPA and also want SEO benefits for pages, rum is the way to go, if you are just doing html / low dynamism then selmer is recommended by me. Don't know about htmx.

javahippie08:02:43

Thanks for the perspective, @U3ES97LAC!

sova-soars-the-sora20:02:37

you got it. rum is excellent for spa and the fact that it can do SSR correctly without much difficulty is very nice -- of course, the components have to be identical in order for dynamic loading of components to work -- so aside from making sure the rendered HTML from the js object [cube, sphere, saltwater code tentacle creature] and the SSR'd version are abso-flippin-lutely the same, it's a joy for SPA w/ SSR. [single page apps with sever-side rendering, for the casual reader]

jmayaalv07:02:43

i would be very surprise if any of them is faster than Selmer also be aware that hiccup doesn’t have a good story against XSS.

jmayaalv07:02:32

and between selmer and rum, do you need really need react? I think Selmer with a bit of https://htmx.org/ can take you far. That’s the choice we made a couple of weeks ago at least 🙂

javahippie07:02:39

Thanks! You can use rum entirely on the backend like hiccup, without any React: https://github.com/tonsky/rum#server-side-rendering But it’s more of a niche

jmayaalv07:02:45

but i am kid from the 80s, never really to into SPAs

javahippie07:02:48

Me neither, I’m trying SSR with progressive enhancement, so HTMX also looks promising, thanks! And I’m also leaning towards Selmer, doing most of the templating in HTML is really appealing

jmayaalv07:02:22

i know, we also checked rum, but decided to go with a traditional template engine as we had to have designers touch the templates

jmayaalv07:02:21

at the end our pages are not so dynamic, if we would have go with hiccup like syntax we wouldn’t really gain much.

orestis07:02:24

Hiccup has a 2.0alpha which fixes the XSS hole

javahippie07:02:53

The thing I liked about hiccup is consistency in the markup, I’m often “visually overwhelmed” when mixing markup with tags. Having everything as Clojure code sounds nice, but in the end, it’s not easy to read a whole document written in Hiccup, either

yes 3
jmayaalv07:02:09

@orestis yes, but it’s been in alpha for quiet some time. Not really sure if it’s evern going to be released.

orestis07:02:15

I developed some internal tools using hiccup mainly because I could use the REPL on a production server 😉

borkdude07:02:21

Hiccup (alpha) is now also part of babashka.

borkdude07:02:00

Selmer isn’t yet but often a str/replace works just as well for me, for templating

borkdude07:02:46

We do use selmer in our production app. Also for email templates

nhanclassroom08:02:02

Sorry if this question is unrelated to Clojure. But I think I can find the answer here. Please don't me if this question is not suitable. • Because I am not living in the USA or study at Stanford or similar university, or similar education system. I wonder what demands a normal top school's students need to achieve to become a junior engineer or computer science. • This picture make me confuse, so what we need 200-300 is minimum requirement course to become junior engineer or 300-400/or even 500-600 (?) • I am confusing that what is the different between undergraduate and graduate. Is graduate is belong to the level of doctor/master or still in bachelor level ?. • ( I am understanding that doctor/master degree is a higher academic level compare with bachelor.) • I try to googling about this problem several hours it seem complex than I think.

The first digit of a CS course number indicates its general level of difficulty:

    0-99 service course for non-technical majors
    100-199 other service courses, basic undergraduate
    200-299 advanced undergraduate/beginning graduate
    300-399 advanced graduate
    400-499 experimental
    500-599 graduate seminars

andy.fingerhut15:02:22

In the USA at least, it is typical to finish high school at about age 17 or 18, and that is often the youngest that one begins attending college or university. The most common is to attend for 4 years, which if you complete the requirements you graduate and get a bachelor's degree. Many people stop there and get a job. Some immediately (or several years later) take graduate-level classes with the goal of achieving a master's degree (usually 2 to 3 years of class work, and sometimes writing a master's thesis or doing a project is a requirement for some master's programs). A smaller fraction continue on to get a doctorate degree.

👀 3
🎉 3
andy.fingerhut15:02:59

People who do not have a bachelor's degree yet are called undergraduates. People who have a bachelor's degree, but not yet a master's or doctorate degree, are called graduates.

nhanclassroom16:02:17

That exactly a perfect answer I need. Oh god... thank you very much.

clyfe09:02:21

It'd be nice if people would choose less of Selmer and Enlive and more of https://github.com/weavejester/comb and https://github.com/Flamefork/fleet. Methinks.

seancorfield18:02:23

If you need to work with UI/UX folks and they need to be able to read/edit your HTML templates, picking Selmer makes a lot of sense since "Django-style" templates are a lot more accessible to those folks than either Comb or Fleet.

👍 3
emil0r21:02:29

@U04V70XH6 Same with styling. Styling via the programming language removes any UI/UX person from being to work on the application / web site

clyfe22:02:37

DHH on Bascamp UI people doing some level of programming: https://youtu.be/OltCr8AWpWw?t=657

borkdude09:02:22

comb also works from source with babashka. I once did a port of the Clojure Toolbox which uses babashka instead of ruby: https://github.com/borkdude/clojure-toolbox.com-babashka

hkjels09:02:17

I wasn’t aware of Fleet. Looks useful

jmayaalv09:02:19

@claudius.nicolae what’s their advantage?

clyfe09:02:25

plain clojure templating; same arguments as smarty vs plain php templates, whatever vs ERB, whatever vs EJS

👍 6
jmayaalv09:02:43

actually enlive is somethig our designers would love 🙂

Mno09:02:08

Today I learned there's more than Selmer and hiccup 😅

javahippie09:02:35

Thanks for sharing, did not know of these

dharrigan09:02:06

On my projects, I'm using cljstache as it works with moustache, which a lot of frontender's know.

dharrigan09:02:23

Tis rather good.

clyfe09:02:48

Beyond <embedded lang x> I only tolerate mustache - because it's generality, and generally avoid it too. And hiccup - hiccup is a good thing.

orestis15:02:57

I use hbs because we have some handlebar templates lying around. But I’m converting some of those to hiccup so I can make components 🙂

seancorfield18:02:23

If you need to work with UI/UX folks and they need to be able to read/edit your HTML templates, picking Selmer makes a lot of sense since "Django-style" templates are a lot more accessible to those folks than either Comb or Fleet.

👍 3
Stuart23:02:16

I have my home PC and my work laptop hooked up to the same three monitors, the laptop has a docking station that has some USB ports so I plug my keyboard and mouse into that hub when I use laptop, then unplug them and plug them into PC when I'm finished with work. I also have to go hit the input buttons on the three monitors as well. Is their a simpler way that I Can reduce this down to pushing one button and not moving dongles?

Kelsey Sorrels23:02:56

Yes. You're looking for a KVM switch. I got one for $36 and it does exactly what you're describing. One button and everything switches

Stuart23:02:26

Thanks! Didn't know of KVM switch

Kelsey Sorrels23:02:29

You're welcome. I should note that my purchase was for a single monitor kvm. Three may be more expensive 😄

jmayaalv09:02:51

you don’t need to press any button, it just works 🙂

Stuart23:02:23

Also annoying if I've been on work laptop all day and I switch keyboard back to my PC (Ubuntu) and it's on the lock screen, it doesnt' always recognise the keyboard is plugged in, so Ihave to plug and unplug it a few times...

Stuart23:02:29

There has to be a better way.

Lennart Buit23:02:46

In the good old days there used to be KVM switches, but I don’t know how reliable that is in the newly digitized world

lread23:02:01

I don’t currently have a need for it, but this https://mtlynch.io/tinypilot/ looks kind of interesting. Would have to make sure security is up to snuff tho.

👍 9
sb06:02:16

That is really cool post, thanks!