News for hackers. Stuff that matters.
Re:Rails 7.1 Released by itake on Friday October 06, 2023 @12:57AM (#37787236)
I lost faith in rails JS integrations.

I either do SSR with slim or do API only with a separate frontend.

Rails changed direction too many times trying to do JS (coffee script, asset precompiling, webpack, etc)

Re:Rails 7.1 Released by roboben on Friday October 06, 2023 @01:23AM (#37787337)
What is SSR with slim?
Re:Rails 7.1 Released by groggo on Friday October 06, 2023 @01:28AM (#37787367)
I think they mean Server Side Rendering (normal rails controllers/views), and Slim is just the name of the templating engine. It's a little nicer than the default ERB. https://github.com/slim-template/slim

There's also SSR with react and other js frameworks, but I don't think that's what they meant.

Re:Rails 7.1 Released by aaronbrethorst on Friday October 06, 2023 @01:35AM (#37787401)
I haven't used Slim before, but looking at the examples shown on the repo's README, it immediately brought to mind the thought experiment: 'what if Haml but Yaml?'

n.b., I've been building Rails apps since 2007. I was a diehard Haml user up until about 2021 when I made an all-in bet on Tailwind and had to switch back to ERB because Haml with Tailwind felt too obtuse.

Re:Rails 7.1 Released by andrei_says_ on Friday October 06, 2023 @05:05AM (#37788519)
I’ve used slim for years and it’s incredible. Writing erb now feels painful. Slim is clean, terse, and correct.

The only downside is I am now spoiled.

Re:Rails 7.1 Released by petepete on Friday October 06, 2023 @05:40AM (#37788730)
Slim is really nice for some things but the moment you want to style words within sentences or paragraphs it gets really messy and you have to start using unintuitive syntax like `|<` or `|<>` to get the spacing right.

You can of course just drop to `markdown:`.

Still, I use it where I can on personal stuff, but tend to opt for Erb when collaboration with others is needed.

Re:Rails 7.1 Released by throwthrow5643 on Friday October 06, 2023 @06:14AM (#37788884)
I'd like to use haml on the front end rather than ugly ternary ridden JSX. I always thought haml was very tasteful.
Re:Rails 7.1 Released by itake on Friday October 06, 2023 @02:34AM (#37787761)
yep that ^
Re:Rails 7.1 Released by lettergram on Friday October 06, 2023 @01:55AM (#37787524)
I’ve taken a rails 4 through to rails 7. Kind of interesting each major version is basically denoted by a change in the way they handle JavaScript.

Rails 5 & 6 were rough, you forgot yarn! That was my biggest pain point. I still have Coffeescript code, we have been slowly converting as needed.

Rails 7 has been a lot better to deal with, we use vanilla JavaScript (outside the coffeescript lol). Makes it pretty easy tbh. We load partials as needed (via js) and the site is fast and light.

My recommendation is to stick close to html with rails or as mentioned, a separate front end. What we have works super well for us, but definitely custom

Re:Rails 7.1 Released by throwthrow5643 on Friday October 06, 2023 @06:18AM (#37788902)
I'd like to see coffeescript make a comeback.