Live data from Hacker News

Rails 7.1 Released

github.com

181–190 of 245 posts

Re: Rails 7.1 Released

#181
post #66

Rails is great, and better than ever. I've spent most of my early years in the field working with Django and Laravel, then moved to frontend doing [all the usual stuff we do nowadays] and this year I was assigned back to a Rails + Hotwire project. I'm truly amazed how much simpler things are. I feel sad most of us have forgotten how easier things could be, and I'm terrified about new people joining this industry that…

What do you consider harder than rails? Something like Remix Run makes things very straightforward.

Those frameworks (Remix, Next, etc) give you like 5% of what you get with Rails or Laravel. There’s no point of comparison.

Re: Rails 7.1 Released

#182

Earlier quoted context omitted.

A lot of rails devs I know have switched to ember.js [1], because it's also a framework based on conventions rather than having a million third-party plugins that break all the time. Architecture-wise I really like the ember-data approach because it allows a lot of automations when it comes to left join/right joins of datasets, with an integrated mockup server etc. But it's not as cool as the other ones I guess, beca…

I thought Ember was a front end framework or am I missing something?

The idea behind ember-data [2] is that the models and their relationships are defined on the frontend side, which implies that the models are the single source of truth for both the frontend and the backend, including the APIs themselves. Ember adheres to json api specification, but there is lots of adapters for other database query languageds and/or storage types [1]

As I said in my previous post, it's a framework based on conventions, so it'd a batteries-included approach to both frontend and backend.

[1] https://emberobserver.com/categories/ember-data-adapters

[2] https://guides.emberjs.com/release/models/

Re: Rails 7.1 Released

#183
post #129

Earlier quoted context omitted.

I'm using both on two different customers. I have a preference for Rails. The project structure of a Rails project is fixed and it's easy to jump into somebody's else project. The structure of a Django project is potentially pure anarchy, good luck with that. That's mitigated by the lack of autoloading so you can learn the structure of the project by looking at the import statements at the top of the files. Unfortuna…

I've worked with both for years and one thing that always bother me is implicit over explicit in RoR. It can seems easy to write code and it's faster because of that, but reading code is harder, there is too much magic. Given that we spent more time reading code than writing code I prefer the python way.

I've been a Rails dev for almost 10 years and the magic is the worst part. When something just works but I expected another hour of work, I feel like I've fallen into a trap. So, instead of just moving on, I look in the documentation for what just happened.

When you find yourself interacting with the magic parts, it is imperative that you comment what is going on so the next dev, which will probably be you, isn't also surprised.

Re: Rails 7.1 Released

#184
post #113

Don't get me wrong, I love Rails, and have been using it off and on since Rails 2. It's a really good framework, and for someone like me who needs to stand up a website from time to time it really is the path of least resistance. What bugs me is the pain of setting up a new laptop to run Rails. I need node, which means npm. I'm a backend guy, I don't understand how to set up node, what order to do things in, etc. I d…

One of these should help with setting up a new laptop to run Rails: https://rails.new https://rubyonmac.dev

Cool, but why not just use Docker? 2-4GB extra ram overhead and some initial learning curve, add a decent Makefile and.. never worry about local env ever again. Switch back and forth between Mac, Windows, Linux like it's nothing.

Re: Rails 7.1 Released

#185

Earlier quoted context omitted.

I'd like to throw in Phoenix LiveView here. Rails wins every battle for initial development speed, as the conventions are so thorough and well thought out that nothing even remotely comes close. Laravel is creeping in, but it's not there yet IMO. LiveView however, scales better (in every sense of the word). It also comes with batteries included (auth, database access, jobs, mailer, complete testing kit etc), little-t…

Other than learning for fun. Is there enough of a benefit to learning Elixir if you would already consider yourself an expert at PHP/Laravel and JS/Vue ? At a glance it's hard to see the value or believe that it has the same longevity or $$$ value.

Its biggest strength is that it is good at almost everything (normal CRUD, websockets, distributed systems, easy to deploy as a single binary). Elixir/Erlang could be your entire stack

Re: Rails 7.1 Released

#186
post #73

Earlier quoted context omitted.

What is terrible about active storage?

