Live data from Hacker News

Doing Rails Wrong

bananacurvingmachine.com

51–60 of 288 posts

Re: Doing Rails Wrong

#51
post #17

I sorely miss the sheer amount of utility that you can get from Rails out of the box for free compared to anything in the JS universe. Most JS devs don’t have the faintest idea how much they’re missing out on. Then again reinventing wheels is the JS way of life.

I find you get a lot of utility, but long-term you need to keep updating your codebase and follow whatever trend rails is currently on.

Re: Doing Rails Wrong

#52

If you're gonna rant about the JS ecosystem at least get it right. You can set up a Vite + React + Tailwind setup with two commands npm create vite npm i @tailwindcss/vite tailwindcss If you want automatic code formatting and linting install biome, that's one more command. You don't need to think about React Refresh or babel or typescript, it's all handled by vite. I've never even seen a .babelrc file. And why does t…

Those two commands required earlier commands to install node and npm.

NPM comes with Node. And obviously you need to install node, just like you need to install Ruby....

Re: Doing Rails Wrong

#53
post #34

If you're gonna rant about the JS ecosystem at least get it right. You can set up a Vite + React + Tailwind setup with two commands npm create vite npm i @tailwindcss/vite tailwindcss If you want automatic code formatting and linting install biome, that's one more command. You don't need to think about React Refresh or babel or typescript, it's all handled by vite. I've never even seen a .babelrc file. And why does t…

What about the backend? Rails covers that, your solution doesn't. I guess I should draw the rest of the owl.

My point is that you don't need half of the things the author thinks you need for a JS frontend with Vite, TS, React, and Tailwind....

Re: Doing Rails Wrong

#55

If you're gonna rant about the JS ecosystem at least get it right. You can set up a Vite + React + Tailwind setup with two commands npm create vite npm i @tailwindcss/vite tailwindcss If you want automatic code formatting and linting install biome, that's one more command. You don't need to think about React Refresh or babel or typescript, it's all handled by vite. I've never even seen a .babelrc file. And why does t…

Those two commands required earlier commands to install node and npm.

And `rails new` required me to install Ruby and Rails. I'm not sure what the point you're making is.

Re: Doing Rails Wrong

#57
post #30

Stimulus and Hotwire are the "rails way" now. I've read the docs and they still confuse the hell out me. Seems like you're reinveting your own javascript components over and over again. In my opinion Rails 8 + Intertia.js + React so much less "reinventing the wheel" (especially if you use shadcn components).

This. We replaced Hotwire frontend with Inertia and it's night and day.

Unless you work 100% alone (and for a smallish project) hotwire leads to a real mess nobody can work on way before anything else I've ever seen in my life.

Re: Doing Rails Wrong

#58
post #17

I sorely miss the sheer amount of utility that you can get from Rails out of the box for free compared to anything in the JS universe. Most JS devs don’t have the faintest idea how much they’re missing out on. Then again reinventing wheels is the JS way of life.

I remember that era, of using vanilla rails with server-generated forms and POST requests leading to more forms. ... even ten years ago, it felt pretty dated. Has Rails grown some framework-supported tooling for web apps yet, or is that the utility we're talking about? > Then again reinventing wheels is the JS way of life. There's some truth to this. The underlying notion is "how much computation do you do server-sid…

I’m using Rails with IntertiaJS which allows React Vue or Svelte for your front end views for Rails or Laravel (made by Laravel).

Rails is amazing compared to NextJS or Express + React for me. Getting a lot more done. Writing a lot less code. The Rails ecosystem is great for doing a SaaS + modern content site/app.

I was away from Rails with full stack JS since before the pandemic.

I don’t think that much has changed with Rails since like Rails 4 or 5.

Maybe this is a recency bias, but for my own work or any work where I can dictate or influence the tech stack of a modern web app, I’m sticking with Rails/Laravel and React or Svelte when modern frontend/views are needed.

I don’t think Rails or Laravel should even focus on views that much any more in Ruby/PHP.

I get the best of all worlds now and I don’t hate JS any more. In fact I have sort of fallen in love with React as well now that it is only doing what it should do and I want to learn Svelte.

Re: Doing Rails Wrong

#59
post #30

Stimulus and Hotwire are the "rails way" now. I've read the docs and they still confuse the hell out me. Seems like you're reinveting your own javascript components over and over again. In my opinion Rails 8 + Intertia.js + React so much less "reinventing the wheel" (especially if you use shadcn components).

Personally I'm liking Rails 8 + Tailwind + Stimulus. No node.

That's the only good reason to use Hotwire. Being a JS hater.

Re: Doing Rails Wrong

#60

Earlier quoted context omitted.

What was the reason?

I’d guess that it’s because React came around and it was from Facebook so it got a lot of adoption? Maybe there’s some other reason, the comment you responded to seems to imply something anyway

I wasn't deeply involved in the Ember.js ecosystem as a user or maintainer, but the impression I got was that, for frontend purposes, clearer abstractions and simpler code was much more critical than "batteries included" frameworks like Rails.

Basically, if Ember.js used abstractions that were better for, say, extremely complex applications, it was dead in the water, because most applications make their library decisions when they are small and relatively straightforward. The market for javascript top-to-bottom rewrites of extremely complex apps (where something with those more complicated abstractions shine) wasn't really large enough for it to become dominant.

I also found it difficult to reason with, even though I'm an experienced Rails developer used to spooky action at a distance in the framework. Something about troubleshooting on the frontend really made it more difficult.

Post reply on HN