My memory is fuzzy, but... 1. all data flow through the rails app (no pre-signed s3 upload or download links for direct uploading). 2. no support for CDNs (I think newer rails versions added support) 3. blobs and attachments were unnecessary abstractions. 3a. Querying was annoying (extra joins) and easy to add n+1 queries. 3b. In my app, images are moderated and it was unclear where to put the moderation metadata (on…

1. Rails has had direct upload since it introduced Active Storage. No one has uploaded files through their servers in a decade

2. What do you mean? Point whatever CDN you want at your origin

3. Maybe

3a. Yes

3b. Metadata or a new table

4. GraphQL is the single worst technology that has ever been adopted. We adopted at my company...twice. Twice we made the same mistake now we're stuck with it for mobile clients. In fact we're stuck on the old Graqphl RB gem that used a DSL instead of classes, which also blocks our Rails upgrade. We've been able to revert everything back to good ole Rest for another part of the app. Be cautious adopting technologies of large companies.

Re: Rails 7.1 Released

#187

Earlier quoted context omitted.

What’s limiting you to taking jobs in just your country? I’ve got a gal working for me in Nepal out of all places. Previously had a guy in Jamaica.

I live in a very HCOL country, companies abroad can’t match local market pay.

What is HCOL?

Re: Rails 7.1 Released

#188
post #2

Currently stuck on a fairly large code base on rails 6 with a ton of react and trying to upgrade to the new “non”-JS way with Hotwire. Wish me luck Rails is great when you stick with the defaults and a land of pain as soon as you leave them.

I wouldn't necessarily recommend moving from an existing react frontend to hotwire at the same time as upgrading Rails itself. I'd get to Rails 7.1 first/independently.

FWIW the Rails 7+ way of doing single page app JS is also more reasonable than it used to be. You pretty much just use whatever build tool you want in isolation from your rails app. You have to run something like `yarn build --watch` alongside `rails s` in development but IMO that's not so bad and makes things a lot simpler.

My company builds software to automate Rails upgrades, and offers a full service where we'll upgrade Rails for you. steve (at) infield.ai if that's interesting or you can generate a free rails upgrade plan at https://app.infield.ai/users/sign_up (no cc required). https://docs.infield.ai/docs/creating-an-upgrade-path for some more details.

Re: Rails 7.1 Released

#189
post #115

Earlier quoted context omitted.

Why not? I have seen or worked on too many projects that would have been better off using Rails/Laravel/Django instead of whatever cobbled together mess was chosen instead. Not saying that those are the best choice under all circumstances but they certainly aren’t wrong.

The alternative to Rails is not "cobbled together mess".

It is not, no. But for whatever reason too many people gravitate to an unreasonably bloated and badly constructed mess of tools and things and services. All for the sake of planet scale.

Re: Rails 7.1 Released

#190
post #5
post #2

Currently stuck on a fairly large code base on rails 6 with a ton of react and trying to upgrade to the new “non”-JS way with Hotwire. Wish me luck Rails is great when you stick with the defaults and a land of pain as soon as you leave them.

I'm working on a fairly recent Rails 7 code base. We initially started using Stimulus, but are now considering switching to React for a few reasons: - if you're looking to hire frontend engineers, the candidate pool for React is a few orders or magnitude bigger - it's getting harder and harder to find vanilla JS packages that you can wrap in Stimulus controllers for common tasks, compared to finding React packages -…

> if you're looking to hire frontend engineers, the candidate pool for React is a few orders or magnitude bigger

Two comments on this - I know it will not change your mind, but maybe other people will read this:

1. Of course, the candidate pool for React is bigger, I think Hotwired - in its current form was released in 2021 (November or December). So this expectation is kinda “Planning to fail” right? If you put this as a criteria of course you are going to choose React. Are you sure you are not already decided to use React and then found reasons for the decision. It is totally fine if you did as we are all doing this constantly (first deciding and then finding reasons or explanations for the decision)

2. I think if you have a React developer (so a person who should know JS and HTML) who cannot write Hotwire code, that is a big problem. Anyone with a good foundation of JS and HTML should be able to write Hotwire code (Stimulus + Turbo)

Recommendation: Don't put in your job ad "Required skill: Hotwired". Just hire people who understand how the web works (browser + HTML ...) and they will be able to write Hotwire-compliant code.

> it's getting harder and harder to find vanilla JS packages that you can wrap in Stimulus controllers for common tasks, compared to finding React packages

I am not sure what packages are you trying to find. But I would suggest if you are trying to find an 1-on-1 corresponding React package to Stimulus package the way the UI and UX is designed is not for Hotwire. You should not choose Hotwire to replace React but keep the same page behaviour. You should think your UX web experience different - more back to basics with interactivity sprinkled around

> Stimulus doesn't really offer a way to write unit tests for your controllers

Again if you have an application like say Figma UI then probably you need unit tests. But if you think the UX to be Rails 7 + Hotwire, you will not write so much JS code that you need unit tests for it.

Testing an end-to-end feature should be enough.

Of course, this is just me talking about a product (yours) that I don't know what it is an I am making so many assumptions.

Post reply on HN